Skip to content

Skip native prop metadata for delegate-backed managers (#59296) - #59296

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D126630163
Open

javache wants to merge 1 commit into
react:mainfrom
javache:export-D126630163

Conversation

@javache

@javache javache commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Add the default-off skipNativePropsForViewManagerWithDelegateAndroid feature flag. When enabled, ViewManager.getNativeProps() returns an empty map for managers with a non-null, non-generic delegate, avoiding unused manager and shadow-node prop metadata generation. Return a fresh mutable map so subclasses can safely extend super.getNativeProps(). The constants helper already omits NativeProps for an empty map; commands, events and custom constants are preserved.

Null and generic delegates keep the existing metadata path, including its legacy-architecture shadow-node handling. The flag must only be enabled when delegate-backed components use static view configs rather than runtime native prop metadata.

NativeProps queries reuse getOrCreateViewManagerDelegate(), sharing the same delegate with prop updates and commands. Make its lazy initialisation thread-safe with a volatile cache and double-checked synchronisation, leaving warm reads lock-free. Document that initialisation may occur on the JavaScript thread when this flag is enabled.

Regenerate all feature-flag bindings and cover enabled/disabled paths, generic and null delegates, marker-only managers, preserved constants, subclass prop extensions, independent mutable maps, existing-cache reuse and concurrent metadata/command initialisation.

Changelog:
[Android][Changed] - Add an opt-in optimisation to skip native prop metadata for delegate-backed view managers using static view configs.

Reviewed By: andrewdacenko

Differential Revision: D126630163

@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 Oct 21, 2026
@meta-codesync

meta-codesync Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Skip native prop metadata for delegate-backed managers Skip native prop metadata for delegate-backed managers (#59296) Oct 22, 2026
javache added a commit to javache/react-native that referenced this pull request Oct 22, 2026
Summary:
Pull Request resolved: react#59296

Add the default-off `skipNativePropsForViewManagerWithDelegateAndroid` feature flag. When enabled, `ViewManager.getNativeProps()` returns an empty map for managers with a non-null, non-generic delegate, avoiding unused manager and shadow-node prop metadata generation. Return a fresh mutable map so subclasses can safely extend `super.getNativeProps()`. The constants helper already omits `NativeProps` for an empty map; commands, events and custom constants are preserved.

Null and generic delegates keep the existing metadata path, including its legacy-architecture shadow-node handling. The flag must only be enabled when delegate-backed components use static view configs rather than runtime native prop metadata.

NativeProps queries reuse `getOrCreateViewManagerDelegate()`, sharing the same delegate with prop updates and commands. Make its lazy initialisation thread-safe with a volatile cache and double-checked synchronisation, leaving warm reads lock-free. Document that initialisation may occur on the JavaScript thread when this flag is enabled.

Regenerate all feature-flag bindings and cover enabled/disabled paths, generic and null delegates, marker-only managers, preserved constants, subclass prop extensions, independent mutable maps, existing-cache reuse and concurrent metadata/command initialisation.

Changelog:
[Android][Changed] - Add an opt-in optimisation to skip native prop metadata for delegate-backed view managers using static view configs.

Differential Revision: D126630163
Summary:

Add the default-off `skipNativePropsForViewManagerWithDelegateAndroid` feature flag. When enabled, `ViewManager.getNativeProps()` returns an empty map for managers with a non-null, non-generic delegate, avoiding unused manager and shadow-node prop metadata generation. Return a fresh mutable map so subclasses can safely extend `super.getNativeProps()`. The constants helper already omits `NativeProps` for an empty map; commands, events and custom constants are preserved.

Null and generic delegates keep the existing metadata path, including its legacy-architecture shadow-node handling. The flag must only be enabled when delegate-backed components use static view configs rather than runtime native prop metadata.

NativeProps queries reuse `getOrCreateViewManagerDelegate()`, sharing the same delegate with prop updates and commands. Make its lazy initialisation thread-safe with a volatile cache and double-checked synchronisation, leaving warm reads lock-free. Document that initialisation may occur on the JavaScript thread when this flag is enabled.

Regenerate all feature-flag bindings and cover enabled/disabled paths, generic and null delegates, marker-only managers, preserved constants, subclass prop extensions, independent mutable maps, existing-cache reuse and concurrent metadata/command initialisation.

Changelog:
[Android][Changed] - Add an opt-in optimisation to skip native prop metadata for delegate-backed view managers using static view configs.

Reviewed By: andrewdacenko

Differential Revision: D126630163

This branch has not been deployed

No deployments
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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant