Skip to content

Remove dead RCTEnableImageStoreManagerStorageQueue declaration#57141

Open
sammy-SC wants to merge 15 commits into
facebook:mainfrom
sammy-SC:export-D108012909
Open

Remove dead RCTEnableImageStoreManagerStorageQueue declaration#57141
sammy-SC wants to merge 15 commits into
facebook:mainfrom
sammy-SC:export-D108012909

Conversation

@sammy-SC

@sammy-SC sammy-SC commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary:
RCTImageStoreManager.h declared RCT_EXTERN void RCTEnableImageStoreManagerStorageQueue(BOOL enabled);, but no definition exists anywhere in the tree and nothing calls it. A declared-but-never-defined external function is uncallable (any use would be a link error), so this is unreachable dead code.

Changelog: [Internal]

Differential Revision: D108012909

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 9, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 9, 2026
@meta-codesync

meta-codesync Bot commented Jun 9, 2026

Copy link
Copy Markdown

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108012909.

sammy-SC added 15 commits June 9, 2026 06:30
Summary:
Pull Request resolved: facebook#57133

`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.

Changelog: [Internal]

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
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
Summary:
`ReactRootView.simulateAttachForTesting()` was a package-private `VisibleForTesting` helper that set up the attach flags and dispatchers, but no test or production code ever called it. `RootViewTest` exercises `startReactApplication`/`unmountReactApplication` and the sibling `simulateCheckForKeyboardForTesting`, never this method. This removes the orphaned helper.

Changelog: [Internal]

Differential Revision: D108012908
Summary:
`HostTargetController::installPerfIssuesBinding()` was declared in `jsinspector-modern/HostTarget.h` but had no definition anywhere and no callers. (`HostTargetController` is `final`, so the method is not an override.) A declared-but-never-defined non-virtual member cannot be invoked — any call would be a link error — so this is unreachable dead code. The unrelated, live `HostTarget::installPerfIssuesBinding` (a different class) is left intact.

Changelog: [Internal]

Differential Revision: D108012907
Summary:
`RAMBundleRegistry::singleBundleRegistry` was a static factory that wrapped the public `RAMBundleRegistry` constructor, but it had no callers anywhere. Objects are constructed via the public constructor directly. This removes the orphaned factory; the sibling `multipleBundlesRegistry`, the constructor, `MAIN_BUNDLE_ID`, `registerBundle`, `getModule`, and `getBundle` are all left intact.

Changelog: [Internal]

Differential Revision: D108012903
Summary:
`RAMBundleRegistry::multipleBundlesRegistry` was a static factory wrapping the public `RAMBundleRegistry` constructor (the one taking a main bundle plus a factory callback), but it had no callers anywhere. Registries are constructed via the public constructor directly. With the sibling `singleBundleRegistry` already removed, this deletes the last orphaned static factory; the constructor and the rest of the class remain intact.

Changelog: [Internal]

Differential Revision: D108012906
Summary:
`StartupLogger::getRunJSBundleEndTime()` was a public getter that returned the `runJSBundleEndTime` member, but it had no callers. `NativePerformance` is the only consumer of `StartupLogger` and reads the start-time getters plus `getAppStartupEndTime`, never this end-time getter. This removes the dead getter. The backing member `runJSBundleEndTime` is kept because `logStartupEvent`/`reset` still write it.

Changelog: [Internal]

Differential Revision: D108012912
Summary:
`StartupLogger::getInitReactRuntimeEndTime()` was a public getter returning the `initReactRuntimeEndTime` member, but it had no callers. `NativePerformance` (the only consumer of `StartupLogger`) never reads it. This removes the dead getter; the backing member `initReactRuntimeEndTime` is kept because `logStartupEvent`/`reset` still write it.

Changelog: [Internal]

Differential Revision: D108012904
Summary:
`getWarningHighlightColor` in `LogBox/UI/LogBoxStyle.js` was an exported color helper with no importers. It is a duplicate of the live `getHighlightColor` (identical `rgba(252, 176, 29, ...)` value), which is the one actually used by LogBox UI. This removes the dead duplicate.

Changelog: [Internal]

Differential Revision: D108012913
Summary:
`RCTJSCSetOptionType` was a file-local `using` alias (`BOOL (*)(const char *)`) in `RCTPerfMonitor.mm` that was never referenced. The concrete `RCTJSCSetOption` function is called directly at its two call sites; no code ever used the function-pointer typedef. This removes the dead alias.

Changelog: [Internal]

Differential Revision: D108012902
Summary:
`RCTImageStoreManager.h` declared `RCT_EXTERN void RCTEnableImageStoreManagerStorageQueue(BOOL enabled);`, but no definition exists anywhere in the tree and nothing calls it. A declared-but-never-defined external function is uncallable (any use would be a link error), so this is unreachable dead code.

Changelog: [Internal]

Differential Revision: D108012909
@sammy-SC sammy-SC force-pushed the export-D108012909 branch from c6bb063 to f3a96b0 Compare June 9, 2026 13:42
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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant