Skip to content

Conversation

@rubennorte
Copy link
Contributor

Summary

This fixes how we map priorities between Fabric and the React reconciler. At the moment, we're only considering default and discrete priorities, when there's a larger range of priorities available.

In Fabric, we'll test supporting additional priorities soon. For that test to do something useful, we need the new priorities to be mapped to reconciler priorities correctly, which is what this change is done.

Important

At the moment, this is a no-op because Fabric is only reporting default and discrete event priorities.

How did you test this change?

Will test e2e on React Native on top of facebook/react-native#50627

The changes are gated in React Native, so we'll use that feature flag to test this.

@react-sizebot
Copy link

react-sizebot commented Apr 10, 2025

Comparing: c44e4a2...d7a7ac1

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.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 517.64 kB 517.64 kB = 92.08 kB 92.08 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 622.45 kB 622.45 kB = 110.15 kB 110.15 kB
facebook-www/ReactDOM-prod.classic.js = 655.67 kB 655.67 kB = 115.72 kB 115.72 kB
facebook-www/ReactDOM-prod.modern.js = 645.95 kB 645.95 kB = 114.17 kB 114.17 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against d7a7ac1

@rubennorte rubennorte force-pushed the fix-fabric-event-priorities branch from d54b7db to d7a7ac1 Compare April 10, 2025 15:41
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 10, 2025
… React via nativeFabricUIManager

Summary:
Changelog: [internal]

This defines 2 new priorities in Fabric, matching the definitions in React:
* Continuous
* Idle

They're exposed to React via 2 new properties in `nativeFabricUIManager`: `unstable_ContinuousEventPriority` and `unstable_IdleEventPriority`.

It also adds the mapping from the raw event priorities to the Fabric event priorities.

This change doesn't have any effect at the moment. For these to come into effect, we need to:
1. Fix the mapping between Fabric priorities and React priorities in the React repository. See facebook/react#32847
2. Enable the `fixMappingOfEventPrioritiesBetweenFabricAndReact` feature flag.

Differential Revision: D72791968
@rubennorte rubennorte marked this pull request as ready for review April 10, 2025 16:27
@rubennorte rubennorte merged commit 5e9b487 into facebook:main Apr 10, 2025
243 checks passed
@rubennorte rubennorte deleted the fix-fabric-event-priorities branch April 10, 2025 16:35
github-actions bot pushed a commit that referenced this pull request Apr 10, 2025
## Summary

This fixes how we map priorities between Fabric and the React
reconciler. At the moment, we're only considering default and discrete
priorities, when there's a larger range of priorities available.

In Fabric, we'll test supporting additional priorities soon. For that
test to do something useful, we need the new priorities to be mapped to
reconciler priorities correctly, which is what this change is done.

> [!IMPORTANT]
> At the moment, this is a no-op because Fabric is only reporting
default and discrete event priorities.

## How did you test this change?

Will test e2e on React Native on top of
facebook/react-native#50627

The changes are gated in React Native, so we'll use that feature flag to
test this.

DiffTrain build for [5e9b487](5e9b487)
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 10, 2025
… React via nativeFabricUIManager (#50627)

Summary:
Pull Request resolved: #50627

Changelog: [internal]

This defines 2 new priorities in Fabric, matching the definitions in React:
* Continuous
* Idle

They're exposed to React via 2 new properties in `nativeFabricUIManager`: `unstable_ContinuousEventPriority` and `unstable_IdleEventPriority`.

It also adds the mapping from the raw event priorities to the Fabric event priorities.

This change doesn't have any effect at the moment. For these to come into effect, we need to:
1. Fix the mapping between Fabric priorities and React priorities in the React repository. See facebook/react#32847
2. Enable the `fixMappingOfEventPrioritiesBetweenFabricAndReact` feature flag.

Reviewed By: javache

Differential Revision: D72791968

fbshipit-source-id: 525b6e5c99dc0ddc1e5c60fdb5b73f0555e5f0d3
uffoltzl pushed a commit to uffoltzl/react-native that referenced this pull request Apr 18, 2025
… React via nativeFabricUIManager (facebook#50627)

Summary:
Pull Request resolved: facebook#50627

Changelog: [internal]

This defines 2 new priorities in Fabric, matching the definitions in React:
* Continuous
* Idle

They're exposed to React via 2 new properties in `nativeFabricUIManager`: `unstable_ContinuousEventPriority` and `unstable_IdleEventPriority`.

It also adds the mapping from the raw event priorities to the Fabric event priorities.

This change doesn't have any effect at the moment. For these to come into effect, we need to:
1. Fix the mapping between Fabric priorities and React priorities in the React repository. See facebook/react#32847
2. Enable the `fixMappingOfEventPrioritiesBetweenFabricAndReact` feature flag.

Reviewed By: javache

Differential Revision: D72791968

fbshipit-source-id: 525b6e5c99dc0ddc1e5c60fdb5b73f0555e5f0d3
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.

4 participants