cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11194) Improve cordova load time
Date Tue, 03 May 2016 16:33:12 GMT

    [ https://issues.apache.org/jira/browse/CB-11194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15269001#comment-15269001
] 

ASF GitHub Bot commented on CB-11194:
-------------------------------------

Github user jasongin commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/434#discussion_r61912394
  
    --- Diff: cordova-common/cordova-common.js ---
    @@ -17,26 +17,40 @@
         under the License.
     */
     
    -exports = module.exports = {
    -    events: require('./src/events'),
    -    superspawn: require('./src/superspawn'),
    -
    -    ActionStack: require('./src/ActionStack'),
    -    CordovaError: require('./src/CordovaError/CordovaError'),
    -    CordovaLogger: require('./src/CordovaLogger'),
    -    CordovaExternalToolErrorContext: require('./src/CordovaError/CordovaExternalToolErrorContext'),
    -    PlatformJson: require('./src/PlatformJson'),
    -    ConfigParser: require('./src/ConfigParser/ConfigParser.js'),
    -
    -    PluginInfo: require('./src/PluginInfo/PluginInfo.js'),
    -    PluginInfoProvider: require('./src/PluginInfo/PluginInfoProvider.js'),
    -    
    -    PluginManager: require('./src/PluginManager'),
    -
    -    ConfigChanges: require('./src/ConfigChanges/ConfigChanges.js'),
    -    ConfigKeeper: require('./src/ConfigChanges/ConfigKeeper.js'),
    -    ConfigFile: require('./src/ConfigChanges/ConfigFile.js'),
    -    mungeUtil: require('./src/ConfigChanges/munge-util.js'),
    -
    -    xmlHelpers: require('./src/util/xml-helpers')
    -};
    +function addProperty(obj, property, modulePath) {
    +    var val = null;
    +
    +    // Add properties as getter to delay load the modules on first invocation
    +    Object.defineProperty(obj, property, {
    +        configurable: true,
    +        get: function () {
    +            val = val || require(modulePath);
    +            ob[property] = val;
    --- End diff --
    
    Typo, should be 'obj', not 'ob' ?


> Improve cordova load time
> -------------------------
>
>                 Key: CB-11194
>                 URL: https://issues.apache.org/jira/browse/CB-11194
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: Android, CordovaLib
>            Reporter: Nikhil Khandelwal
>
> We can delay load some of our dependencies to improve our load time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message