-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '01-07-_devoverlay_add_pagination' of github.com:vercel/…
…next.js into 01-07-_devoverlay_add_pagination
- Loading branch information
Showing
22 changed files
with
267 additions
and
103 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import type { NextConfig } from '../server/config-shared' | ||
|
||
export function needsExperimentalReact(config: NextConfig) { | ||
const { ppr, taint, reactOwnerStack } = config.experimental || {} | ||
return Boolean(ppr || taint || reactOwnerStack) | ||
const { ppr, taint, reactOwnerStack, viewTransition } = | ||
config.experimental || {} | ||
return Boolean(ppr || taint || reactOwnerStack || viewTransition) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
test/e2e/app-dir/view-transitions/fixtures/default/app/basic/Toggle.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,26 @@ | ||
'use client' | ||
import * as React from 'react' | ||
|
||
export function Toggle() { | ||
const [show, setShow] = React.useState(false) | ||
React.useEffect(() => { | ||
React.startTransition(() => { | ||
setShow(true) | ||
}) | ||
}, []) | ||
|
||
return ( | ||
<div> | ||
<button | ||
onClick={() => { | ||
React.startTransition(() => { | ||
setShow((show) => !show) | ||
}) | ||
}} | ||
> | ||
{show ? 'A' : 'B'} | ||
</button> | ||
{show ? <div>hello</div> : <section>Loading</section>} | ||
</div> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/view-transitions/fixtures/default/app/basic/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { unstable_ViewTransition as ViewTransition } from 'react' | ||
import { Toggle } from './Toggle' | ||
|
||
export default function BasicPage() { | ||
return ( | ||
<ViewTransition name="page"> | ||
<Toggle /> | ||
</ViewTransition> | ||
) | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/view-transitions/fixtures/default/app/layout.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 @@ | ||
export default function Root({ children }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
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 function Page() {} |
5 changes: 5 additions & 0 deletions
5
test/e2e/app-dir/view-transitions/fixtures/default/next.config.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 @@ | ||
module.exports = { | ||
experimental: { | ||
viewTransition: true, | ||
}, | ||
} |
Binary file added
BIN
+14.7 KB
test/e2e/app-dir/view-transitions/fixtures/default/public/favicon.ico
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
test/e2e/app-dir/view-transitions/view-transitions.test.ts
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,24 @@ | ||
import * as path from 'path' | ||
import { nextTestSetup } from 'e2e-utils' | ||
import { BrowserInterface } from 'next-webdriver' | ||
|
||
async function assertNoConsoleErrors(browser: BrowserInterface) { | ||
const logs = await browser.log() | ||
const warningsAndErrors = logs.filter((log) => { | ||
return log.source === 'warning' || log.source === 'error' | ||
}) | ||
|
||
expect(warningsAndErrors).toEqual([]) | ||
} | ||
|
||
describe('view-transitions', () => { | ||
const { next } = nextTestSetup({ | ||
files: path.join(__dirname, 'fixtures/default'), | ||
}) | ||
|
||
it('smoketest', async () => { | ||
const browser = await next.browser('/basic') | ||
|
||
await assertNoConsoleErrors(browser) | ||
}) | ||
}) |
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.