cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Gill <stevengil...@gmail.com>
Subject Re: Cordova-js update
Date Fri, 22 May 2015 03:26:57 GMT
This change was made so we could get the browserify workflow working well.

The main advantage of the browserify workflow is build time inclusion of
plugins javascript instead of runtime. Our old way, we use
cordova_plugins.js to inject the javascript of every plugin at runtime.
With the browserify workflow, all of the JS for the plugins essentially
gets concatenated to cordova.js.

createmobilespec should work the same. You still use the same grunt
commands and it grabs the platform specific js from the platforms in the
node_modules/PLATFORM/cordova-js-src directories. If the platform
dependencies don't have a cordova-js-src directory (amazon, firefoxos,
browser, osx) then it will use the src/legacy-exec/PLATFORM directories to
build cordova.js.

grunt, grunt compile, grunt test all work still. You actually don't need to
pass in the --platformVersion flag anymore as it will figure out the
version based on the platform dependencies of cordova.js. It still accepts
it though.

createmobilespec also takes a --browserify flag if you want to build the
mobile-spec project with the browserified cordovajs. You could also just go
to generated mobilespec project and run cordova prepare --browserify to
generate the browserified cordova.js.

Lastly, I added support to paramedic  for the --browserify flag to test the
plugins that way.

Let me know if you have more questions! I'd love to clear everything up.

If you are having issues with createmobilespec, please let me know the
issue so I can investigate it. Been working fine for me.

Cheers,
-Steve







On Thu, May 21, 2015 at 5:19 PM, Nikhil Khandelwal <nikhilkh@microsoft.com>
wrote:

> I'm new to this area. Steve: Can you provide some background on the
> motivation for this change? In particular, what is the advantage of this
> workflow, over the existing one:
>
> I have also made some changes to cordova-lib which will copy the contents
> of cordova-js-src into platform_www when a project gets created. If a user
> decided to do cordova prepare --browserify, it will use the platform
> specific js files included in their app to build their cordova.js. [3] [4]
>
> I think you need to update createmobilespec as it uses the grunt task to
> generate the latest cordova.js for creating an app that is used by the
> Apache CI (http://ci.cordova.io). Now the latest cordova.js is not being
> generated and we are likely missing some test coverage as we make changes
> to cordova.js.
>
> Thanks,
> Nikhil
>
> -----Original Message-----
> From: Steven Gill [mailto:stevengill97@gmail.com]
> Sent: Monday, May 18, 2015 2:18 AM
> To: dev@cordova.apache.org
> Subject: Cordova-js update
>
> I have a pull request [1] ready for cordova-js which adds platforms as dev
> dependencies and uses the previously moved cordova-js-src from the platform
> repos instead of src/platform. I moved existing platform specific js into
> cordovajs/src/legacy-exec to use in cases where released platforms don't
> have a cordova-js-src directory. [2]
>
> I have updated both normal build and browserify build to use
> cordova-js-src if present when building cordova.js.
>
> I have also made some changes to cordova-lib which will copy the contents
> of cordova-js-src into platform_www when a project gets created. If a user
> decided to do cordova prepare --browserify, it will use the platform
> specific js files included in their app to build their cordova.js. [3] [4]
>
> I will need to make sure each platform has their most up to date platform
> specific js files in cordova-platform/cordova-js-src. After these PRs get
> merged, platform maintainers should only worry about updating these files
> instead of what exists in cordovajs/src/legacy-exec.
>
> Let me know if you have any questions or concerns.
>
> [1] https://github.com/apache/cordova-js/pull/112
> [2] https://issues.apache.org/jira/browse/CB-8441
> [3] https://github.com/apache/cordova-lib/pull/221
> [4] https://issues.apache.org/jira/browse/CB-8965
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

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