-
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
aeec6b5
commit 1fbaf44
Showing
409 changed files
with
4,911 additions
and
4,881 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
3 changes: 1 addition & 2 deletions
3
packages/next-swc/crates/core/tests/errors/next-ssg/server-side-after-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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
const getStaticProps = async () => {} | ||
export { a as getServerSideProps } | ||
|
||
export { a as getServerSideProps } |
2 changes: 0 additions & 2 deletions
2
packages/next-swc/crates/core/tests/errors/next-ssg/static-paths-after-server-side/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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
export { a as getServerSideProps } from './input' | ||
export { getStaticPaths } from 'a' | ||
|
||
|
6 changes: 3 additions & 3 deletions
6
...xt-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// This is a comment. | ||
|
||
"use strict"; | ||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import "client-only" | ||
import 'client-only' | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
5 changes: 2 additions & 3 deletions
5
...tes/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export function getServerSideProps (){ | ||
} | ||
export function getServerSideProps() {} | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
5 changes: 2 additions & 3 deletions
5
...c/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export function getStaticProps (){ | ||
} | ||
export function getStaticProps() {} | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
6 changes: 3 additions & 3 deletions
6
...xt-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// This is a comment. | ||
|
||
"use strict"; | ||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import "server-only" | ||
import 'server-only' | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
7 changes: 3 additions & 4 deletions
7
...ext-swc/crates/core/tests/errors/react-server-components/client-graph/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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import "react" | ||
|
||
"use client" | ||
import 'react' | ||
;('use client') | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
6 changes: 3 additions & 3 deletions
6
...xt-swc/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// This is a comment. | ||
|
||
"use strict"; | ||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import "client-only" | ||
import 'client-only' | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
5 changes: 2 additions & 3 deletions
5
...tes/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export function getServerSideProps (){ | ||
} | ||
export function getServerSideProps() {} | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
5 changes: 2 additions & 3 deletions
5
...c/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export function getStaticProps (){ | ||
} | ||
export function getStaticProps() {} | ||
|
||
export default function () { | ||
return null; | ||
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: 2 additions & 6 deletions
8
...-swc/crates/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import { | ||
findDOMNode, | ||
flushSync, | ||
unstable_batchedUpdates, | ||
} from "react-dom" | ||
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom' | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
8 changes: 4 additions & 4 deletions
8
...s/core/tests/errors/react-server-components/server-graph/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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
// This is a comment. | ||
|
||
"use strict"; | ||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
import "react-dom/server" | ||
import 'react-dom/server' | ||
|
||
import "react-dom/client" | ||
import 'react-dom/client' | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/errors/server-actions/1/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use server'; | ||
'use server' | ||
|
||
export function foo() {} |
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/errors/server-actions/10/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use sevrer' | ||
|
||
export async function foo () {} | ||
export async function foo() {} |
3 changes: 1 addition & 2 deletions
3
packages/next-swc/crates/core/tests/errors/server-actions/11/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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import 'react' | ||
|
||
('use sevrer') | ||
;('use sevrer') | ||
|
||
// ^Tools like Prettier sometimes do this. |
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/errors/server-actions/2/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
// comment | ||
|
||
'use server'; | ||
'use server' | ||
|
||
export function bar() {} |
3 changes: 1 addition & 2 deletions
3
packages/next-swc/crates/core/tests/errors/server-actions/3/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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
'use server'; | ||
'use server' | ||
|
||
export const x = 1 | ||
|
4 changes: 2 additions & 2 deletions
4
packages/next-swc/crates/core/tests/errors/server-actions/4/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use server'; | ||
'use server' | ||
|
||
export default class Component { | ||
render() { | ||
return null; | ||
return null | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/errors/server-actions/5/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use server'; | ||
'use server' | ||
|
||
export * from 'foo' |
2 changes: 1 addition & 1 deletion
2
packages/next-swc/crates/core/tests/errors/server-actions/6/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use server'; | ||
'use server' | ||
|
||
export default () => {} |
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 |
---|---|---|
|
@@ -5,5 +5,5 @@ const foo = async () => { | |
|
||
const bar = async () => { | ||
const x = 1 | ||
'use server' | ||
;('use server') | ||
} |
3 changes: 1 addition & 2 deletions
3
packages/next-swc/crates/core/tests/errors/server-actions/9/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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import 'my-module' | ||
|
||
'use server' | ||
;('use 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
11 changes: 7 additions & 4 deletions
11
packages/next-swc/crates/core/tests/fixture/next-dynamic/wrapped-import/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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import dynamic from 'next/dynamic' | ||
const DynamicComponent = dynamic(() => handleImport(import('./components/hello')), { | ||
loading: () => null, | ||
ssr: false, | ||
}); | ||
const DynamicComponent = dynamic( | ||
() => handleImport(import('./components/hello')), | ||
{ | ||
loading: () => null, | ||
ssr: false, | ||
} | ||
) |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ function About(props) { | |
return <h3>My AMP About Page!</h3> | ||
} | ||
|
||
export default About | ||
export default About |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ function About(props) { | |
return <h3>My AMP About Page!</h3> | ||
} | ||
|
||
export default About | ||
export default About |
10 changes: 6 additions & 4 deletions
10
packages/next-swc/crates/core/tests/fixture/react-remove-properties/custom/simple/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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export default function Home() { | ||
return <div data-test-id="1" data-custom="1a"> | ||
<div data-custom="2"> | ||
<h1 data-testid="3">Hello World!</h1> | ||
return ( | ||
<div data-test-id="1" data-custom="1a"> | ||
<div data-custom="2"> | ||
<h1 data-testid="3">Hello World!</h1> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
12 changes: 8 additions & 4 deletions
12
packages/next-swc/crates/core/tests/fixture/react-remove-properties/default/simple/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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
export default function Home() { | ||
return <div data-test-id="1" data-custom="1a"> | ||
<div data-custom="2"> | ||
<h1 data-testid="3" nested={() => (<div data-testid="4">nested</div>)}>Hello World!</h1> | ||
return ( | ||
<div data-test-id="1" data-custom="1a"> | ||
<div data-custom="2"> | ||
<h1 data-testid="3" nested={() => <div data-testid="4">nested</div>}> | ||
Hello World! | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
20 changes: 9 additions & 11 deletions
20
...-swc/crates/core/tests/fixture/react-server-components/client-graph/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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
// This is a comment. | ||
|
||
"use strict"; | ||
'use strict' | ||
|
||
/** | ||
* This is a comment. | ||
*/ | ||
|
||
"use client"; | ||
'use client' | ||
|
||
// This is a comment. | ||
|
||
"foo"; | ||
'foo' | ||
|
||
"use client"; | ||
'use client' | ||
|
||
import "fs" | ||
|
||
"bar"; | ||
import 'fs' | ||
;('bar') | ||
|
||
// This is a comment. | ||
|
||
1 + 1; | ||
|
||
"baz"; | ||
1 + 1 | ||
;('baz') | ||
|
||
export default function () { | ||
return null; | ||
return null | ||
} |
2 changes: 1 addition & 1 deletion
2
.../crates/core/tests/fixture/react-server-components/server-graph/client-entry-cjs/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"use client"; | ||
'use client' | ||
|
||
module.exports = function () {} |
18 changes: 8 additions & 10 deletions
18
...-swc/crates/core/tests/fixture/react-server-components/server-graph/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
Oops, something went wrong.