I ported cordova-plugin-meteor-webapp to Capacitor!
It’s iOS-only at this point (only because I haven’t tackled Android yet and have less experience with that platform) and not thoroughly tested or reviewed (i.e. not calling it production-ready yet), but it WORKS!
There are a full set of instructions (different from those in my first post) for how to get Capacitor running with Meteor in the README. The plugin changes the way files are loaded to match how the Cordova plugin works, so there’s no longer a need to massage the output in the built server’s web.cordova directory.
We also need to shim window.WebAppLocalServer and proxy that API to CapacitorMeteorWebApp, so that the Meteor runtime is able to interact with window.WebAppLocalServer as usual and remain blissfully ignorant that we’re not in Cordova anymore. The banjerluke:capacitor-meteor-webapp-shim Meteor package will do this for you. As of v0.1.0 the Capacitor plugin adds this directly to the index.html file before serving it, so it’s all taken care of.
The build process still feels a little “hacky”, but it’s a good DX now (one build script). I am curious to see what Meteor maintainers might think of adapting the core to make this script less hacky, perhaps outputting a static index.html and program.json with a version field so that there was no need to boot up the server.
I will be out of town during the conference but I encourage anyone to take this as a starting point and run with it!
Haven’t tried, and probably won’t (ToDesktop has been working flawlessly for me) but I don’t see why it wouldn’t work! When all is said and done, you’re left with a pretty standard Capacitor setup, so any Capacitor plugin should work…