Skip to content

Commit 8b0ffb0

Browse files
authored
Merge branch 'next' into vite-5
2 parents c083802 + 6b2150c commit 8b0ffb0

11 files changed

Lines changed: 108 additions & 112 deletions

File tree

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,30 +609,30 @@ workflows:
609609
requires:
610610
- build
611611
- create-sandboxes:
612-
parallelism: 34
612+
parallelism: 36
613613
requires:
614614
- build
615615
# - smoke-test-sandboxes: # disabled for now
616616
# requires:
617617
# - create-sandboxes
618618
- build-sandboxes:
619-
parallelism: 34
619+
parallelism: 36
620620
requires:
621621
- create-sandboxes
622622
- chromatic-sandboxes:
623-
parallelism: 31
623+
parallelism: 33
624624
requires:
625625
- build-sandboxes
626626
- e2e-production:
627-
parallelism: 31
627+
parallelism: 33
628628
requires:
629629
- build-sandboxes
630630
- e2e-dev:
631631
parallelism: 4
632632
requires:
633633
- create-sandboxes
634634
- test-runner-production:
635-
parallelism: 31
635+
parallelism: 33
636636
requires:
637637
- build-sandboxes
638638
# TODO: reenable once we find out the source of flakyness

.github/workflows/generate-sandboxes-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: yarn wait-on http://localhost:6001
4444
working-directory: ./code
4545
- name: Generate
46-
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease
46+
run: yarn generate-sandboxes --local-registry
4747
working-directory: ./code
4848
- name: Publish
4949
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=main

.github/workflows/generate-sandboxes-next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: yarn wait-on http://localhost:6001
4444
working-directory: ./code
4545
- name: Generate
46-
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease --debug
46+
run: yarn generate-sandboxes --local-registry --debug
4747
working-directory: ./code
4848
- name: Publish
4949
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=next

code/frameworks/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"@types/babel__core": "^7",
120120
"@types/babel__plugin-transform-runtime": "^7",
121121
"@types/babel__preset-env": "^7",
122-
"next": "13.4.19",
122+
"next": "13.5.4",
123123
"typescript": "^4.9.3",
124124
"webpack": "^5.65.0"
125125
},

code/frameworks/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const setupRuntimeConfig = (baseConfig: WebpackConfig, nextConfig: NextConfig):
4848
}),
4949
};
5050

51-
const newNextLinkBehavior = nextConfig.experimental?.newNextLinkBehavior;
51+
const newNextLinkBehavior = (nextConfig.experimental as any)?.newNextLinkBehavior;
5252

