v15 PWA with offline support

I try to transform a vaadin 15 app (from start.vaadin.com with spring boot and TypeScript) into an offline PWA. I know the basic of the PWA stuff and wrote one with pure js. But I’ve absolutely no idea how to add all the ts files after the are converted to js to the cache.

I also found nothing on the documentation. Or did I missed it?

Is there somewhere an example app?

Thanks for all advices,
Lars

You will need to customize webpack to produce a manifest that has the reference to the generated bundles.
That is something that vaadin will add at some point but not in the very short time.
Take a look to this plugin https://github.com/arthurbergmz/webpack-pwa-manifest

Thanks for your answer. I has suspect that I have to config it my self.

When can we expect such a starter or docu? Weeks, months?

not programmed right now, but most likely in vaadin-17. We are right now working on form-binding for vaadin-16

This is to sad. Like I understand you are only a small step away from having a real PWA framework. Frankly speaking: I don’t understand why you waiting so long to go this step.

Well, it’s a matter of priorities and resources, we are first focused on improve Typescript Experience for the UI.
Be patient all good things will come, and obviously good PWA experience

Manuel Carrasco:
Be patient all good things will come, and obviously good PWA experience

I guess you are right. Always the same with people like me: Want the promised features short after they are promised.

Two last questions (planning for my next project):

Will it be possible, at some day, that we can deliver a LitElement offline PWA from / and a Flow online PWA from /backend? That would be great! :slight_smile:

Will vaadin be able to use TypeScript and LitElement with CDI?

Sorry, for asking, but the roadmap is not so detailed in this matter.

There is an example of how to manually set things up for offline bootstrapping in Vaadin Labs: https://vaadin.com/labs/offline-app.

Our roadmap is indeed a bit vague since this whole thing is still quite new and we’re collecting more feedback to understand how to prioritize different ideas.

We have a bunch of directions to expand towards. Here are some of the most promising ones (in no particular order):

  • Offline bootstrapping and navigation. Automatically generate a Service Worker and such based on a declaratively defined routing configuration. Automatic placeholder for views implemented using Java when the user is offline.
  • Offline data. Transparently cache selected parts of the application’s data for offline use and queue pending changes to that data to be sent to the server once you’re online again.
  • Server push. Allow pushing out updates from the Java backend using an API similar to the current request-based endpoints.
  • Really stateless. Use JWT for authenticating the user so that endpoints can won’t need a server-side session.
  • Support more of the JVM ecosystem. CDI, Kotlin, Portlet, OSGi, …