-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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(next-core): build time client|server-only assertion #61732
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
ijjk
added
Turbopack
Related to Turbopack with Next.js.
created-by: Turbopack team
PRs by the turbopack team
type: next
labels
Feb 6, 2024
kwonoj
changed the title
feat(next-core): build time client|server-only assertion
[DONOTMERGE] [WIP] feat(next-core): build time client|server-only assertion
Feb 6, 2024
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
Next Runtimes
Diff detailsDiff for page.jsDiff too large to display |
kwonoj
force-pushed
the
resolve-plugin-invalid-imports
branch
from
February 6, 2024 20:41
0c60a96
to
2c8b93e
Compare
kwonoj
force-pushed
the
resolve-plugin-invalid-imports
branch
2 times, most recently
from
February 6, 2024 23:07
c6be212
to
9df9516
Compare
kwonoj
force-pushed
the
resolve-plugin-invalid-imports
branch
from
February 6, 2024 23:42
9df9516
to
930aed6
Compare
kwonoj
changed the title
[DONOTMERGE] [WIP] feat(next-core): build time client|server-only assertion
eat(next-core): build time client|server-only assertion
Feb 6, 2024
kwonoj
changed the title
eat(next-core): build time client|server-only assertion
feat(next-core): build time client|server-only assertion
Feb 6, 2024
kwonoj
commented
Feb 6, 2024
plugins.push(Vc::upcast(invalid_client_only_resolve_plugin)); | ||
} | ||
ServerContextType::AppSSR { .. } => { | ||
//[TODO] Build error in this context makes rsc-build-error.ts fail which expects runtime error code |
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 makes one of invalid-imports test not able to pass
kwonoj
commented
Feb 6, 2024
messages.push("\n".to_string()); | ||
|
||
//[TODO]: how do we get the import trace? | ||
messages.push(format!( |
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.
- we don't get import trace to display
- also this place doesn't know
styled-jsx
import from the<styled..
tag
kwonoj
requested review from
timneutkens,
ijjk,
shuding,
huozhi,
a team,
feedthejim,
ztanner and
wyattjoh
as code owners
February 6, 2024 23:44
huozhi
approved these changes
Feb 7, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
created-by: Turbopack team
PRs by the turbopack team
locked
Turbopack
Related to Turbopack with Next.js.
type: next
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.
What
This PR injects a build-time error for the turbopack if
client|server-only
is imported in incorrect context. The basic idea is using resolve plugin, so in resolve time if matching context (which alises erroneous import), raise a build time error.Unfortunately this won't fix all of the tests in
invalid-imports
, due tostyled-jsx
from using<styled..
tagsCloses PACK-2397