Skip to content

Type mutable style and event registry builders - #60144

Merged
meta-codesync[bot] merged 2 commits into
react:mainfrom
rubennorte:export-D132934090
Nov 19, 2026
Merged

meta-codesync[bot] merged 2 commits into
react:mainfrom
rubennorte:export-D132934090

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:

Context

Style splitting builds fresh objects, while the listener registry allocates and deletes event slots. Using readonly API types for these mutable implementation objects requires unnecessary write suppressions. The listener registry is also sparse: event keys need not exist before registration.

Changes

  • Derive a mutable view-style builder with a mapped type that removes readonly, keeping readonly style inputs and returned API types.
  • Make listener-registry slots mutable and optional while preserving readonly event argument tuples and registrations.
  • Remove six obsolete suppressions for readonly writes and style-builder initialization.
  • Preserve runtime code, null-prototype registry storage, and existing dynamic-key suppressions.

Flow configurations that check React Native implementation source need experimental.tslib_syntax=true for signed-readonly mapped types. The preceding configuration-only change provides that opt-in for React Native's OSS validation.

Changelog: [Internal]

Differential Revision: D132934090

Summary:
## Context
React Native implementation type improvements use `satisfies` and signed-readonly mapped types. The open-source Flow checker needs an explicit opt-in before source files can adopt these features.

## Changes
- Enable `experimental.tslib_syntax=true` in the open-source Flow configuration.
- Keep the syntax opt-in separate from the implementation refactors that use it.

Changelog: [Internal]

Differential Revision: D133191436
Summary:
## Context
Style splitting builds fresh objects, while the listener registry allocates and deletes event slots. Using readonly API types for these mutable implementation objects requires unnecessary write suppressions. The listener registry is also sparse: event keys need not exist before registration.

## Changes
- Derive a mutable view-style builder with a mapped type that removes readonly, keeping readonly style inputs and returned API types.
- Make listener-registry slots mutable and optional while preserving readonly event argument tuples and registrations.
- Remove six obsolete suppressions for readonly writes and style-builder initialization.
- Preserve runtime code, null-prototype registry storage, and existing dynamic-key suppressions.

Flow configurations that check React Native implementation source need `experimental.tslib_syntax=true` for signed-readonly mapped types. The preceding configuration-only change provides that opt-in for React Native's OSS validation.

Changelog: [Internal]

Differential Revision: D132934090
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 19, 2026
@meta-codesync

meta-codesync Bot commented Nov 19, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D132934090.

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync
meta-codesync Bot merged commit 1a44dcf into react:main Nov 19, 2026
101 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in 1a44dcf

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants