From a5bdb96973c77164c0310251d0852aa65b367a03 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:49:40 +0000 Subject: [PATCH 1/5] Update ./docs/versions/next.json for v10.3.0-alpha.10 --- docs/versions/next.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index 0bb964213238..bb7b7651757c 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"10.3.0-alpha.9","info":{"plain":"- React: Add react-docgen-typescript to component manifest - [#33818](https://github.com/storybookjs/storybook/pull/33818), thanks @kasperpeulen!"}} \ No newline at end of file +{"version":"10.3.0-alpha.10","info":{"plain":"- Addon-Vitest: Fix postinstall a11y installation - [#33888](https://github.com/storybookjs/storybook/pull/33888), thanks @valentinpalkovic!\n- Builder-Vite: Use preview annotations as entry points for optimizeDeps - [#33875](https://github.com/storybookjs/storybook/pull/33875), thanks @copilot-swe-agent!\n- React Native Web: Fix inconsistent example stories - [#33891](https://github.com/storybookjs/storybook/pull/33891), thanks @danielalanbates!\n- Webpack: Improve performance of module-mocking plugins - [#33169](https://github.com/storybookjs/storybook/pull/33169), thanks @valentinpalkovic!"}} \ No newline at end of file From 1b6073bafedfcd77895724ca623337b4e65a9d38 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 23 Feb 2026 19:55:56 +0100 Subject: [PATCH 2/5] Merge pull request #33169 from storybookjs/valentin/fix-hmr-for-webpack-users Webpack: Improve performance of module-mocking plugins (cherry picked from commit 20bf5123dd319927f7a5488d23bd614dd8599700) --- .../webpack-inject-mocker-runtime-plugin.ts | 18 +++++--- .../src/plugins/webpack-mock-plugin.ts | 43 ++++++++++++++++--- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/code/builders/builder-webpack5/src/plugins/webpack-inject-mocker-runtime-plugin.ts b/code/builders/builder-webpack5/src/plugins/webpack-inject-mocker-runtime-plugin.ts index da843d1cd782..84e0fcdfdac6 100644 --- a/code/builders/builder-webpack5/src/plugins/webpack-inject-mocker-runtime-plugin.ts +++ b/code/builders/builder-webpack5/src/plugins/webpack-inject-mocker-runtime-plugin.ts @@ -13,6 +13,7 @@ const PLUGIN_NAME = 'WebpackInjectMockerRuntimePlugin'; * Storybook preview bundle, are executed. */ export class WebpackInjectMockerRuntimePlugin { + private cachedRuntime: string | null = null; // We need to lazy-require HtmlWebpackPlugin because it's an optional peer dependency. private getHtmlWebpackPlugin(compiler: Compiler): typeof HtmlWebpackPlugin | null { try { @@ -52,20 +53,23 @@ export class WebpackInjectMockerRuntimePlugin { PLUGIN_NAME, (data, cb) => { try { - const runtimeScriptContent = getMockerRuntime(); + const runtimeScriptContent = + this.cachedRuntime ?? (this.cachedRuntime = getMockerRuntime()); const runtimeAssetName = 'mocker-runtime-injected.js'; // Use the documented `emitAsset` method to add the pre-bundled runtime script // to the compilation's assets. This is the standard Webpack way. - compilation.emitAsset( - runtimeAssetName, - new compiler.webpack.sources.RawSource(runtimeScriptContent) - ); + if (!compilation.getAsset(runtimeAssetName)) { + compilation.emitAsset( + runtimeAssetName, + new compiler.webpack.sources.RawSource(runtimeScriptContent) + ); + data.assets.js.unshift(runtimeAssetName); + } - // Prepend the name of our new asset to the list of JavaScript files. + // Prepend the name of our new asset to the list of JavaScript files, once. // HtmlWebpackPlugin will automatically create a