Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
75670d5
Docs: Add CSF factory API documentation
yannbf Jan 22, 2025
e1c2cdc
WIP: Move CSF Factories content to page tab
kylegach Jan 28, 2025
a9eaf38
Content revisions
kylegach Jan 29, 2025
dcfab08
Address feedback
kylegach Feb 4, 2025
6e6eb53
Reference addon-a11y instead of experimental-addon-test
kylegach Feb 5, 2025
8acbd6b
Apply suggestions from code review
kylegach Feb 6, 2025
86cf50d
Address feedback
kylegach Feb 6, 2025
9aa5d03
Merge branch 'kasper/csf-factories' into yann/csf-factories-documenta…
kylegach Feb 6, 2025
8b0fb30
don't default to server.allowedHosts = true
JReinhold Feb 12, 2025
ec1ef51
show error log in console and DOM when vite app could not load
JReinhold Feb 13, 2025
e6e3952
Add link to RFC
valentinpalkovic Feb 13, 2025
de265a7
Merge branch 'next' into jeppe/partially-revert-vite-allowedhosts
JReinhold Feb 13, 2025
2429ddd
Merge pull request #30343 from storybookjs/yann/csf-factories-documen…
valentinpalkovic Feb 13, 2025
e549d42
Merge branch 'next' into jeppe/partially-revert-vite-allowedhosts
shilman Feb 13, 2025
4f0adff
Add documentation for `parameters.a11y.test`
kylegach Feb 13, 2025
2b7a4c9
Update MIGRATION.md with `parameters.a11y.test` details
kylegach Feb 13, 2025
fc7404d
fix lint and check
JReinhold Feb 14, 2025
65548b1
Merge branch 'jeppe/partially-revert-vite-allowedhosts' of github.com…
JReinhold Feb 14, 2025
6bf22ff
Fix incorrect import
mrginglymus Feb 14, 2025
463636d
Merge pull request #30523 from storybookjs/jeppe/partially-revert-vit…
JReinhold Feb 14, 2025
0a0b5b2
UI: Fix tags sort to be compatible with older browsers
shilman Feb 14, 2025
0f256ad
Merge branch 'next' into shilman/30545-fix-tags-sort
shilman Feb 14, 2025
be2ef66
Merge pull request #30547 from storybookjs/shilman/30545-fix-tags-sort
shilman Feb 14, 2025
17583d7
Update CHANGELOG.md for v8.5.6 [skip ci]
storybook-bot Feb 14, 2025
4a368a7
Merge pull request #30542 from mrginglymus/fix-react-preview-import
kasperpeulen Feb 14, 2025
5537645
Docs: Fix `test` tags description
shilman Feb 14, 2025
2614d9b
Fix malformed link
kylegach Feb 14, 2025
4010440
Merge branch 'next' into shilman/fix-test-tag-docs
kylegach Feb 14, 2025
8e68bd8
Merge pull request #30548 from storybookjs/shilman/fix-test-tag-docs
kylegach Feb 14, 2025
492ee30
Improve prose
kylegach Feb 14, 2025
5333a91
Fix snippet typo
kylegach Feb 14, 2025
cfd4753
Merge branch 'next' into docs-addon-a11y-parameter
kylegach Feb 14, 2025
14d1a37
Merge pull request #30538 from storybookjs/docs-addon-a11y-parameter
kylegach Feb 14, 2025
77dc3c3
Core: Add tags usage telemetry
shilman Feb 17, 2025
e8009f3
Merge pull request #30555 from storybookjs/shilman/add-tags-telemetry
shilman Feb 17, 2025
4d27fdc
Write changelog for 8.6.0-beta.1 [skip ci]
storybook-bot Feb 17, 2025
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 8.5.6

