Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop browser field for edge runtime (#35335)
Related to #31678 For streaming pages, Nodejs runtime: setting global runtime to `"nodejs"` will work with default module resolution. Edge runtime: previously next.js will pick up browser field since it's the "similar" asset (unlike nodejs) to edge runtime but browser specific things like DOM api could breaks cause edge runtime is more like worker without dom runtime. This PR is to revert the main field resolution behavior. And if you have a library targeting multiple runtime with different fields, ideally is to make it more isomorphic and will be easy to use in edge runtime
- Loading branch information
Showing
6 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
...ion/react-streaming-and-server-components/app/node_modules/non-isomorphic-text/browser.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ation/react-streaming-and-server-components/app/node_modules/non-isomorphic-text/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...n/react-streaming-and-server-components/app/node_modules/non-isomorphic-text/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 7 additions & 1 deletion
8
test/integration/react-streaming-and-server-components/app/pages/external-imports.server.js
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import moment from 'moment' | ||
import nonIsomorphicText from 'non-isomorphic-text' | ||
|
||
export default function Page() { | ||
return <div>date:{moment().toString()}</div> | ||
return ( | ||
<div> | ||
<div>date:{moment().toString()}</div> | ||
<div>{nonIsomorphicText()}</div> | ||
</div> | ||
) | ||
} |
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