Thanks for the feedback, guys. As a result of your comments, I've done the following changes :
- Pivoted towards a plugin-based architecture : https://github.com/omefire/cordova-plugin-livereload - The plugin is going to be activated only when the '--livereload' option is passed to the CLI. - I forgot to include the changes to cordova-cli to accommodate the --livereload flag : https://github.com/MSOpenTech/cordova-cli/commits/LiveReload Thanks, Mefire -----Original Message----- From: Carlos Santana [mailto:csantan...@gmail.com] Sent: Friday, August 21, 2015 5:28 PM To: dev@cordova.apache.org Subject: Re: [DISCUSS] CORDOVA AND LIVERELOAD This is so awesome, as working on a downstream I have being debating if this is something I should add to my downstream. I think this is standard stuff that cordova should enable but not include in core, it should be a plugin. maybe we should have a tag for plugins that are only for tooling, meaning that are easy to take out or ignore when building/running a production app. or be dormant until the "--livereload" is pass in the command line for emulate or run. I really think BrowserSync is rad, and having a plugin implemented by cordova is good as reference implementation if others want to implement a different one. but I think we can provide that satisfy the need of most developers. But I think the cordova-cli should document and have some convention support the developer to emulate/run with --livereload. then a plugin can declare that it provides the livereload feature, and detect that --livereload was pass do it's magic On Fri, Aug 21, 2015 at 5:14 PM Jesse <purplecabb...@gmail.com> wrote: > This is really cool work, and will absolutely help developers. > Personally, I prefer the plugin approach. > Which library is chosen is entirely up to the plugin author, but I > really like BrowserSync! > > In all cases, I believe it is important to try NOT to add features to > cordova. The ultimate goal is have cordova be intrinsic to all device > platforms, and the more things we build into cordova, the more > difficult this becomes. Others may have different views, and I am > anxious to hear them, but that is the way I have always looked at it. > > > > > > My team is hiring! > @purplecabbage > https://na01.safelinks.protection.outlook.com/?url=risingj.com&data=01 > %7c01%7commenjik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a610%7c > 72f988bf86f141af91ab2d7cd011db47%7c1&sdata=ZDxBbaiDrRKHqVa7fRKQut47GEt > cdR6r1kDZvZPTl6o%3d > > On Fri, Aug 21, 2015 at 11:50 AM, Mefire O. <ommen...@microsoft.com> > wrote: > > > Hi all, > > > > Problem > > Most Web developement workflows today have a quick > > edit-refresh-preview loop, enabling rapid application development. > > While Cordova is based on > Web > > technologies, the cordova run step after every little HTML or CSS > > change > is > > still slow and takes a considerable amount of time to deploy to the > > emulator or device. > > Some livereload-related offerings : > > https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fsco > > tch.io%2ftutorials%2fa-quick-guide-to-using-livereload-with-gulp&dat > > a=01%7c01%7commenjik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a > > 610%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=kFyIR7Q1nZljOSdc1HI > > dhl6mgExcgIG0CVrGLHU%2fXew%3d > . > > Adding the "live reload" capability in Cordova would increase > > developer efficiency. Note that varieties of LiveReload already in > > many downstream Cordova distributions. > > > > Prototypes > > Browsersync<https://na01.safelinks.protection.outlook.com/?url=http% > > 3a%2f%2fbrowsersync.io%2f&data=01%7c01%7commenjik%40microsoft.com%7c > > 0cc1f1dff2144c1556fa08d2aa88a610%7c72f988bf86f141af91ab2d7cd011db47% > > 7c1&sdata=TKcLau%2bk%2fRfQ2wGutlt4gspmxDMbTTa4ZRqLSBxKkCM%3d> is a > > popular livereload library that enables refreshing the > > browser/webview when HTML/CSS/JS or images change, mirrors clicks > > and scrolls across multiple devices and even does incremental CSS or > > DOM updates. Here is a prototype implementation< > > https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgit > > hub.com%2fMSOpenTech%2fcordova-lib%2fcommits%2fLiveReload&data=01%7c > > 01%7commenjik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a610%7c7 > > 2f988bf86f141af91ab2d7cd011db47%7c1&sdata=qFVTL9IljD%2bCrsg%2bpkF8PD > > %2fse%2bJUVcFAzZ5BWnCpVpk%3d> that I put together into cordova-lib > > using BrowserSync and can be started easily > using > > --livereload with the cordova run command : `cordova run android > > -livereload` An alternative approach here implements a similar > > functionality using a Cordova > > plugin<https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2faxemclion%2fcordova-plugin-browsersync&data=01%7c01%7commenjik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a610%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=zX7tQKxHoiw6AWowjzJIOeTo9xVj4qFF87sU2Nuirrg%3d>. > > Here is another plugin< > > https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgit > > hub.com%2ffingerproof%2fcordova-plugin-gapreload&data=01%7c01%7comme > > njik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a610%7c72f988bf86 > > f141af91ab2d7cd011db47%7c1&sdata=qMT7cUIEh3XbP5RWaVpVuw20F2RtPnDXYT8 > > XT%2bS%2frzI%3d> that implements livereload using > > LiveReload<https://na01.safelinks.protection.outlook.com/?url=http%3 > > a%2f%2flivereload.com%2f&data=01%7c01%7commenjik%40microsoft.com%7c0 > > cc1f1dff2144c1556fa08d2aa88a610%7c72f988bf86f141af91ab2d7cd011db47%7 > > c1&sdata=d2sbj1khMnFHemoIM4aRZ3OzagVexcNNK9qr9qKFn6w%3d> instead of > browserSyc. > > > > Design Questions > > What would be the best approach to add this functionality into Cordova ? > > 1. In cordova-lib as prototyped above ? > > 2. As a Plugins with hooks that start browserSync? > > 3. As a plugin with hooks that uses LiveReload ? > > 4. A plugin that is a part of the default template 5. Any other > > suggestions > > > > Trying to list the goals from our implementation > > > > 1. Live reload should be discoverable, quick to get started and > > easy > to > > use. It should be available to all developers in a standard way. > > 2. It should integrate well with existing workflows and not come > > in > the > > way of existing solutions that already have live reload. > > 3. It should work for most major platforms. Note that the above > > examples change the <content src=> to a http:// server. This has a > > different behavior from the default Cordova app. > > 4. Though the above examples depend on browsersync, there are > > other equally good solutions like LiveReload, Amok, etc. Should we > > depend on BrowserSync? Or will using a plugin approach give us the > > flexibility of using alternate solutions > > > > Here's a link to the corresponding cordova-discuss proposal : > > https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgit > > hub.com%2fomefire%2fcordova-discuss%2fcommits%2fLiveReload&data=01%7 > > c01%7commenjik%40microsoft.com%7c0cc1f1dff2144c1556fa08d2aa88a610%7c > > 72f988bf86f141af91ab2d7cd011db47%7c1&sdata=PKJALeV0NmgPckU9s0CYv0BsY > > 5XZBNLKCvBFjyIWqa0%3d > > Thanks, > > Mefire > > >