Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing app.zip with tree shaking? #3099

Closed
hololeo opened this issue Apr 25, 2024 · 4 comments
Closed

Optimizing app.zip with tree shaking? #3099

hololeo opened this issue Apr 25, 2024 · 4 comments

Comments

@hololeo
Copy link

hololeo commented Apr 25, 2024

A minimal "hello flet" web when compiled with flet build web produces an app.zip of 3 megs. Inside is the entirety of flet with controls not used by the app.

This produces a long startup time making the user experience feel laggy even broken

Is there a possibility of 'tree shaking' so the resulting app.zip only contains the necessary flet code that is used by the application.

The idea would be to do a source analysis and only use the stuff that is imported.

Or allow the developer to list out the components they want to include.

@baseplate-admin
Copy link

baseplate-admin commented Apr 25, 2024

I don't think it is possible at this point in time..

For context :

Duplicate of :

@hololeo
Copy link
Author

hololeo commented Apr 25, 2024

intresting. though i dont think its a duplicate of #3056 because this request optimization of the flet build web process. with flet build web --wasm we are getting close to sub 3 second start up, but scrunching down app.zip would be the last mile

@FeodorFitsner
Copy link
Contributor

My guts tell me tree-shaking for Python is non-trivial task. Some tools, such as PyInstaller (or maybe Nuitka?) tries to solve that, but it's not 100% possible to analyze all imports.

@baseplate-admin
Copy link

baseplate-admin commented Apr 26, 2024

intresting. though i dont think its a duplicate of #3056 because this request optimization of the flet build web process. with flet build web --wasm we are getting close to sub 3 second start up, but scrunching down app.zip would be the last mile

My apologies, i saw app.zip, my brain told me it was related to serious-python, and i am pretty much involved with the android side of serious-python

My guts tell me tree-shaking for Python is non-trivial task.

The problem with python is those pesky C extensions, those are pretty much the size gobblers.

@flet-dev flet-dev locked and limited conversation to collaborators Apr 28, 2024
@FeodorFitsner FeodorFitsner converted this issue into discussion #3119 Apr 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants