Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Releases: YahooArchive/mojito

0.4.8

06 Aug 23:52
Compare
Choose a tag to compare

We encourage everyone who wants to experience the latest features and bugfixes to upgrade to this new release! Our dist-tag mojito@latest was moved to this release, while mojito@stable still refers to 0.3.30.

Notes

All performance regressions will be addressed in an upcoming release. Please see DEPRECATIONS.md.

Features

  • #643 new hybrid archetype
    • new archetype: mojito create app hybrid myapp
    • new build type: mojito build hybrid path/to/packages/dir
    • new custom archetypes: mojito create custom path/to/your/archetype mything

Fixes

  • #645, bz5472979 fix server resources in build
  • #650 [docs] Added a prereq for doing the code example, added a link
  • #546 multiple jslint errors in developer-guide and getting-started code examples
  • #547 errors in basic_yql example (getting-started-guide/part2)
  • #570 documentation - add api_key to the binders/index.js in the code example on Binding Events
  • 98e1c492 fix path for create mojit.

Acknowledgements

Special thanks to Haibiao Chen for his contributions to this release.

0.5.0pr2

06 Aug 23:31
Compare
Choose a tag to compare
0.5.0pr2 Pre-release
Pre-release

This is a special preview release of Mojito 0.5.0. It incorporates some significant re-architecting for performance. There are a few significant changes that break backwards compatibility, see below.

!!! NOTE !!! This release DOES NOT pass our functional tests. This started as a rough prototype, and we're still cleaning it up.

Compatibility Changes

1. server.js has changed

!!! NOTE !!! This release requires changing your server.js to properly launch. The template in mojito/lib/app/archetypes/app/default/server.js is the appropriate one to use in any application. For new applications, these files are automatically used when the mojito create app command is invoked to create a new application.

2. ac.app.* is no longer available

For performance reasons, to avoid computing app config per mojit instance, per request, when the majority of the time it is not needed, we completed the transition to mojito-config-addon add-on. This change affects ac.app.*, specifically, ac.app.config which was commonly used to access the computed application.json configuration per context. If you need to access the application config in an action or another add-on, you should:

  • require mojito-config-addon in the controller.
  • use ac.config.getAppConfig() to get the former ac.app.config

3. Unified logger

In previous version, the console log was separated for client and server, and between Mojito and YUI. We decided to leverage the YUI Logger, and unify this setting under a single configuration, actually the YUI configuration in application.json:

    "log": {
        "client": {
            "level": "error",
            "yui": false
        },
        "server": {
            "level": "error",
            "yui": false
        }
    }

is now:

    "yui": {
        "config": {
            "debug": true,
            "logLevel": "error"
        }
    }

and we recommend this setting for production:

    "yui": {
        "config": {
            "debug": false,
            "logLevel": "none"
        }
    }

To customize this for client or server, you can use the runtime context. Also, you can now use logExclude and logInclude. More information at http://yuilibrary.com/yui/docs/api/classes/config.html.

4. Naming convention

Mojito is more restrictive in how you names mojits and add-ons. There are 2 new rules:

  • addon namespace should match the filename. E.g. ac.foo corresponds to addons/ac/foo.common.js.
  • The name of the mojit, which is the name of the folder, should match the language bundle, including the filename of the bundle and its definition. E.g. Foo mojit can have lang/Foo_da-DK.js, and the content should be YUI.add('lang/Foo_da-DK', function (Y) { Y.Intl.add('Foo', 'da-DK', {}); });
  • Controller YUI module name should be same as directory.
  • YUI modules need to have unique names, regardless of selector.

5. Other Changes

  • The embedJsFilesInHtmlFrame option is no longer available.

Fixes

  • #601 Mojito mojito-lite into develop-perf branch
  • #604 fixed unit tests
  • #605 run.js reports how it's called
  • #608 upgrading to YUI 3.7.2 to facilitate the use of new loader
  • #611 changed the action of the tunnel to be the mojito default
  • #613 pathToRoot should be dynamic rather than static config
  • #614 Improve copy performance
  • #616 loader metadata per lang
  • #617 today's functional test fixes
  • #619 fixed unit tests
  • #626 support for moving YUI meta computation out of combo middleware
  • #630 merge develop into develop-perf
  • #631 fixed unit tests
  • #512 Mojito seems to override Y.log, without maintaining the original contract
  • #70 Simplify logging

Acknowledgements

Special thanks to @dferreiroval for his contributions to this release!

0.4.7

06 Aug 23:33
Compare
Choose a tag to compare

Notes

IMPORTANT - server.js compatibility changes This release requires changes to any application's index.js file and server.js file to properly launch. The templates in mojito/lib/app/archetypes/app/default for index.js and server.js are the appropriate content to use in any existing applications. For new applications these files are automatically used when the mojito create app command is invoked to create a new application.