- Builder-Vite: Fix defaulting to allowing all hosts - [#30523](https://github.com/storybookjs/storybook/pull/30523), thanks @JReinhold!
- UI: Fix tags sort for browser back-compat - [#30547](https://github.com/storybookjs/storybook/pull/30547), thanks @shilman!

## 8.5.5

- Builder-Vite: Fix Turbosnap - [#30522](https://github.com/storybookjs/storybook/pull/30522), thanks @valentinpalkovic!
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 8.6.0-beta.1

- Builder-Vite: Fix defaulting to allowing all hosts - [#30523](https://github.com/storybookjs/storybook/pull/30523), thanks @JReinhold!
- React: Fix incorrect import in preview.ts - [#30542](https://github.com/storybookjs/storybook/pull/30542), thanks @mrginglymus!
- Tags: Add story/meta usage telemetry - [#30555](https://github.com/storybookjs/storybook/pull/30555), thanks @shilman!
- UI: Fix tags sort for browser back-compat - [#30547](https://github.com/storybookjs/storybook/pull/30547), thanks @shilman!

## 8.6.0-beta.0

- Addon A11y: Introduce parameters.a11y.test - [#30516](https://github.com/storybookjs/storybook/pull/30516), thanks @valentinpalkovic!
Expand Down
35 changes: 23 additions & 12 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [From version 8.5.x to 8.6.x](#from-version-85x-to-86x)
- [Angular: Support experimental zoneless support](#angular-support-experimental-zoneless-support)
- [Addon-a11y: Replaced experimental `ally-test` tag behavior with `parameters.a11y.test`](#addon-a11y-replaced-experimental-ally-test-tag-behavior-with-parametersa11ytest)
- [From version 8.4.x to 8.5.x](#from-version-84x-to-85x)
- [React Vite: react-docgen-typescript is updated](#react-vite-react-docgen-typescript-is-updated)
- [Introducing features.developmentModeForBuild](#introducing-featuresdevelopmentmodeforbuild)
Expand Down Expand Up @@ -116,17 +117,17 @@
- [Tab addons cannot manually route, Tool addons can filter their visibility via tabId](#tab-addons-cannot-manually-route-tool-addons-can-filter-their-visibility-via-tabid)
- [Removed `config` preset](#removed-config-preset-1)
- [From version 7.5.0 to 7.6.0](#from-version-750-to-760)
- [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated)
- [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated)
- [typescript.skipBabel deprecated](#typescriptskipbabel-deprecated)
- [Primary doc block accepts of prop](#primary-doc-block-accepts-of-prop)
- [Addons no longer need a peer dependency on React](#addons-no-longer-need-a-peer-dependency-on-react)
- [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated)
- [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated)
- [typescript.skipBabel deprecated](#typescriptskipbabel-deprecated)
- [Primary doc block accepts of prop](#primary-doc-block-accepts-of-prop)
- [Addons no longer need a peer dependency on React](#addons-no-longer-need-a-peer-dependency-on-react)
- [From version 7.4.0 to 7.5.0](#from-version-740-to-750)
- [`storyStoreV6` and `storiesOf` is deprecated](#storystorev6-and-storiesof-is-deprecated)
- [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers)
- [`storyStoreV6` and `storiesOf` is deprecated](#storystorev6-and-storiesof-is-deprecated)
- [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers)
- [From version 7.0.0 to 7.2.0](#from-version-700-to-720)
- [Addon API is more type-strict](#addon-api-is-more-type-strict)
- [Addon-controls hideNoControlsWarning parameter is deprecated](#addon-controls-hidenocontrolswarning-parameter-is-deprecated)
- [Addon API is more type-strict](#addon-api-is-more-type-strict)
- [Addon-controls hideNoControlsWarning parameter is deprecated](#addon-controls-hidenocontrolswarning-parameter-is-deprecated)
- [From version 6.5.x to 7.0.0](#from-version-65x-to-700)
- [7.0 breaking changes](#70-breaking-changes)
- [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below)
Expand All @@ -152,7 +153,7 @@
- [Deploying build artifacts](#deploying-build-artifacts)
- [Dropped support for file URLs](#dropped-support-for-file-urls)
- [Serving with nginx](#serving-with-nginx)
- [Ignore story files from node_modules](#ignore-story-files-from-node_modules)
- [Ignore story files from node\_modules](#ignore-story-files-from-node_modules)
- [7.0 Core changes](#70-core-changes)
- [7.0 feature flags removed](#70-feature-flags-removed)
- [Story context is prepared before for supporting fine grained updates](#story-context-is-prepared-before-for-supporting-fine-grained-updates)
Expand All @@ -166,7 +167,7 @@
- [Addon-interactions: Interactions debugger is now default](#addon-interactions-interactions-debugger-is-now-default)
- [7.0 Vite changes](#70-vite-changes)
- [Vite builder uses Vite config automatically](#vite-builder-uses-vite-config-automatically)
- [Vite cache moved to node_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook)
- [Vite cache moved to node\_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook)
- [7.0 Webpack changes](#70-webpack-changes)
- [Webpack4 support discontinued](#webpack4-support-discontinued)
- [Babel mode v7 exclusively](#babel-mode-v7-exclusively)
Expand Down Expand Up @@ -217,7 +218,7 @@
- [Dropped addon-docs manual babel configuration](#dropped-addon-docs-manual-babel-configuration)
- [Dropped addon-docs manual configuration](#dropped-addon-docs-manual-configuration)
- [Autoplay in docs](#autoplay-in-docs)
- [Removed STORYBOOK_REACT_CLASSES global](#removed-storybook_react_classes-global)
- [Removed STORYBOOK\_REACT\_CLASSES global](#removed-storybook_react_classes-global)
- [7.0 Deprecations and default changes](#70-deprecations-and-default-changes)
- [storyStoreV7 enabled by default](#storystorev7-enabled-by-default)
- [`Story` type deprecated](#story-type-deprecated)
Expand Down Expand Up @@ -461,6 +462,16 @@ Storybook now supports [Angular's experimental zoneless mode](https://angular.de
}
```

### Addon-a11y: Replaced experimental `ally-test` tag behavior with `parameters.a11y.test`

In Storybook 8.6, the `ally-test` tag behavior in the Accessibility addon (`@storybook/addon-a11y`) has been replaced with the `parameters.a11y.test` parameter. See the comparison table below.

| Previous tag value | New parameter value | Description |
| ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------ |
| `'!ally-test'` | `'off'` | Do not run accessibility tests (you can still manually verify via the addon panel) |
| N/A | `'todo'` | Run accessibility tests; violations return a warning in the Storybook UI and a summary count in CLI/CI |
| `'ally-test'` | `'error'` | Run accessibility tests; violations return a failing test in the Storybook UI and CLI/CI |

## From version 8.4.x to 8.5.x

### React Vite: react-docgen-typescript is updated
Expand Down
29 changes: 28 additions & 1 deletion code/builders/builder-vite/input/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,33 @@
<!-- [BODY HTML SNIPPET HERE] -->
<div id="storybook-root"></div>
<div id="storybook-docs"></div>
<script type="module" src="virtual:/@storybook/builder-vite/vite-app.js"></script>
<script>
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/naming-convention
function __onViteAppLoadingError(event) {
const hostname = globalThis.location.hostname;
if (hostname !== 'localhost' && globalThis.CONFIG_TYPE === 'DEVELOPMENT') {
const message = `Failed to load the Storybook preview file 'vite-app.js':

It looks like you're visiting the Storybook development server on another hostname than localhost: '${hostname}', but you haven't configured the necessary security features to support this.
Please re-run your Storybook development server with the '--host ${hostname}' flag, or manually configure your Vite allowedHosts configuration with viteFinal.

See:`;
const docs = [
'https://storybook.js.org/docs/api/cli-options#dev',
'https://storybook.js.org/docs/api/main-config/main-config-vite-final',
'https://vite.dev/config/server-options.html#server-allowedhosts',
];
console.error(`${message}\n${docs.map((doc) => `- ${doc}`).join('\n')}`);

document.getElementById('storybook-root').innerHTML =
`<p style="color: red; max-width: 70ch">${message.replaceAll(
'\n',
'<br/>'
)}<ul>${docs.map((doc) => `<li><a href='${doc}' target='_blank'>${doc}</a></li>`).join('')}<ul></p>`;
Comment on lines +85 to +89

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Potential XSS vulnerability - hostname is inserted into innerHTML without sanitization

return;
}
}
</script>
<script type="module" src="virtual:/@storybook/builder-vite/vite-app.js" onerror="__onViteAppLoadingError(event)"></script>
</body>
</html>
10 changes: 7 additions & 3 deletions code/builders/builder-vite/src/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export async function createViteServer(options: Options, devServer: Server) {

const ipRegex = /^(?:\d{1,3}\.){3}\d{1,3}$|^(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}$/;

config.server.allowedHosts =
commonCfg.server?.allowedHosts ??
(options.host && !ipRegex.test(options.host) ? [options.host.toLowerCase()] : true);
if (
!(config.server.allowedHosts as string[])?.length &&
options.host &&
!ipRegex.test(options.host)
) {
config.server.allowedHosts = [options.host.toLowerCase()];
}

const finalConfig = await presets.apply('viteFinal', config, options);

Expand Down
3 changes: 3 additions & 0 deletions code/core/src/core-server/utils/StoryIndexGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ describe('StoryIndexGenerator', () => {
"play": 0,
"render": 0,
"storyFn": 0,
"tags": 1,
}
`);
});
Expand Down Expand Up @@ -472,6 +473,7 @@ describe('StoryIndexGenerator', () => {
"play": 2,
"render": 1,
"storyFn": 1,
"tags": 5,
}
`);
});
Expand Down Expand Up @@ -738,6 +740,7 @@ describe('StoryIndexGenerator', () => {
"play": 2,
"render": 1,
"storyFn": 1,
"tags": 5,
}
`);
});
Expand Down
Loading