incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <>
Subject Re: Plugin loading - on startup and on demand
Date Wed, 06 Jun 2012 23:53:23 GMT
That's one idea that doesn't require changing formats, great :)

On Wed, Jun 6, 2012 at 3:57 PM, Patrick Mueller <> wrote:
> Do other platforms have similar issues?
> One thought - since our plugin list in the plist is already "name based",
> just augment the name.  Change the "class" name of "CDVLocalStorage" to
> "CDVLocalStorage+LoadAtStart" or something.
> On Wed, Jun 6, 2012 at 5:01 PM, Shazron <> wrote:
>> How are plugins loaded in the other platforms?
>> Right now in iOS, a plugin is lazily loaded, that is - it is loaded
>> only on first time use. There is a case for loading plugins at startup
>> - like my iOS 5.1 local storage fix (CDVLocalStorage). Right now that
>> plugin is hard-coded to load at startup, but I would like there to be
>> a general plugin loading at startup feature in Cordova (at least iOS).
>> In iOS, we have the "Plugins" key in Cordova.plist. Unfortunately - we
>> can't just add a checkbox to the list since it's an Array. What I'm
>> proposing (as a quick thing) is to add another Array in Cordova.plist
>> for plugins that should be loaded at startup, say, a key called
>> "Startup".
>> The alternative is to change the "Plugins" Array of Strings to a
>> Dictionary - then the Dictionary key will be the plugin Name and the
>> Dictionary value would be a boolean saying whether it should be loaded
>> at startup. But I tried it in Xcode, and the checkbox could be
>> confused with whether the plugin is "enabled" or not.
>> Yet another alternative is to change the "Plugins" Array of Strings to
>> a "Plugins" Array of Dictionaries. Each dictionary would have two
>> keys: "Name" (String), and "LoadOnStartup" (Boolean). Then it won't be
>> ambiguous.
>> Having a separate "Startup" list would be advantageous:
>>    1. We don't have to make users upgrade their Cordova.plist/Plugins
>> (backwards compatibility)
>>    2. It is unambiguous what it is for (vs the changing
>> Cordova.plist/Plugins to a Dictionary)
> --
> Patrick Mueller

View raw message