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

Lazy load unbrotli.js and inflate.js #18

Open
pascalw opened this issue Sep 14, 2020 · 5 comments
Open

Lazy load unbrotli.js and inflate.js #18

pascalw opened this issue Sep 14, 2020 · 5 comments

Comments

@pascalw
Copy link
Contributor

pascalw commented Sep 14, 2020

Unbrotli.js and inflate.js account for most of the weight of this module (66.9 KB gzipped, out of 92 KB). Which of the two is needed depends on the type of font file that is analyzed, so lazy loading these modules as needed could save quite a few bits.

@pascalw
Copy link
Contributor Author

pascalw commented Sep 14, 2020

@RoelN can you determine priority for this?

@pascalw
Copy link
Contributor Author

pascalw commented Sep 28, 2020

I just came across https://github.com/101arrowz/fflate which could perhaps replace inflate.js. It's only 8kb min/gzipped, but could even be smaller with treeshaking since we don't need all supported algorithms.

@RoelN
Copy link
Contributor

RoelN commented Oct 1, 2020

Hey, well spotted, thanks! Reading up on fflate, I saw tiny-inflate which might be an even better fit, as we only need decompression?

@pascalw
Copy link
Contributor Author

pascalw commented Oct 2, 2020

Worth to consider indeed. That does seem to be quite a bit slower, but might be ok for our usecase.
For inflate only fflate should also be only 3KB btw, it supports threeshaking.

@RoelN
Copy link
Contributor

RoelN commented Oct 7, 2020

@pascalw I see your question for priority, sorry I missed that. It's one of the requirements before going live, so perhaps you could pick this up at your earliest convenience?

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

2 participants