-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: SSR split
mode
#7220
feat: SSR split
mode
#7220
Conversation
🦋 Changeset detectedLatest commit: cd06296 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e770d22
to
f98d395
Compare
157af39
to
0e7d932
Compare
I rebased the branch. The PR should be ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
We discussed offline. Integrations (adapters) will need to know the mapping of routes to the entrypoint. We discussed adding this to the |
de11b09
to
d49e185
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
d4279f3
to
114eec4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Changes
This PR adds a new SSR mode, called
split
.Serverless mode creates an entry point for each page, and each entry point is a self-contained application meant to render one single page.
Here's a list of changes:
split
boolean to thebuild
object; by default, the value isfalse
, which means that Astro will keep the current behaviour;plugin-ssr.ts
will emit two plugins, one to emit SSR server and one for SSR split, and they can't coexist. One is used, and the other won't. The reason why the two plugins live in the same file is that they share the majority of the code;plugin-ssr.ts
the code that generates the deserialisation of the manifest was moved into a function, shared between the new plugins;split
value.pageMap
is kept for SSR server, while SSR split has a simplepageModule
function. Because of that, I created two types:SSRServerManifest
andSSRServerlessManifest
;serverlessEntryPrefix
; by default it'sentry
Here's an example of the emitted output
Testing
Added some test case
Docs
/cc @withastro/maintainers-docs for feedback!
If you're OK with the APIs, then I will start drafting a PR in the docs repo, because now the payload of
astro:build:ssr
has an additional property