Skip to content

fix(storybook-angular): resolve experimentalZoneless in Vitest path#2059

Merged
brandonroberts merged 1 commit intoanalogjs:betafrom
palexcast:fix/storybook-zoneless-vitest
Feb 10, 2026
Merged

fix(storybook-angular): resolve experimentalZoneless in Vitest path#2059
brandonroberts merged 1 commit intoanalogjs:betafrom
palexcast:fix/storybook-zoneless-vitest

Conversation

@palexcast
Copy link
Contributor

@palexcast palexcast commented Feb 9, 2026

Closes #2058

What is the current behavior?

The storybook-angular preset checks options.angularBuilderOptions.experimentalZoneless to decide whether to skip zone.js injection. This property is populated by the Angular builder executors (start-storybook/build-storybook), but is never set when tests run via @storybook/addon-vitest. As a result, zoneless Angular apps are forced to install zone.js just to run Vitest-based Storybook tests.

What is the new behavior?

The preset resolves experimentalZoneless through a 3-tier fallback:

  1. Framework optionsframework.options.experimentalZoneless in .storybook/main.ts (new, works with @storybook/addon-vitest)
  2. Builder optionsoptions.angularBuilderOptions.experimentalZoneless (existing path, unchanged)
  3. Auto-detect — Angular 21+ defaults to zoneless (matches @storybook/angular builder behavior)

Users can now configure zoneless in .storybook/main.ts:

const config: StorybookConfig = {
  framework: {
    name: '@analogjs/storybook-angular',
    options: {
      experimentalZoneless: true,
    },
  },
};

Does this introduce a breaking change?

No. The existing angularBuilderOptions path is unchanged. The new tiers only activate when the builder option is absent.

Other information


Full transparency: This PR was pair-programmed with Claude Opus 4.6 (Anthropic's AI), who did the typing while a human did the thinking. The human filed the issue, designed the 3-tier approach, and caught every shortcut the AI tried to take during review. The AI's main contribution was not complaining about resolving the same merge conflict three times.

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 666e03e
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/698b3504d7ab7b31b5551008
😎 Deploy Preview https://deploy-preview-2059--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 666e03e
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/698a4fc1ce5500000839f783
😎 Deploy Preview https://deploy-preview-2059--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit 666e03e
🔍 Latest deploy log https://app.netlify.com/projects/analog-docs/deploys/698a4fc15ef1370007d3cbed
😎 Deploy Preview https://deploy-preview-2059--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The preset checked options.angularBuilderOptions.experimentalZoneless to skip
zone.js injection, but this property is never populated when running via
@storybook/addon-vitest. Added 3-tier resolution: framework options from
.storybook/main.ts, builder options (existing), Angular 21+ auto-detection.

Closes analogjs#2058

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brandonroberts brandonroberts merged commit 447dad2 into analogjs:beta Feb 10, 2026
21 of 23 checks passed
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.

Storybook preset always injects zone.js when running via @storybook/addon-vitest

2 participants