5353
/**
5454
* In Next 13.0.0 - 13.0.5, the `newNextLinkBehavior` option now defaults to truthy (still

code/frameworks/nextjs/src/dependency-map.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ const mapping: Record<string, Record<string, string>> = {
66
'<11.1.0': {
77
'next/dist/next-server/lib/router-context': 'next/dist/next-server/lib/router-context',
88
},
9-
'>=11.1.0': {
9+
'>=11.1.0 <13.5.0': {
1010
'next/dist/shared/lib/router-context': 'next/dist/shared/lib/router-context',
1111
},
12-
'>=13.5.0': {
13-
'next/dist/shared/lib/router-context': 'next/dist/shared/lib/router-context.shared-runtime',
14-
'next/dist/shared/lib/head-manager-context':
15-
'next/dist/shared/lib/head-manager-context.shared-runtime',
16-
'next/dist/shared/lib/app-router-context':
17-
'next/dist/shared/lib/app-router-context.shared-runtime',
18-
'next/dist/shared/lib/hooks-client-context':
19-
'next/dist/shared/lib/hooks-client-context.shared-runtime',
12+
'>=13.0.2 <13.5.0': {
13+
'next/dist/shared/lib/hooks-client-context.shared-runtime':
14+
'next/dist/shared/lib/hooks-client-context',
15+
},
16+
'<13.5.0': {
17+
'next/dist/shared/lib/router-context.shared-runtime': 'next/dist/shared/lib/router-context',
18+
'next/dist/shared/lib/head-manager-context.shared-runtime':
19+
'next/dist/shared/lib/head-manager-context',
20+
'next/dist/shared/lib/app-router-context.shared-runtime':
21+
'next/dist/shared/lib/app-router-context',
2022
},
2123
};
2224

code/frameworks/nextjs/src/head-manager/head-manager-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from 'react';
2-
import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context';
2+
import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context.shared-runtime';
33
import initHeadManager from 'next/dist/client/head-manager';
44

55
type HeadManagerValue = {

code/frameworks/nextjs/src/routing/app-router-provider.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type {
33
LayoutRouterContext as TLayoutRouterContext,
44
AppRouterContext as TAppRouterContext,
55
GlobalLayoutRouterContext as TGlobalLayoutRouterContext,
6-
} from 'next/dist/shared/lib/app-router-context';
6+
} from 'next/dist/shared/lib/app-router-context.shared-runtime';
77
import type {
88
PathnameContext as TPathnameContext,
99
SearchParamsContext as TSearchParamsContext,
10-
} from 'next/dist/shared/lib/hooks-client-context';
10+
} from 'next/dist/shared/lib/hooks-client-context.shared-runtime';
1111
import type { FlightRouterState } from 'next/dist/server/app-render/types';
1212
import type { RouteParams } from './types';
1313

@@ -25,12 +25,16 @@ let SearchParamsContext: typeof TSearchParamsContext;
2525
let GlobalLayoutRouterContext: typeof TGlobalLayoutRouterContext;
2626

2727
try {
28-
AppRouterContext = require('next/dist/shared/lib/app-router-context').AppRouterContext;
29-
LayoutRouterContext = require('next/dist/shared/lib/app-router-context').LayoutRouterContext;
30-
PathnameContext = require('next/dist/shared/lib/hooks-client-context').PathnameContext;
31-
SearchParamsContext = require('next/dist/shared/lib/hooks-client-context').SearchParamsContext;
28+
AppRouterContext =
29+
require('next/dist/shared/lib/app-router-context.shared-runtime').AppRouterContext;
30+
LayoutRouterContext =
31+
require('next/dist/shared/lib/app-router-context.shared-runtime').LayoutRouterContext;
32+
PathnameContext =
33+
require('next/dist/shared/lib/hooks-client-context.shared-runtime').PathnameContext;
34+
SearchParamsContext =
35+
require('next/dist/shared/lib/hooks-client-context.shared-runtime').SearchParamsContext;
3236
GlobalLayoutRouterContext =
33-
require('next/dist/shared/lib/app-router-context').GlobalLayoutRouterContext;
37+
require('next/dist/shared/lib/app-router-context.shared-runtime').GlobalLayoutRouterContext;
3438
} catch {
3539
AppRouterContext = React.Fragment as any;
3640
LayoutRouterContext = React.Fragment as any;

code/frameworks/nextjs/src/routing/page-router-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Globals } from '@storybook/csf';
2-
import { RouterContext } from 'next/dist/shared/lib/router-context';
2+
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime';
33
import React from 'react';
44
import type { RouteParams } from './types';
55

code/lib/cli/src/sandbox-templates.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ const baseTemplates = {
137137
},
138138
skipTasks: ['e2e-tests-dev', 'bench'],
139139
},
140+
'nextjs/prerelease': {
141+
name: 'Next.js Prerelease (Webpack | TypeScript)',
142+
script:
143+
'npx create-next-app@canary {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',
144+
expected: {
145+
framework: '@storybook/nextjs',
146+
renderer: '@storybook/react',
147+
builder: '@storybook/builder-webpack5',
148+
},
149+
skipTasks: ['e2e-tests-dev', 'bench'],
150+
},
140151
'react-vite/default-js': {
141152
name: 'React Latest (Vite | JavaScript)',
142153
script: 'npm create vite@beta --yes {{beforeDir}} -- --template react',
@@ -296,8 +307,6 @@ const baseTemplates = {
296307
builder: '@storybook/builder-webpack5',
297308
},
298309
skipTasks: ['e2e-tests-dev', 'bench'],
299-
// TODO: Should be removed after we merge this PR: https://github.com/storybookjs/storybook/pull/24188
300-
inDevelopment: true,
301310
},
302311
'angular-cli/default-ts': {
303312
name: 'Angular CLI Latest (Webpack | TypeScript)',
@@ -586,8 +595,7 @@ export const merged: TemplateKey[] = [
586595
];
587596
export const daily: TemplateKey[] = [
588597
...merged,
589-
// TODO: Should be re-added after we merge this PR: https://github.com/storybookjs/storybook/pull/24188
590-
// 'angular-cli/prerelease',
598+
'angular-cli/prerelease',
591599
'cra/default-js',
592600
'react-vite/default-js',
593601
'vue3-vite/default-js',
@@ -598,6 +606,7 @@ export const daily: TemplateKey[] = [
598606
'svelte-vite/default-js',
599607
'nextjs/12-js',
600608
'nextjs/default-js',
609+
'nextjs/prerelease',
601610
'qwik-vite/default-ts',
602611
'preact-webpack5/default-js',
603612
'preact-vite/default-js',

0 commit comments

Comments
 (0)