Does Meteor fit the modern offline-first paradigm?

I’m starting to evaluate Meteor for a new project, and would appreciate any advice on whether it’s the right tool for the job.

My app is a mobile web app (think WhatsApp), based on the PWA principles of offline-first (service workers/cache) and installable as a desktop (manifest). It’s a messaging app so needs to be allow the user to compose and “send” a message when offline, with the actual send taking place as soon as the network is available. It also needs to be able to receive a message and display a native notification, even if the app’s browser window has been closed (webworkers). For rendering, I will be using WebComponents (lit-element).

I’ve successfully used Meteor for a much simpler project, but for this project I have a feeling that I would be fighting against the platform. Any thoughts very much appreciated.

1 Like

There are no official packages that will make offline-first Meteor (it is on a wishlist of some people, including me).
There are some packages like ground:db that go the offline-first route for collections. You could probably get around some of the issues with GraphQL, but I have just started with it, so I can’t tell yet.
Web workers are already doable and there have been some examples produced.
So theoretically it is hackable, but if offline-first is the central requirement, then I would consider some other frameworks which are build around that principles (Hoodie comes to mind).

1 Like

You can set it up. You’ll need to consider offline storage for your data and your static assets (CSS, JS bundle, images, etc.).

You can take care of the data system by using something like Ground:DB or an alternative for Apollo, Redux, etc. if you use any of those.

You can take care of the static assets using Meteor’s appcache package, which is a Meteor first-party offline solution. The problem with it is that it’s based on old browser appcache API, as its name suggests, and that is outdated, will kick up warnings, and will be removed at some point in the future. But it does work today, and even supports tricky packages (for offline first support) such as dynamic-imports for code splitting.

There are service workers out there, which you can manually copy into your public folder, and link up, etc. but I’m hoping for a better service worker solution at some point.