From f73384c4384cbf605cf53d8e1ea2ce77e758cbdf Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 03:13:06 -0700 Subject: [PATCH 1/9] Remove dead JSIndexedRAMBundle from cxxreact 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 --- .../ReactCommon/cxxreact/Instance.cpp | 25 --- .../ReactCommon/cxxreact/Instance.h | 2 - .../cxxreact/JSIndexedRAMBundle.cpp | 145 ------------------ .../ReactCommon/cxxreact/JSIndexedRAMBundle.h | 72 --------- .../cxxreact/tests/JSIndexedRAMBundleTest.cpp | 76 --------- .../api-snapshots/ReactAndroidDebugCxx.api | 10 -- .../api-snapshots/ReactAndroidReleaseCxx.api | 10 -- .../api-snapshots/ReactAppleDebugCxx.api | 10 -- .../api-snapshots/ReactAppleReleaseCxx.api | 10 -- .../api-snapshots/ReactCommonDebugCxx.api | 10 -- .../api-snapshots/ReactCommonReleaseCxx.api | 10 -- 11 files changed, 380 deletions(-) delete mode 100644 packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp delete mode 100644 packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.h delete mode 100644 packages/react-native/ReactCommon/cxxreact/tests/JSIndexedRAMBundleTest.cpp diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.cpp b/packages/react-native/ReactCommon/cxxreact/Instance.cpp index d61f049076eb..4a67b17c33db 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.cpp +++ b/packages/react-native/ReactCommon/cxxreact/Instance.cpp @@ -20,7 +20,6 @@ #include "RecoverableError.h" #include "TraceSection.h" -#include #include #include @@ -175,30 +174,6 @@ void Instance::loadScriptFromString( } } -void Instance::loadRAMBundleFromString( - std::unique_ptr script, - const std::string& sourceURL) { - auto bundle = std::make_unique(std::move(script)); - auto startupScript = bundle->getStartupCode(); - auto registry = RAMBundleRegistry::singleBundleRegistry(std::move(bundle)); - loadRAMBundle(std::move(registry), std::move(startupScript), sourceURL, true); -} - -void Instance::loadRAMBundleFromFile( - const std::string& sourcePath, - const std::string& sourceURL, - bool loadSynchronously) { - auto bundle = std::make_unique(sourcePath.c_str()); - auto startupScript = bundle->getStartupCode(); - auto registry = RAMBundleRegistry::multipleBundlesRegistry( - std::move(bundle), JSIndexedRAMBundle::buildFactory()); - loadRAMBundle( - std::move(registry), - std::move(startupScript), - sourceURL, - loadSynchronously); -} - void Instance::loadRAMBundle( std::unique_ptr bundleRegistry, std::unique_ptr startupScript, diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.h b/packages/react-native/ReactCommon/cxxreact/Instance.h index 501810e69ada..a8026d0aaec7 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.h +++ b/packages/react-native/ReactCommon/cxxreact/Instance.h @@ -57,8 +57,6 @@ class RN_EXPORT [[deprecated("This API will be removed along with the legacy arc void setSourceURL(std::string sourceURL); void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); - void loadRAMBundleFromString(std::unique_ptr script, const std::string &sourceURL); - void loadRAMBundleFromFile(const std::string &sourcePath, const std::string &sourceURL, bool loadSynchronously); void loadRAMBundle( std::unique_ptr bundleRegistry, std::unique_ptr startupScript, diff --git a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp b/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp deleted file mode 100644 index c17685de39fd..000000000000 --- a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "JSIndexedRAMBundle.h" - -#ifndef RCT_REMOVE_LEGACY_ARCH - -#include -#include -#include -#include -#include - -#include - -namespace facebook::react { - -namespace { -uint32_t littleEndianToHost(uint32_t value) { - if constexpr (std::endian::native == std::endian::big) { - return (value << 24) | ((value & 0x0000FF00U) << 8) | - ((value & 0x00FF0000U) >> 8) | (value >> 24); - } - return value; -} -} // namespace - -std::function(std::string)> -JSIndexedRAMBundle::buildFactory() { - return [](const std::string& bundlePath) { - return std::make_unique(bundlePath.c_str()); - }; -} - -JSIndexedRAMBundle::JSIndexedRAMBundle(const char* sourcePath) { - m_bundle = std::make_unique(sourcePath, std::ifstream::binary); - if (!m_bundle) { - throw std::ios_base::failure( - std::string("Bundle ") + sourcePath + - "cannot be opened: " + std::to_string(m_bundle->rdstate())); - } - init(); -} - -JSIndexedRAMBundle::JSIndexedRAMBundle( - std::unique_ptr script) { - // tmpStream is needed because m_bundle is std::istream type - // which has no member 'write' - std::unique_ptr tmpStream = - std::make_unique(); - tmpStream->write(script->c_str(), script->size()); - m_bundle = std::move(tmpStream); - if (!m_bundle) { - throw std::ios_base::failure( - "Bundle from string cannot be opened: " + - std::to_string(m_bundle->rdstate())); - } - init(); -} - -void JSIndexedRAMBundle::init() { - // read in magic header, number of entries, and length of the startup section - uint32_t header[3]; - static_assert( - sizeof(header) == 12, - "header size must exactly match the input file format"); - - readBundle(reinterpret_cast(header), sizeof(header)); - size_t numTableEntries = littleEndianToHost(header[1]); - std::streamsize startupCodeSize = littleEndianToHost(header[2]); - - // allocate memory for meta data and lookup table. - m_table = ModuleTable(numTableEntries); - m_baseOffset = sizeof(header) + m_table.byteLength(); - - // read the lookup table from the file - readBundle(reinterpret_cast(m_table.data.get()), m_table.byteLength()); - - // read the startup code - m_startupCode = std::make_unique(startupCodeSize - 1); - - readBundle(m_startupCode->mutableData(), startupCodeSize - 1); -} - -JSIndexedRAMBundle::Module JSIndexedRAMBundle::getModule( - uint32_t moduleId) const { - Module ret; - ret.name = std::to_string(moduleId) + ".js"; - ret.code = getModuleCode(moduleId); - return ret; -} - -std::unique_ptr JSIndexedRAMBundle::getStartupCode() { - CHECK(m_startupCode) - << "startup code for a RAM Bundle can only be retrieved once"; - return std::move(m_startupCode); -} - -std::string JSIndexedRAMBundle::getModuleCode(const uint32_t id) const { - const auto moduleData = id < m_table.numEntries ? &m_table.data[id] : nullptr; - - // entries without associated code have offset = 0 and length = 0 - const uint32_t length = - moduleData != nullptr ? littleEndianToHost(moduleData->length) : 0; - if (length == 0) { - throw std::ios_base::failure( - "Error loading module" + std::to_string(id) + "from RAM Bundle"); - } - - std::string ret(length - 1, '\0'); - readBundle( - &ret.front(), - length - 1, - m_baseOffset + littleEndianToHost(moduleData->offset)); - return ret; -} - -void JSIndexedRAMBundle::readBundle(char* buffer, std::streamsize bytes) const { - if (!m_bundle->read(buffer, bytes)) { - if ((m_bundle->rdstate() & std::ios::eofbit) != 0) { - throw std::ios_base::failure("Unexpected end of RAM Bundle file"); - } - throw std::ios_base::failure( - "Error reading RAM Bundle: " + std::to_string(m_bundle->rdstate())); - } -} - -void JSIndexedRAMBundle::readBundle( - char* buffer, - const std::streamsize bytes, - const std::ifstream::pos_type position) const { - if (!m_bundle->seekg(position)) { - throw std::ios_base::failure( - "Error reading RAM Bundle: " + std::to_string(m_bundle->rdstate())); - } - readBundle(buffer, bytes); -} - -} // namespace facebook::react - -#endif // RCT_REMOVE_LEGACY_ARCH diff --git a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.h b/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.h deleted file mode 100644 index 715d85358849..000000000000 --- a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#ifndef RCT_REMOVE_LEGACY_ARCH - -#include -#include -#include -#include - -#include -#include - -#ifndef RN_EXPORT -#define RN_EXPORT __attribute__((visibility("default"))) -#endif - -namespace facebook::react { - -class RN_EXPORT [[deprecated("This API will be removed along with the legacy architecture.")]] JSIndexedRAMBundle - : public JSModulesUnbundle { - public: - static std::function(std::string)> buildFactory(); - - // Throws std::runtime_error on failure. - explicit JSIndexedRAMBundle(const char *sourcePath); - JSIndexedRAMBundle(std::unique_ptr script); - - // Throws std::runtime_error on failure. - std::unique_ptr getStartupCode(); - // Throws std::runtime_error on failure. - Module getModule(uint32_t moduleId) const override; - - private: - struct ModuleData { - uint32_t offset; - uint32_t length; - }; - static_assert(sizeof(ModuleData) == 8, "ModuleData must not have any padding and use sizes matching input files"); - - struct ModuleTable { - size_t numEntries; - std::unique_ptr data; - ModuleTable() : numEntries(0) {}; - ModuleTable(size_t entries) - : numEntries(entries), data(std::unique_ptr(new ModuleData[numEntries])) {}; - size_t byteLength() const - { - return numEntries * sizeof(ModuleData); - } - }; - - void init(); - std::string getModuleCode(uint32_t id) const; - void readBundle(char *buffer, std::streamsize bytes) const; - void readBundle(char *buffer, std::streamsize bytes, std::istream::pos_type position) const; - - mutable std::unique_ptr m_bundle; - ModuleTable m_table; - size_t m_baseOffset{}; - std::unique_ptr m_startupCode; -}; - -} // namespace facebook::react - -#endif // RCT_REMOVE_LEGACY_ARCH diff --git a/packages/react-native/ReactCommon/cxxreact/tests/JSIndexedRAMBundleTest.cpp b/packages/react-native/ReactCommon/cxxreact/tests/JSIndexedRAMBundleTest.cpp deleted file mode 100644 index 4c4cd90a7d21..000000000000 --- a/packages/react-native/ReactCommon/cxxreact/tests/JSIndexedRAMBundleTest.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include -#include -#include - -#include -#include -#include - -#ifndef RCT_REMOVE_LEGACY_ARCH - -using namespace facebook::react; - -namespace { -constexpr uint32_t kRAMBundleMagic = 0xFB0BD1E5; - -void appendLittleEndian32(std::string& out, uint32_t value) { - out.push_back(static_cast(value & 0xFF)); - out.push_back(static_cast((value >> 8) & 0xFF)); - out.push_back(static_cast((value >> 16) & 0xFF)); - out.push_back(static_cast((value >> 24) & 0xFF)); -} - -void appendNullTerminatedSection(std::string& out, const std::string& section) { - out += section; - out.push_back('\0'); -} -} // namespace - -TEST(JSIndexedRAMBundleTest, ReadsLittleEndianStartupAndModules) { - const std::string startup = "var startup = true;"; - const std::string moduleZero = "module zero code"; - const std::string moduleOne = "m1"; - - const auto startupCodeSize = static_cast(startup.size() + 1); - const auto lengthZero = static_cast(moduleZero.size() + 1); - const auto lengthOne = static_cast(moduleOne.size() + 1); - const uint32_t offsetZero = startupCodeSize; - const uint32_t offsetOne = offsetZero + lengthZero; - - std::string bundle; - appendLittleEndian32(bundle, kRAMBundleMagic); - appendLittleEndian32(bundle, 2); - appendLittleEndian32(bundle, startupCodeSize); - appendLittleEndian32(bundle, offsetZero); - appendLittleEndian32(bundle, lengthZero); - appendLittleEndian32(bundle, offsetOne); - appendLittleEndian32(bundle, lengthOne); - appendNullTerminatedSection(bundle, startup); - appendNullTerminatedSection(bundle, moduleZero); - appendNullTerminatedSection(bundle, moduleOne); - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - JSIndexedRAMBundle ramBundle(std::make_unique(bundle)); - - const auto startupCode = ramBundle.getStartupCode(); - EXPECT_EQ(std::string(startupCode->c_str(), startupCode->size()), startup); - - const auto firstModule = ramBundle.getModule(0); - EXPECT_EQ(firstModule.name, "0.js"); - EXPECT_EQ(firstModule.code, moduleZero); - - const auto secondModule = ramBundle.getModule(1); - EXPECT_EQ(secondModule.name, "1.js"); - EXPECT_EQ(secondModule.code, moduleOne); -#pragma GCC diagnostic pop -} - -#endif // RCT_REMOVE_LEGACY_ARCH diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index c44d48b62522..032f7dd1c76c 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -2727,8 +2727,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -3004,14 +3002,6 @@ class facebook::react::JSINativeModules { public void reset(); } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index c56d1e02cff1..59d13ef89625 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -2724,8 +2724,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -3001,14 +2999,6 @@ class facebook::react::JSINativeModules { public void reset(); } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index cc1a910e081e..16b939771c84 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -5134,8 +5134,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -5281,14 +5279,6 @@ class facebook::react::JSIRuntimeHolder : public facebook::react::JSRuntime { public virtual facebook::jsi::Runtime& getRuntime() noexcept override; } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 1fd3e340c7d5..024be03a5faf 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -5131,8 +5131,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -5278,14 +5276,6 @@ class facebook::react::JSIRuntimeHolder : public facebook::react::JSRuntime { public virtual facebook::jsi::Runtime& getRuntime() noexcept override; } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 6f3564afb730..9463e781a003 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -1846,8 +1846,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -1988,14 +1986,6 @@ class facebook::react::JSINativeModules { public void reset(); } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index ccc712d9617d..caa722b7836c 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -1843,8 +1843,6 @@ class facebook::react::Instance { public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); - public void loadRAMBundleFromFile(const std::string& sourcePath, const std::string& sourceURL, bool loadSynchronously); - public void loadRAMBundleFromString(std::unique_ptr script, const std::string& sourceURL); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); @@ -1985,14 +1983,6 @@ class facebook::react::JSINativeModules { public void reset(); } -class facebook::react::JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { - public JSIndexedRAMBundle(const char* sourcePath); - public JSIndexedRAMBundle(std::unique_ptr script); - public static std::function(std::string)> buildFactory(); - public std::unique_ptr getStartupCode(); - public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const override; -} - class facebook::react::JSModulesUnbundle { public JSModulesUnbundle(); public virtual facebook::react::JSModulesUnbundle::Module getModule(uint32_t moduleId) const = 0; From c9b3243aa0d5eff1ae78084ea4a972510d4d6d8f Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 04:32:52 -0700 Subject: [PATCH 2/9] Remove dead Instance::loadRAMBundle from cxxreact 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] --- .../ReactCommon/cxxreact/Instance.cpp | 18 ------------------ .../ReactCommon/cxxreact/Instance.h | 5 ----- .../api-snapshots/ReactAndroidDebugCxx.api | 1 - .../api-snapshots/ReactAndroidReleaseCxx.api | 1 - .../api-snapshots/ReactAppleDebugCxx.api | 1 - .../api-snapshots/ReactAppleReleaseCxx.api | 1 - .../api-snapshots/ReactCommonDebugCxx.api | 1 - .../api-snapshots/ReactCommonReleaseCxx.api | 1 - 8 files changed, 29 deletions(-) diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.cpp b/packages/react-native/ReactCommon/cxxreact/Instance.cpp index 4a67b17c33db..990601519cb6 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.cpp +++ b/packages/react-native/ReactCommon/cxxreact/Instance.cpp @@ -174,24 +174,6 @@ void Instance::loadScriptFromString( } } -void Instance::loadRAMBundle( - std::unique_ptr bundleRegistry, - std::unique_ptr startupScript, - std::string startupScriptSourceURL, - bool loadSynchronously) { - if (loadSynchronously) { - loadBundleSync( - std::move(bundleRegistry), - std::move(startupScript), - std::move(startupScriptSourceURL)); - } else { - loadBundle( - std::move(bundleRegistry), - std::move(startupScript), - std::move(startupScriptSourceURL)); - } -} - void Instance::setGlobalVariable( std::string propName, std::unique_ptr jsonValue) { diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.h b/packages/react-native/ReactCommon/cxxreact/Instance.h index a8026d0aaec7..911445e74a86 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.h +++ b/packages/react-native/ReactCommon/cxxreact/Instance.h @@ -57,11 +57,6 @@ class RN_EXPORT [[deprecated("This API will be removed along with the legacy arc void setSourceURL(std::string sourceURL); void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); - void loadRAMBundle( - std::unique_ptr bundleRegistry, - std::unique_ptr startupScript, - std::string startupScriptSourceURL, - bool loadSynchronously); bool supportsProfiling(); void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); void *getJavaScriptContext(); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 032f7dd1c76c..41b59735e39a 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -2726,7 +2726,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 59d13ef89625..a12a130a5451 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -2723,7 +2723,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 16b939771c84..1f8d3c618908 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -5133,7 +5133,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 024be03a5faf..e8a103701879 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -5130,7 +5130,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 9463e781a003..5975cc160c48 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -1845,7 +1845,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index caa722b7836c..de44355d40d7 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -1842,7 +1842,6 @@ class facebook::react::Instance { public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); public void initializeRuntime(); - public void loadRAMBundle(std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL, bool loadSynchronously); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); From 16e1154acdceb4da30e4dcf37dec2f47e5f6e7dd Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 04:38:56 -0700 Subject: [PATCH 3/9] Remove dead Instance::supportsProfiling declaration 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] --- packages/react-native/ReactCommon/cxxreact/Instance.h | 1 - scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api | 1 - 7 files changed, 7 deletions(-) diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.h b/packages/react-native/ReactCommon/cxxreact/Instance.h index 911445e74a86..4ccd2a14d91d 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.h +++ b/packages/react-native/ReactCommon/cxxreact/Instance.h @@ -57,7 +57,6 @@ class RN_EXPORT [[deprecated("This API will be removed along with the legacy arc void setSourceURL(std::string sourceURL); void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); - bool supportsProfiling(); void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); void *getJavaScriptContext(); bool isInspectable(); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 41b59735e39a..c88f3ba769e3 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -2715,7 +2715,6 @@ class facebook::react::InspectorNetworkRequestListener : public jni::HybridClass class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index a12a130a5451..478989eb2cd2 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -2712,7 +2712,6 @@ class facebook::react::InspectorNetworkRequestListener : public jni::HybridClass class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 1f8d3c618908..b5830d68183a 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -5122,7 +5122,6 @@ class facebook::react::InputAccessoryState { class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index e8a103701879..4d3798bf3178 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -5119,7 +5119,6 @@ class facebook::react::InputAccessoryState { class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 5975cc160c48..d6667ff8b604 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -1834,7 +1834,6 @@ class facebook::react::InputAccessoryState { class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index de44355d40d7..74ec66126eca 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -1831,7 +1831,6 @@ class facebook::react::InputAccessoryState { class facebook::react::Instance { public bool isBatchActive(); public bool isInspectable(); - public bool supportsProfiling(); public const facebook::react::ModuleRegistry& getModuleRegistry() const; public facebook::react::ModuleRegistry& getModuleRegistry(); public facebook::react::RuntimeExecutor getRuntimeExecutor(); From 2cbe6b5fe69dd3d14a7aa6f630e9676c60984773 Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 04:40:06 -0700 Subject: [PATCH 4/9] Remove dead Instance::initializeRuntime declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] --- packages/react-native/ReactCommon/cxxreact/Instance.h | 2 -- scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api | 1 - 7 files changed, 8 deletions(-) diff --git a/packages/react-native/ReactCommon/cxxreact/Instance.h b/packages/react-native/ReactCommon/cxxreact/Instance.h index 4ccd2a14d91d..3b03ba8d9330 100644 --- a/packages/react-native/ReactCommon/cxxreact/Instance.h +++ b/packages/react-native/ReactCommon/cxxreact/Instance.h @@ -52,8 +52,6 @@ class RN_EXPORT [[deprecated("This API will be removed along with the legacy arc std::shared_ptr moduleRegistry, jsinspector_modern::HostTarget *inspectorTarget = nullptr); - void initializeRuntime(); - void setSourceURL(std::string sourceURL); void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index c88f3ba769e3..3515f0ba1410 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -2724,7 +2724,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 478989eb2cd2..e5ed7dcf5341 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -2721,7 +2721,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index b5830d68183a..14ac6104206f 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -5131,7 +5131,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 4d3798bf3178..896efbead49a 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -5128,7 +5128,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index d6667ff8b604..9aec134fc543 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -1843,7 +1843,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 74ec66126eca..0b2740b83086 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -1840,7 +1840,6 @@ class facebook::react::Instance { public void callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params); public void handleMemoryPressure(int pressureLevel); public void initializeBridge(std::unique_ptr callback, std::shared_ptr jsef, std::shared_ptr jsQueue, std::shared_ptr moduleRegistry, facebook::react::jsinspector_modern::HostTarget* inspectorTarget = nullptr); - public void initializeRuntime(); public void loadScriptFromString(std::unique_ptr string, std::string sourceURL, bool loadSynchronously); public void registerBundle(uint32_t bundleId, const std::string& bundlePath); public void setGlobalVariable(std::string propName, std::unique_ptr jsonValue); From 51461e6093dd626e88f3d51e82ed543f74d516a4 Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 06:15:09 -0700 Subject: [PATCH 5/9] Remove dead telemetryTimePointToSecondsSinceEpoch helper 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 --- .../ReactCommon/react/utils/Telemetry.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/react-native/ReactCommon/react/utils/Telemetry.h b/packages/react-native/ReactCommon/react/utils/Telemetry.h index ac4c6a1eec8f..d7ebf2b0e82c 100644 --- a/packages/react-native/ReactCommon/react/utils/Telemetry.h +++ b/packages/react-native/ReactCommon/react/utils/Telemetry.h @@ -81,19 +81,6 @@ DestinationTimePointT clockCast(SourceTimePointT timePoint) timePoint - sourseClockNow + destinationClockNow); } -/* - * Returns a number of seconds that passed from the UNIX Epoch starting time - * point to a given time point. - * Also known as POSIX time or UNIX Timestamp. - */ -static inline double telemetryTimePointToSecondsSinceEpoch(TelemetryTimePoint timePoint) -{ - auto systemClockTimePoint = clockCast(timePoint); - return (double)std::chrono::duration_cast(systemClockTimePoint.time_since_epoch()) - .count() / - 1000000.0; -} - /* * Returns a number of milliseconds that represents the given duration object. */ From 4488b71a8444e00c67b8c5d30200960e92e168f2 Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 06:15:09 -0700 Subject: [PATCH 6/9] Remove dead internal class ClearableSynchronizedPool 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 --- .../react/common/ClearableSynchronizedPool.kt | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt deleted file mode 100644 index 16e79301734a..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.common - -import androidx.core.util.Pools.Pool - -/** - * Like [androidx.core.util.Pools.SynchronizedPool] with the option to clear the pool (e.g. on - * memory pressure). - */ -internal class ClearableSynchronizedPool(maxSize: Int) : Pool { - - private val pool: Array = arrayOfNulls(maxSize) - private var size = 0 - - @Synchronized - @Suppress("UNCHECKED_CAST", "KotlinGenericsCast") - override fun acquire(): T? { - if (size == 0) { - return null - } - size-- - val lastIndex = size - val toReturn = pool[lastIndex] as T - pool[lastIndex] = null - return toReturn - } - - @Synchronized - override fun release(instance: T): Boolean { - if (size == pool.size) { - return false - } - pool[size] = instance - size++ - return true - } - - @Synchronized - fun clear(): Unit { - for (i in 0 until size) { - pool[i] = null - } - size = 0 - } -} From a6f3ddd8e5bad60c54e2ce3cc0519761f3934530 Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 06:15:09 -0700 Subject: [PATCH 7/9] Remove dead test-only method simulateAttachForTesting from ReactRootView 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 --- .../java/com/facebook/react/ReactRootView.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index a6188100c52e..f55eca6e4a7a 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -776,22 +776,6 @@ public void runApplication() { } } - /** - * Is used by unit test to setup mIsAttachedToWindow flags, that will let this view to be properly - * attached to catalyst instance by startReactApplication call - */ - @VisibleForTesting - /* package */ void simulateAttachForTesting() { - mIsAttachedToInstance = true; - mJSTouchDispatcher = new JSTouchDispatcher(this); - if (ReactFeatureFlags.dispatchPointerEvents) { - mJSPointerDispatcher = new JSPointerDispatcher(this); - } - if (ReactNativeFeatureFlags.enableKeyEvents()) { - mJSKeyDispatcher = new JSKeyDispatcher(); - } - } - @VisibleForTesting /* package */ void simulateCheckForKeyboardForTesting() { getCustomGlobalLayoutListener().checkForKeyboardEvents(); From f6901706c341614710df77322bc028cbcbb6222e Mon Sep 17 00:00:00 2001 From: samuelsusla Date: Tue, 9 Jun 2026 06:15:09 -0700 Subject: [PATCH 8/9] Remove dead HostTargetController::installPerfIssuesBinding declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../ReactCommon/jsinspector-modern/HostTarget.h | 7 ------- scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api | 1 - 10 files changed, 16 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h b/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h index 55194fc98b61..7d0193d31087 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h @@ -252,13 +252,6 @@ class HostTargetController final { bool hasInstance() const; - /** - * [Experimental] Install a runtime binding subscribing to new Performance - * Issues, which we broadcast to the V2 Perf Monitor overlay via - * \ref HostTargetDelegate::unstable_onPerfIssueAdded. - */ - void installPerfIssuesBinding(); - /** * Increments the target's pause overlay counter. The counter represents the * exact number of Agents that have (concurrently) requested the pause diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 3515f0ba1410..d318be0b1128 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -10511,7 +10511,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index dd01b050910f..4de47f9fc43f 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -10162,7 +10162,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index e5ed7dcf5341..ca5e2d3e2267 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -10364,7 +10364,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 14ac6104206f..7cc36677e3b1 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -12405,7 +12405,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index b46962198fa4..478a14b5e94d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -12118,7 +12118,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 896efbead49a..c685c98f7a5b 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -12268,7 +12268,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 9aec134fc543..ed1c209816f6 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -7566,7 +7566,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 8f00ecd9e8d5..1e211b6392e7 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -7419,7 +7419,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 0b2740b83086..803a5f9fe3e2 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -7557,7 +7557,6 @@ class facebook::react::jsinspector_modern::HostTargetController { public facebook::react::jsinspector_modern::HostTargetDelegate& getDelegate(); public facebook::react::jsinspector_modern::tracing::HostTracingProfile stopTracing(); public void incrementPauseOverlayCounter(); - public void installPerfIssuesBinding(); } class facebook::react::jsinspector_modern::HostTargetDelegate : public facebook::react::jsinspector_modern::LoadNetworkResourceDelegate { From e0aa800f0852eecad8f250bf776a9ae2d4cf2d4b Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 9 Jun 2026 06:41:25 -0700 Subject: [PATCH 9/9] Remove dead RAMBundleRegistry::singleBundleRegistry factory (#57143) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/57143 `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 --- .../react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp | 5 ----- .../react-native/ReactCommon/cxxreact/RAMBundleRegistry.h | 1 - scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api | 1 - scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api | 1 - 8 files changed, 12 deletions(-) diff --git a/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp b/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp index 29ff28857055..b105676cc9f4 100644 --- a/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp +++ b/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp @@ -20,11 +20,6 @@ namespace facebook::react { constexpr uint32_t RAMBundleRegistry::MAIN_BUNDLE_ID; #pragma clang diagnostic pop -std::unique_ptr RAMBundleRegistry::singleBundleRegistry( - std::unique_ptr mainBundle) { - return std::make_unique(std::move(mainBundle)); -} - std::unique_ptr RAMBundleRegistry::multipleBundlesRegistry( std::unique_ptr mainBundle, std::function(std::string)> factory) { diff --git a/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.h b/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.h index 7951bf3dc3d8..434855471b8b 100644 --- a/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.h +++ b/packages/react-native/ReactCommon/cxxreact/RAMBundleRegistry.h @@ -27,7 +27,6 @@ class RN_EXPORT [[deprecated("This API will be removed along with the legacy arc public: constexpr static uint32_t MAIN_BUNDLE_ID = 0; - static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); static std::unique_ptr multipleBundlesRegistry( std::unique_ptr mainBundle, std::function(std::string)> factory); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index d318be0b1128..33a4d790b770 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -4177,7 +4177,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); } diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index ca5e2d3e2267..95df33b72a15 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -4174,7 +4174,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 7cc36677e3b1..e65661b46002 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -6358,7 +6358,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index c685c98f7a5b..edbd6daf94d9 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -6355,7 +6355,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); } diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index ed1c209816f6..5900ceaebb48 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -2758,7 +2758,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); } diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 803a5f9fe3e2..ce4cc1352d70 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -2755,7 +2755,6 @@ class facebook::react::RAMBundleRegistry { public facebook::react::RAMBundleRegistry& operator=(facebook::react::RAMBundleRegistry&&) = default; public static constexpr uint32_t MAIN_BUNDLE_ID; public static std::unique_ptr multipleBundlesRegistry(std::unique_ptr mainBundle, std::function(std::string)> factory); - public static std::unique_ptr singleBundleRegistry(std::unique_ptr mainBundle); public virtual ~RAMBundleRegistry() = default; public void registerBundle(uint32_t bundleId, std::string bundlePath); }