-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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!: support latest Next.js versions #7026
Merged
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
jacobsfletch
approved these changes
Jul 8, 2024
jacobsfletch
reviewed
Jul 8, 2024
Webpack: [ {}, [Function: ExampleServer] ] | ||
|
||
*/ | ||
const clientRefSymbol = Symbol.for('react.client.reference') |
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 is soo nice
jacobsfletch
reviewed
Jul 8, 2024
if (component === null || component === undefined) { | ||
return false | ||
} | ||
const hasClientComponentSymbol = component.$$typeof == clientRefSymbol |
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.
Amazing
paulpopus
pushed a commit
that referenced
this pull request
Jul 24, 2024
…assed to Client Document Views (#7026) **BREAKING:** The minimum required Next.js version has been bumped from `15.0.0-rc.0` to `15.0.0-canary.53`. This is because the way client components are represented changed somewhere between those versions, and it is not feasible to support both versions in our RSC detection logic.
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.
BREAKING: The minimum required Next.js version has been bumped from
15.0.0-rc.0
to15.0.0-canary.53
. This is because the way client components are represented changed somewhere between those versions, and it is not feasible to support both versions in our RSC detection logic.Previously, Client Components in Webpack were represented as
{}
objects. Now, they are functions, which broke our RSC detection logic. Now, we can use thereact.client.reference
symbol to detect whether a component is a client or server component.This actually uncovered another bug - this logic in
getCustomViewByKey
was broken:payload/packages/next/src/views/Document/getCustomViewByKey.tsx
Line 18 in 9e76c8f
You can pass both the actual component, or an object which then contains a
Component
property, containing the React Component, as a custom view:However, since Client Components previously were objects, they incorrectly triggered this check, leading this logic to assume you passing in an object containing a component and not the actual component, which is incorrect. This resulted in it not returning a custom view. Now that components are represented as functions, this was automatically fixed and uncovered a different bug where we were passing server props to client components (fixed in 8cc5614)