Git Product home page Git Product logo

mojiito / mojiito Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 1.0 2.71 MB

DEPRECATED - No longer maintained! Mojito is a JavaScript framework, heavily inspired by Angular, which brings the benefits of components, services, ... to your (static) website.

License: MIT License

TypeScript 87.71% Shell 10.81% JavaScript 0.52% HTML 0.89% CSS 0.06%
mojito javascript-framework typescript javascript pwa

mojiito's Introduction


Mojiito
Deprecated - No longer maintained

Mojiito is a JavaScript framework, heavily inspired by Angular, which brings the benefits of components, services, ... to your (static) website. It takes many usefull core concepts provided by Angular, like Dependency Injection or the component architecture, and makes it accessible through an Angular like API.

What Mojiito is NOT

Mojiito is not a JavaScript framework for Web Applications. Use Angular, Ember, React, ... instead. Mojiito shines when used on your website where your DOM is already in place.

Status

Deprecated - No longer maintained. Please use Angular Elements instead!

Install

Run npm install mojiito-core mojiito-platform-browser --save in your command line tool.

Getting Started & Documentation

Visit the Getting Started Guide or the Documentation Section
Note: Documentation is still WIP. If you want to contribute, pls contact me :)

mojiito's People

Contributors

dominikstrasser avatar thomaspink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sebherzinger

mojiito's Issues

Components

  • Components Decorator
  • Components Templates ( #24 )
  • Actions (#29)
  • Observable Properties
  • Computed Properties

innerZone Error Handling missing

If you select a child of your component with native .querySelector and it doesn't exist, but you still "work" with it - you receive an error without explanation "what really happened" and only can find the real cause of that issue with luck - or debugging into the mojito source.

this._innerZone = this._outerZone.fork({
        name: 'mojito',
        properties: {'isMojitoZone': true},
        onInvokeTask: function(delegate, current, target, task, applyThis, applyArgs) {
          try {
            _this._onEnter();
            return delegate.invokeTask(target, task, applyThis, applyArgs);
          } finally {
            _this._onLeave();
          }
        },
        onInvoke: function(delegate, current, target, callback, applyThis, applyArgs, source) {
          try {
            _this._onEnter();
            return delegate.invoke(target, callback, applyThis, applyArgs, source);
          } finally {
            _this._onLeave();
          }
        },
        onHasTask: function(delegate, current, target, hasTaskState) {
          delegate.hasTask(target, hasTaskState);
          if (current == target) {
            if (hasTaskState.change == 'microTask') {
              _this._setMicrotask(hasTaskState.microTask);
            } else if (hasTaskState.change == 'macroTask') {
              _this._setMacrotask(hasTaskState.macroTask);
            }
          }
        },
        onHandleError: function(delegate, current, target, error) {
          delegate.handleError(target, error);
          _this._onError(error); // here the error is reported.
          return false;
        }
      });

slot functionality

Idea:
It should be possible to render html which is defined in the dom or parent document into specific slots in your child component (like multiple outlets in ember).
You can define templates with a slot id inside the html of your component. In your template of the component you can not mark the places where the outer template should be rendered.

<my-component>
    <template slot="content">
        some content
    </template>
</my-component>
@Component({
    selector: 'my-component',
    template: `
        <div>
            <slot ref="content"></slot>
        </div>
    `
})
class MyComponent {}

renderes into:

<my-component>
    <div>
        some content
    </div>
</my-component>

The context inside the template tag has to be discussed. Is it the context of my-component or the parent component.

Slots should be the default behaviour of component templates. Slots/Templates should also be used internally for rendering the components template into the dom.

<my-component></my-component>
@Component({
    selector: 'my-component',
    template: `
        <div>
            some content
        </div>
    `
})
class MyComponent {}

The code above is the same as:

<my-component><slot ref="_body_"></slot></my-component>
@Component({
    selector: 'my-component',
    template: `
        <div>
            some content
        </div>
    `
})
class MyComponent {}

This will give us a powerful functionality for rendering html into different parts of your template

Why isn't it on NPM

Esp. when used with ES6/Browserify, having it available on NPM as client side dependency should be a must ;-)

Actions

<button (click)="method()">submit</button>

rework Observer

  • fully support nested/chained keys
  • support arrays (needs custom array methods)

content binding

only update the content which has changed, don't replace the whole stuff

Formatted Parameter with \n & \r causes error.

Using the data-parameter on a controller binded element like:

data-params='{
    map_headline:locationfinder,
    map_choose_headline_continent:Continent,
    map_choose_headline_country:Country,
    map_choose_headline_category:Category,
    map_choose_headline_brand:Brand,
    map_choose_continent:Choose Continent,
    map_choose_country:Choose Country,
    map_choose_category:Choose Category,
    map_choose_brand:Choose Brand,
    map_category_headquarter:Headquarter,
    map_category_daughter:Daughter,
    map_category_regionalOffice:Regional Office,
    map_category_salesLocation:Saleslocation,
    map_category_production:Production,
    map_modal_to_website:To Website,
    map_modal_email:E-Mail,
    map_modal_phone:Phone
    }'

this, causes Mojito too throw an error like:

Uncaught Please call super(args), in your Controller!
Controller @ controller.js:37
MapController @ MapController.js:8
registerController @ core.js:675
.../../bower_components/mojito/lib/main @ mojitoSetup.js:15s
...

but using it without \n and \r the whole thing works just fine:

data-params='{map_headline:locationfinder,map_choose_headline_continent:Continent,map_choose_headline_country:Country,map_choose_headline_category:Category,map_choose_headline_brand:Brand,map_choose_continent:Choose Continent,map_choose_country:Choose Country,map_choose_category:Choose Category,map_choose_brand:Choose Brand,map_category_headquarter:Headquarter,map_category_daughter:Daughter,map_category_regionalOffice:Regional Office,map_category_salesLocation:Saleslocation,map_category_production:Production,map_modal_to_website:To Website,map_modal_email:E-Mail,map_modal_phone:Phone}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.