[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13572095#comment-13572095 ] Andrew Grieve commented on CB-2227: --- Nope, the majority of the changes are still in the symbolmapping branch. I'll merge & close this once 2.4 is out. > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13571931#comment-13571931 ] Filip Maj commented on CB-2227: --- [~agrieve] i see this is merged in. Can we set this as resolved? > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565751#comment-13565751 ] Andrew Grieve commented on CB-2227: --- This is now complete and just needs to be merged. > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558940#comment-13558940 ] Andrew Grieve commented on CB-2227: --- Initial work is now done & merged: https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=commit;h=1aa3643deaa9f14970806277d5f651f3cd78caa9 What is left is to move other plugins over to using modulemapper (File plugin is the only one using it atm) > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557547#comment-13557547 ] Andrew Grieve commented on CB-2227: --- The working branch is here: https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=shortlog;h=refs/heads/symbolmapping Currently steps 1-3 are done. And the File plugin has been moved over to using it. Next up is to do likewise for other core plugins. This changes does not affect existing third-party plugins. It would be nice to fold builder & modulemapper into the same module when this is over, but we should check that no third-party plugins currently depend on cordova/builder. I think Ripple currently depends on it. > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2227) Move mapping of module->symbol into individual plugins
[ https://issues.apache.org/jira/browse/CB-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13556923#comment-13556923 ] Simon MacDonald commented on CB-2227: - [~agrieve] Will this in any way affect the 3rd party plugins written by our users? > Move mapping of module->symbol into individual plugins > -- > > Key: CB-2227 > URL: https://issues.apache.org/jira/browse/CB-2227 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS >Reporter: Andrew Grieve >Assignee: Andrew Grieve >Priority: Minor > Fix For: 2.4.0 > > > Goals: > - 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. > Requirements: > Plugins must be able to declare dependencies > Plugins must be able to delay onDeviceReady() > Plugins must be able to run code to initialize > Implementation > modulemapper.js: > clobbers(...) > merges(...) > defaults(...) > mapModules(wnd) > getOriginalSymbol('FileSystem') > Start-up flow: > Parse all modules > common-bootstrap: > 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: http://www.atlassian.com/software/jira