Project: titanium
Issue TIMOB-9658: BlackBerry: Add JavaScript bootstrapping to framework
Some of the Titanium implementation can be done using JavaScript so we need to provide a way to run our own bootstrapping .js files before we load app.js. There is possibly a lot of JavaScript code we can reuse from the android directory. The method I suggest is to package the .js files into the .bar file. The files should be put into a new folder called "framework" that is next to, not inside, the "assets" folder. The "assets" and "framework" folders should be separate so we don't have conflicts. The only complication would be that the require() and include() functions might need a flag to know whether the app has been bootstrapped or not (ie read from "framework" if bootstrapping and "assets" if not). A flag may not be sufficient if things are done asynchronously so the other solution would be to check if the file calling the require/include is in "framework" or "assets" and make sure to load the file from the same directory. There should be one file called boostrap.js that will include/require the other files, as needed.
Story points: 5