You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by Apache Wiki <wi...@apache.org> on 2013/12/05 15:11:24 UTC

[Cordova Wiki] Update of "Platform Engine" by jbondc

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.

The "Platform Engine" page has been changed by jbondc:
https://wiki.apache.org/cordova/Platform%20Engine

New page:
= Platform engine =

== Context ==

Cordova 3.x is centered around plugins & platforms. An objective is to make it easier to write and publish plugins.

A plugin is tied to a particular platform (ios, android, windows8, blackberry10, fireos, ubuntu, firefoxos, tizen or ?) and is expected to be compatible on these platforms.

A plugin describes its dependencies and additional metadata required for installation on a particular platform.

== Problem ==

There's no clear definition of what defines a Cordova platform. Is it an OS? Is it a rendering engine on top of an OS? Anything that satisfies the Cordova api?

As of this writing, there's currently 4 platforms officially supported (ios, android, windows8, blackberry10) and an increasing number of additional platforms.

In those 4 platforms, Android and Windows 8 have already evolved where several rendering engines are available:

=== Android ===  
WebView
ChromeView
GeckoView
Crosswalk [2]: https://github.com/crosswalk-project/crosswalk-cordova-android

=== Windows 8 === 
WinJS 1.0
WinJS 2.0 (Windows 8.1)

Since plugins are tied to particular platform, it makes testing of plugins hard as the number of platforms increases. The state of plugins feels the "Wild Wild West". 

TODO: Talk about newer platforms based on Android or Chromium

== Solutions ==

a) Define as platform as an OS that satisfies a core set of Cordova apis. 

Keep a few core platforms but use a new 'engine' flag

e.g. cli perspective
> cordova prepare android                                              #uses WebView of OS
> cordova prepare android -engine crosswalk           #uses Crosswalk
> cordova prepare android -engine ChromeView     #uses ChromeView bundled jar

> cordova prepare windows8
> cordova prepare windows8 -engine v8.1              #uses/injects 8.1  code
> cordova prepare windows8 -engine crosswalk    #uses Crosswalk?


b) Define as platform as anything that satisfies a core set of Cordova apis. 

Make platforms 'compatible'

crosswalk-cordova-android 'compatibleWith' cordova-android
windows81 'compatibleWith' windows8

Disadvantages:
- More 'platforms', overwhelming for user
- More code to maintain

== Q & A ==