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

ReleaseNotes0_5_0pr2

rwaldura edited this page Oct 17, 2012 · 21 revisions

Mojito Release 0.5.0pr2

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.

None of the NPM tags have changed. If you want to try this version, you need to ask for mojito@0.5.0pr2 explicitly.

!!! 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 not 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('Mojit10', 'da-DK', {}); });

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!

Clone this wiki locally