Delete legacy RCTNativeAnimatedModule from RN iOS - #57904
Open
christophpurrer wants to merge 1 commit into
Open
Conversation
Summary:
The Old Architecture has been deleted from React Native iOS, which makes the
legacy `RCTNativeAnimatedModule` unreachable:
- Its JS spec only requests `'NativeAnimatedModule'` when
`shouldUseTurboAnimatedModule()` is false, but `ReactInstance.cpp` sets
`RN$Bridgeless = true` unconditionally on iOS, so that branch never runs.
- Its only entry points were `-setBridge:` and `RCTUIManagerObserver`, and
`RCTBridge` is now an all-nil stub with `RCTCxxBridge` deleted.
- Nothing referenced it by filename except a single `legacy = True` Buck
plugin provider.
iOS Animated is served by `RCTNativeAnimatedTurboModule` (bridgeless ObjC) and
by the C++ `facebook::react::AnimatedModule` behind `cxxNativeAnimatedEnabled()`.
Deleted `RCTNativeAnimatedModule.h` / `.mm` and its registrations: the
`legacy = True` `react_module_plugin_providers` entry in
`xplat/js/react-native-github/BUCK`, the `RCTNativeAnimatedModuleCls` shim in
the `generated` `RCTAnimationPlugins.{h,mm}`, the `getCoreModuleClasses()`
entry in `RCTBridge.mm`, the `headers-include-baseline.json` entries, and the
`js1 rn-arch` codemod skip-list entry.
With the last bridge-dependent Animated consumer gone, also stripped the dead
bridge plumbing it was the only reason for:
- `RCTNativeAnimatedNodesManager -initWithBridge:surfacePresenter:` loses
`bridge:`.
- `RCTPropsAnimatedNode -connectToView:viewName:bridge:surfacePresenter:` loses
`bridge:` and the `RCTUIManager` fallback in `-updateView`, which collapses to
the single `synchronouslyUpdateViewOnUIThread:props:` call.
- `viewName:` goes too, since it was only used to look up a legacy view
manager. The C++ (`connectAnimatedNodeToView(Tag, Tag)`) and Kotlin
(`connectAnimatedNodeToView(animatedNodeTag, viewTag)`) nodes managers already
take two arguments, and the sole remaining ObjC caller passed `nil`.
`RCTNativeAnimatedTurboModule` is deliberately NOT renamed back to
`RCTNativeAnimatedModule` — that is a much wider rename, best done separately.
Changelog: [INTERNAL]
Differential Revision: D115663619
|
@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D115663619. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The Old Architecture has been deleted from React Native iOS, which makes the
legacy
RCTNativeAnimatedModuleunreachable:'NativeAnimatedModule'whenshouldUseTurboAnimatedModule()is false, butReactInstance.cppsetsRN$Bridgeless = trueunconditionally on iOS, so that branch never runs.-setBridge:andRCTUIManagerObserver, andRCTBridgeis now an all-nil stub withRCTCxxBridgedeleted.legacy = TrueBuckplugin provider.
iOS Animated is served by
RCTNativeAnimatedTurboModule(bridgeless ObjC) andby the C++
facebook::react::AnimatedModulebehindcxxNativeAnimatedEnabled().Deleted
RCTNativeAnimatedModule.h/.mmand its registrations: thelegacy = Truereact_module_plugin_providersentry inxplat/js/react-native-github/BUCK, theRCTNativeAnimatedModuleClsshim inthe
generatedRCTAnimationPlugins.{h,mm}, thegetCoreModuleClasses()entry in
RCTBridge.mm, theheaders-include-baseline.jsonentries, and thejs1 rn-archcodemod skip-list entry.With the last bridge-dependent Animated consumer gone, also stripped the dead
bridge plumbing it was the only reason for:
RCTNativeAnimatedNodesManager -initWithBridge:surfacePresenter:losesbridge:.RCTPropsAnimatedNode -connectToView:viewName:bridge:surfacePresenter:losesbridge:and theRCTUIManagerfallback in-updateView, which collapses tothe single
synchronouslyUpdateViewOnUIThread:props:call.viewName:goes too, since it was only used to look up a legacy viewmanager. The C++ (
connectAnimatedNodeToView(Tag, Tag)) and Kotlin(
connectAnimatedNodeToView(animatedNodeTag, viewTag)) nodes managers alreadytake two arguments, and the sole remaining ObjC caller passed
nil.RCTNativeAnimatedTurboModuleis deliberately NOT renamed back toRCTNativeAnimatedModule— that is a much wider rename, best done separately.Changelog: [INTERNAL]
Differential Revision: D115663619