-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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 update-with-styletron-example
- Loading branch information
Showing
15 changed files
with
142 additions
and
127 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
8 changes: 0 additions & 8 deletions
8
...nt/app-dir/next-after-app-invalid-usage/dynamic-apis/app/dynamic-apis/connection/page.tsx
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...pment/app-dir/next-after-app-invalid-usage/dynamic-apis/app/dynamic-apis/cookies/page.tsx
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...nt/app-dir/next-after-app-invalid-usage/dynamic-apis/app/dynamic-apis/draft-mode/page.tsx
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...pment/app-dir/next-after-app-invalid-usage/dynamic-apis/app/dynamic-apis/headers/page.tsx
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
test/development/app-dir/next-after-app-invalid-usage/dynamic-apis/app/layout.tsx
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
test/development/app-dir/next-after-app-invalid-usage/dynamic-apis/next.config.js
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
31 changes: 31 additions & 0 deletions
31
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/helpers.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,31 @@ | ||
import { unstable_after as after } from 'next/server' | ||
import { draftMode } from 'next/headers' | ||
|
||
export function testDraftMode(/** @type {string} */ route) { | ||
after(async () => { | ||
const draft = await draftMode() | ||
try { | ||
console.log(`[${route}] draft.isEnabled: ${draft.isEnabled}`) | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
}) | ||
|
||
after(async () => { | ||
const draft = await draftMode() | ||
try { | ||
draft.enable() | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
}) | ||
|
||
after(async () => { | ||
const draft = await draftMode() | ||
try { | ||
draft.disable() | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
}) | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/page-dynamic/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,8 @@ | ||
import { connection } from 'next/server' | ||
import { testDraftMode } from '../helpers' | ||
|
||
export default async function Page() { | ||
await connection() | ||
testDraftMode('/draft-mode/page-dynamic') | ||
return null | ||
} |
6 changes: 6 additions & 0 deletions
6
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/page-static/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,6 @@ | ||
import { testDraftMode } from '../helpers' | ||
|
||
export default function Page() { | ||
testDraftMode('/draft-mode/page-static') | ||
return null | ||
} |
6 changes: 6 additions & 0 deletions
6
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/route-handler-dynamic/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,6 @@ | ||
import { testDraftMode } from '../helpers' | ||
|
||
export async function GET() { | ||
testDraftMode('/draft-mode/route-handler-dynamic') | ||
return new Response() | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/route-handler-static/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,8 @@ | ||
import { testDraftMode } from '../helpers' | ||
|
||
export const dynamic = 'force-static' | ||
|
||
export async function GET() { | ||
testDraftMode('/draft-mode/route-handler-static') | ||
return new Response() | ||
} |
14 changes: 14 additions & 0 deletions
14
test/e2e/app-dir/next-after-app-api-usage/app/draft-mode/server-action/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,14 @@ | ||
import { testDraftMode } from '../helpers' | ||
|
||
export default async function Page() { | ||
return ( | ||
<form | ||
action={async () => { | ||
'use server' | ||
testDraftMode('/draft-mode/server-action') | ||
}} | ||
> | ||
<button type="submit">Submit</button> | ||
</form> | ||
) | ||
} |
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