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

Migrate ReactHost / ReactInstanceManager destroy() call sites to use invalidate() #45082

Closed
wants to merge 2 commits into from

Conversation

motiz88
Copy link
Contributor

@motiz88 motiz88 commented Jun 20, 2024

Summary:
Changelog: [Android][Breaking] ReactNativeHost invalidates the instance manager on clear()

Changes ReactNativeHost.clear() to invalidate the underlying ReactInstanceManager, rather than merely destroying the instance.

This is technically a breaking change because the underlying ReactInstanceManager may have escaped (via ReactNativeHost.getReactInstanceManager()) before the clear() call. In my reading of the API and of usages like this one in Expo, this should rarely occur in practice.

The plan:

  1. D58811090: Add the basic invalidate() functionality.
  2. [This diff]: Add invalidate() call sites where it makes sense in core.
  3. [Upcoming diff]: Keep the Fusebox debugging target registered until the Host is explicitly invalidated.

Differential Revision: D58811091

@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 Jun 20, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

motiz88 added a commit to motiz88/react-native that referenced this pull request Jun 24, 2024
…invalidate() (facebook#45082)

Summary:
Pull Request resolved: facebook#45082

Changelog: [Android][Breaking] `ReactNativeHost` invalidates the instance manager on `clear()`

Changes `ReactNativeHost.clear()` to invalidate the underlying `ReactInstanceManager`, rather than merely destroying the instance.

This is technically a **breaking change** because the underlying `ReactInstanceManager` may have escaped (via `ReactNativeHost.getReactInstanceManager()`) before the `clear()` call. In my reading of the API and of usages like [this one in Expo](https://github.com/expo/expo/blob/23a905b17065703882ebeda1fc9f65a05cc69fa7/packages/expo-dev-menu-interface/android/src/main/java/expo/interfaces/devmenu/ReactHostWrapper.kt#L117), this should rarely occur in practice.

The plan:
1. D58811090: Add the basic `invalidate()` functionality.
2. **[This diff]**: Add `invalidate()` call sites where it makes sense in core.
3. [Upcoming diff]: Keep the Fusebox debugging target registered until the Host is explicitly invalidated.

Reviewed By: javache

Differential Revision: D58811091
…invalidate() (facebook#45082)

Summary:
Pull Request resolved: facebook#45082

Changelog: [Android][Breaking] `ReactNativeHost` invalidates the instance manager on `clear()`

Changes `ReactNativeHost.clear()` to invalidate the underlying `ReactInstanceManager`, rather than merely destroying the instance.

This is technically a **breaking change** because the underlying `ReactInstanceManager` may have escaped (via `ReactNativeHost.getReactInstanceManager()`) before the `clear()` call. In my reading of the API and of usages like [this one in Expo](https://github.com/expo/expo/blob/23a905b17065703882ebeda1fc9f65a05cc69fa7/packages/expo-dev-menu-interface/android/src/main/java/expo/interfaces/devmenu/ReactHostWrapper.kt#L117), this should rarely occur in practice.

The plan:
1. D58811090: Add the basic `invalidate()` functionality.
2. **[This diff]**: Add `invalidate()` call sites where it makes sense in core.
3. [Upcoming diff]: Keep the Fusebox debugging target registered until the Host is explicitly invalidated.

Reviewed By: javache

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 986cf18.

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.

2 participants