Newest changes are support for simple module definitions and internationalization (i18n) bundles.
Simple module definitions are possible when there are no dependencies for the module. In that case the function wrapper for the module is not needed:
i18n bundle support is handy for separating out strings that might need to be translated into other languages. Quick example for a my/nls/colors.js that will define a bundle:
run(
"my.simplething",
{
color: "red",
size: "large"
}
);
Then define a file at my/nls/fr-fr/colors.js that has the following contents:
run(
"my.nls.colors",
[{
"root": {
"red": "red",
"blue": "blue",
"green": "green"
},
"fr-fr": "my.nls.fr-fr.colors"
}]
);
See the documentation for more information.
run(
"my.nls.fr-fr.colors",
{
"red": "rouge",
"blue": "bleu",
"green": "vert"
}
);
If you want to try out the latest code, you can use one of the following URLs to fetch the code:
In addition to the documentation, some of the test files might be of interest to see how RunJS can be used.
RunJS is still nice and small with these new features, around 2.7KB, when minified via YUICompressor and gzipped.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.