cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darryl Pogue <dvpdin...@gmail.com>
Subject Re: HTML 5 platform
Date Wed, 06 Nov 2013 06:54:21 GMT
On 5 November 2013 13:37, Braden Shepherdson <braden@chromium.org> wrote:
>
> Why is any development here happening outside of Cordova? Most apps are
> going to depend on Cordova APIs too deeply to get all that far with the
> early steps in your outline.
>
> Braden

My approach when developing multi-platform apps is to think of the core
cordova.js as a polyfill manager, and the plugins as polyfills for features
that might not exist yet. My first target is the browser (usually desktop
Chrome) to build out a prototype, and then running on each of the target
platform devices for debugging and adding extras.

In this case, I actually want cordova.js and cordova_plugins.json in desktop
Chrome, so I can use them for adding polyfills or stubbing out plugins that
will be provided at a device platform level.

To that end, I took the firefoxos platform of cordova.js from 3.1.0 and very
slightly modified it and saved it as a "browser" platform[1]. I put the
resulting cordova.js in my www folder so I can run it in the browser without
any cordova prepare commands, and when I do make a build for a device, it gets
overwritten by the platform-specific JS file.

This allows me to have a cordova.js that works in the web browser, and allows
me to use it to provide polyfills without actually trying to cross a bridge
into native code specific to a platform. Which may be an unconventional way
of using cordova, but so far hasn't caused me any problems.

[1] https://github.com/dpogue/cordova-js/compare/browser

~ Darryl


> On Tue, Nov 5, 2013 at 4:35 PM, Jonathan Bond-Caron <jbondc@gdesolutions.com
> > wrote:
>
> > On Mon Nov 4 11:00 AM, Josh Soref wrote:
> > > https://issues.apache.org/jira/browse/CB-2062
> > >
> > > > Any thoughts on adding html5 as a platform?
> > >
> > > Fil mentioned Ripple. While not endorsing it, have you tried it?
> > >
> > > Ripple is more or less what you want. It's a JavaScript shim to which
> > you can
> > > deploy. It should also include API support for sensors and other
> > features.
> >
> > I just installed Ripple as a chrome extension.
> > There still seems to be something missing to test rendering differences
> > between Webkit browsers & IE 10, Firefox, while using only some of the
> > basic Cordova apis.
> >
> > Ripple looks great for emulation but doesn't help for
> > cross-browser/platform testing & debugging.
> >
> > With the workflow:
> > a) Develop HTML5 app
> > b) Test on Webkit, IE10, Firefox
> > c) Import into Cordova
> > d) Deploy on devices (Windows 8, Android, iOS, Blackberry, ...)
> >
> > For (d) Eclipse, Visual Studio, Xcode, Ripple, Cordova cli, ..?
> >
> > An example: Deploy on a Windows 8 device and the CSS doesn't work (e.g.
> > flexbox), debug in Visual Studio then back at step (a) to port the changes.
> >
> > Merging steps (a), (b), (c) into a single 'browser/html5' platform to do
> > iterative testing/debugging would be a win.
> >
> > In that sense, the 'browser/html5' platform would be the smallest subset
> > of features that works consistently across all platforms:
> > - localStorage
> > - XMLHttpRequest
> > - JavaScript only plugins / shims
> >
> >

Mime
View raw message