cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <>
Subject Re: [DISCUSS] Loading plugins async or on demand
Date Fri, 11 Dec 2015 14:25:53 GMT
Can you open a JIRA and explain with more details what is taking most of
the time when loading?

Are the plugins taking time to load are core cordova plugins (i.e. camera,
device, etc..)?
We try to keep our scripts for clobbers/run/merge very light with no much

You want to delay the injections and loading of the plugin js scripts?

If you want to improve load time for your own plugin, maybe you are doing
too much work in the scritps you specify in plugin.xml for merges and
clobbers, run.
What you can do is put the minimal amount of init and work in those
scripts, and later when your plugin is used check if initialize and then do
rest of the init there, including injecting scripts.

We are planning to use browserfy to concat all the plugin js, and this
should help at least with the loading of the script.

Another point of is native code for the plugin, you can specify in your
plugin to not load the native code on load of the webview, I believe the
default is false, so it you have true for the custom plugins you are using
maybe this is adding time to your load time
<param name="onload" value="false" />

<feature name="SuperPlugin">
                <param name="android-package" value="com.acme.superplugin"
                <param name="onload" value="true" />

On Thu, Dec 10, 2015 at 9:13 AM Simon MacDonald <>

> When you say "fair amount of time" do you have any data on that? Before
> spending time on a solution I'd want to make sure there is actually a
> problem.
> What does the delay look like in Chrome/Safari web tools? I'd try running
> an on various devices and seeing what the load times are for the JS on the
> different platforms.
> Simon Mac Donald
> On Thu, Dec 10, 2015 at 7:39 AM, Philipp Kursawe <>
> wrote:
> > I am new to the list, and somewhat new to Cordova.
> >
> > I wonder why all plugins are loaded before "deviceready" is emitted? I
> > understand for plugins that extend the hosts "navigator" object to mimic
> > webbrowser functionality like location or sensors you might want to have
> > them guaranteed to be accessible via global objects on "navigator" once
> the
> > app has been loaded.
> > Was there ever an async/on demand approach considered?
> > Like "cordova.getPlugin("").then(maps) {}"
> >
> > I am asking because I would like to reduce the startup time. Loading the
> > webview already takes a lot of time. Loading all JS takes another fair
> > amount of time all the while cordova is busy loading all plugins. And I
> > don't need any of those plugins functionality right after startup.
> >
> > Happy coding,
> > Phil
> >

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