Skip to content

Commit 4a75d13

Browse files
authored
Merge pull request #29585 from storybookjs/version-non-patch-from-8.5.0-alpha.3
Release: Prerelease 8.5.0-alpha.4
2 parents 85055fa + 1d892a2 commit 4a75d13

File tree

67 files changed

+1626
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1626
-287
lines changed

.circleci/config.yml

+69-9
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,57 @@ jobs:
211211
yarn knip --no-exit-code
212212
- report-workflow-on-failure
213213
- cancel-workflow-on-failure
214+
bench-packages:
215+
executor:
216+
class: medium
217+
name: sb_node_22_classic
218+
steps:
219+
- git-shallow-clone/checkout_advanced:
220+
clone_options: "--depth 1 --verbose"
221+
- attach_workspace:
222+
at: .
223+
# if there is a base branch AND a PR number in parameters, benchmark packages against those
224+
# this happens when run against a PR
225+
- when:
226+
condition:
227+
and:
228+
- << pipeline.parameters.ghBaseBranch >>
229+
- << pipeline.parameters.ghPrNumber >>
230+
steps:
231+
- run:
232+
name: Benchmarking packages against base branch
233+
working_directory: scripts
234+
command: |
235+
yarn local-registry --open &
236+
until curl -s http://localhost:6001 > /dev/null; do
237+
echo 'Waiting for local registry to be available...'
238+
sleep 2
239+
done
240+
yarn bench-packages --base-branch << pipeline.parameters.ghBaseBranch >> --pull-request << pipeline.parameters.ghPrNumber >> --upload
241+
# if there is a NOT a base branch OR NOT a PR number in parameters, just upload benchmarks for the branch
242+
# this happens when runned directly on branches, like next or main
243+
- when:
244+
condition:
245+
or:
246+
- not: << pipeline.parameters.ghBaseBranch >>
247+
- not: << pipeline.parameters.ghPrNumber >>
248+
steps:
249+
- run:
250+
name: Uploading package benchmarks for branch
251+
working_directory: scripts
252+
command: |
253+
yarn local-registry --open &
254+
until curl -s http://localhost:6001 > /dev/null; do
255+
echo 'Waiting for local registry to be available...'
256+
sleep 2
257+
done
258+
yarn bench-packages --upload
259+
- store_artifacts:
260+
path: bench/packages/results.json
261+
- store_artifacts:
262+
path: bench/packages/compare-with-<< pipeline.parameters.ghBaseBranch >>.json
263+
- report-workflow-on-failure
264+
- cancel-workflow-on-failure
214265
check:
215266
executor:
216267
class: xlarge
@@ -543,7 +594,7 @@ jobs:
543594
- store_artifacts: # this is where playwright puts more complex stuff
544595
path: code/playwright-results/
545596
destination: playwright
546-
bench:
597+
bench-sandboxes:
547598
parameters:
548599
parallelism:
549600
type: integer
@@ -753,6 +804,9 @@ workflows:
753804
- knip:
754805
requires:
755806
- build
807+
- bench-packages:
808+
requires:
809+
- build
756810
- check:
757811
requires:
758812
- build
@@ -799,7 +853,7 @@ workflows:
799853
parallelism: 5
800854
requires:
801855
- create-sandboxes
802-
- bench:
856+
- bench-sandboxes:
803857
parallelism: 5
804858
requires:
805859
- build-sandboxes
@@ -828,6 +882,9 @@ workflows:
828882
- knip:
829883
requires:
830884
- build
885+
- bench-packages:
886+
requires:
887+
- build
831888
- check:
832889
requires:
833890
- build
@@ -883,7 +940,7 @@ workflows:
883940
- test-ui-testing-module:
884941
requires:
885942
- build
886-
- bench:
943+
- bench-sandboxes:
887944
parallelism: 5
888945
requires:
889946
- build-sandboxes
@@ -904,6 +961,9 @@ workflows:
904961
- knip:
905962
requires:
906963
- build
964+
- bench-packages:
965+
requires:
966+
- build
907967
- check:
908968
requires:
909969
- build
@@ -920,30 +980,30 @@ workflows:
920980
requires:
921981
- build
922982
- create-sandboxes:
923-
parallelism: 38
983+
parallelism: 37
924984
requires:
925985
- build
926986
# - smoke-test-sandboxes: # disabled for now
927987
# requires:
928988
# - create-sandboxes
929989
- build-sandboxes:
930-
parallelism: 38
990+
parallelism: 37
931991
requires:
932992
- create-sandboxes
933993
- chromatic-sandboxes:
934-
parallelism: 35
994+
parallelism: 34
935995
requires:
936996
- build-sandboxes
937997
- e2e-production:
938-
parallelism: 33
998+
parallelism: 32
939999
requires:
9401000
- build-sandboxes
9411001
- e2e-dev:
9421002
parallelism: 2
9431003
requires:
9441004
- create-sandboxes
9451005
- test-runner-production:
946-
parallelism: 33
1006+
parallelism: 32
9471007
requires:
9481008
- build-sandboxes
9491009
- vitest-integration:
@@ -977,7 +1037,7 @@ workflows:
9771037
# --smoke-test is not supported for the angular builder right now
9781038
# - "angular-cli"
9791039
- "lit-vite-ts"
980-
- bench:
1040+
- bench-sandboxes:
9811041
parallelism: 5
9821042
requires:
9831043
- build-sandboxes

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 8.4.2
2+
3+
- Addon Test: Fix post-install logic for Next.js Vite framework support - [#29524](https://github.com/storybookjs/storybook/pull/29524), thanks @valentinpalkovic!
4+
- Addon Test: Only render the TestingModule component in development mode - [#29501](https://github.com/storybookjs/storybook/pull/29501), thanks @yannbf!
5+
- CLI: Fix Solid init by installing `@storybook/test` - [#29514](https://github.com/storybookjs/storybook/pull/29514), thanks @shilman!
6+
- Core: Shim CJS-only globals in ESM output - [#29157](https://github.com/storybookjs/storybook/pull/29157), thanks @valentinpalkovic!
7+
- Next.js: Fix bundled react and react-dom in monorepos - [#29444](https://github.com/storybookjs/storybook/pull/29444), thanks @sentience!
8+
19
## 8.4.1
210

311
- Core: Relax peer dep constraint of shim packages - [#29503](https://github.com/storybookjs/storybook/pull/29503), thanks @kasperpeulen!

CHANGELOG.prerelease.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 8.5.0-alpha.4
2+
3+
- Next.js: Add support for Next 15 - [#29587](https://github.com/storybookjs/storybook/pull/29587), thanks @yannbf!
4+
- UI: Add Yarn to About Section - [#29225](https://github.com/storybookjs/storybook/pull/29225), thanks @grantwforsythe!
5+
16
## 8.5.0-alpha.3
27

38
- Addon Test: Fix post-install logic for Next.js Vite framework support - [#29524](https://github.com/storybookjs/storybook/pull/29524), thanks @valentinpalkovic!

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Storybook is developed against a specific node version which is defined in an `.
55
## Ensure you have the required system utilities
66

77
You will need to have the following installed:
8+
89
- git
910
- node
1011
- yarn
@@ -20,7 +21,7 @@ You will need to have the following installed:
2021

2122
## Running the local development environment
2223

23-
- Ensure if you are using Windows to use the Windows Subsystem for Linux (WSL).
24+
- All commands should be run in a terminal with administrator privileges in Windows environments.
2425
- Run `yarn start` in the root directory to run a basic test Storybook "sandbox".
2526

2627
The `yarn start` script will generate a React Vite TypeScript sandbox with a set of test stories inside it, as well as taking all steps required to get it running (building the various packages we need etc). There is no need to run `yarn` or `yarn install` as `yarn start` will do this for you.

CONTRIBUTING/RELEASING.md

+54
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [5. Make Manual Changes](#5-make-manual-changes)
2020
- [6. Merge](#6-merge)
2121
- [7. See the "Publish" Workflow Finish](#7-see-the-publish-workflow-finish)
22+
- [Releasing changes to older minor versions](#releasing-changes-to-older-minor-versions)
2223
- [Releasing Locally in an Emergency 🚨](#releasing-locally-in-an-emergency-)
2324
- [Canary Releases](#canary-releases)
2425
- [With GitHub UI](#with-github-ui)
@@ -330,6 +331,59 @@ Merging the pull request will trigger [the publish workflow](https://github.com/
330331

331332
Done! 🚀
332333

334+
## Releasing changes to older minor versions
335+
336+
If you need to release a change to an older minor version that is not the latest, you have to do it manually, locally. The process is described below, with an example of releasing a new `v8.3.7` in a situation where `8.4.0` is currently the latest version.
337+
338+
1. Checkout the _existing_ tag that matches the latest minor release you want to bump, and create a new branch from it. In this case, we want to do:
339+
1. `git fetch --all --tags`
340+
2. `git checkout tags/v8.3.6 -b patch-8-3-7`
341+
2. Make the changes you need to, most likely cherry-picking commits from the fix you need to back-port.
342+
3. Run `yarn install` in `scripts` and `code`
343+
4. Build all packages in `code` with `yarn task --task compile --no-link`
344+
5. Commit and push your changes.
345+
6. Trigger _daily_ CI manually on your branch:
346+
1. Open [CircleCI](https://app.circleci.com/pipelines/github/storybookjs/storybook) and click "Trigger Pipeline" on the top right corner of the page.
347+
2. Set the following configuration options:
348+
- Pipeline: _"storybook default"_
349+
- Config Source: _"storybook"_
350+
- Branch: Your branch, eg. `patch-8-3-7`
351+
3. Add a parameter, with _"name"_ `workflow`, _"value"_ `daily`
352+
7. Wait for CI to finish successfully.
353+
8. Bump all package versions:
354+
1. `cd scripts`
355+
2. `yarn release:version --release-type patch`
356+
9. Commit with `git commit -m "Bump version from <CURRENT_VERSION> to <NEXT_VERSION> MANUALLY"`
357+
10. Add a new entry to `CHANGELOG.md`, describing your changes
358+
11. Commit with `git commit -m "Update CHANGELOG.md with <NEXT_VERSION> MANUALLY"`
359+
12. Ensure you have the correct write permissions for all the Storybook npm packages. You need to be an admin of the _storybook_ org, and the packages that are not in the org. The simplest way to check this is to ensure you can see the _"Settings"_ tab in the following packages:
360+
1. [`@storybook/react-vite`](https://www.npmjs.com/package/@storybook/react-vite/access)
361+
2. [`storybook`](https://www.npmjs.com/package/storybook/access)
362+
3. [`sb`](https://www.npmjs.com/package/sb/access)
363+
4. [`create-storybook`](https://www.npmjs.com/package/create-storybook/access)
364+
13. Get your npm access token or generate a new one at https://www.npmjs.com/settings/your-username/tokens. Remember to give it access to the `storybook` org and the packages not in the org, as listed above.
365+
14. Publish all packages with `YARN_NPM_AUTH_TOKEN=<NPM_TOKEN> yarn release:publish --tag tag-for-publishing-older-releases --verbose`
366+
- It goes through all packages and publishes them. If any number of packages fails to publish, it will retry 5 times, skipping those that have already been published.
367+
15. Confirm the new version has been released on npm with the tag `tag-for-publishing-older-releases`:
368+
1. [`@storybook/react-vite`](https://www.npmjs.com/package/@storybook/react-vite?activeTab=versions)
369+
2. [`storybook`](https://www.npmjs.com/package/storybook?activeTab=versions)
370+
3. [`sb`](https://www.npmjs.com/package/sb?activeTab=versions)
371+
4. [`create-storybook`](https://www.npmjs.com/package/create-storybook?activeTab=versions)
372+
16. Push
373+
17. Manually create a GitHub Release at https://github.com/storybookjs/storybook/releases/new with:
374+
1. Create new tag: `v<VERSION>` (e.g., `v8.3.7`)
375+
2. Target: your branch (e.g., `patch-8-3-7`)
376+
3. Previous tag: `v<PREVIOUS_VERSION>` (e.g., `v8.3.6`)
377+
4. Title: `v<VERSION>` (e.g., `v8.3.7`)
378+
5. Description: The content you added to `CHANGELOG.md`
379+
6. Untick _"Set as the latest release"_
380+
18. Cherry-pick your changelog changes into `next`, so they are actually visible
381+
1. Checkout the `next` branch
382+
2. Cherry-pick the commit you created with your changelog modifications
383+
3. Push
384+
385+
Done. 🎉
386+
333387
## Releasing Locally in an Emergency 🚨
334388

335389
Things can fail, code can break, and bugs can exist. When automation is broken, there may be a need for an emergency escape hatch to release new fixes. In such a situation, it's valid to run the whole release process locally instead of relying on pull requests and workflows. You don't need to create pull requests or split preparation and publishing; you can do it all at once, but make sure you still follow the correct branching strategy.

code/addons/backgrounds/src/components/Tool.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const Pure = memo(function PureTool(props: PureProps) {
124124
onHide();
125125
},
126126
})),
127-
]}
127+
].flat()}
128128
/>
129129
);
130130
}}

code/addons/themes/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Don't see your favorite tool listed? Don't worry! That doesn't mean this addon i
3636

3737
### ❗️ Overriding theme
3838

39-
If you want to override your theme for a particular component or story, you can use the `themes.themeOverride` parameter.
39+
If you want to override your theme for a particular component or story, you can use the `globals.theme` parameter.
4040

4141
```js
4242
import React from 'react';

code/addons/viewport/src/components/Tool.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ const Pure = React.memo(function PureTool(props: PureProps) {
139139
onHide();
140140
},
141141
})),
142-
]}
142+
].flat()}
143143
/>
144144
)}
145145
closeOnOutsideClick

code/core/src/manager/components/upgrade/UpgradeBlock.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface UpgradeBlockProps {
1414

1515
export const UpgradeBlock: FC<UpgradeBlockProps> = ({ onNavigateToWhatsNew }) => {
1616
const api = useStorybookApi();
17-
const [activeTab, setActiveTab] = useState<'npm' | 'pnpm'>('npm');
17+
const [activeTab, setActiveTab] = useState<'npm' | 'yarn' | 'pnpm'>('npm');
1818

1919
return (
2020
<Container>
@@ -24,12 +24,17 @@ export const UpgradeBlock: FC<UpgradeBlockProps> = ({ onNavigateToWhatsNew }) =>
2424
<ButtonTab active={activeTab === 'npm'} onClick={() => setActiveTab('npm')}>
2525
npm
2626
</ButtonTab>
27+
<ButtonTab active={activeTab === 'yarn'} onClick={() => setActiveTab('yarn')}>
28+
yarn
29+
</ButtonTab>
2730
<ButtonTab active={activeTab === 'pnpm'} onClick={() => setActiveTab('pnpm')}>
2831
pnpm
2932
</ButtonTab>
3033
</Tabs>
3134
<Code>
32-
{activeTab === 'npm' ? 'npx storybook@latest upgrade' : 'pnpm dlx storybook@latest upgrade'}
35+
{activeTab === 'npm'
36+
? 'npx storybook@latest upgrade'
37+
: `${activeTab} dlx storybook@latest upgrade`}
3338
</Code>
3439
{onNavigateToWhatsNew && (
3540
// eslint-disable-next-line jsx-a11y/anchor-is-valid

code/e2e-tests/addon-docs.spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ test.describe('addon-docs', () => {
189189
});
190190

191191
test('should resolve react to the correct version', async ({ page }) => {
192+
test.skip(
193+
templateName?.includes('nextjs'),
194+
'TODO: remove this once sandboxes are synced (SOON!!)'
195+
);
192196
// Arrange - Navigate to MDX docs
193197
const sbPage = new SbPage(page, expect);
194198
await sbPage.navigateToStory('addons/docs/docs2/resolvedreact', 'mdx', 'docs');
@@ -201,6 +205,7 @@ test.describe('addon-docs', () => {
201205
} else if (templateName.includes('react16')) {
202206
expectedReactVersionRange = /^16/;
203207
} else if (
208+
templateName.includes('nextjs/default-ts') ||
204209
templateName.includes('nextjs/prerelease') ||
205210
templateName.includes('react-vite/prerelease') ||
206211
templateName.includes('react-webpack/prerelease')

code/e2e-tests/framework-nextjs.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ test.describe('Next.js', () => {
5353
test.beforeEach(async ({ page }) => {
5454
sbPage = new SbPage(page, expect);
5555

56-
await sbPage.navigateToStory(
57-
'stories/frameworks/nextjs-nextjs-default-ts/Navigation',
58-
'default'
59-
);
56+
await sbPage.navigateToStory('stories/frameworks/nextjs/Navigation', 'default');
6057
root = sbPage.previewRoot();
6158
});
6259

@@ -88,7 +85,7 @@ test.describe('Next.js', () => {
8885
test.beforeEach(async ({ page }) => {
8986
sbPage = new SbPage(page, expect);
9087

91-
await sbPage.navigateToStory('stories/frameworks/nextjs-nextjs-default-ts/Router', 'default');
88+
await sbPage.navigateToStory('stories/frameworks/nextjs/Router', 'default');
9289
root = sbPage.previewRoot();
9390
});
9491

code/frameworks/nextjs/package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
"import": "./dist/compatibility/redirect-status-code.compat.mjs",
5858
"require": "./dist/compatibility/redirect-status-code.compat.js"
5959
},
60+
"./dist/compatibility/draft-mode.compat": {
61+
"types": "./dist/compatibility/draft-mode.compat.d.ts",
62+
"import": "./dist/compatibility/draft-mode.compat.mjs",
63+
"require": "./dist/compatibility/draft-mode.compat.js"
64+
},
6065
"./export-mocks": {
6166
"types": "./dist/export-mocks/index.d.ts",
6267
"import": "./dist/export-mocks/index.mjs",
@@ -171,12 +176,12 @@
171176
"@types/babel__preset-env": "^7",
172177
"@types/loader-utils": "^2.0.5",
173178
"@types/react-refresh": "^0",
174-
"next": "^14.1.0",
179+
"next": "^15.0.3",
175180
"typescript": "^5.3.2",
176181
"webpack": "^5.65.0"
177182
},
178183
"peerDependencies": {
179-
"next": "^13.5.0 || ^14.0.0",
184+
"next": "^13.5.0 || ^14.0.0 || ^15.0.0",
180185
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
181186
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
182187
"storybook": "workspace:^",
@@ -212,6 +217,7 @@
212217
"./src/export-mocks/navigation/index.ts",
213218
"./src/compatibility/segment.compat.ts",
214219
"./src/compatibility/redirect-status-code.compat.ts",
220+
"./src/compatibility/draft-mode.compat.ts",
215221
"./src/next-image-loader-stub.ts",
216222
"./src/images/decorator.tsx",
217223
"./src/images/next-legacy-image.tsx",

0 commit comments

Comments
 (0)