Skip to content

Commit

Permalink
feat: add jsitooling package
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Feb 12, 2025
1 parent 7926d65 commit 4684f64
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <JSITooling/JSRuntimeFactory.h>

@implementation RCTRootViewFactoryConfiguration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Pod::Spec.new do |s|
add_dependency(s, "React-debug")
add_dependency(s, "React-rendererdebug")
add_dependency(s, "React-featureflags")
add_dependency(s, "React-jsitooling")

depend_on_js_engine(s)
end
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ add_react_common_subdir(runtimeexecutor)
add_react_common_subdir(reactperflogger)
add_react_common_subdir(logger)
add_react_common_subdir(jsiexecutor)
add_react_common_subdir(jsitooling)
add_react_common_subdir(cxxreact)
add_react_common_subdir(jsc)
add_react_common_subdir(jsi)
Expand Down Expand Up @@ -163,6 +164,7 @@ add_library(reactnative
$<TARGET_OBJECTS:jni_lib_merge_glue>
$<TARGET_OBJECTS:jserrorhandler>
$<TARGET_OBJECTS:jsinspector>
$<TARGET_OBJECTS:jsitooling>
$<TARGET_OBJECTS:jsinspector_tracing>
$<TARGET_OBJECTS:jsireact>
$<TARGET_OBJECTS:logger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ target_merge_so(hermesinstancejni)

target_link_libraries(hermesinstancejni
hermes-engine::libhermes
jsitooling
fbjni
bridgelesshermes
reactnative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <fbjni/fbjni.h>
#include <jni.h>
#include <jsi/jsi.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>
#include <react/runtime/hermes/HermesInstance.h>
#include "../../jni/JJSRuntimeFactory.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ target_link_libraries(
react_featureflagsjni
turbomodulejsijni
jsi
jsitooling
fbjni
bridgeless
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <fbjni/fbjni.h>
#include <jni.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>

namespace facebook::react {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <react/jni/JRuntimeScheduler.h>
#include <react/jni/JSLoader.h>
#include <react/jni/ReadableNativeMap.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>
#include <react/runtime/PlatformTimerRegistry.h>
#include <react/runtime/ReactInstance.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <jsc/JSCRuntime.h>
#include <jsi/jsi.h>
#include <react/jni/ReadableNativeMap.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>
#include <react/runtime/jni/JJSRuntimeFactory.h>

namespace facebook::react {
Expand Down
20 changes: 20 additions & 0 deletions packages/react-native/ReactCommon/jsitooling/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-fexceptions)

file(GLOB jsitooling_SRC CONFIGURE_DEPENDS *.cpp)
add_library(jsitooling OBJECT ${jsitooling_SRC})

target_include_directories(jsitooling PUBLIC .)

target_link_libraries(jsitooling
react_cxxreact
folly_runtime
glog
jsi)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-jsitooling"
s.version = version
s.summary = "-" # TODO
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 = "*.{cpp,h}"
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
s.header_dir = "jsitooling"
s.module_name = "JSITooling"

s.dependency "React-cxxreact", version
s.dependency "React-jsi", version
s.dependency "RCT-Folly", folly_version
s.dependency "DoubleConversion"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "glog"
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
end
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Pod::Spec.new do |s|

s.dependency folly_dep_name, folly_version
s.dependency "React-jsiexecutor"
s.dependency "React-jsitooling"
s.dependency "React-cxxreact"
s.dependency "React-runtimeexecutor"
s.dependency "glog"
Expand All @@ -64,4 +65,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)

s.dependency "React-jsinspector"
s.dependency "React-jsitooling"
end
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ Pod::Spec.new do |s|

s.dependency "React-hermes"
s.dependency "hermes-engine"
s.dependency "React-jsitooling"
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <jsireact/JSIExecutor.h>
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
#include <react/runtime/BufferedRuntimeExecutor.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>
#include <react/runtime/TimerManager.h>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <cxxreact/MessageQueueThread.h>
#include <hermes/hermes.h>
#include <jsi/jsi.h>
#include <react/runtime/JSRuntimeFactory.h>
#include <jsitooling/JSRuntimeFactory.h>

namespace facebook::react {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Pod::Spec.new do |s|
s.dependency "React-jserrorhandler"
s.dependency "React-jsinspector"
s.dependency "React-featureflags"
s.dependency "React-jsitooling"

add_dependency(s, "React-RCTFBReactNativeSpec")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import <cxxreact/MessageQueueThread.h>
#import <hermes/Public/CrashManager.h>
#import <jsi/jsi.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <JSITooling/JSRuntimeFactory.h>
#import <react/runtime/hermes/HermesInstance.h>

namespace facebook::react {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <React/RCTDefines.h>
#import <react/renderer/core/ReactPrimitives.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <JSITooling/JSRuntimeFactory.h>

#import "RCTInstance.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import <React/RCTDefines.h>
#import <React/RCTJavaScriptLoader.h>
#import <jsinspector-modern/ReactCdp.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <JSITooling/JSRuntimeFactory.h>
#import <react/runtime/ReactInstance.h>

#import "RCTContextContainerHandling.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#import <react/utils/ContextContainer.h>
#import <react/utils/ManagedObjectWrapper.h>
#import <JSITooling/JSRuntimeFactory.h>

#import "ObjCTimerRegistry.h"
#import "RCTJSThreadManager.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <cxxreact/MessageQueueThread.h>
#import <jsi/jsi.h>
#import <react/runtime/JSRuntimeFactory.h>
#import <jsitooling/JSRuntimeFactory.h>

namespace facebook {
namespace react {
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/scripts/cocoapods/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ def self.react_native_pods
"React-jsi",
"React-jsiexecutor",
"React-jsinspector",
"React-jsitooling",
"React-logger",
"React-perflogger",
"React-rncore",
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def use_react_native! (

pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector-modern"
pod 'React-jsitooling', :path => "#{prefix}/ReactCommon/jsitooling"
pod 'React-jsinspectortracing', :path => "#{prefix}/ReactCommon/jsinspector-modern/tracing"

pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker"
Expand Down

0 comments on commit 4684f64

Please sign in to comment.