feat(build): cache JS client script and compress with gzip #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #50
Instead of directly embedding the JavaScript code during runtime, the build process now generates a script with a unique hash. The HTML file then references this script using a
src
attribute andasync
, allowing for better version control and cache management.Key Changes:
These combined enhancements not only streamline the deployment process but also contribute to a more efficient and faster user experience by minimizing script retrieval and optimizing script delivery.
@danielart @amatiasq after gzip, Brisa client code is reduced from 5kb to 3kb, similar than preact but including signals (preact/signals is +2kb).
I also improve the build log table:
Colors:
About brotli:
I would like to give it to Brotli, I will leave it for later as it is in Bun's plans, now I could do it with zlib but I prefer to wait.