-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
feat: Add Compression to Hacker News w/ Islands Example #2613
Conversation
Code was taken from leptos-rs/cargo-leptos#165 (comment) Co-authored-by: Sebastian Dobe <[email protected]>
Fix lints for CI |
This will prevent users from using an old cached file after updates are made
Looks like the issue is that when building it is trying to access |
I also add |
Cool -- This looks great, thanks! |
One of the things I love about leptos is how easy it is to ship a small frontend.
Leptos provides islands that reduce the amount of total HTML generated and it's build tool minifies CSS with
lightningcss
, soon will be minifying javascript withswc
, and it can even precompress these static assets. That last of which I think may be the most important because web assembly compress fairly well and it allows the user to ship their entire app as 1 static binary (with musl).Since precompression was added as a feature in
cargo-leptos
I haven't seen it mentioned a whole lot so I wanted to help people see how to use it. I have also seen a couple question about setting up compression in general so I added that too.I've updated the
hackernews_islands_axum
example to serve all static assets precompressed withcargo-leptos
and to dynamically compress the HTML.The type of compression sent will depend on what the client supports.
The resulting network usage