-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(next-swc): skips client/server only checks when running with Jest…
… to unblock testing (#54891) Co-authored-by: Jiachi Liu <inbox@huozhi.im>
- Loading branch information
Showing
54 changed files
with
393 additions
and
142 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
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
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
13 changes: 13 additions & 0 deletions
13
...es/core/tests/fixture/react-server-components/client-graph-no-checks/client-only/input.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,13 @@ | ||
// This is a comment. | ||
|
||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import 'client-only' | ||
|
||
export default function () { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/core/tests/fixture/react-server-components/client-graph-no-checks/client-only/output.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,8 @@ | ||
// This is a comment. | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import 'client-only'; | ||
export default function() { | ||
return null; | ||
} |
5 changes: 5 additions & 0 deletions
5
...sts/fixture/react-server-components/client-graph-no-checks/get-server-side-props/input.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,5 @@ | ||
export function getServerSideProps() {} | ||
|
||
export default function () { | ||
return null | ||
} |
4 changes: 4 additions & 0 deletions
4
...ts/fixture/react-server-components/client-graph-no-checks/get-server-side-props/output.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,4 @@ | ||
export function getServerSideProps() {} | ||
export default function() { | ||
return null; | ||
} |
5 changes: 5 additions & 0 deletions
5
...re/tests/fixture/react-server-components/client-graph-no-checks/get-static-props/input.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,5 @@ | ||
export function getStaticProps() {} | ||
|
||
export default function () { | ||
return null | ||
} |
4 changes: 4 additions & 0 deletions
4
...e/tests/fixture/react-server-components/client-graph-no-checks/get-static-props/output.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,4 @@ | ||
export function getStaticProps() {} | ||
export default function() { | ||
return null; | ||
} |
13 changes: 13 additions & 0 deletions
13
...es/core/tests/fixture/react-server-components/client-graph-no-checks/server-only/input.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,13 @@ | ||
// This is a comment. | ||
|
||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import 'server-only' | ||
|
||
export default function () { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/core/tests/fixture/react-server-components/client-graph-no-checks/server-only/output.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,8 @@ | ||
// This is a comment. | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import 'server-only'; | ||
export default function() { | ||
return null; | ||
} |
8 changes: 8 additions & 0 deletions
8
...tes/core/tests/fixture/react-server-components/client-graph-no-checks/use-client/input.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,8 @@ | ||
import 'react' | ||
|
||
// prettier-ignore | ||
'use client' | ||
|
||
export default function () { | ||
return null | ||
} |
4 changes: 4 additions & 0 deletions
4
...es/core/tests/fixture/react-server-components/client-graph-no-checks/use-client/output.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,4 @@ | ||
import 'react'; | ||
export default function() { | ||
return null; | ||
} |
13 changes: 13 additions & 0 deletions
13
...es/core/tests/fixture/react-server-components/server-graph-no-checks/client-only/input.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,13 @@ | ||
// This is a comment. | ||
|
||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import 'client-only' | ||
|
||
export default function () { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/core/tests/fixture/react-server-components/server-graph-no-checks/client-only/output.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,8 @@ | ||
// This is a comment. | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import 'client-only'; | ||
export default function() { | ||
return null; | ||
} |
6 changes: 6 additions & 0 deletions
6
...e/tests/fixture/react-server-components/server-graph-no-checks/fake-client-entry/input.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,6 @@ | ||
export default function () { | ||
return null | ||
} | ||
|
||
// prettier-ignore | ||
'use client' |
3 changes: 3 additions & 0 deletions
3
.../tests/fixture/react-server-components/server-graph-no-checks/fake-client-entry/output.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,3 @@ | ||
export default function() { | ||
return null; | ||
} |
5 changes: 5 additions & 0 deletions
5
...sts/fixture/react-server-components/server-graph-no-checks/get-server-side-props/input.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,5 @@ | ||
export function getServerSideProps() {} | ||
|
||
export default function () { | ||
return null | ||
} |
4 changes: 4 additions & 0 deletions
4
...ts/fixture/react-server-components/server-graph-no-checks/get-server-side-props/output.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,4 @@ | ||
export function getServerSideProps() {} | ||
export default function() { | ||
return null; | ||
} |
5 changes: 5 additions & 0 deletions
5
...re/tests/fixture/react-server-components/server-graph-no-checks/get-static-props/input.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,5 @@ | ||
export function getStaticProps() {} | ||
|
||
export default function () { | ||
return null | ||
} |
4 changes: 4 additions & 0 deletions
4
...e/tests/fixture/react-server-components/server-graph-no-checks/get-static-props/output.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,4 @@ | ||
export function getStaticProps() {} | ||
export default function() { | ||
return null; | ||
} |
21 changes: 21 additions & 0 deletions
21
...ates/core/tests/fixture/react-server-components/server-graph-no-checks/react-api/input.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,21 @@ | ||
import { useState } from 'react' | ||
|
||
import { createContext } from 'react' | ||
|
||
import { useEffect, useImperativeHandle } from 'react' | ||
|
||
import { | ||
Component, | ||
createFactory, | ||
PureComponent, | ||
useDeferredValue, | ||
useInsertionEffect, | ||
useLayoutEffect, | ||
useReducer, | ||
useRef, | ||
useSyncExternalStore, | ||
} from 'react' | ||
|
||
export default function () { | ||
return null | ||
} |
7 changes: 7 additions & 0 deletions
7
...tes/core/tests/fixture/react-server-components/server-graph-no-checks/react-api/output.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,7 @@ | ||
import { useState } from 'react'; | ||
import { createContext } from 'react'; | ||
import { useEffect, useImperativeHandle } from 'react'; | ||
import { Component, createFactory, PureComponent, useDeferredValue, useInsertionEffect, useLayoutEffect, useReducer, useRef, useSyncExternalStore } from 'react'; | ||
export default function() { | ||
return null; | ||
} |
10 changes: 10 additions & 0 deletions
10
.../core/tests/fixture/react-server-components/server-graph-no-checks/react-dom-api/input.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,10 @@ | ||
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' | ||
|
||
import { | ||
experimental_useOptimistic as useOptimistic, | ||
experimental_useFormStatus, | ||
} from 'react-dom' | ||
|
||
export default function () { | ||
return null | ||
} |
5 changes: 5 additions & 0 deletions
5
...core/tests/fixture/react-server-components/server-graph-no-checks/react-dom-api/output.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,5 @@ | ||
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'; | ||
import { experimental_useOptimistic as useOptimistic, experimental_useFormStatus } from 'react-dom'; | ||
export default function() { | ||
return null; | ||
} |
15 changes: 15 additions & 0 deletions
15
...s/fixture/react-server-components/server-graph-no-checks/react-dom-server-client/input.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,15 @@ | ||
// This is a comment. | ||
|
||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import 'react-dom/server' | ||
|
||
import 'react-dom/client' | ||
|
||
export default function () { | ||
return null | ||
} |
Oops, something went wrong.