Because of the dependence on the server to get JS, my guess is no. Qwik's goal is to only load the JS that's needed at a given moment, whereas PWA's have a goal of being able to run fully client side, and to do that all the JS needs to be loaded onto the client. These goals seems antithetical, so I don't believe Qwik can be used for a PWA without heavily fighting against the framework: I don't know much about Qwik though so I might be wrong.
If that the downloading the initial bundle file which is relatively huge and so it takes time make it interactive, then why dont you use service workers to download the files and make the rendering as early as possible. Google came up with a nice package called workbox where you can even cache the network requests. It pre reaches the file and store it in the client
Ofcourse a lot of things involved, like computation cost, network latency, time taken for interactivity etc. but my point is , with the help of service worker you can pre download your assets and put it a cache that might require to be available in coming pages. After that there is no round trip to get assets including JS. In My application , i have done this, the amount of file transferred with 2 pages , login and dashboard was almost 7.6 MB then i cut down into 339kB
Yes right, service worker cannot speed up the download, but it will start downloading it when you just landed the first page in a diff thread. So only thing is, you make your landing page as tiny as possible.
@@ahammadalipk Downloading the static assets in a different thread doesn't shorten the TTI. What's your point? And what do you mean by "landing page"? Modern SPA serves an index.html that's basically blank. Isn't that "small" enough? That's not the point... Service workers can be useful in building PWAs, caching data, and executing heavy computing tasks in the background without blocking the UI thread. But none of these have anything to do with downloading and parsing and executing fewer stuff on the *first* visit, hence not improving TTI in those aspects.
Great talk Misko and congrats to the whole team for the tremendous work! I'm sure the whole web space will follow suit sooner or later, thanks for paving the way!