Skip to content

Changeset: New Version - #707

Merged
Patrick Lafrance (patricklafrance) merged 1 commit into
mainfrom
changeset-release/main
Sep 3, 2026
Merged

Patrick Lafrance (patricklafrance) merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@squide/firefly-storybook@3.0.0

Major Changes

  • #706 d37944e Thanks @patricklafrance! - The documented Storybook integration moved to msw-storybook-addon v3. Applications must update their .storybook/preview.tsx when they upgrade the addon — see the migration below.

    This ships as a major release deliberately, to put the migration in front of every consumer, rather than because the package's own code changed. @squide/firefly-storybook never imports the addon: the integration is runtime.requestHandlers fed through parameters.msw, and that contract is identical across both addon majors. msw-storybook-addon is therefore declared as an optional peer spanning the range actually supported, ^2.0.7 || ^3.0.0. Applications already on v2 keep working and are not warned about an addon they installed correctly, and it is optional because the addon belongs to the Storybook application, which is not necessarily the package depending on @squide/firefly-storybook.

    Why

    v3 removed the initialize export and moved mswLoader to the msw-storybook-addon/csf3 subpath, where it became a factory. With v3 installed, a preview.tsx written against the v2 API throws while the preview module is being evaluated:

    TypeError: (0, msw_storybook_addon.initialize) is not a function
    

    Because a broken preview.js aborts the whole preview, this blanks every story in the Storybook — including trivial ones that use neither MSW nor Squide — which makes the cause hard to spot.

    Migration

    Update .storybook/preview.tsx:

    -import { initialize as initializeMsw, mswLoader } from "msw-storybook-addon";
    +import { setupWorker } from "msw/browser";
    +import { mswLoader } from "msw-storybook-addon/csf3";
    
    -initializeMsw({
    -    onUnhandledRequest: "bypass"
    -});
    +async function startMswWorker() {
    +    const worker = setupWorker();
    +
    +    await worker.start({
    +        onUnhandledRequest: "bypass"
    +    });
    +
    +    return worker;
    +}
    
     const preview: Preview = {
         // ...
    -    loaders: [mswLoader]
    +    loaders: [mswLoader(startMswWorker)]
     };

    If the application augments Storybook's Parameters interface, the MswParameters type has been replaced by MswParameter:

    -import type { MswParameters } from "msw-storybook-addon";
    +import type { MswParameter } from "msw-storybook-addon/csf3";
    
     declare module "storybook-react-rsbuild" {
         interface Parameters {
    -        msw?: MswParameters["msw"];
    +        msw?: MswParameter;
         }
     }

    The setup function is optional and only needed to preserve onUnhandledRequest: "bypass". Without one, v3 creates and starts the worker itself, warning on unhandled requests while filtering common asset and Storybook-internal URLs. Handler reset semantics and both parameters.msw shapes ([...] and { handlers }) are unchanged.

    Two traps to watch for

    • mswLoader is a factory and must be called. Leaving the v2 shape loaders: [mswLoader] still type checks, but Storybook invokes it with the loader context and treats the returned function as loaded data, so handlers are never applied and mocking silently stops with no error.
    • The worker now starts lazily, inside the first loader, i.e. after story modules are evaluated. v2 started it at preview-module evaluation. Requests issued from the top level of a story file, before the first story renders, are no longer intercepted.

    Stay on the CSF 3.0 API shown above. v3's newer addonMsw() (CSF Next) does not read parameters.msw at all, so adopting it would silently disable mocking in every story that relies on the msw parameter — including the runtime.requestHandlers pattern this package documents.

Patch Changes

  • #706 d37944e Thanks @patricklafrance! - Updated dependencies to their latest versions.
  • Updated dependencies [d37944e]:
    • @squide/env-vars@1.4.24
    • @squide/firefly@19.2.1
    • @squide/launch-darkly@1.0.17
    • @squide/msw@4.1.2

@squide/core@7.5.1

Patch Changes

@squide/env-vars@1.4.24

Patch Changes

@squide/fakes@2.2.23

Patch Changes

@squide/firefly@19.2.1

Patch Changes

  • #706 d37944e Thanks @patricklafrance! - Updated dependencies to their latest versions.
  • Updated dependencies [d37944e]:
    • @squide/core@7.5.1
    • @squide/env-vars@1.4.24
    • @squide/launch-darkly@1.0.17
    • @squide/msw@4.1.2
    • @squide/react-router@10.2.1

@squide/firefly-module-federation@3.0.3

Patch Changes

@squide/firefly-rsbuild-configs@2.2.11

Patch Changes

@squide/firefly-webpack-configs@5.2.13

Patch Changes

@squide/i18next@2.6.2

Patch Changes

@squide/launch-darkly@1.0.17

Patch Changes

@squide/msw@4.1.2

Patch Changes

@squide/react-router@10.2.1

Patch Changes

@patricklafrance
Patrick Lafrance (patricklafrance) merged commit e0efc2e into main Sep 3, 2026
3 checks passed
@patricklafrance
Patrick Lafrance (patricklafrance) deleted the changeset-release/main branch September 3, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant