From 331fab068355a3ba78776fbdf7e75ff4af3b740f Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 17 Jun 2025 09:38:21 -0700 Subject: [PATCH] Remove JSC related files from the repo (#51945) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51945 Remove code from jsc folder from React Native ## Changelog: [iOS][Removed] - Remove code from jsc folder from React Native Reviewed By: rshest Differential Revision: D76419587 fbshipit-source-id: 6d5079c8f2843872172620601629e9643c7debdc --- .../React/CxxBridge/JSCExecutorFactory.h | 31 ---------------- .../React/CxxBridge/JSCExecutorFactory.mm | 28 -------------- .../React/Runtime/RCTJscInstanceFactory.h | 20 ---------- .../React/Runtime/RCTJscInstanceFactory.mm | 20 ---------- .../ReactCommon/jsc/React-jsc.podspec | 37 ------------------- 5 files changed, 136 deletions(-) delete mode 100644 packages/react-native/React/CxxBridge/JSCExecutorFactory.h delete mode 100644 packages/react-native/React/CxxBridge/JSCExecutorFactory.mm delete mode 100644 packages/react-native/React/Runtime/RCTJscInstanceFactory.h delete mode 100644 packages/react-native/React/Runtime/RCTJscInstanceFactory.mm delete mode 100644 packages/react-native/ReactCommon/jsc/React-jsc.podspec diff --git a/packages/react-native/React/CxxBridge/JSCExecutorFactory.h b/packages/react-native/React/CxxBridge/JSCExecutorFactory.h deleted file mode 100644 index ebb32622787..00000000000 --- a/packages/react-native/React/CxxBridge/JSCExecutorFactory.h +++ /dev/null @@ -1,31 +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_FIT_RM_OLD_RUNTIME - -#include - -namespace facebook::react { - -class JSCExecutorFactory : public JSExecutorFactory { - public: - explicit JSCExecutorFactory(JSIExecutor::RuntimeInstaller runtimeInstaller) - : runtimeInstaller_(std::move(runtimeInstaller)) {} - - std::unique_ptr createJSExecutor( - std::shared_ptr delegate, - std::shared_ptr jsQueue) override; - - private: - JSIExecutor::RuntimeInstaller runtimeInstaller_; -}; - -} // namespace facebook::react - -#endif // RCT_FIT_RM_OLD_RUNTIME diff --git a/packages/react-native/React/CxxBridge/JSCExecutorFactory.mm b/packages/react-native/React/CxxBridge/JSCExecutorFactory.mm deleted file mode 100644 index 401df0d7247..00000000000 --- a/packages/react-native/React/CxxBridge/JSCExecutorFactory.mm +++ /dev/null @@ -1,28 +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 "JSCExecutorFactory.h" - -#ifndef RCT_FIT_RM_OLD_RUNTIME - -#import - -#import - -namespace facebook::react { - -std::unique_ptr JSCExecutorFactory::createJSExecutor( - std::shared_ptr delegate, - std::shared_ptr __unused jsQueue) -{ - return std::make_unique( - facebook::jsc::makeJSCRuntime(), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_); -} - -} // namespace facebook::react - -#endif // RCT_FIT_RM_OLD_RUNTIME diff --git a/packages/react-native/React/Runtime/RCTJscInstanceFactory.h b/packages/react-native/React/Runtime/RCTJscInstanceFactory.h deleted file mode 100644 index 7536407ab2f..00000000000 --- a/packages/react-native/React/Runtime/RCTJscInstanceFactory.h +++ /dev/null @@ -1,20 +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. - */ - -#import - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -JSRuntimeFactoryRef jsrt_create_jsc_factory(void); - -#ifdef __cplusplus -} -#endif diff --git a/packages/react-native/React/Runtime/RCTJscInstanceFactory.mm b/packages/react-native/React/Runtime/RCTJscInstanceFactory.mm deleted file mode 100644 index baca3caef11..00000000000 --- a/packages/react-native/React/Runtime/RCTJscInstanceFactory.mm +++ /dev/null @@ -1,20 +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. - */ - -#import "RCTJscInstanceFactory.h" -#import - -using namespace facebook::react; - -extern "C" { - -JSRuntimeFactoryRef jsrt_create_jsc_factory(void) -{ - return reinterpret_cast(new RCTJscInstance()); -} - -} // extern "C" diff --git a/packages/react-native/ReactCommon/jsc/React-jsc.podspec b/packages/react-native/ReactCommon/jsc/React-jsc.podspec deleted file mode 100644 index 22f3314a3be..00000000000 --- a/packages/react-native/ReactCommon/jsc/React-jsc.podspec +++ /dev/null @@ -1,37 +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. - -require "json" - -package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) -version = package['version'] - -source = { :git => 'https://github.com/facebook/react-native.git' } -if version == '1000.0.0' - # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. - source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") -else - source[:tag] = "v#{version}" -end - -Pod::Spec.new do |s| - s.name = "React-jsc" - s.version = version - s.summary = "JavaScriptCore engine for React Native" - s.homepage = "https://reactnative.dev/" - s.license = package["license"] - s.author = "Meta Platforms, Inc. and its affiliates" - s.platforms = min_supported_versions - s.source = source - s.source_files = "JSCRuntime.{cpp,h}" - s.exclude_files = "**/test/*" - s.weak_framework = "JavaScriptCore" - - s.dependency "React-jsi", version - - s.subspec "Fabric" do |ss| - ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)", "DEFINES_MODULE" => "YES" } - end -end