Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Prerelease 8.0.0-rc.4 #26370

Merged
merged 88 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9fdc7a2
Docs: Snapshot testing updates
jonniebigodes Mar 5, 2024
f352857
use npm to create qwik sandbox
JReinhold Mar 6, 2024
e4a47f5
replace testing-library with test in monorepo
ndelangen Mar 6, 2024
dbef8b5
Add explicit actions to CLI header story
kasperpeulen Mar 6, 2024
f1bdb70
what's new modal changes
kasperpeulen Mar 6, 2024
b3fa8c5
load refs in sequence, await writing to state
ndelangen Mar 6, 2024
b045da1
rename & fix test
ndelangen Mar 6, 2024
414193b
improve understandability of the test
ndelangen Mar 6, 2024
e76e062
Add `angular` framework doc
kylegach Feb 29, 2024
6bc602c
Rename snippet
kylegach Mar 6, 2024
3612c0b
Add docs for `vue3-vite` framework
kylegach Feb 27, 2024
8f2a88a
Apply suggestions from code review
kylegach Feb 28, 2024
ee11be5
Address comments
kylegach Feb 28, 2024
b211ec1
Add builder options details
kylegach Feb 29, 2024
28207a4
Address TKs
kylegach Feb 29, 2024
19044b8
Make content conditional on required renderer
kylegach Mar 5, 2024
ecb8537
Replace README
kylegach Mar 5, 2024
5c269f2
Add troubleshooting
kylegach Mar 6, 2024
8f3b3b8
CLI: Fix doctor compatibility check
yannbf Mar 7, 2024
1d76565
Fix attaching action, after a spy is restored to the original impleme…
kasperpeulen Mar 7, 2024
8804797
add an automigration for upgrading dependencies
ndelangen Mar 7, 2024
dc74337
Merge pull request #26221 from storybookjs/framework-doc-vue3-vite
kasperpeulen Mar 7, 2024
32de171
Add a comment
kasperpeulen Mar 7, 2024
69b78cc
Merge pull request #26364 from storybookjs/kasper-fix-attaach-action
kasperpeulen Mar 7, 2024
5af40cd
Merge pull request #26352 from storybookjs/kasper/cli-story-update
kasperpeulen Mar 7, 2024
b400750
Merge pull request #26355 from storybookjs/kasper/whats-new-adjustment
kasperpeulen Mar 7, 2024
54eccd1
improvements
ndelangen Mar 7, 2024
5ee7f99
Update index.md
joevaugh4n Mar 7, 2024
3356ca2
Update index.md
joevaugh4n Mar 7, 2024
6047711
make it look prettier
ndelangen Mar 7, 2024
83303b1
Merge branch 'next' into fix/doctor-compat-check
ndelangen Mar 7, 2024
d478011
Merge branch 'next' into norbert/automigration-upgrading-storybook-re…
ndelangen Mar 7, 2024
b317cdb
Merge branch 'fix/doctor-compat-check' into norbert/automigration-upg…
ndelangen Mar 7, 2024
6c5bb5e
revert the use of satisfies
ndelangen Mar 7, 2024
e0444ac
Address comments
kylegach Mar 7, 2024
4c60e7b
minor typing issues fixed
ndelangen Mar 7, 2024
586ba18
fix another typing issue
ndelangen Mar 7, 2024
247015e
Merge pull request #26363 from storybookjs/fix/doctor-compat-check
ndelangen Mar 7, 2024
422aa0d
Merge branch 'next' into norbert/automigration-upgrading-storybook-re…
ndelangen Mar 7, 2024
3d3a326
Merge pull request #26376 from storybookjs/joevaugh4n-patch-4
kylegach Mar 7, 2024
3fc8363
Merge pull request #26351 from storybookjs/norbert/remove-testing-lib
ndelangen Mar 7, 2024
9a1c77c
make `changeRefVersion` async as well, and correct the types
ndelangen Mar 7, 2024
4780ae3
Add section about missing vite config file
kylegach Mar 7, 2024
8b0040f
use a shorter link
ndelangen Mar 7, 2024
33fd582
use the right link
ndelangen Mar 7, 2024
c550330
Docs: update index.md
joevaugh4n Mar 7, 2024
9eea0d4
Update index.md
joevaugh4n Mar 7, 2024
c2be62f
Update from-older-version.md
joevaugh4n Mar 7, 2024
0a91864
Merge pull request #26378 from storybookjs/update-migration-guide-2
kylegach Mar 7, 2024
3491284
Merge pull request #26379 from storybookjs/norbert/shorter-link-cli-v…
ndelangen Mar 7, 2024
fc222b9
Merge pull request #26340 from storybookjs/jeppe/fix-qwik-sandbox
JReinhold Mar 8, 2024
13e872c
React: Support all React component types in JSX Decorator
yannbf Mar 8, 2024
2f5cfe7
Update code/lib/manager-api/src/modules/refs.ts
ndelangen Mar 8, 2024
e887915
fixes
ndelangen Mar 8, 2024
4fb9164
Fix missing fn import
kasperpeulen Mar 8, 2024
15fa09b
make stylistic code change
ndelangen Mar 8, 2024
4e723fe
Merge branch 'next' into norbert/fix-composition-loading-problem
ndelangen Mar 8, 2024
df71b26
CLI: Remove duplicated "duplicated dependency" warning
yannbf Mar 8, 2024
6903f38
Merge pull request #26384 from storybookjs/kasper/preact-template
ndelangen Mar 8, 2024
37401af
Merge branch 'next' into yann/fix-docs-jsx-in-react
ndelangen Mar 8, 2024
d135d12
Merge pull request #26356 from storybookjs/norbert/fix-composition-lo…
ndelangen Mar 8, 2024
fa2b315
Update code/lib/cli/src/automigrate/fixes/upgrade-storybook-related-d…
ndelangen Mar 8, 2024
93b7ed4
use document.body as default canvasElement instead of injecting a roo…
JReinhold Mar 8, 2024
0dbe3e4
Merge branch 'next' into jeppe/composed-play-default-canvaselement
JReinhold Mar 8, 2024
af63b0f
wip
ndelangen Mar 8, 2024
9dfb3aa
make it better
ndelangen Mar 8, 2024
9d552b2
even better
ndelangen Mar 8, 2024
becdbd9
remove the problematicPackages feature
ndelangen Mar 8, 2024
80a112d
fix
ndelangen Mar 8, 2024
d0663d6
Merge branch 'next' into norbert/automigration-upgrading-storybook-re…
ndelangen Mar 8, 2024
b4e944d
ship it
ndelangen Mar 8, 2024
d98cfc9
Merge branch 'next' into yann/fix-docs-jsx-in-react
ndelangen Mar 8, 2024
fc86712
Merge pull request #26385 from storybookjs/yann/remove-duplicated-dup…
ndelangen Mar 8, 2024
909cb23
remove hard-coded login in inner command
ndelangen Mar 8, 2024
b197874
Revert "remove hard-coded login in inner command"
ndelangen Mar 8, 2024
b74ca12
add tests
yannbf Mar 8, 2024
d369c9d
Merge pull request #26387 from storybookjs/jeppe/composed-play-defaul…
yannbf Mar 8, 2024
a6b04dc
Merge pull request #26382 from storybookjs/yann/fix-docs-jsx-in-react
yannbf Mar 8, 2024
0702351
Merge branch 'next' into framework-doc-angular
kylegach Mar 8, 2024
0b2b5ff
Merge pull request #26269 from storybookjs/framework-doc-angular
kylegach Mar 8, 2024
0cfd141
Merge pull request #26377 from storybookjs/norbert/automigration-upgr…
ndelangen Mar 8, 2024
b5eacba
Docs: Fix table alignment
jonniebigodes Mar 10, 2024
973fa2d
Merge pull request #26398 from storybookjs/docs_fix_tables
jonniebigodes Mar 10, 2024
9c2d525
fix the esbuild compatibility versions ranges
ndelangen Mar 11, 2024
4f6f044
Merge pull request #26405 from storybookjs/norbert/fix-esbuild-version
ndelangen Mar 11, 2024
c1fc191
Merge branch 'next' into docs_snapshot_testing
jonniebigodes Mar 11, 2024
37276b2
Merge pull request #26321 from storybookjs/docs_snapshot_testing
jonniebigodes Mar 11, 2024
a6e4d90
Write changelog for 8.0.0-rc.4 [skip ci]
storybook-bot Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 8.0.0-rc.4

