Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
export from
and native modules in server component (#36072)
This PR fixes a bunch of bugs and it now supports: - Importing a client component from a nested server component (a.server → b.server → c.client). - The `export from` syntax in server component (`export { default } from './a.server'`) - Native modules in server components (currently broken) ## Buga - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
- Loading branch information
Showing
5 changed files
with
90 additions
and
22 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
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
16 changes: 16 additions & 0 deletions
16
test/integration/react-streaming-and-server-components/app/pages/native-module.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import fs from 'fs' | ||
|
||
import Foo from '../components/foo.client' | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<h1>fs: {typeof fs.readFile}</h1> | ||
<Foo /> | ||
</> | ||
) | ||
} | ||
|
||
export const config = { | ||
runtime: 'nodejs', | ||
} |
1 change: 1 addition & 0 deletions
1
test/integration/react-streaming-and-server-components/app/pages/re-export.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './css-modules.server' |
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