-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into 07-12-render_source
- Loading branch information
Showing
26 changed files
with
255 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { isNotFoundError } from './not-found' | ||
import { isRedirectError } from './redirect' | ||
|
||
/** | ||
* Returns true if the error is a navigation signal error. These errors are | ||
* thrown by user code to perform navigation operations and interrupt the React | ||
* render. | ||
*/ | ||
export function isNextRouterError(error: any): boolean { | ||
return ( | ||
error && error.digest && (isRedirectError(error) || isNotFoundError(error)) | ||
) | ||
return isRedirectError(error) || isNotFoundError(error) | ||
} |
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 +1,8 @@ | ||
import { isDynamicServerError } from '../../client/components/hooks-server-context' | ||
import { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr' | ||
import { isNavigationSignalError } from './is-navigation-signal-error' | ||
import { isNextRouterError } from '../../client/components/is-next-router-error' | ||
|
||
export const isDynamicUsageError = (err: unknown) => | ||
isDynamicServerError(err) || | ||
isBailoutToCSRError(err) || | ||
isNavigationSignalError(err) | ||
isNextRouterError(err) |
10 changes: 0 additions & 10 deletions
10
packages/next/src/export/helpers/is-navigation-signal-error.ts
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
test/e2e/on-request-error/skip-next-internal-error/app/another/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,3 @@ | ||
export default function Page() { | ||
return <p>another</p> | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/on-request-error/skip-next-internal-error/app/app-route/not-found/route.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 { notFound } from 'next/navigation' | ||
|
||
export function GET() { | ||
notFound() | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
7 changes: 7 additions & 0 deletions
7
test/e2e/on-request-error/skip-next-internal-error/app/app-route/redirect/route.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 { redirect } from 'next/navigation' | ||
|
||
export function GET() { | ||
redirect('/another') | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
4 changes: 4 additions & 0 deletions
4
test/e2e/on-request-error/skip-next-internal-error/app/client/dynamic-fetch/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,4 @@ | ||
export default async function Page() { | ||
await fetch('https://example.vercel.sh') | ||
return <p>dynamic page</p> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/on-request-error/skip-next-internal-error/app/client/no-ssr/component.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 Component() { | ||
return <p>Component</p> | ||
} |
11 changes: 11 additions & 0 deletions
11
test/e2e/on-request-error/skip-next-internal-error/app/client/no-ssr/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,11 @@ | ||
'use client' | ||
|
||
import nextDynamic from 'next/dynamic' | ||
|
||
const Component = nextDynamic(() => import('./component')) | ||
|
||
export default function Page() { | ||
return <Component /> | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
9 changes: 9 additions & 0 deletions
9
test/e2e/on-request-error/skip-next-internal-error/app/client/not-found/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,9 @@ | ||
'use client' | ||
|
||
import { notFound } from 'next/navigation' | ||
|
||
export default function Page() { | ||
notFound() | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
9 changes: 9 additions & 0 deletions
9
test/e2e/on-request-error/skip-next-internal-error/app/client/redirect/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,9 @@ | ||
'use client' | ||
|
||
import { redirect } from 'next/navigation' | ||
|
||
export default function Page() { | ||
redirect('/another') | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
9 changes: 9 additions & 0 deletions
9
test/e2e/on-request-error/skip-next-internal-error/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,9 @@ | ||
export default function Layout({ children }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
4 changes: 4 additions & 0 deletions
4
test/e2e/on-request-error/skip-next-internal-error/app/server/dynamic-fetch/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,4 @@ | ||
export default async function Page() { | ||
await fetch('https://example.vercel.sh') | ||
return <p>dynamic page</p> | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/on-request-error/skip-next-internal-error/app/server/not-found/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,7 @@ | ||
import { notFound } from 'next/navigation' | ||
|
||
export default function Page() { | ||
notFound() | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
7 changes: 7 additions & 0 deletions
7
test/e2e/on-request-error/skip-next-internal-error/app/server/redirect/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,7 @@ | ||
import { redirect } from 'next/navigation' | ||
|
||
export default function Page() { | ||
redirect('/another') | ||
} | ||
|
||
export const dynamic = 'force-dynamic' |
3 changes: 3 additions & 0 deletions
3
test/e2e/on-request-error/skip-next-internal-error/instrumentation.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 function onRequestError(err, request, context) { | ||
console.log('[instrumentation]:error', err.message) | ||
} |
5 changes: 5 additions & 0 deletions
5
test/e2e/on-request-error/skip-next-internal-error/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: { | ||
instrumentationHook: true, | ||
}, | ||
} |
Oops, something went wrong.