Skip to content

Core: Add changeDetection feature flag#34314

Merged
valentinpalkovic merged 2 commits into
nextfrom
valentin/change-detection-flag
Mar 25, 2026
Merged

Core: Add changeDetection feature flag#34314
valentinpalkovic merged 2 commits into
nextfrom
valentin/change-detection-flag

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented Mar 25, 2026

Closes #

What I did

Added changeDetection feature flag

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • New Features

    • Added a new changeDetection configuration option.
    • Several UI-related feature flags are now explicitly enabled: actions, backgrounds, controls, measure, components manifest, viewport, and outline; legacy decorator file ordering explicitly set to false.
  • Documentation

    • Updated configuration docs to describe the new changeDetection option and its default.

Comment thread docs/api/main-config/main-config-features.mdx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

Fails
🚫 The "#### Manual testing" section must be filled in. Please describe how to test the changes you've made, step by step, so that reviewers can confirm your PR works as intended.

Generated by 🚫 dangerJS against 7f4b44e

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 25, 2026

View your CI Pipeline Execution ↗ for commit 7f4b44e

Command Status Duration Result
nx run-many -t compile,check,knip,test,lint,fmt... ✅ Succeeded 8m 27s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-25 13:27:28 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34257938-2c95-4adc-ac28-b66a716057b9

📥 Commits

Reviewing files that changed from the base of the PR and between 5f92309 and 7f4b44e.

📒 Files selected for processing (1)
  • code/core/src/core-server/presets/common-preset.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/core/src/core-server/presets/common-preset.ts

📝 Walkthrough

Walkthrough

Adds a new optional changeDetection boolean feature flag to Storybook config types, exposes it in the default preset (explicitly set to false), and documents the option across renderer branches.

Changes

Cohort / File(s) Summary
Types
code/core/src/types/modules/core-common.ts
Added optional features.changeDetection?: boolean to StorybookConfigRaw with JSDoc and default note.
Presets / Core server
code/core/src/core-server/presets/common-preset.ts
Updated returned features object to explicitly set several flags including changeDetection: false and other boolean feature flags.
Documentation
docs/api/main-config/main-config-features.mdx
Documented changeDetection?: boolean option for React, Angular, and other renderer branches and added description/default value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/api/main-config/main-config-features.mdx (1)

141-148: Consider expanding the documentation description.

The description "Enable change detection." is quite vague. Users would benefit from understanding:

  • What behavior this feature flag controls
  • Which renderers/frameworks it affects
  • Why they might want to enable or disable it

Other feature flags in this file include links to more detailed documentation (e.g., [Actions](../../essentials/actions.mdx)). Consider adding similar context or a brief explanation of what "change detection" means in this context.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/api/main-config/main-config-features.mdx` around lines 141 - 148, The
`changeDetection` entry has an overly terse description; update it to explain
what behavior the flag controls (e.g., whether the system performs automatic
diffing to detect and apply UI/state changes vs. requiring manual updates), list
which renderers/frameworks it affects (mention any specific renderers or
integrations that honor this flag), and give guidance on when to enable vs.
disable it (performance tradeoffs, debugging, or manual-control scenarios).
Replace "Enable change detection." with a short sentence covering those points
and add a link to the detailed docs or a relevant section (same style as other
flags) for users who need deeper information.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/api/main-config/main-config-features.mdx`:
- Around line 141-148: The `changeDetection` entry has an overly terse
description; update it to explain what behavior the flag controls (e.g., whether
the system performs automatic diffing to detect and apply UI/state changes vs.
requiring manual updates), list which renderers/frameworks it affects (mention
any specific renderers or integrations that honor this flag), and give guidance
on when to enable vs. disable it (performance tradeoffs, debugging, or
manual-control scenarios). Replace "Enable change detection." with a short
sentence covering those points and add a link to the detailed docs or a relevant
section (same style as other flags) for users who need deeper information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b795c7a-973a-4f71-8827-5664668c7a6a

📥 Commits

Reviewing files that changed from the base of the PR and between 09a3460 and 5f92309.

📒 Files selected for processing (3)
  • code/core/src/core-server/presets/common-preset.ts
  • code/core/src/types/modules/core-common.ts
  • docs/api/main-config/main-config-features.mdx

Comment thread code/core/src/core-server/presets/common-preset.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants