Skip to content

Commit

Permalink
Merge pull request #25012 from storybookjs/version-patch-from-7.6.0
Browse files Browse the repository at this point in the history
Release: Patch 7.6.1
  • Loading branch information
kasperpeulen authored Nov 29, 2023
2 parents b64214c + 5fa66f7 commit e3e78ef
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 81 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,27 +560,27 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 23
parallelism: 21
requires:
- build
- build-sandboxes:
parallelism: 23
parallelism: 21
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 20
parallelism: 18
requires:
- build-sandboxes
- e2e-production:
parallelism: 18
parallelism: 16
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 18
parallelism: 16
requires:
- build-sandboxes
- bench:
Expand Down Expand Up @@ -614,30 +614,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 38
parallelism: 36
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 38
parallelism: 36
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 35
parallelism: 33
requires:
- build-sandboxes
- e2e-production:
parallelism: 33
parallelism: 31
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 33
parallelism: 31
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 7.6.1

- Next.js: Fix AppRouterProvider usage - [#25032](https://github.com/storybookjs/storybook/pull/25032), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
- SvelteKit: Fix HMR not working - [#25031](https://github.com/storybookjs/storybook/pull/25031), thanks [@JReinhold](https://github.com/JReinhold)!
- Test: Downgrade @testing-library/user-event to 14.3.0 - [#25004](https://github.com/storybookjs/storybook/pull/25004), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
- Webpack: Fix exclude regex in react-docgen-loader - [#25030](https://github.com/storybookjs/storybook/pull/25030), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!

## 7.6.0

Storybook 7.6 is here with increased performance and much more!
Expand Down
12 changes: 12 additions & 0 deletions code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
"require": "./dist/image-context.js",
"import": "./dist/image-context.mjs"
},
"./dist/routing/app-router-provider": {
"types": "./dist/routing/app-router-provider.d.ts",
"require": "./dist/routing/app-router-provider.js",
"import": "./dist/routing/app-router-provider.mjs"
},
"./dist/routing/app-router-provider-mock": {
"types": "./dist/routing/app-router-provider-mock.d.ts",
"require": "./dist/routing/app-router-provider-mock.js",
"import": "./dist/routing/app-router-provider-mock.mjs"
},
"./preset": {
"types": "./dist/preset.d.ts",
"require": "./dist/preset.js"
Expand Down Expand Up @@ -161,6 +171,8 @@
"./src/images/next-future-image.tsx",
"./src/images/next-legacy-image.tsx",
"./src/images/next-image.tsx",
"./src/routing/app-router-provider.tsx",
"./src/routing/app-router-provider-mock.tsx",
"./src/font/webpack/loader/storybook-nextjs-font-loader.ts",
"./src/swc/next-swc-loader-patch.ts"
],
Expand Down
4 changes: 4 additions & 0 deletions code/frameworks/nextjs/src/dependency-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const mapping: Record<string, Record<string, string>> = {
'next/dist/shared/lib/hooks-client-context.shared-runtime':
'next/dist/shared/lib/hooks-client-context',
},
'<13.0.0': {
'@storybook/nextjs/dist/routing/app-router-provider':
'@storybook/nextjs/dist/routing/app-router-provider-mock',
},
'<13.5.0': {
'next/dist/shared/lib/router-context.shared-runtime': 'next/dist/shared/lib/router-context',
'next/dist/shared/lib/head-manager-context.shared-runtime':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

// The mock is used for Next.js < 13, where the AppRouterProvider doesn't exist
export const AppRouterProvider: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {
return <>{children}</>;
};
17 changes: 3 additions & 14 deletions code/frameworks/nextjs/src/routing/decorator.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react';
import type { Addon_StoryContext } from '@storybook/types';
import { action } from '@storybook/addon-actions';
// @ts-expect-error Using absolute path import to 1) avoid prebundling and 2) being able to substitute the module for Next.js < 13
// eslint-disable-next-line import/no-extraneous-dependencies
import { AppRouterProvider } from '@storybook/nextjs/dist/routing/app-router-provider';
import { PageRouterProvider } from './page-router-provider';
import type { AppRouterProvider as TAppRouterProvider } from './app-router-provider';
import type { RouteParams, NextAppDirectory } from './types';

const defaultRouterParams: RouteParams = {
Expand All @@ -17,19 +19,6 @@ export const RouterDecorator = (
const nextAppDirectory =
(parameters.nextjs?.appDirectory as NextAppDirectory | undefined) ?? false;

const [AppRouterProvider, setAppRouterProvider] = React.useState<
typeof TAppRouterProvider | undefined
>();

React.useEffect(() => {
if (!nextAppDirectory) {
return;
}
import('./app-router-provider').then((exports) =>
setAppRouterProvider(() => exports.AppRouterProvider)
);
}, [nextAppDirectory]);

if (nextAppDirectory) {
if (!AppRouterProvider) {
return null;
Expand Down
16 changes: 7 additions & 9 deletions code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { resolve } from 'node:path';
import { mergeConfig, type Plugin } from 'vite';
import type { Plugin } from 'vite';

export function mockSveltekitStores() {
return {
name: 'storybook:sveltekit-mock-stores',
enforce: 'post',
config: (config) =>
mergeConfig(config, {
resolve: {
alias: {
$app: resolve(__dirname, '../src/mocks/app/'),
},
config: () => ({
resolve: {
alias: {
$app: resolve(__dirname, '../src/mocks/app/'),
},
}),
},
}),
} satisfies Plugin;
}
30 changes: 0 additions & 30 deletions code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,34 +466,6 @@ const baseTemplates = {
* They will be hidden by default in the Storybook status page.
*/
const internalTemplates = {
'internal/ssv6-vite': {
...baseTemplates['react-vite/default-ts'],
name: 'StoryStore v6 (react-vite/default-ts)',
isInternal: true,
modifications: {
mainConfig: {
features: {
storyStoreV7: false,
storyStoreV7MdxErrors: false,
},
},
},
skipTasks: ['bench'],
},
'internal/ssv6-webpack': {
...baseTemplates['cra/default-ts'],
name: 'StoryStore v6 (cra/default-ts)',
isInternal: true,
modifications: {
mainConfig: {
features: {
storyStoreV7: false,
storyStoreV7MdxErrors: false,
},
},
},
skipTasks: ['bench'],
},
'internal/swc-webpack': {
...baseTemplates['react-webpack/18-ts'],
name: 'SWC (react-webpack/18-ts)',
Expand Down Expand Up @@ -615,8 +587,6 @@ export const merged: TemplateKey[] = [
'preact-vite/default-ts',
'html-webpack/default',
'html-vite/default-ts',
'internal/ssv6-vite',
'internal/ssv6-webpack',
];
export const daily: TemplateKey[] = [
...merged,
Expand Down
2 changes: 1 addition & 1 deletion code/lib/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@storybook/preview-api": "workspace:*",
"@testing-library/dom": "^9.3.1",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/user-event": "^14.4.3",
"@testing-library/user-event": "14.3.0",
"@types/chai": "^4",
"@vitest/expect": "^0.34.2",
"@vitest/spy": "^0.34.1",
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "7.6.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('framework-preset-react-docgen', () => {
module: {
rules: [
{
exclude: /node_modules\/.*/,
exclude: /node_modules/,
loader: '@storybook/preset-react-webpack/dist/loaders/react-docgen-loader',
options: { babelOptions: { plugins: [], presets: [] } },
test: /\.(cjs|mjs|tsx?|jsx?)$/,
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('framework-preset-react-docgen', () => {
module: {
rules: [
{
exclude: /node_modules\/.*/,
exclude: /node_modules/,
loader: '@storybook/preset-react-webpack/dist/loaders/react-docgen-loader',
options: { babelOptions: { plugins: [], presets: [] } },
test: /\.(cjs|mjs|jsx?)$/,
Expand Down
4 changes: 2 additions & 2 deletions code/presets/react-webpack/src/framework-preset-react-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (
options: {
babelOptions,
},
exclude: /node_modules\/.*/,
exclude: /node_modules/,
},
],
},
Expand All @@ -64,7 +64,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (
options: {
babelOptions,
},
exclude: /node_modules\/.*/,
exclude: /node_modules/,
},
],
},
Expand Down
13 changes: 11 additions & 2 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7697,7 +7697,7 @@ __metadata:
"@storybook/preview-api": "workspace:*"
"@testing-library/dom": "npm:^9.3.1"
"@testing-library/jest-dom": "npm:^6.1.3"
"@testing-library/user-event": "npm:^14.4.3"
"@testing-library/user-event": "npm:14.3.0"
"@types/chai": "npm:^4"
"@vitest/expect": "npm:^0.34.2"
"@vitest/spy": "npm:^0.34.1"
Expand Down Expand Up @@ -8368,6 +8368,15 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/user-event@npm:14.3.0":
version: 14.3.0
resolution: "@testing-library/user-event@npm:14.3.0"
peerDependencies:
"@testing-library/dom": ">=7.21.4"
checksum: 8a0e708709f2510287568dff668bc7d6f5c4e7e17407452b7aa0fcf74732dccf511c63fc76ac514d753cb1f0586c1def59ba7f5245a9523715d37a8f198745d3
languageName: node
linkType: hard

"@testing-library/user-event@npm:^13.2.1":
version: 13.5.0
resolution: "@testing-library/user-event@npm:13.5.0"
Expand All @@ -8379,7 +8388,7 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/user-event@npm:^14.4.0, @testing-library/user-event@npm:^14.4.3":
"@testing-library/user-event@npm:^14.4.0":
version: 14.5.1
resolution: "@testing-library/user-event@npm:14.5.1"
peerDependencies:
Expand Down
7 changes: 1 addition & 6 deletions docs/versions/latest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"version": "7.6.0",
"info": {
"plain": "- 🔥 Improved SWC support\n- 🧪New test utilities and fast build mode\n- 🔼NextJS SWC + avif support & fixes\n- 🤡 SvelteKit page and navigation mocking\n- ⚛️React-docgen upgrade\n- 🎨Controls a11y, background theming, and viewports\n- 🩺CLI: The doctor is in!\n- 🚫Addons: Remove React as a peer dependency\n- 🪦Storyshots and Vue2 deprecated"
}
}
{"version":"7.6.1","info":{"plain":"- Next.js: Fix AppRouterProvider usage - [#25032](https://github.com/storybookjs/storybook/pull/25032), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- SvelteKit: Fix HMR not working - [#25031](https://github.com/storybookjs/storybook/pull/25031), thanks [@JReinhold](https://github.com/JReinhold)!\n- Test: Downgrade @testing-library/user-event to 14.3.0 - [#25004](https://github.com/storybookjs/storybook/pull/25004), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Webpack: Fix exclude regex in react-docgen-loader - [#25030](https://github.com/storybookjs/storybook/pull/25030), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!"}}
7 changes: 6 additions & 1 deletion docs/versions/next.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{"version":"7.6.0-beta.2","info":{"plain":"- Actions: Fix `@storybook/core-events/preview-errors` dependency missing for Yarn PnP - [#24973](https://github.com/storybookjs/storybook/pull/24973), thanks [@JReinhold](https://github.com/JReinhold)!\n- Webpack5: Resolve circular dependency and fix HMR - [#24974](https://github.com/storybookjs/storybook/pull/24974), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!"}}
{
"version": "8.0.0-alpha.0",
"info": {
"plain": "- Addon Viewport: Expose types for user parameter validation - [#24896](https://github.com/storybookjs/storybook/pull/24896), thanks [@piratetaco](https://github.com/piratetaco)!\n- Build: Remove unused/deprecated packages - [#24528](https://github.com/storybookjs/storybook/pull/24528), thanks [@ndelangen](https://github.com/ndelangen)!\n- Builder-Vite: use user's build.target - [#23123](https://github.com/storybookjs/storybook/pull/23123), thanks [@Hoishin](https://github.com/Hoishin)!\n- CLI: Remove `sb extract` command - [#24653](https://github.com/storybookjs/storybook/pull/24653), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Improve project root detection logic - [#20791](https://github.com/storybookjs/storybook/pull/20791), thanks [@dobesv](https://github.com/dobesv)!\n- Core: Prebundling globalize the core-event sub paths - [#24976](https://github.com/storybookjs/storybook/pull/24976), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Remove `storiesOf`-API - [#24655](https://github.com/storybookjs/storybook/pull/24655), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: StorybookConfig `stories`-field support type async function - [#21555](https://github.com/storybookjs/storybook/pull/21555), thanks [@imccausl](https://github.com/imccausl)!\n- Dependencies: Update Typescript - [#24970](https://github.com/storybookjs/storybook/pull/24970), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Dependencies: Upgrade monorepo to TS5 - [#24440](https://github.com/storybookjs/storybook/pull/24440), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Migrate `@storybook/preset-create-react-app` to strict TS - [#22395](https://github.com/storybookjs/storybook/pull/22395), thanks [@kuriacka](https://github.com/kuriacka)!\n- Manager: Enable refs filtered via `experimental_setFilter` - [#24211](https://github.com/storybookjs/storybook/pull/24211), thanks [@ndelangen](https://github.com/ndelangen)!\n- Mdx : Theme `fontCode` not applied consistently when writing MDX - [#23110](https://github.com/storybookjs/storybook/pull/23110), thanks [@gitstart-storybook](https://github.com/gitstart-storybook)!\n- UI: Bring back role main - [#24411](https://github.com/storybookjs/storybook/pull/24411), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Fix IconButton not being aligned correctly in blocks - [#24529](https://github.com/storybookjs/storybook/pull/24529), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Fix button size on controls - [#24737](https://github.com/storybookjs/storybook/pull/24737), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Fix layout height - [#24370](https://github.com/storybookjs/storybook/pull/24370), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Fix theming not updating - [#24399](https://github.com/storybookjs/storybook/pull/24399), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Improved Button and IconButton - [#24266](https://github.com/storybookjs/storybook/pull/24266), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Keep mobile drawer open on component selection - [#24258](https://github.com/storybookjs/storybook/pull/24258), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Mobile truncate story name - [#24372](https://github.com/storybookjs/storybook/pull/24372), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: New icon library - [#24433](https://github.com/storybookjs/storybook/pull/24433), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Replace Form.Button with the new Button component - [#24360](https://github.com/storybookjs/storybook/pull/24360), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- UI: Screen reader announcing changes for expand/collapse button - [#24984](https://github.com/storybookjs/storybook/pull/24984), thanks [@wjdtjdgns](https://github.com/wjdtjdgns)!\n- UI: Upgrade manager to react 18 - [#24514](https://github.com/storybookjs/storybook/pull/24514), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: sidebar UI updates - [#24707](https://github.com/storybookjs/storybook/pull/24707), thanks [@cdedreuille](https://github.com/cdedreuille)!"
}
}
1 change: 0 additions & 1 deletion scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export const install: Task['run'] = async ({ sandboxDir }, { link, dryRun, debug
'bench-react-vite-default-ts',
'bench-react-vite-default-ts-nodocs',
'bench-react-vite-default-ts-test-build',
'internal-ssv6-vite',
'react-vite-default-js',
'react-vite-default-ts',
'svelte-vite-default-js',
Expand Down

0 comments on commit e3e78ef

Please sign in to comment.