Remove dead internal class ClearableSynchronizedPool#57135
Open
sammy-SC wants to merge 6 commits into
Open
Conversation
Summary:
`JSIndexedRAMBundle` was a deprecated legacy-architecture class (annotated `[[deprecated("This API will be removed along with the legacy architecture.")]]` and guarded by `#ifndef RCT_REMOVE_LEGACY_ARCH`) for parsing indexed RAM bundles. It was only ever instantiated by `Instance::loadRAMBundleFromString` and `Instance::loadRAMBundleFromFile`, and those two `Instance` methods have no callers anywhere in fbsource: the old Android entry point `CatalystInstanceImpl` that used to call them has been deleted, and the new architecture (`ReactInstance` / bridgeless) routes `loadScriptFromFile` through `loadJSBundleFromFile` in the new runtime, never touching the legacy `Instance`. The only remaining user was its own unit test.
This removes `JSIndexedRAMBundle` and the two dead `Instance` RAM-bundle loaders that referenced it:
- Delete `JSIndexedRAMBundle.cpp`, `JSIndexedRAMBundle.h`, and `JSIndexedRAMBundleTest.cpp`.
- Remove `loadRAMBundleFromString` / `loadRAMBundleFromFile` from `Instance.cpp` / `Instance.h` and drop the now-unused include.
- Drop `JSIndexedRAMBundle.h` from `CXXREACT_PUBLIC_HEADERS` in `cxxreact/BUCK`.
- Update the committed C++ API snapshots accordingly.
The broader legacy RAM-bundle machinery (`RAMBundleRegistry`, `JSModulesUnbundle`, `Instance::loadRAMBundle`, `JSIExecutor::setBundleRegistry`) is left in place; it belongs to the same `RCT_REMOVE_LEGACY_ARCH` legacy bridge and can be removed as a follow-up.
Differential Revision: D108001933
Summary:
`Instance::loadRAMBundle` was a deprecated legacy-architecture method (annotated `[[deprecated("This API will be removed along with the legacy architecture.")]]` and guarded by `#ifndef RCT_REMOVE_LEGACY_ARCH`) that loaded a RAM bundle through a `RAMBundleRegistry`. It has no callers anywhere: the two `Instance` methods that used to feed the RAM-bundle path (`loadRAMBundleFromString` / `loadRAMBundleFromFile`) were already removed together with the `JSIndexedRAMBundle` parser, and nothing else ever invoked `loadRAMBundle` directly.
This removes the dead method and its public C++ API snapshot entries:
- Delete `Instance::loadRAMBundle` from `Instance.h` and `Instance.cpp`.
- Drop the `loadRAMBundle` line from the six committed C++ API snapshots.
The private `Instance::loadBundle` / `loadBundleSync` helpers are kept (still used by `loadScriptFromString` and `setSourceURL`), and the rest of the legacy RAM-bundle machinery (`RAMBundleRegistry`, `Instance::registerBundle` and its `NativeToJsBridge` chain) is left in place; it belongs to the same legacy bridge and can be removed as a follow-up.
Changelog: [Internal]
Summary: `Instance::supportsProfiling()` was declared in `Instance.h` but had no definition anywhere and no callers. A declared-but-never-defined non-virtual member function cannot be invoked (any use would be a link error), so this is unreachable dead code left over from an earlier refactor. This removes: - The `supportsProfiling()` declaration from `Instance.h`. - The corresponding entry from the six committed C++ API snapshots. Changelog: [Internal]
Summary: `Instance::initializeRuntime()` (the no-argument legacy `Instance` method) was declared in `Instance.h` but had no definition and no callers. `Instance::initializeBridge` calls `nativeToJsBridge_->initializeRuntime()` — a different method on `NativeToJsBridge` — and the only `instance->initializeRuntime(...)` call site in the tree is the new-architecture `ReactInstance::initializeRuntime(options, callback)`, an unrelated class with a different signature. A declared-but-never-defined non-virtual member function cannot be invoked (any use would be a link error), so this is unreachable dead code. This removes: - The `initializeRuntime()` declaration from `Instance.h`. - The corresponding entry from the six committed C++ API snapshots. Changelog: [Internal]
Summary: `telemetryTimePointToSecondsSinceEpoch()` in `ReactCommon/react/utils/Telemetry.h` was a `static inline` helper that converted a `TelemetryTimePoint` to seconds since the UNIX epoch, but it had no callers anywhere. This is a pure dead-code removal. The sibling `clockCast` helper it used is left in place (it remains part of the public API surface). Changelog: [Internal] Differential Revision: D108012910
7e29e56 to
890cdd7
Compare
Summary: `ClearableSynchronizedPool` (an `internal` Kotlin class in `ReactAndroid/.../common/`) was a variant of androidx `Pools.SynchronizedPool` adding a `clear()` method, but it was never instantiated or referenced anywhere. The live event pools (`OnLayoutEvent`, `PointerEvent`, `TouchEvent`, `ScrollEvent`) use androidx `SynchronizedPool` directly. This removes the orphaned class. Changelog: [Internal] Differential Revision: D108012905
890cdd7 to
5103c1f
Compare
|
@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108012905. |
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:
ClearableSynchronizedPool(aninternalKotlin class inReactAndroid/.../common/) was a variant of androidxPools.SynchronizedPooladding aclear()method, but it was never instantiated or referenced anywhere. The live event pools (OnLayoutEvent,PointerEvent,TouchEvent,ScrollEvent) use androidxSynchronizedPooldirectly. This removes the orphaned class.Changelog: [Internal]
Differential Revision: D108012905