Hey everyone - I wanted to highlight a post I made to the Cordova dev list late 
last week. The thread can be found here: 
http://callback.markmail.org/thread/xhjr6gj2llzdfeu7

The gist is that we are making a proposal to the Cordova community that 
cordova-browser should be enhanced include functionality that allows for UI to 
simulate Cordova plugins and device capabilities. I want to be clear up a 
couple of things up front:

* We're not proposing a Ripple replacement, but rather is something that could 
potentially underpin some future version of Ripple. Hence my subject line :).
* We're not suggesting that cordova-browser itself would show this UI (though 
that's how the prototype discussed in the document works, for simplicity sake) 
- just that it provide the necessary hooks for third parties to display plugin 
simulation UI.

My original post in the thread includes links to some documents (and a video!) 
that introduce what I'm talking about, but I'd like to summarize here what we 
are suggesting, why we are suggesting it, and what it might mean for Ripple (if 
anything).

I'll start with the "why":

Before I begin - a quick introduction to terminology: I use "app host" to refer 
to the browser window that hosts the app, and "simulation host" to refer to the 
window that hosts the plugin simulation controls.

* We'd like to see a world where a "simulation host" could be "anywhere". 
Ripple is one example. But what about the "simulation host" being within the 
debugger of an IDE like Visual Studio, or in the browser dev tools, or ... ?
* We'd like to keep the "simulation host" separate from the "app host", to 
simplify the debugging experience. I believe Intel's XDK does some magic with 
Ripple so that you only see the app in the debugger, but in other debugging 
tools (like Visual Studio or browser debug tools), Ripple adds a lot of baggage 
that complicates debugging your app. And of course it doesn't play nicely with 
browser "device simulation" modes (though I suppose it could be argued that 
with Ripple you don't need "device simulation" modes :) ).
* We'd like to make it easy for plugin authors to define simulation UI for 
their plugins (if they want to) that will work in any "simulation host", be 
that some future version of Ripple, some IDE like Visual Studio, or ... (well, 
you get the idea).

The core idea is fairly simple:

* Keep the "simulation host" entirely separate from the "app host", and 
communicate between the two using web sockets.
* Cordova provides any necessary additional functionality in the "app host", 
and also the server that a "simulation host" connects to.
* Plugins provide the UI that will display in the "simulation host", and 
supporting code (which could run in the "simulation host" or the "app host").
* Third parties like Ripple provide the simulation host. A simulation host can 
be any window capable of displaying HTML content.

What might this mean for Ripple?

Potentially, once this capability is added to Cordova, we might want to modify 
Ripple to utilize this functionality when emulating Cordova apps. Perhaps 
Ripple will continue to host the app in an iframe with the UI surrounding it 
(which would work fine with the proposed model), but we would still gain a 
couple of advantages:

* We could simplify some of the Ripple codebase - cordova-browser should be 
doing a bunch of the work that Ripple currently does.
* We benefit from the extensible plugin UI - Ripple can continue to have as 
much of its own built in stuff as it wants, but would also be able to display 
UI for plugins it knows nothing about.

Obviously there's nothing we need to do right away. But the proposal would 
greatly benefit from the input of people with experience working on Ripple, so 
I'd love any of you to contribute! (BTW, if your feedback is most relevant to 
the Cordova side of things, it would be great if you could respond there so the 
Cordova community sees your feedback, otherwise if your feedback is more 
related to Ripple itself, respond here)

Thanks!

Tim

Reply via email to