-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Apply react-server transform and valication to middleware #57448
Merged
Conversation
This file contains 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
Tests Passed |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Diff detailsDiff for page.jsDiff too large to display Diff for middleware.jsDiff too large to display Diff for edge-ssr.jsDiff too large to display Diff for 199-HASH.jsDiff too large to display |
huozhi
force-pushed
the
middleware/react-server
branch
from
October 25, 2023 22:20
77af7c2
to
6501af4
Compare
huozhi
commented
Oct 25, 2023
afterAll(async () => { | ||
await next.patchFile(middlewareFile, middlewareContent) | ||
// await next.patchFile(pagesApiFile, pagesApiContent) | ||
// await next.patchFile( |
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.
leave these comments here, which could be enabled later once we apply the same rule to pages/api
huozhi
changed the title
(wip) Apply react-server transform and valication to middleware
Apply react-server transform and valication to middleware
Oct 25, 2023
huozhi
requested review from
timneutkens,
ijjk,
shuding,
ztanner,
feedthejim,
a team and
wyattjoh
as code owners
October 25, 2023 22:46
shuding
approved these changes
Oct 25, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Oct 26, 2023
Apply react-server condition and related API checks for pages API. if you're doing react SSR with renderToString in middleware it should be disallowed. Imaging it could send the rendered html code to client and you display it in browser. But it might require hydration so it can be broken. Follow up for #57448 , same reason explained in #57448 Closes NEXT-1653
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Apply
react-server
resolving and server components invalid APIs checking to middleware. We want to limit the react usage in in middleware as so far it's not aimed for rendering purpose.Another invalid case could be: if you're doing react SSR with
renderToString
in middleware it should be disallowed. Imaging it could send the rendered html code to client and you display it in browser. But it might require hydration so it can be broken.This PR will only let you import
react-server
export condition packages.