Please see DEPRECATIONS.md.

Features

  • #565 Added support for /crossdomain.xml and /robots.txt

Fixes

  • #525 mojito test app|mojit failed for archetype-code…
  • #615 [doc] Added func/unit test instructions.
  • #546 multiple jslint errors in developer-guide
  • #621 [docs] Fixed a syntax issue for using run.js.
  • #624 Add getter to avoid exposing _app for Manhattan use.
  • #625 Move app init so any getHttpServer call returns initialized app instance...
  • #598 The routing configuration documentation covers the 'regex' property.
  • #628 Fix start logic.
  • #602 Rewrote item in the FAQ regarding passing data from the controller to the binder.

Acknowledgements

Special thanks to @jlecomte for his contributions to this release.

0.4.6

06 Aug 23:34
Compare
Choose a tag to compare

We encourage everyone who wants to experience the latest features and bugfixes to upgrade to this new release! Our dist-tag mojito@latest was moved to this release, while mojito@stable still refers to 0.3.30.

Notes

All performance regressions will be addressed in an upcoming release. Please see DEPRECATIONS.md.

Backward Compatibility Changes

As of this release, Mojito has changed the way the application boots up. Update the file server.js that is at the root dir of your application. Here is an example:

   var Mojito = require('mojito');
   var app = Mojito.createServer({
       context: {}
   });
   // Mojito 0.4 and 0.5 compatibility...
   module.exports = app.start ? app.start() : app;

Features

  • #265 Mojito can now be started using the standard node command.

Fixes

None.

Acknowledgements

Special thanks to @FabianFrank for his contributions to this release!

0.5.0pr1

06 Aug 23:31
Compare
Choose a tag to compare
0.5.0pr1 Pre-release
Pre-release

This is a special preview release of Mojito 0.5.0. It incorporates some significant re-architecting for performance. There are a few significant backwards-compatibility breaking changes, details below.

!!! NOTE !!! This release DOES NOT pass our functional tests. This started as a rough prototype, and we're slowly cleaning it up.

Backwards Compatibility Changes

1. Addons should be required

In the past, a subset of the addons provided by Mojito framework were attached on every ActionContext object (which are created per request, per mojit instance in the page). The specific list was ['mojito-config-addon', 'mojito-url-addon', 'mojito-assets-addon', 'mojito-cookie-addon', 'mojito-params-addon', 'mojito-composite-addon']. This resulted in overhead for every mojit in the page. As part of this release, all requirements have to be specified in the controller definition. e.g:

    YUI.add('Foo', function(Y, NAME) {

        Y.namespace('mojito.controllers')[NAME] = {

            index: function(ac) {
                // ac.params.* is now available
            }

        };

    }, '0.0.1', {requires: ['mojito', 'mojito-params-addon']});

In this release, no addon is attached unless it is required. The only public members of ActionContent object are ac.done, ac.error, and ac.flush.

Recommendations to upgrade:

  • check every controller in your app, and check if it is using ac.*, and add the corresponding requirements.
  • the most common addons are: config, params, url, assets.

2. Introducing Model Factory

Models are no longer computed and attached to ActionContext by default. In other words, ac.models.foo is no longer a valid way to access a model. Computing and attaching models automatically, even when they were not really needed, added overhead during the page rendering process. Instead, we want Mojito to be more strict in defining and exposing structures automatically.

In this new version, if you need to use a model in a controller (defined at the mojit level, or at the application level), you need to:

  • require a new addon called mojito-models-addon in your controller.
  • require the module in your controller.
  • use ac.models.get('foo') to get a reference of the model.

Here is an example:

    YUI.add('DemoModelFoo', function(Y, NAME) {
        Y.namespace('mojito.models')[NAME] = {
            init: function(config) {
                this.config = config;
            },
            getData: function(callback) {}
        };
    }, '0.0.1', {requires: []});
    YUI.add('Foo', function(Y, NAME) {
        Y.namespace('mojito.controllers')[NAME] = {
            index: function(ac) {
                ac.models.get('DemoModelFoo').getData(function (data) {
                    // data from model available here
                });
            }
        };

    }, '0.0.1', {requires: ['mojito', 'mojito-models-addon', 'DemoModelFoo']});

Note: the model name doesn't have to match the yui module name for the model anymore.

3. Removing init method from controllers

The init method on the controller is now deprecated and should be removed. In many cases, the init method was just storing a reference of the config parameter to use it later on. This is no longer available, and the init method will not be executed. If you need to access the mojit config in an actions, you should:

  • require mojito-config-addon in the controller.
  • use ac.config.get() to get the config

Note: do not try to store a reference of that config, as it is not safe, More details below.

4. Controllers are now singletons

