Skip to content

Commit da7b738

Browse files
Merge branch 'next' into patch-1
2 parents e2a036d + db633c6 commit da7b738

File tree

44 files changed

+3515
-1200
lines changed

Some content is hidden

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

44 files changed

+3515
-1200
lines changed

.circleci/config.yml

Lines changed: 79 additions & 95 deletions
Large diffs are not rendered by default.

.nvmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
22.6.0
1+
22.13.1
2+

.yarn/releases/yarn-4.3.0.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ nodeLinker: node-modules
88

99
npmPublishAccess: public
1010

11-
yarnPath: .yarn/releases/yarn-4.3.0.cjs
11+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 8.5.2
2+
3+
- Addon Test: Support Vitest 3 browser.test.instances field - [#30309](https://github.com/storybookjs/storybook/pull/30309), thanks @valentinpalkovic!
4+
- CLI: Corrected Next.js createScript for pnpm. - [#30304](https://github.com/storybookjs/storybook/pull/30304), thanks @zhyd1997!
5+
16
## 8.5.1
27

38
- Addon Test: Replace `interaction test` -> `component test` - [#30333](https://github.com/storybookjs/storybook/pull/30333), thanks @kylegach!

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@
433433

434434
Storybook now supports [Angular's experimental zoneless mode](https://angular.dev/guide/experimental/zoneless). This mode is intended to improve performance by removing Angular's zone.js dependency. To enable zoneless mode in your Angular Storybook, set the `experimentalZoneless` config in your `angular.json` file:
435435

436-
````diff
436+
```diff
437437
{
438438
"projects": {
439439
"your-project": {

code/.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/.yarnrc.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ plugins:
2222
- path: ../.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
2323
spec: '@yarnpkg/plugin-workspace-tools'
2424

25-
# See https://github.com/nrwl/nx/issues/22177
2625
supportedArchitectures:
2726
cpu:
2827
- current
@@ -36,6 +35,4 @@ supportedArchitectures:
3635
unsafeHttpWhitelist:
3736
- localhost
3837

39-
yarnPath: ../.yarn/releases/yarn-4.3.0.cjs
40-
# Sometimes you get a "The remote archive doesn't match the expected checksum" error, uncommenting this line will fix it
41-
# checksumBehavior: 'update'
38+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

code/addons/a11y/src/components/VisionSimulator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ const getFilter = (filterName: string) => {
4242
return `url('#${filterName}')`;
4343
};
4444

45-
const Hidden = styled.div(() => ({
45+
const Hidden = styled.div({
4646
'&, & svg': {
4747
position: 'absolute',
4848
width: 0,
4949
height: 0,
5050
},
51-
}));
51+
});
5252

5353
const ColorIcon = styled.span<{ filter: string }>(
5454
{

code/addons/interactions/src/components/Interaction.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
1414
import { MethodCall } from './MethodCall';
1515
import { StatusIcon } from './StatusIcon';
1616

17-
const MethodCallWrapper = styled.div(() => ({
17+
const MethodCallWrapper = styled.div({
1818
fontFamily: typography.fonts.mono,
1919
fontSize: typography.size.s1,
2020
overflowWrap: 'break-word',
2121
inlineSize: 'calc( 100% - 40px )',
22-
}));
22+
});
2323

2424
const RowContainer = styled('div', {
2525
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { styled } from 'storybook/internal/theming';
22

3-
export const ListWrapper = styled.ul(() => ({
3+
export const ListWrapper = styled.ul({
44
display: 'flex',
55
flexDirection: 'column',
66
rowGap: 16,
77
padding: 0,
88
margin: 0,
9-
}));
9+
});

code/addons/test/src/components/Interaction.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
1414
import { MethodCall } from './MethodCall';
1515
import { StatusIcon } from './StatusIcon';
1616

17-
const MethodCallWrapper = styled.div(() => ({
17+
const MethodCallWrapper = styled.div({
1818
fontFamily: typography.fonts.mono,
1919
fontSize: typography.size.s1,
2020
overflowWrap: 'break-word',
2121
inlineSize: 'calc( 100% - 40px )',
22-
}));
22+
});
2323

2424
const RowContainer = styled('div', {
2525
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),

code/addons/test/src/components/TestProviderRender.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
379379
icon={
380380
state.crashed ? (
381381
<TestStatusIcon status="critical" aria-label="status: crashed" />
382-
) : // @ts-expect-error: TODO: Fix types
382+
) : // @ts-expect-error @ghengeveld should check whether this is a bug or not
383383
status === 'unknown' ? (
384384
<TestStatusIcon status="unknown" aria-label="status: unknown" />
385385
) : (

code/addons/viewport/src/legacy/ToolLegacy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ const flip = ({ width, height, ...styles }: ViewportStyles) => ({
7474
width: height,
7575
});
7676

77-
const ActiveViewportSize = styled.div(() => ({
77+
const ActiveViewportSize = styled.div({
7878
display: 'inline-flex',
7979
alignItems: 'center',
80-
}));
80+
});
8181

8282
const ActiveViewportLabel = styled.div(({ theme }) => ({
8383
display: 'inline-block',

code/addons/viewport/src/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { BrowserIcon, MobileIcon, TabletIcon } from '@storybook/icons';
77

88
import type { Viewport, ViewportMap } from './types';
99

10-
export const ActiveViewportSize = styled.div(() => ({
10+
export const ActiveViewportSize = styled.div({
1111
display: 'inline-flex',
1212
alignItems: 'center',
13-
}));
13+
});
1414

1515
export const ActiveViewportLabel = styled.div(({ theme }) => ({
1616
display: 'inline-block',

code/core/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,16 @@
296296
"@babel/traverse": "^7.24.1",
297297
"@babel/types": "^7.24.0",
298298
"@discoveryjs/json-ext": "^0.5.3",
299-
"@emotion/cache": "^11.11.0",
300-
"@emotion/is-prop-valid": "^1.2.2",
301-
"@emotion/react": "^11.11.4",
302-
"@emotion/styled": "^11.11.0",
303-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
299+
"@emotion/cache": "^11.14.0",
300+
"@emotion/is-prop-valid": "^1.3.1",
301+
"@emotion/react": "^11.14.0",
302+
"@emotion/styled": "^11.14.0",
303+
"@emotion/use-insertion-effect-with-fallbacks": "^1.2.0",
304304
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
305305
"@ndelangen/get-tarball": "^3.0.7",
306306
"@polka/compression": "^1.0.0-next.28",
307307
"@popperjs/core": "^2.6.0",
308-
"@radix-ui/react-dialog": "^1.0.5",
308+
"@radix-ui/react-dialog": "^1.1.2",
309309
"@radix-ui/react-scroll-area": "1.2.0-rc.7",
310310
"@radix-ui/react-slot": "^1.0.2",
311311
"@storybook/docs-mdx": "4.0.0-next.1",
@@ -369,7 +369,7 @@
369369
"js-yaml": "^4.1.0",
370370
"lazy-universal-dotenv": "^4.0.0",
371371
"leven": "^4.0.0",
372-
"markdown-to-jsx": "^7.4.5",
372+
"markdown-to-jsx": "^7.7.2",
373373
"memfs": "^4.11.1",
374374
"memoizerific": "^1.11.3",
375375
"nanoid": "^4.0.2",

code/core/src/components/components/bar/button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ const IconPlaceholder = styled.div(({ theme }) => ({
140140
animation: `${theme.animation.glow} 1.5s ease-in-out infinite`,
141141
}));
142142

143-
const IconButtonSkeletonWrapper = styled.div(() => ({
143+
const IconButtonSkeletonWrapper = styled.div({
144144
marginTop: 6,
145145
padding: 7,
146146
height: 28,
147-
}));
147+
});
148148

149149
/** @deprecated This component will be removed in Storybook 9.0 */
150150
export const IconButtonSkeleton = () => (

code/core/src/core-server/utils/get-server-channel.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ export class ServerChannelTransport {
1717

1818
private handler?: ChannelHandler;
1919

20-
isAlive = false;
21-
22-
private heartbeat() {
23-
this.isAlive = true;
24-
}
25-
2620
constructor(server: Server) {
27-
this.heartbeat = this.heartbeat.bind(this);
28-
2921
this.socket = new WebSocketServer({ noServer: true });
3022

3123
server.on('upgrade', (request, socket, head) => {
@@ -36,29 +28,18 @@ export class ServerChannelTransport {
3628
}
3729
});
3830
this.socket.on('connection', (wss) => {
39-
this.isAlive = true;
4031
wss.on('message', (raw) => {
4132
const data = raw.toString();
4233
const event =
4334
typeof data === 'string' && isJSON(data)
4435
? parse(data, { allowFunction: false, allowClass: false })
4536
: data;
4637
this.handler?.(event);
47-
if (event.type === 'pong') {
48-
this.heartbeat();
49-
}
5038
});
5139
});
5240

5341
const interval = setInterval(() => {
54-
this.socket.clients.forEach((ws) => {
55-
if (this.isAlive === false) {
56-
return ws.terminate();
57-
}
58-
59-
this.isAlive = false;
60-
this.send({ type: 'ping' });
61-
});
42+
this.send({ type: 'ping' });
6243
}, HEARTBEAT_INTERVAL);
6344

6445
this.socket.on('close', function close() {

code/core/src/manager/components/notifications/NotificationItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const NotificationWithInteractiveStates = styled(Notification)({
9393
const NotificationButton = NotificationWithInteractiveStates.withComponent('div');
9494
const NotificationLink = NotificationWithInteractiveStates.withComponent(Link);
9595

96-
const NotificationIconWrapper = styled.div(() => ({
96+
const NotificationIconWrapper = styled.div({
9797
display: 'flex',
9898
marginRight: 10,
9999
alignItems: 'center',
@@ -102,7 +102,7 @@ const NotificationIconWrapper = styled.div(() => ({
102102
width: 16,
103103
height: 16,
104104
},
105-
}));
105+
});
106106

107107
const NotificationTextWrapper = styled.div(({ theme }) => ({
108108
width: '100%',

code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3793,6 +3793,9 @@ describe('PreviewWeb', () => {
37933793
},
37943794
"component": undefined,
37953795
"componentId": "component-one",
3796+
"globals": {
3797+
"a": "b",
3798+
},
37963799
"id": "component-one--a",
37973800
"initialArgs": {
37983801
"foo": "a",
@@ -3844,6 +3847,9 @@ describe('PreviewWeb', () => {
38443847
},
38453848
"component": undefined,
38463849
"componentId": "component-one",
3850+
"globals": {
3851+
"a": "b",
3852+
},
38473853
"id": "component-one--b",
38483854
"initialArgs": {
38493855
"foo": "b",
@@ -3876,6 +3882,9 @@ describe('PreviewWeb', () => {
38763882
"args": {},
38773883
"component": undefined,
38783884
"componentId": "component-one",
3885+
"globals": {
3886+
"a": "b",
3887+
},
38793888
"id": "component-one--e",
38803889
"initialArgs": {},
38813890
"kind": "Component One",
@@ -3914,6 +3923,9 @@ describe('PreviewWeb', () => {
39143923
},
39153924
"component": undefined,
39163925
"componentId": "component-two",
3926+
"globals": {
3927+
"a": "b",
3928+
},
39173929
"id": "component-two--c",
39183930
"initialArgs": {
39193931
"foo": "c",

code/core/src/preview-api/modules/store/StoryStore.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ describe('StoryStore', () => {
301301
},
302302
"component": undefined,
303303
"componentId": "component-one",
304+
"globals": {
305+
"a": "b",
306+
},
304307
"id": "component-one--a",
305308
"initialArgs": {
306309
"foo": "a",
@@ -471,6 +474,9 @@ describe('StoryStore', () => {
471474
},
472475
"component": undefined,
473476
"componentId": "component-one",
477+
"globals": {
478+
"a": "b",
479+
},
474480
"id": "component-one--a",
475481
"initialArgs": {
476482
"foo": "a",
@@ -514,6 +520,9 @@ describe('StoryStore', () => {
514520
},
515521
"component": undefined,
516522
"componentId": "component-one",
523+
"globals": {
524+
"a": "b",
525+
},
517526
"id": "component-one--b",
518527
"initialArgs": {
519528
"foo": "b",
@@ -557,6 +566,9 @@ describe('StoryStore', () => {
557566
},
558567
"component": undefined,
559568
"componentId": "component-two",
569+
"globals": {
570+
"a": "b",
571+
},
560572
"id": "component-two--c",
561573
"initialArgs": {
562574
"foo": "c",
@@ -847,6 +859,9 @@ describe('StoryStore', () => {
847859
},
848860
"component": undefined,
849861
"componentId": "component-one",
862+
"globals": {
863+
"a": "b",
864+
},
850865
"id": "component-one--a",
851866
"initialArgs": {
852867
"foo": "a",
@@ -890,6 +905,9 @@ describe('StoryStore', () => {
890905
},
891906
"component": undefined,
892907
"componentId": "component-one",
908+
"globals": {
909+
"a": "b",
910+
},
893911
"id": "component-one--b",
894912
"initialArgs": {
895913
"foo": "b",
@@ -933,6 +951,9 @@ describe('StoryStore', () => {
933951
},
934952
"component": undefined,
935953
"componentId": "component-two",
954+
"globals": {
955+
"a": "b",
956+
},
936957
"id": "component-two--c",
937958
"initialArgs": {
938959
"foo": "c",

code/core/src/preview-api/modules/store/StoryStore.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,15 @@ export class StoryStore<TRenderer extends Renderer> {
323323
}
324324
return Object.assign(storyAcc, { [key]: value });
325325
},
326-
{ args: story.initialArgs }
326+
{
327+
//
328+
args: story.initialArgs,
329+
globals: {
330+
...this.userGlobals.initialGlobals,
331+
...this.userGlobals.globals,
332+
...story.storyGlobals,
333+
},
334+
}
327335
);
328336
return acc;
329337
},

code/lib/blocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@types/color-convert": "^2.0.0",
5555
"color-convert": "^2.0.1",
5656
"es-toolkit": "^1.22.0",
57-
"markdown-to-jsx": "^7.4.5",
57+
"markdown-to-jsx": "^7.7.2",
5858
"memoizerific": "^1.11.3",
5959
"polished": "^4.2.2",
6060
"react-colorful": "^5.1.2",

0 commit comments

Comments
 (0)