-
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
Introduce NextMode #49852
Merged
Merged
Introduce NextMode #49852
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6b39985
Introduce NextMode
alexkirsz 652769e
Link
alexkirsz 05d7cb8
Comments and formatting
alexkirsz 2048c84
Improve types somewhat
alexkirsz 4eb6117
Link
alexkirsz 2dbf95d
Inherit NODE_ENV from execution context
alexkirsz 70ba8f6
Link
alexkirsz 2229f84
Cleanup
alexkirsz 4ac8a36
Link
alexkirsz 78e177d
Link
alexkirsz 94392e5
Address review comments
alexkirsz 57e7737
Link
alexkirsz a161414
Lints and fixes
alexkirsz ef19cdc
get_client_compile_time_info -> get_compile_time_info
alexkirsz d7df472
Merge branch 'canary' into alexkirsz/web-397-next-mode
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
6 changes: 6 additions & 0 deletions
6
packages/next-swc/crates/next-core/js/src/build/client/bootstrap.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* This is the runtime entry point for Next.js client-side bundles. | ||
*/ | ||
|
||
import './shims' | ||
import 'next/dist/client/next' |
11 changes: 11 additions & 0 deletions
11
packages/next-swc/crates/next-core/js/src/build/client/shims.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import '../shims' | ||
|
||
// Next uses __webpack_require__ extensively. | ||
globalThis.__webpack_require__ = (name) => { | ||
console.error( | ||
`__webpack_require__ is not implemented (when requiring ${name})` | ||
) | ||
} | ||
|
||
// initialize() needs `__webpack_public_path__` to be defined. | ||
globalThis.__webpack_public_path__ = undefined |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This ensures Next.js uses React 18's APIs (hydrateRoot) instead of React 17's | ||
// (hydrate). | ||
process.env.__NEXT_REACT_ROOT = 'true' |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I started getting a TS error from this, saying there was no error there. I think our types might be busted in this package. In any case, I tried to improve our typing a bit (see above).