Each controller is now a singleton object, and it stays alive between requests and mojit instances. As a result, you should no longer do this.foo = something; within an action, or any other method in a controller. Instead, you should rely more on the ActionContext (ac object) which is unique per request and per mojit instance. E.g:

    YUI.add('Foo', function(Y, NAME) {

        Y.namespace('mojito.controllers')[NAME] = {

            index: function(ac) {
                // ac.myCustomAddon.* provides a nice mechanism to store data.
            }

        };

    }, '0.0.1', {requires: ['mojito', 'my-custom-addon']});

Note: we will re-evaluating this feature in the upcoming release, but for now, it is not safe to be used.

5. New routine to boot the app

As part of the effort to allow Mojito applications to run in 3rd party hosting environments, we have changed the way the application will resolve the port. If you want to application to be compatible with 0.4.x, you can change server.js to export app.start() or app conditionally. Here is an example:

   var Mojito = require('mojito');
   var app = Mojito.createServer({
       context: {}
   });
   // Mojito 0.4 and 0.5 compatibility...
   module.exports = app.start ? app.start() : app;

Fixes

  • #478 updated perf marks/timelines
  • #481 controller only gets what is -explicitely- listed in it's "requires"
  • #483 adding store:getMojitTypeDetails metric
  • #484 adding cache for getRoutes function (resourceStore)
  • #485 adding support for perf.log
  • #486 Removed unneeded YUI instances
  • #489 Fixes to middleware (contextualizer, router) and route-maker
  • #491 Adding cache and freeze to getAppConfig + removed unnecessary validatedContext
  • #492 removed unnecessary validateContext
  • #494 Large changes
  • #497 Fixes based on Ric's changes
  • #499 first version of tool to turn perf.log into a graph
  • #500 feature: models are optional for perf reasons
  • #501 Bug fixes in simple examples replacing "mojit_guid" with "mojit_view_id"
  • #502 use an AC addon for accessing the config
  • #503 updated TODO
  • #504 re-enabling the perf metrics
  • #505 removing the qeperf logs
  • #506 Added YUI cache per req context
  • #511 More search-perf fixes
  • #517 more cache changes
  • #518 enhancement for perf and profiler
  • #521 Replace Y.JSON.xxx with JSON.xxx for server affinities (faster)
  • #524 delinted
  • #527 Fix action-context tests
  • #528 adding metric for the handlebars renderer engine
  • #531 fix some store unit tests in develop-perf
  • #532 need to do a recursive merge
  • #534 Cleaned up renderers cache and added unit tests
  • #538 fixed middleware unit tests
  • #539 Fixed Dispatcher unit tests and interfaces.
  • #540 Fixed mojito-mu and output-adapter-addon tests
  • #553 Fixed for routemaker and middleware router
  • #557 better use of store.validateContext()
  • #560 Removed references to app.config in output-adapter addon
  • #569 no longer use resource store adapter
  • #572 Fix broken test due to buildUrl reference rather than _buildUrl.
  • #573 attaching required ac addons
  • #574 use POSL and lang instead of context for the cache key in store.expandInstanceForEnv()
  • #575 Fixed arrow unit tests for output-adapter
  • #576 Perf refactor
  • #578 adding some guarding in case perf is not enabled, in which case we do no...
  • #579 Fix func tests - phase one
  • #586 AC addon namespace should match the ac filename
  • #588 more careful about use of Y.Loader
  • #590 better handling of shared/global language bundles
  • #593 Merge assets from config.assets to meta
  • #595 much better about YUI module dependencies when calculating for the client

Acknowledgements

Special thanks to the Yahoo! Search team for inspiring the work and contributing a great deal to Mojito.

0.4.5

06 Aug 23:35
Compare
Choose a tag to compare

We encourage everyone who wants to experience the latest features and bugfixes to upgrade to this new release! Our dist-tag mojito@latest was moved to this release, while mojito@stable still refers to 0.3.30.

Notes

Some performance regressions remain from 0.4.0 and will be addressed in an upcoming release.

Features

  • Improved JavaScript parse error messages.
  • Improved functional test stability.

Fixes

  • #13 ContextController cache never cleans up
  • #461 build html5app command - the "builds.html5app" key in "application.json" is * #482 improve error handling and messaging
  • #496 Compatibility with Node.js 0.8
    not context aware
  • #507 Add "hi" group in dimensions.json
  • #508 better error message for javascript parse errors
  • #519 Adds a --path option to run.js to allow specifying a path to find the test descriptors or applications
  • #522 fixed multiple typos in the code example as well as typo in explanation
  • #547 Updated YQL key used for examples

Acknowledgements

Special thanks to Fabian Frank and dmitrys for their contributions to this release.

0.4.4

06 Aug 23:35
Compare
Choose a tag to compare

Notes

Some performance regressions remain from 0.4.0 and will be addressed in an upcoming release.

Features

