cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@chromium.org>
Subject Re: Symbol Mapping in Cordova
Date Thu, 17 Jan 2013 17:45:44 GMT
Pushed up the change with the File plugin being registered in this new way.
Please let me know if you have concerns about it, since the next step is
moving over other plugin APIs, which is boring work :P.

Also, let's move any discussion into the JIRA issue:
https://issues.apache.org/jira/browse/CB-2227



On Wed, Jan 16, 2013 at 4:35 PM, Andrew Grieve <agrieve@chromium.org> wrote:

> Branch started!
>
> I've completed steps 1 & 2.
>
>
> https://git-wip-us.apache.org/repos/asf?p=cordova-js.git;a=shortlog;h=refs/heads/symbolmapping
>
>
> On Wed, Jan 16, 2013 at 1:39 PM, Filip Maj <fil@adobe.com> wrote:
>
>> This all seems reasonable. Shall we start a branch?
>>
>> On 1/15/13 2:47 PM, "Andrew Grieve" <agrieve@google.com> wrote:
>>
>> >Sorry to dump another large email on the list, but I'm hoping this one is
>> >at least less controversial :). I wrote up a plan for moving
>> >module->symbol
>> >mapping out of common.js & platform.js and into individual plugins.
>> >
>> >If you have feedback/comments, let me know.
>> >
>> >* 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:
>> >
>> >   1. Parse all modules
>> >   2. common-bootstrap:
>> >      1. Loads list of modules named "cordova.*/symbols"
>> >      2. Run modulemapper.mapModules(window);
>> >      3. 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
>> >   4. create $PLUGIN_NAME/symbols.js files for each plugin within
>> cordova.
>> >   5. Add logic to bootstrap.js that calls into modulemapper
>> >   6. Create main.js files for those that currently have logic in their
>> >   platform.js files
>> >
>> >*
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message