feat: prebundle code + restore from snapshot#1604
Merged
Merged
Conversation
Contributor
|
This is a very similar approach to what I did in #1084 for a PoC. I think this is the right way to do it. +1 for the concept. |
c38f13b to
3f7b378
Compare
a1947af to
14b139c
Compare
Contributor
Author
|
Gonna do the documentation update in another PR since the deploy page needs an overall in general. |
bartlomieju
reviewed
Aug 12, 2023
Contributor
|
We should add this to the documentation. |
2aa212c to
a3a7647
Compare
Contributor
Author
|
Added a page to our documentation and I think the PR is ready to be merged. |
Contributor
|
Let me take a look! |
lino-levan
reviewed
Aug 15, 2023
Closed
This reverts commit 14b139c.
f59c364 to
264abe2
Compare
Contributor
|
Nice! Excited to have this land. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR allows you to prebundle all islands and other code needed for the browser ahead of time. The workflow with this is that you have a GitHub action where you build the assets and then deploy from there.
Pros:
Cons:
Assets can be generated by running
deno task buildand themain.tsscript will pick up the snapshots automatically if one is there. When it does it prints a message to the terminal.The speed difference is best shown with a video. In the ahead of time (AOT) bundled version the agolia search loads nearly instantaneously. Go to https://fresh-www-test.deno.dev/ to see that for yourself.
output.mp4
The main difference to #1450 is, that this accounts for plugins and includes a way to generate the bundles + snapshots directly in Fresh.
Fixes #1062