Skip to content

Make JS Representation cache all TurboModule properties#36625

Closed
RSNara wants to merge 2 commits into
facebook:mainfrom
RSNara:export-D44253229
Closed

Make JS Representation cache all TurboModule properties#36625
RSNara wants to merge 2 commits into
facebook:mainfrom
RSNara:export-D44253229

Conversation

@RSNara
Copy link
Copy Markdown
Contributor

@RSNara RSNara commented Mar 24, 2023

Summary:

Context

Previously, jsRepresentation would only cache the HostFunctions returned from TurboModule::createHostFunction().

Changes

This diff replaces TurboModule::createHostFunction() with TurboModule::create().

Now, jsRepresentation will cache all the properties returned from TurboModule::create().

Motivation

For interop modules, constants will be exported as properties on the TurboModule HostObject. This diff allows those constants (which are non HostFunctions) to be cached.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44253229

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Mar 24, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Mar 24, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,526,426 +6,854
android hermes armeabi-v7a 7,842,089 +6,311
android hermes x86 9,006,359 +7,631
android hermes x86_64 8,861,818 +6,919
android jsc arm64-v8a 9,147,709 +6,848
android jsc armeabi-v7a 8,339,317 +6,317
android jsc x86 9,202,189 +7,642
android jsc x86_64 9,460,565 +6,925

Base commit: 4e0dfed
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 84f0cd1 to 1deeb37 Compare March 24, 2023 14:35
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 1deeb37 to f3d1b7f Compare March 24, 2023 14:40
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from f3d1b7f to 19cc0e7 Compare March 26, 2023 18:09
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 19cc0e7 to 5e5ff39 Compare March 26, 2023 19:56
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 5e5ff39 to b874929 Compare March 26, 2023 20:00
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from b874929 to 2fcfae8 Compare March 26, 2023 20:12
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 2fcfae8 to 150bc40 Compare March 27, 2023 20:32
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch 2 times, most recently from 833d9ee to 1b13a08 Compare March 28, 2023 14:07
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 1b13a08 to 06169fc Compare March 28, 2023 14:13
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 06169fc to 0caa6e7 Compare March 28, 2023 14:18
RSNara and others added 2 commits March 28, 2023 08:22
Summary:
In Bridgeless mode, With the TurboModule interop layer, the TurboModule system will need to customize the nativeModuleProxy global.

This customization would be much easier if the nativeModuleProxy global were installed by the TurboModule system (and not the Bridgeless core).

So, this diff moves nativeModuleProxy installation into the TurboModule system.

Changelog: [Internal]

Differential Revision: https://internalfb.com/D43993197

fbshipit-source-id: fdc508b58deaa36597536584eab838a36c583734
Summary:
Pull Request resolved: facebook#36625

## Context
Previously, jsRepresentation would only cache the **HostFunctions** returned from TurboModule::createHostFunction().

## Changes
This diff replaces TurboModule::createHostFunction() with TurboModule::create().

Now, jsRepresentation will cache **all** the **properties** returned from TurboModule::create().

## Motivation
For interop modules, constants will be exported as properties on the TurboModule HostObject. This diff allows those constants (which are non HostFunctions) to be cached.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44253229

fbshipit-source-id: 13b39f80fb0c3a21307e1456f347f155ac52119d
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44253229

@RSNara RSNara force-pushed the export-D44253229 branch from 0caa6e7 to a9b0698 Compare March 28, 2023 15:24
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 28, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 51893c4.

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants