Feature
Support natively compiled JavaScript modules like we do on iOS.
Example Module
The following steps create a compiled module that you could distribute as a zip on iOS. Once implemented, the same process would work on Android.
1. Create a new module for Android: titanium create --platform=android --type=module --name=jsmod --id=ti.jsmod --android=/path/to/android-sdk
2. Drop the below in assets/ti.jsmod.js:
exports.createBox = function() {
return Ti.UI.createView({
width: 100, height: 100,
backgroundColor: 'red'
});
};
3. Drop the below in example/app.js:
var window = Ti.UI.createWindow({ backgroundColor: 'white' });
window.add(require('ti.jsmod').createBox());
window.open();
4. Enjoy your luscious red rectangle
Workaround
Until this feature is available, you can always distribute just the JS file. Developers can utilize it in its un-compiled state, although your code isn't protected from prying eyes.
Associated Helpdesk Ticket
http://appc.me/c/APP-487811
Any news on this? -- Cheers
Seems like a lot of people are watching this. Is there anything else we can do to push this forward?
How about a little love for Android here, please...
I'd like to see this as well, so we can maintain parity between iOS and Android for our modules.
Is there any chance we will see this in 1.9?
Please...
Dependency on TIMOB-9010 because a) it's in the same sprint; b) it affects how the javascript is packaged
Pull request: https://github.com/appcelerator/titanium_mobile/pull/2237
Looks like the pull request was merged and closed 11 minutes ago.
Yeah, I think because it's an absolute requirement for 2.0.X immediately, we'll delay the resolution of the ticket. The cherry-pick is going to be nasty and require another round of testing.
2.0.X backport pull request ready: https://github.com/appcelerator/titanium_mobile/pull/2251
Needs to reopen because Python 2.6+ specific code is in there :( Need to convert that code to be compatible with Python 2.5 because that's what is packaged in Studio on Windows. Sorry, I didn't know the relevant syntax was new in 2.6.
Pull requests for conversion of Python 2.6+ code to Python 2.5: 2_0_X: https://github.com/appcelerator/titanium_mobile/pull/2266 master: https://github.com/appcelerator/titanium_mobile/pull/2267
Adding environment info - Tested with Titanium SDK: 2.1.0.v20120608174150 Tested with Titanium Studio: 2.1.0.201206081630 Device - Android 2.2 and Android 2.3.3 Android Runtime - V8