-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
163fd91
commit 3bc6c25
Showing
85 changed files
with
338 additions
and
384 deletions.
There are no files selected for viewing
11 changes: 4 additions & 7 deletions
11
packages/next-swc/crates/core/tests/errors/next-dynamic/too-many-arguments/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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import dynamic from 'next/dynamic' | ||
|
||
const DynamicComponentWithCustomLoading = dynamic( | ||
() => import('../components/hello'), | ||
{ loading: () => <p>...</p> }, | ||
"3rd" | ||
) | ||
import dynamic from 'next/dynamic'; | ||
const DynamicComponentWithCustomLoading = dynamic(()=>import('../components/hello'), { | ||
loading: ()=><p>...</p> | ||
}, '3rd'); |
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/errors/next-font-loaders/export-let/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import firaCode from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Abel","arguments":[],"variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; | ||
import firaCode from '@next/font/google/target.css?{"arguments":[],"import":"Abel","path":"pages/test.tsx","variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"arguments":[],"import":"Inter","path":"pages/test.tsx","variableName":"inter"}'; | ||
import React from 'react'; | ||
export { firaCode }; | ||
export { inter }; |
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/errors/next-font-loaders/not-const/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import inter1 from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[{"variant":"400"}],"variableName":"inter1"}'; | ||
import inter2 from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[{"variant":"400"}],"variableName":"inter2"}'; | ||
import inter1 from '@next/font/google/target.css?{"arguments":[{"variant":"400"}],"import":"Inter","path":"pages/test.tsx","variableName":"inter1"}'; | ||
import inter2 from '@next/font/google/target.css?{"arguments":[{"variant":"400"}],"import":"Inter","path":"pages/test.tsx","variableName":"inter2"}'; | ||
var i = 10; | ||
var i2 = 20; |
8 changes: 4 additions & 4 deletions
8
packages/next-swc/crates/core/tests/errors/next-font-loaders/options-object/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
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/errors/next-font-loaders/spread-arg/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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import inter from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[{},[]],"variableName":"inter"}'; | ||
import inter from '@next/font/google/target.css?{"arguments":[{},[]],"import":"Inter","path":"pages/test.tsx","variableName":"inter"}'; | ||
const a = fn(...{}, ...[]); |
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
4 changes: 2 additions & 2 deletions
4
...t-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// This is a comment. | ||
"use strict"; | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import "client-only"; | ||
*/ import 'client-only'; | ||
export default function() { | ||
return null; | ||
} |
3 changes: 1 addition & 2 deletions
3
...ore/tests/errors/react-server-components/client-graph/get-server-side-props/output.stderr
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,7 +1,6 @@ | ||
|
||
x NEXT_RSC_ERR_INVALID_API: getServerSideProps | ||
,-[input.js:1:1] | ||
1 | export function getServerSideProps (){ | ||
1 | export function getServerSideProps() {} | ||
: ^^^^^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
3 changes: 1 addition & 2 deletions
3
...tes/core/tests/errors/react-server-components/client-graph/get-static-props/output.stderr
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,7 +1,6 @@ | ||
|
||
x NEXT_RSC_ERR_INVALID_API: getStaticProps | ||
,-[input.js:1:1] | ||
1 | export function getStaticProps (){ | ||
1 | export function getStaticProps() {} | ||
: ^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
4 changes: 2 additions & 2 deletions
4
...t-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// This is a comment. | ||
"use strict"; | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import "server-only"; | ||
*/ import 'server-only'; | ||
export default function() { | ||
return null; | ||
} |
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
7 changes: 4 additions & 3 deletions
7
...xt-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import "react"; | ||
export default function () { | ||
return null; | ||
import 'react'; | ||
'use client'; | ||
export default function() { | ||
return null; | ||
} |
10 changes: 5 additions & 5 deletions
10
...wc/crates/core/tests/errors/react-server-components/client-graph/use-client/output.stderr
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,7 +1,7 @@ | ||
|
||
x NEXT_RSC_ERR_CLIENT_DIRECTIVE | ||
,-[input.js:2:1] | ||
2 | | ||
3 | "use client" | ||
: ^^^^^^^^^^^^ | ||
x NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN | ||
,-[input.js:1:1] | ||
1 | import 'react' | ||
2 | ;('use client') | ||
: ^^^^^^^^^^^^^^ | ||
`---- |
4 changes: 2 additions & 2 deletions
4
...t-swc/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// This is a comment. | ||
"use strict"; | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import "client-only"; | ||
*/ import 'client-only'; | ||
export default function() { | ||
return null; | ||
} |
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
3 changes: 1 addition & 2 deletions
3
...ore/tests/errors/react-server-components/server-graph/get-server-side-props/output.stderr
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,7 +1,6 @@ | ||
|
||
x NEXT_RSC_ERR_INVALID_API: getServerSideProps | ||
,-[input.js:1:1] | ||
1 | export function getServerSideProps (){ | ||
1 | export function getServerSideProps() {} | ||
: ^^^^^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
3 changes: 1 addition & 2 deletions
3
...tes/core/tests/errors/react-server-components/server-graph/get-static-props/output.stderr
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,7 +1,6 @@ | ||
|
||
x NEXT_RSC_ERR_INVALID_API: getStaticProps | ||
,-[input.js:1:1] | ||
1 | export function getStaticProps (){ | ||
1 | export function getStaticProps() {} | ||
: ^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
2 changes: 1 addition & 1 deletion
2
...ext-swc/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,7 +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"; | ||
import { Component, createFactory, PureComponent, useDeferredValue, useInsertionEffect, useLayoutEffect, useReducer, useRef, useSyncExternalStore } from 'react'; | ||
export default function() { | ||
return null; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...swc/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { findDOMNode, flushSync, unstable_batchedUpdates } from "react-dom"; | ||
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'; | ||
export default function() { | ||
return null; | ||
} |
22 changes: 8 additions & 14 deletions
22
...crates/core/tests/errors/react-server-components/server-graph/react-dom-api/output.stderr
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,24 +1,18 @@ | ||
|
||
x NEXT_RSC_ERR_REACT_API: findDOMNode | ||
,-[input.js:1:1] | ||
1 | import { | ||
2 | findDOMNode, | ||
: ^^^^^^^^^^^ | ||
3 | flushSync, | ||
1 | import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' | ||
: ^^^^^^^^^^^ | ||
`---- | ||
|
||
x NEXT_RSC_ERR_REACT_API: flushSync | ||
,-[input.js:2:1] | ||
2 | findDOMNode, | ||
3 | flushSync, | ||
: ^^^^^^^^^ | ||
4 | unstable_batchedUpdates, | ||
,-[input.js:1:1] | ||
1 | import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' | ||
: ^^^^^^^^^ | ||
`---- | ||
|
||
x NEXT_RSC_ERR_REACT_API: unstable_batchedUpdates | ||
,-[input.js:3:1] | ||
3 | flushSync, | ||
4 | unstable_batchedUpdates, | ||
: ^^^^^^^^^^^^^^^^^^^^^^^ | ||
5 | } from "react-dom" | ||
,-[input.js:1:1] | ||
1 | import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' | ||
: ^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- |
6 changes: 3 additions & 3 deletions
6
.../core/tests/errors/react-server-components/server-graph/react-dom-server-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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// This is a comment. | ||
"use strict"; | ||
'use strict'; | ||
/** | ||
* This is a comment. | ||
*/ import "react-dom/server"; | ||
import "react-dom/client"; | ||
*/ import 'react-dom/server'; | ||
import 'react-dom/client'; | ||
export default function() { | ||
return null; | ||
} |
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
8 changes: 4 additions & 4 deletions
8
packages/next-swc/crates/core/tests/errors/server-actions/11/output.stderr
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,7 +1,7 @@ | ||
|
||
x The "use server" directive must be at the top of the file, and cannot be wrapped in parentheses. | ||
,-[input.js:2:1] | ||
2 | | ||
3 | ('use sevrer') | ||
: ^^^^^^^^^^^^^^ | ||
,-[input.js:1:1] | ||
1 | import 'react' | ||
2 | ;('use sevrer') | ||
: ^^^^^^^^^^^^^^ | ||
`---- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +0,0 @@ | ||
|
||
x The "use server" directive must be at the top of the function body. | ||
,-[input.js:7:1] | ||
7 | const x = 1 | ||
8 | 'use server' | ||
: ^^^^^^^^^^^^ | ||
9 | } | ||
`---- | ||
10 changes: 5 additions & 5 deletions
10
packages/next-swc/crates/core/tests/errors/server-actions/9/output.stderr
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,7 +1,7 @@ | ||
|
||
x The "use server" directive must be at the top of the file. | ||
,-[input.js:2:1] | ||
2 | | ||
3 | 'use server' | ||
: ^^^^^^^^^^^^ | ||
x The "use server" directive must be at the top of the file, and cannot be wrapped in parentheses. | ||
,-[input.js:1:1] | ||
1 | import 'my-module' | ||
2 | ;('use server') | ||
: ^^^^^^^^^^^^^^ | ||
`---- |
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/fixture/next-font-loaders/default-import/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 |
---|---|---|
@@ -1 +1 @@ | ||
import font from 'cool-fonts/target.css?{"path":"pages/test.tsx","import":"","arguments":[{"prop":true}],"variableName":"font"}'; | ||
import font from 'cool-fonts/target.css?{"arguments":[{"prop":true}],"import":"","path":"pages/test.tsx","variableName":"font"}'; |
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/fixture/next-font-loaders/export-const/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import firaCode from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Abel","arguments":[],"variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; | ||
import firaCode from '@next/font/google/target.css?{"arguments":[],"import":"Abel","path":"pages/test.tsx","variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"arguments":[],"import":"Inter","path":"pages/test.tsx","variableName":"inter"}'; | ||
import React from 'react'; | ||
export { firaCode }; | ||
export { inter }; |
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/fixture/next-font-loaders/exports/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import firaCode from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Abel","arguments":[],"variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Inter","arguments":[],"variableName":"inter"}'; | ||
import firaCode from '@next/font/google/target.css?{"arguments":[],"import":"Abel","path":"pages/test.tsx","variableName":"firaCode"}'; | ||
import inter from '@next/font/google/target.css?{"arguments":[],"import":"Inter","path":"pages/test.tsx","variableName":"inter"}'; | ||
import React from 'react'; | ||
export { firaCode }; | ||
export default inter; |
Oops, something went wrong.