flet icon indicating copy to clipboard operation
flet copied to clipboard

Means to pre-fetch static dependencies for web

Open adampiskorski opened this issue 3 years ago • 1 comments

To offset the longer loading times of the web output, it would be beneficial to have the client browser asynchronously download all the dependencies for Flet on web (such as canvaskit.wasm) when the client lands on a landing or login page so that when they launch the actual web app, there is a minimal delay for the user.

I'm thinking of something that allows introspection of a felt distribution on runtime or build phase in a CI pipeline, which outputs a list of URLs, which can then be sent to a different service.

Right now, pre-fetching isn't a problem (for example https://unpkg.com/[email protected]/bin/canvaskit.wasm is currently as of this writing, the dependency), however, when this changes it will be impractical to manually update it in a timely fashion.

A workaround would be to launch the app in the pipeline, visit it with headless chromium and get all the static files that way. Due to the likely lower priority of this issue and lower demand, I can settle with a code snippet that could be put into a pipeline to do just this in the documentation. I would be happy to write it when I get around to needing this.

adampiskorski avatar Sep 04 '22 10:09 adampiskorski

There is a whole thread on Flutter dedicated to this problem: https://github.com/flutter/flutter/issues/76009#issuecomment-1236276700 - there are related issues too. You may want to check them.

FeodorFitsner avatar Sep 05 '22 02:09 FeodorFitsner