- Actions: Fix attaching action after a spy is restored to original function - [#26364](https://github.com/storybookjs/storybook/pull/26364), thanks @kasperpeulen!
- CLI: Add explicit actions to header story - [#26352](https://github.com/storybookjs/storybook/pull/26352), thanks @kasperpeulen!
- CLI: Automigration for upgrading storybook related dependencies - [#26377](https://github.com/storybookjs/storybook/pull/26377), thanks @ndelangen!
- CLI: Fix doctor compatibility check - [#26363](https://github.com/storybookjs/storybook/pull/26363), thanks @yannbf!
- CLI: Fix fn reference in preact templates - [#26384](https://github.com/storybookjs/storybook/pull/26384), thanks @kasperpeulen!
- CLI: Remove duplicated dependency warning - [#26385](https://github.com/storybookjs/storybook/pull/26385), thanks @yannbf!
- CLI: Vite migration link (shorter) - [#26379](https://github.com/storybookjs/storybook/pull/26379), thanks @ndelangen!
- Composition: Fix refs not loading when there's multiple - [#26356](https://github.com/storybookjs/storybook/pull/26356), thanks @ndelangen!
- Dependencies: Broaden `esbuild` version range - [#26405](https://github.com/storybookjs/storybook/pull/26405), thanks @ndelangen!
- Maintenance: Replace `@storybook/testing-library` with `@storybook/test` in monorepo - [#26351](https://github.com/storybookjs/storybook/pull/26351), thanks @ndelangen!
- Maintenance: What's new modal changes - [#26355](https://github.com/storybookjs/storybook/pull/26355), thanks @kasperpeulen!
- Portable Stories: Fix injected root element changing layout - [#26387](https://github.com/storybookjs/storybook/pull/26387), thanks @JReinhold!
- React: Support all React component types in JSX Decorator - [#26382](https://github.com/storybookjs/storybook/pull/26382), thanks @yannbf!

## 8.0.0-rc.3

- Addon-themes: Fix switcher initialization after first start - [#26353](https://github.com/storybookjs/storybook/pull/26353), thanks @valentinpalkovic!
Expand Down
31 changes: 1 addition & 30 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- [Portable stories](#portable-stories)
- [Project annotations are now merged instead of overwritten in composeStory](#project-annotations-are-now-merged-instead-of-overwritten-in-composestory)
- [Type change in `composeStories` API](#type-change-in-composestories-api)
- [DOM structure changed in portable stories](#dom-structure-changed-in-portable-stories)
- [Composed Vue stories are now components instead of functions](#composed-vue-stories-are-now-components-instead-of-functions)
- [Tab addons are now routed to a query parameter](#tab-addons-are-now-routed-to-a-query-parameter)
- [Default keyboard shortcuts changed](#default-keyboard-shortcuts-changed)
Expand Down Expand Up @@ -440,35 +439,6 @@ await Primary.play!(...) // if you want a runtime error when the play function d

There are plans to make the type of the play function be inferred based on your imported story's play function in a near future, so the types will be 100% accurate.

#### DOM structure changed in portable stories

The portable stories API now adds a wrapper to your stories with a unique id based on your story id, such as:

```html
<div data-story="true" id="#storybook-story-button--primary">
<!-- your story here -->
</div>
```

This means that if you take DOM snapshots of your stories, they will be affected and you will have to update them.

The id calculation is based on different heuristics based on your Meta title and Story name. When using `composeStories`, the id can be inferred automatically. However, when using `composeStory` and your story does not explicitly have a `storyName` property, the story name can't be inferred automatically. As a result, its name will be "Unnamed Story", resulting in a wrapper id like `"#storybook-story-button--unnamed-story"`. If the id matters to you and you want to fix it, you have to specify the `exportsName` property like so:

```ts
test("snapshots the story with custom id", () => {
const Primary = composeStory(
stories.Primary,
stories.default,
undefined,
// If you do not want the `unnamed-story` id, you have to pass the name of the story as a parameter
"Primary"
);

const { baseElement } = render(<Primary />);
expect(baseElement).toMatchSnapshot();
});
```

#### Composed Vue stories are now components instead of functions

`composeStory` (and `composeStories`) from `@storybook/vue3` now return Vue components rather than story functions that return components. This means that when rendering these composed stories you just pass the composed story _without_ first calling it.
Expand Down Expand Up @@ -1105,6 +1075,7 @@ const preview: Preview = {

export default preview;
```

To learn more about the available icons and their names, see the [Storybook documentation](https://storybook.js.org/docs/8.0/faq#what-icons-are-available-for-my-toolbar-or-my-addon).

#### Removals in @storybook/types
Expand Down
8 changes: 7 additions & 1 deletion code/addons/actions/src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import type { LoaderFunction } from '@storybook/types';
import { action } from './runtime';

export const tinySpyInternalState = Symbol.for('tinyspy:spy');

const attachActionsToFunctionMocks: LoaderFunction = (context) => {
const {
args,
Expand All @@ -15,7 +17,11 @@ const attachActionsToFunctionMocks: LoaderFunction = (context) => {
typeof value === 'function' && '_isMockFunction' in value && value._isMockFunction
)
.forEach(([key, value]) => {
const previous = value.getMockImplementation();
// See this discussion for context:
// https://github.com/vitest-dev/vitest/pull/5352
const previous =
value.getMockImplementation() ??
(tinySpyInternalState in value ? value[tinySpyInternalState]?.getOriginal() : undefined);
if (previous?._actionAttached !== true && previous?.isAction !== true) {
const implementation = (...params: unknown[]) => {
action(key)(...params);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { global as globalThis } from '@storybook/global';
import { expect } from '@storybook/test';
import { within } from '@storybook/testing-library';
import { expect, within } from '@storybook/test';

export default {
component: globalThis.Components.Pre,
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@storybook/instrumenter": "workspace:*",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/testing-library": "next",
"@storybook/test": "workspace:*",
"@storybook/theming": "workspace:*",
"@types/node": "^18.0.0",
"formik": "^2.2.9",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { StoryObj, Meta } from '@storybook/react';
import { expect } from '@storybook/test';
import { CallStates } from '@storybook/instrumenter';
import { userEvent, within } from '@storybook/testing-library';
import { userEvent, within, expect } from '@storybook/test';
import { getCalls } from '../mocks';

import { Interaction } from './Interaction';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import type { StoryObj, Meta } from '@storybook/react';
import { CallStates } from '@storybook/instrumenter';
import { styled } from '@storybook/theming';
import { userEvent, within, waitFor } from '@storybook/testing-library';
import { expect } from '@storybook/test';
import { userEvent, within, waitFor, expect } from '@storybook/test';
import isChromatic from 'chromatic/isChromatic';

import { getCalls, getInteractions } from '../mocks';
Expand Down
1 change: 0 additions & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@storybook/react": "workspace:*",
"@storybook/telemetry": "workspace:*",
"@storybook/test": "workspace:*",
"@storybook/testing-library": "next",
"@storybook/theming": "workspace:*",
"@storybook/types": "workspace:*",
"framer-motion": "^11.0.3",
Expand Down
3 changes: 1 addition & 2 deletions code/addons/onboarding/src/components/List/List.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { userEvent, waitFor, within } from '@storybook/testing-library';
import { expect } from '@storybook/test';
import { userEvent, waitFor, within, expect } from '@storybook/test';

import { List } from './List';
import { ListItem } from './ListItem/ListItem';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library';
import { expect } from '@storybook/test';
import { userEvent, within, expect } from '@storybook/test';

import { Modal } from './Modal';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { PulsatingEffect } from './PulsatingEffect';
import React from 'react';
import { within } from '@storybook/testing-library';
import { expect } from '@storybook/test';
import { within, expect } from '@storybook/test';

const meta: Meta<typeof PulsatingEffect> = {
component: PulsatingEffect,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';

import { waitFor, within } from '@storybook/testing-library';
import { expect, fn } from '@storybook/test';
import { waitFor, within, expect, fn } from '@storybook/test';
import { STORY_INDEX_INVALIDATED, STORY_RENDERED } from '@storybook/core-events';
import { WriteStoriesModal } from './WriteStoriesModal';
import typescriptSnippet from './code/typescript';
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
"browser-assert": "^1.2.1",
"ejs": "^3.1.8",
"esbuild": "^18.0.0 || ^19.0.0 || ^0.20.0",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0",
"esbuild-plugin-alias": "^0.2.1",
"express": "^4.17.3",
"fs-extra": "^11.1.0",
Expand Down
Loading