Fixes

  • #438 Shaker 2.0 compatibility
  • #78 Client resource store implementation
  • #77, #76 YUIDocs for resource store
  • #429 PUT requests not handled correctly
  • 091929f8 Fixed a browser incompatibility with XML output
  • c5baa19e fixed how commands instantiate the store
  • 3cfff95e performance: use Y.mojito.util.copy() instead of Y.clone()
  • f63614f4 performance: removed Y.clone() from YCB library
  • c9cfcf16 fix multiple done() calls in client-side Handlebar renderer, consequence of fixing #408

Acknowledgements

Special thanks to Diego Ferreiro Val for his contributions to this release.

0.4.3

06 Aug 23:36
Compare
Choose a tag to compare

Fixes

  • pull 371 -- Fix buffer mojito040
  • pull 381 -- add node 0.8 compatibility
  • pull 391 -- Travis CI Configuration
  • pull 395 -- fix broken UTs in mojit skeletons
  • pull 397 -- Fixed examples so that they should work with shareYUIInstance
  • pull 398 -- Remove YCB and depend on ycb npm package
  • pull 406 -- honoring context.lang in the loader
  • pull 408 -- Fix for handlebar renderer when ac.flush() is called more than once
  • pull 420 -- Moved fixtures; Migrated resource store addon tests
  • pull 424 -- change example & fixture mojito dependency to >0.3
  • pull 425 -- Store client url fix
  • pull 426 -- Remove i13n from public mojito
  • pull 428 -- fix store unit test
  • pull 439 -- fix (and un-ignore) the resource store unit test for optional YUI modules
  • pull 442 -- Remove i13n from public mojito
  • pull 445 -- make nice names for the pids

Credits

Special thanks to Fabian Frank for his code contributions to this release.

0.4.2

06 Aug 23:37
Compare
Choose a tag to compare

This release is the bleeding edge of our development tree. To install the most stable, production-ready Mojito release, use npm install mojito@stable.

Deprecations

Please see DEPRECATIONS.md.

Features

Handlebars

Handlebars is now supported and is the default view engine for new projects. We are also recommending that projects change their view engine from Mustache to Handlebars for performance and stability reasons. Please see the DEPRECATIONS.md for more information on migrating. Big thanks to Caridy Patino for this contribution.

  • 5443546 Made handlebars the default renderer for new projects and all examples #365
  • 99b2a38 Added deprecation warning for Mu #369
  • b74b7a7 #270: Added unit tests for client and server handlebars engines
  • a2d95f2 Added client side handlebars engine; Cleaned up jslint errors with server side engine
  • 522bcc9 cleaning up the handlebar wrapper for mojito as a view engine for the server side.
  • fa8cc2f adding support for handlebars for the server runtime only for now.

Reason Phrase

Providing the ability to provide a reasonPhrase property when calling ac.error.

shareYUIInstance

It was discovered that shareYUIInstance was not usable in previous versions. We have addressed some of the issues such that shareYUIInstance should be usable, although should be considered experimental. This configuration now works in the following way:

Default value is false at app level, mojits can override the app config by specifying shareYUIInstance in their defaults.json (parallel to the config key).

Fixes

  • e0b71a9 fix #375, unified handling of frameworkName, appName, and prefix #383
  • 7e1e03e Set server runtime when handling tunnel calls. #242 - Thanks Fabian Frank!
  • 2071d03 jslint command now uses node-jslint npm module; Fixed jslint errors from jslint upgrade #360
  • 5b5d4bb #352 archetypes now specify a version of mojito similar to that which uses them #355
  • d398308 when using the loader at the server side to generate combo urls we should pipe the yui config into the loader settings otherwise some settings will not be honored. #350 - Thanks Caridy Patino!
  • f69eedc guard against missing edges in mojito gv #349
  • cee2548 Removed DaliProxy and adding application configurable tunnel timeout #345
  • 3fda46d [Fix 5712477] Make sure to callback when there is an error #338
  • 746c799 Porting mojito doc over to the new yuidocjs #243 - Thanks Fabian Frank!

Docs

  • a387d35 Reorganized the document, added links to images, section IDs, rewrote sections, and edited.
  • 36b87c7 Adding architecture images.
  • 63d7c8c Added a link to the RS from the selector property and an example that you cannot add the selector * property to the defaults.json file of a mojit.
  • 0f45fdc Added the 'selector' property to the config docs and made a note in the RS docs that the selector can only be set in application.json.
  • a1a8ab3 Added the --context option to the build and start commands.
  • 84e3687 Added the tunnelTimeout property to the application config object.

Credits

Special thanks to Caridy Patino and Fabian Frank for their code contributions to this release.

0.4.1

06 Aug 23:38
Compare
Choose a tag to compare
release 0.4.1 (based on 0.4.0-166-g619e6f1)