Skip to content

Minify, compress, and possibly tree-shake assets #1843

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

Open
peekxc opened this issue Feb 5, 2025 · 1 comment
Open

Minify, compress, and possibly tree-shake assets #1843

peekxc opened this issue Feb 5, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@peekxc
Copy link

peekxc commented Feb 5, 2025

Possibly a generalization / duplicate of #1665

When I load a basic shiny app w/ the cache disable, the download size for shiny.js is ~1 MB

Image

The size of the minified file (shiny.min.js) shipped in the package is only 435 KB (though it is not loaded in the default app); a minified and Brotli-compressed version would be a mere 78 KB.

It would be nice if you fixed the include to the minified one, and perhaps consider pre-compressing all the js/css assets for speedy loading

@schloerke schloerke added enhancement New feature or request and removed needs-triage labels Apr 8, 2025
@schloerke
Copy link
Collaborator

No reason why we shouldn't be shipping shiny.min.js instead of shiny.js.


Pre-compressing the files would be a new concept for the project. https://caniuse.com/brotli shows wide adoption of brotli. So it seems like a fair idea!

(We can not combine JS/CSS output files as html-dependencies could be overruled by another html-dependency definition. )

I see https://pypi.org/project/brotli-asgi/ , but it hasn't been updated for recent versions of python.

https://pypi.org/project/Brotli/ states version 3. So its a possibility

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

No branches or pull requests

2 participants