cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <>
Subject [jira] [Created] (CB-2227) Move mapping of module->symbol into individual plugins
Date Wed, 16 Jan 2013 15:48:13 GMT
Andrew Grieve created CB-2227:

             Summary: Move mapping of module->symbol into individual plugins
                 Key: CB-2227
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaJS
            Reporter: Andrew Grieve
            Assignee: Andrew Grieve
            Priority: Minor
             Fix For: 2.4.0


- Change from listing module->symbol mapping within common.js & platform.js, to listing
this within the plugins themselves.
- Support apps that don't want us to clobber global symbols. 
aka, allow module->symbol mapping to be turned off
- Allow retrieval of clobbered globals
- Currently modules save it themselves when they are loaded
- This won't work (reliably) for saving references to globals overridden by other modules
- This gets in the way of the idea of lazy-loading modules via getters
- Support the use of other module loaders 
- So... don't do crazy things at require() time.


Plugins must be able to declare dependencies
Plugins must be able to delay onDeviceReady()
Plugins must be able to run code to initialize




Start-up flow:

Parse all modules
Loads list of modules named "cordova.*/symbols"
Run modulemapper.mapModules(window);
Loads list of modules named "cordova.*/main"
symbols.js files:

Will make calls to modulemapper instead of exporting {clobbers:}
This make dependencies work by require()ing dependent symbols
We want the to be an evaluated .js file instead of something listed in plugin.xml
So that it can export based on browser version

Implementation Steps

1. - Expose list of registered modules in scripts/require.js so that we can loop over them
2. - Write modulemapper.js (and have unit tests, of course)
3. - Add logic to bootstrap.js that calls into modulemapper
create $PLUGIN_NAME/symbols.js files for each plugin within cordova.
4. - Add logic to bootstrap.js that calls into modulemapper
5. - Create main.js files for those that currently have logic in their platform.js files

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message