Skip to content
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

Bundle composition / tree shaking #327

Open
laurentpayot opened this issue Oct 7, 2024 · 0 comments
Open

Bundle composition / tree shaking #327

laurentpayot opened this issue Oct 7, 2024 · 0 comments

Comments

@laurentpayot
Copy link
Contributor

laurentpayot commented Oct 7, 2024

Hi, I’m evaluating Instant to rewrite a Firebase app.

I was surprised to see that devtools.js is part of my production bundle, even though I use init with the devtool parameter set to false:

image

In the image above you can also see 2.49KB of StorageAPI.js even though I am not using storage features (yet) in my POC todo app.

Is it because the db.storage is not tree shakable from the rest of Instant? By the way, are all the db functions stuffed into db even if I only use one or two of them? That would explain why I get lighthouse warnings about 25Kb of JS being unused. The coverage tab of the Chrome devtools tells me around 40% of my JS bundle is here for nothing (after I manually used all the features)!

It reminds me 2021 Firebase with the old "namespaced" way vs the new "modular" (tree shakable) way. Firebase had to move to a modular version because the namespaced one was much too bloated. Is a "modular" version of Instant also planned?

Cheers,
Laurent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant