-
Notifications
You must be signed in to change notification settings - Fork 26k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use edge environment in server-side rendering of client components too
- Loading branch information
Showing
8 changed files
with
169 additions
and
47 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: 12 additions & 4 deletions
16
...crates/next-dev-tests/tests/integration/next/import/conditions/input/app/app-edge/page.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,11 +1,19 @@ | ||
import edgeThenNode from 'edge-then-node' | ||
import nodeThenEdge from 'node-then-edge' | ||
import ClientComponent from '../client' | ||
|
||
export const runtime = 'edge' | ||
|
||
export default function AppEdge() { | ||
return JSON.stringify({ | ||
edgeThenNode, | ||
nodeThenEdge, | ||
}) | ||
return ( | ||
<> | ||
<div id="server"> | ||
{JSON.stringify({ | ||
edgeThenNode, | ||
nodeThenEdge, | ||
})} | ||
</div> | ||
<ClientComponent /> | ||
</> | ||
) | ||
} |
16 changes: 12 additions & 4 deletions
16
...ates/next-dev-tests/tests/integration/next/import/conditions/input/app/app-nodejs/page.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,11 +1,19 @@ | ||
import edgeThenNode from 'edge-then-node' | ||
import nodeThenEdge from 'node-then-edge' | ||
import ClientComponent from '../client' | ||
|
||
export const runtime = 'nodejs' | ||
|
||
export default function AppNodeJs() { | ||
return JSON.stringify({ | ||
edgeThenNode, | ||
nodeThenEdge, | ||
}) | ||
return ( | ||
<> | ||
<div id="server"> | ||
{JSON.stringify({ | ||
edgeThenNode, | ||
nodeThenEdge, | ||
})} | ||
</div> | ||
<ClientComponent /> | ||
</> | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
...t-swc/crates/next-dev-tests/tests/integration/next/import/conditions/input/app/client.tsx
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,17 @@ | ||
'use client' | ||
|
||
import edgeThenNode from 'edge-then-node' | ||
import nodeThenEdge from 'node-then-edge' | ||
|
||
export const runtime = 'edge' | ||
|
||
export default function ClientComponent() { | ||
return ( | ||
<div id="client"> | ||
{JSON.stringify({ | ||
edgeThenNode, | ||
nodeThenEdge, | ||
})} | ||
</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
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