Skip to content

Add enableViewTransitionForPersistenceMode feature flag#36014

Open
zeyap wants to merge 1 commit intofacebook:mainfrom
zeyap:enable-vt-persistence-mode
Open

Add enableViewTransitionForPersistenceMode feature flag#36014
zeyap wants to merge 1 commit intofacebook:mainfrom
zeyap:enable-vt-persistence-mode

Conversation

@zeyap
Copy link

@zeyap zeyap commented Mar 11, 2026

Summary

  • Adds enableViewTransitionForPersistenceMode feature flag (defaults to false in all channels)
  • Wherever the reconciler checks supportsMutation before running view transition logic, adds an else if (enableViewTransitionForPersistenceMode) branch for persistent renderers (Fabric)
  • This follows the principle that supportsMutation guards mutation-mode-only logic, and persistent mode should have its own branch rather than being lumped under a single supportsViewTransition capability flag
  • Affected functions in ReactFiberCommitViewTransitions.js:
    • applyViewTransitionToHostInstancesRecursive
    • restoreViewTransitionOnHostInstances
    • measureViewTransitionHostInstancesRecursive
  • Affected check in ReactFiberCommitWork.js:
    • restoreRootViewTransitionName in passive mount for HostRoot
  • For now the persistent mode branches duplicate the mutation logic; they will diverge as persistent-mode-specific behavior is implemented

Test plan

  • Existing view transition tests pass (flag is false by default, so no behavior change)
  • yarn flow for dom-node, fabric, native renderers

Wherever the reconciler checks supportsMutation before running view
transition logic, add an else-if branch gated on
enableViewTransitionForPersistenceMode for persistent renderers (Fabric).

This follows the pattern that supportsMutation guards mutation-mode-only
logic, and persistent mode should have its own branch rather than being
lumped under a single supportsViewTransition capability flag.

For now the persistent mode branches duplicate the mutation logic.
The flag defaults to false in all channels.
@react-sizebot
Copy link

Comparing: 7b5b561...bf9744b

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 611.79 kB 611.79 kB = 108.12 kB 108.12 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 677.72 kB 677.72 kB = 119.08 kB 119.08 kB
facebook-www/ReactDOM-prod.classic.js = 697.67 kB 697.67 kB = 122.58 kB 122.58 kB
facebook-www/ReactDOM-prod.modern.js = 687.98 kB 687.98 kB = 120.96 kB 120.96 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against bf9744b

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