Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement microtasks using new JSI method #43397

Closed
wants to merge 4 commits into from

Conversation

rubennorte
Copy link
Contributor

Summary:
Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Differential Revision: D54687056

@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 labels Mar 8, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 11, 2024
Summary:
Pull Request resolved: facebook#43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Differential Revision: D54687056
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,111,105 +57,620
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,465,580 +57,651
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: e2157f0
Branch: main

@facebook-github-bot
Copy link
Contributor

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

rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 12, 2024
Summary:
Pull Request resolved: facebook#43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Differential Revision: D54687056
@facebook-github-bot
Copy link
Contributor

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

rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 12, 2024
Summary:
Pull Request resolved: facebook#43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Differential Revision: D54687056
rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 12, 2024
Summary:
Pull Request resolved: facebook#43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Reviewed By: sammy-SC

Differential Revision: D54687056
@facebook-github-bot
Copy link
Contributor

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

rubennorte and others added 4 commits March 12, 2024 06:49
…es before writing

Differential Revision: D54690126
…only overrides

Differential Revision: D54687055
Summary:
Pull Request resolved: facebook#43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Reviewed By: sammy-SC

Differential Revision: D54687056
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 5833eb5.

rubennorte added a commit to facebook/react that referenced this pull request Mar 13, 2024
… by RN (#28472)

## Summary

We want to enable the new event loop in React Native
(react-native-community/discussions-and-proposals#744)
for all users in the new architecture (determined by the use of
bridgeless, not by the use of Fabric). In order to leverage that, we
need to also set the flag for the React reconciler to use microtasks for
scheduling (so we'll execute them at the right time in the new event
loop).

This migrates from the previous approach using a dynamic flag (to be
used at Meta) with the check of a global set by React Native. The reason
for doing this is:
1) We still need to determine this dynamically in OSS (based on
Bridgeless, not on Fabric).
2) We still need the ability to configure the behavior at Meta, and for
internal build system reasons we cannot access the flag that enables
microtasks in
[`ReactNativeFeatureFlags`](https://github.com/facebook/react-native/blob/6c28c87c4d5d8a9f5be5e02cd7d3eba5b4aaca8c/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js#L121).

## How did you test this change?

Manually synchronized the changes to React Native and ran all tests for
the new architecture on it. Also tested manually.

> [!NOTE]
> This change depends on
facebook/react-native#43397 which has been
merged already
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
… by RN (facebook#28472)

## Summary

We want to enable the new event loop in React Native
(react-native-community/discussions-and-proposals#744)
for all users in the new architecture (determined by the use of
bridgeless, not by the use of Fabric). In order to leverage that, we
need to also set the flag for the React reconciler to use microtasks for
scheduling (so we'll execute them at the right time in the new event
loop).

This migrates from the previous approach using a dynamic flag (to be
used at Meta) with the check of a global set by React Native. The reason
for doing this is:
1) We still need to determine this dynamically in OSS (based on
Bridgeless, not on Fabric).
2) We still need the ability to configure the behavior at Meta, and for
internal build system reasons we cannot access the flag that enables
microtasks in
[`ReactNativeFeatureFlags`](https://github.com/facebook/react-native/blob/6c28c87c4d5d8a9f5be5e02cd7d3eba5b4aaca8c/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js#L121).

## How did you test this change?

Manually synchronized the changes to React Native and ran all tests for
the new architecture on it. Also tested manually.

> [!NOTE]
> This change depends on
facebook/react-native#43397 which has been
merged already
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