cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kamrik <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-6481 Add unified hooks support for co...
Date Mon, 11 Aug 2014 17:12:59 GMT
Github user kamrik commented on the pull request:

    https://github.com/apache/cordova-lib/pull/55#issuecomment-51810029
  
    Unfortunately utils.js knows nothing about the project, it re-reads all the info from
file system on each call. This results in lots of cases of re-parsing of config files or re-listing
the same dirs over and over again. On top of that we add some caching, which then results
in weird cache-invalidation bugs.
    As I see it, CordovaProject instance should be created by the CLI (or by any other consumer
of cordova-lib) exactly once per process invocation, and then passed around to be available
to almost any cordova-lib function.
    
        // Along the lines of
        var cordovaProject = new cordova_lib.CordovaProject(rootDir, ?)
        cordovaProject.verbose = args.verbose  // etc.
        cordova.platform(cordovaProject, 'add', ['android'])
        // Or even
        crodovaProject.platform('add', ['android'])
        // And then inside cordova-lib we use
        hooksRunner = new HooksRunner(cordovaProject);
    
    In most places where we pass projectRoot, it should be replaced by cordovaProject. Or
have it accessible as either "this" (e.t. in "create()") or "this.cordovaProject" (e.g. in
HooksRunner methods).



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message