Skip to content

Support C++ construction of WritableNativeMap (#59618) - #59618

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

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

Conversation

@javache

@javache javache commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Avoid initialising the native object twice when constructing WritableNativeMap from C++. Give newObjectCxxArgs a no-init Java constructor path while preserving the normal empty-map Java constructor.

Build touch-event payloads as complete folly::dynamic maps and pass them to that factory, instead of populating writable maps and arrays field by field. The payload shape, value types and writable event APIs remain unchanged.

Changelog:
[Android][Fixed] - Allow WritableNativeMap construction from C++ without double initialisation.
[Android][Changed] - Construct writable touch-event payloads directly in C++.

Differential Revision: D128312388

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

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

Visual regression

1 visual difference(s) at a8aa5ad8dc5f. Visual differences need maintainer approval. Review the report, then apply visual-change-approved.

ios button/default-styling/default: Changed, 38223 px (1.533%)

diff

Expected and Captured
Expected Captured
expected captured

@meta-codesync meta-codesync Bot changed the title Support C++ construction of WritableNativeMap Support C++ construction of WritableNativeMap (#59618) Oct 29, 2026
javache added a commit to javache/react-native that referenced this pull request Oct 29, 2026
Summary:

Avoid initialising the native object twice when constructing `WritableNativeMap` from C++. Give `newObjectCxxArgs` a no-init Java constructor path while preserving the normal empty-map Java constructor.

Build touch-event payloads as complete `folly::dynamic` maps and pass them to that factory, instead of populating writable maps and arrays field by field. The payload shape, value types and writable event APIs remain unchanged.

Changelog:
[Android][Fixed] - Allow `WritableNativeMap` construction from C++ without double initialisation.
[Android][Changed] - Construct writable touch-event payloads directly in C++.

Differential Revision: D128312388
javache added a commit to javache/react-native that referenced this pull request Oct 29, 2026
Summary:

Avoid initialising the native object twice when constructing `WritableNativeMap` from C++. Give `newObjectCxxArgs` a no-init Java constructor path while preserving the normal empty-map Java constructor.

Build touch-event payloads as complete `folly::dynamic` maps and pass them to that factory, instead of populating writable maps and arrays field by field. The payload shape, value types and writable event APIs remain unchanged.

Changelog:
[Android][Fixed] - Allow `WritableNativeMap` construction from C++ without double initialisation.
[Android][Changed] - Construct writable touch-event payloads directly in C++.

Differential Revision: D128312388
Summary:
Pull Request resolved: react#59618

Avoid initialising the native object twice when constructing `WritableNativeMap` from C++. Give `newObjectCxxArgs` a no-init Java constructor path while preserving the normal empty-map Java constructor.

Build touch-event payloads as complete `folly::dynamic` maps and pass them to that factory, instead of populating writable maps and arrays field by field. The payload shape, value types and writable event APIs remain unchanged.

Changelog:
[Android][Fixed] - Allow `WritableNativeMap` construction from C++ without double initialisation.
[Android][Changed] - Construct writable touch-event payloads directly in C++.

Differential Revision: D128312388

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