Thanks Steven for clarifying this for me. For now I'll update the www\cordova.js manually for the windows platform. Windows cordova.js is outdated and I'm hitting a bug.
Personally, I'm +1 with auto generating cordova.js but it's not as easy as I originally thought because of the dependencies. Currently, updating cordova.js is also not so trivial. We have a folder structure like this: Cordova Project ├─┬ cordova-js @ Dev (local) Version │ └── cordova-windows @ NPM Version └── cordova-windows @ Dev (local) Version For platform developers the easiest workflow is to npm-link cordova-js\cordova-windows to cordova-windows. Once linked you have to grunt compile cordova-js and manually move file over cordova-windows. On second thought, regenerating cordova.js from cordova-cli is not a great idea. For browserify workflow it makes a lot of sense because we don't know which plugins the user has but otherwise the file is static. -----Original Message----- From: Steven Gill [mailto:stevengil...@gmail.com] Sent: Tuesday, May 26, 2015 5:10 PM To: dev@cordova.apache.org Subject: Re: Building cordova.js on first build If people are into it, I can handle this one as I am very familiar with the code base since I just did it for the browserify workflow. On Tue, May 26, 2015 at 4:15 PM, Steven Gill <stevengil...@gmail.com> wrote: > Hey Murat, > > By two files you mean cordova-js-src and www\cordova.js I assume. The > www\cordova.js file is generated and updated on each release of the > platform. It will use cordova-js-src to build it when available > (instead of legacy-exe version) > > Problem with removing www\cordova.js and building it on runtime is > that we loose support of platforms being able to build cordova > projects independently of cordova-cli. We would have to have > cordova.js as a dependency for each platform to be able to keep the > ./bin/create scripts still having access to a cordova.js file. > > Right now, the browserify way builds cordova.js at runtime with the > CLI by grabbing cordova-js-src from platform_www of added platforms or > from cordovajs/src/legacy-exec if cordova-js-src doesn't exist (older > platforms) . Because of this, we already have cordovajs as a > dependency of cordova-lib. So theoretically, we could build cordova.js > at runtime for non-browserify use case using a similar workflow. > > I think we should keep the www\cordova.js for now, and add > non-browserify runtime cordova.js generation behind a flag so we can > test it out. I see the value in it because we have use cases where we > update the platform specific JS (in cordova-js-src) but can't test > without generating a new cordova.js and moving it over to our platforms. > > Obviously using the --browserify flag will also work for you to be > able to test those platform specific changes. > > On Tue, May 26, 2015 at 3:31 PM, Murat Sutunc <mura...@microsoft.com> > wrote: > >> Hey there, >> I've a quick question. Now that every platform comes with >> cordova-js-src should we remove the www\cordova.js from platform repos? >> I think it's a better idea to compile cordova.js on first build if >> it's missing. This way we don't have to update two files when working >> on platform js. >> Thoughts? >> >> Thanks, >> Murat >> > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org