Open catmando opened 5 years ago
More complicated than I thought.
Cordova has its own build system.
You can get it it to work with webpack: https://github.com/kotarella1110/cordova-plugin-webpack
Implication is that if all your assets were in webpack everything should work fine.
The problem is that we still keep ruby code in sprockets.
So this reinforces the view that we need to drop sprockets in favor of webpacker
This blog post may help: https://rossta.net/blog/from-sprockets-to-webpack.html
ALTERNATIVELY
It may not actually be that hard (???) to modify https://github.com/kotarella1110/cordova-plugin-webpack to also work with sprockets assets ???
BUT ACTUALLY
The real problem is this: A web app assumes that the client code is "recently" delivered by the server, and so the server and client are running in sync.
For example lets say you make a change to some model perhaps changing an attribute from a integer to a string. You deploy to production. All the browsers have to be refreshed before anything involving that attribute is going to work.
But say that the client is now a phone app. The user has sometime in the past installed the app, and now, with your change from "integer" to "string" you have effectively made a non-backwards compatible change to the API between the phone app and the server.
TWO SOLUTIONS
Control the API. But this breaks the whole Hyperstack world view.
Hot load new version on the client as the API changes. There have been solutions to do this, but none seem to be currently maintained, except for: https://github.com/Microsoft/cordova-plugin-code-push#readme Here are some of the deprecated ones:
nice capacitor tutorial we can build off of I think: https://www.youtube.com/watch?v=x2jRs7Qqai8
In order to build desktop and mobile apps, you need Cordova make sure it all works with Cordova and their are instructions. Technically you don't have to have Cordova, but ATM I think everything that allows JS, CSS, and HTML to be embedded into a mobile or desk top app, is built on top of Cordova (i.e. ionic, phonegap, etc)
However it does seem that there is a new player worth investigating: https://capacitor.ionicframework.com