Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion React/CxxBridge/JSCExecutorFactory.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "JSCExecutorFactory.h"

#import <jsi/JSCRuntime.h>
#import <jsc/JSCRuntime.h>

#import <memory>

Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/jscexecutor/OnLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include <fbjni/fbjni.h>
#include <jsi/JSCRuntime.h>
#include <jsc/JSCRuntime.h>
#include <jsireact/JSIExecutor.h>
#include <react/jni/JReactMarker.h>
#include <react/jni/JSLogging.h>
Expand Down
5 changes: 5 additions & 0 deletions ReactCommon/jsc/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '>
clang-diagnostic-*,
'
...
31 changes: 31 additions & 0 deletions ReactCommon/jsc/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load("//tools/build_defs/oss:rn_defs.bzl", "APPLE", "IOS", "MACOSX", "react_native_xplat_dep", "rn_xplat_cxx_library")

rn_xplat_cxx_library(
name = "JSCRuntime",
srcs = [
"JSCRuntime.cpp",
],
header_namespace = "jsi",
exported_headers = [
"JSCRuntime.h",
],
apple_sdks = (IOS, MACOSX),
compiler_flags_pedantic = True,
fbobjc_compiler_flags = [
"-Os",
],
fbobjc_frameworks = [
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
platforms = APPLE,
visibility = ["PUBLIC"],
xplat_mangled_args = {
"soname": "libjscjsi.$(ext)",
},
exported_deps = [
react_native_xplat_dep("jsi:jsi"),
],
)
30 changes: 30 additions & 0 deletions ReactCommon/jsc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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.

##################
### jscruntime ###
##################

cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(
-fexceptions
-frtti
-O3
-Wno-unused-lambda-capture
-DLOG_TAG=\"ReactNative\")

add_library(jscruntime STATIC
JSCRuntime.h
JSCRuntime.cpp)

target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_link_libraries(jscruntime folly_runtime jsc glog)

# TODO: Remove this flag when ready.
# Android has this enabled by default, but the flag is still needed for iOS.
target_compile_options(jscruntime PRIVATE -DRN_FABRIC_ENABLED)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ Pod::Spec.new do |s|
s.source_files = "JSCRuntime.{cpp,h}"
s.exclude_files = "**/test/*"
s.framework = "JavaScriptCore"
s.dependency "React-jsi", version
s.default_subspec = "Default"

s.subspec "Default" do
# no-op
end
s.dependency "React-jsi", version

s.subspec "Fabric" do |ss|
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" }
Expand Down
30 changes: 0 additions & 30 deletions ReactCommon/jsi/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,3 @@ rn_xplat_cxx_library(
react_native_xplat_dep("jsi:jsi"),
],
)

rn_xplat_cxx_library(
name = "JSCRuntime",
srcs = [
"JSCRuntime.cpp",
],
header_namespace = "jsi",
exported_headers = [
"JSCRuntime.h",
],
apple_sdks = (IOS, MACOSX),
compiler_flags_pedantic = True,
fbobjc_compiler_flags = [
"-Os",
],
fbobjc_frameworks = [
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
platforms = APPLE,
visibility = ["PUBLIC"],
xplat_mangled_args = {
"soname": "libjscjsi.$(ext)",
},
exported_deps = [
react_native_xplat_dep("jsi:jsi"),
],
)
6 changes: 3 additions & 3 deletions scripts/cocoapods/__tests__/jsengine-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_setupJsc_installsPods
# Assert
assert_equal($podInvocationCount, 2)
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-jsc"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-jsc"][:path], "../../ReactCommon/jsc")
end

def test_setupJsc_installsPods_installsFabricSubspecWhenFabricEnabled
Expand All @@ -57,8 +57,8 @@ def test_setupJsc_installsPods_installsFabricSubspecWhenFabricEnabled
# Assert
assert_equal($podInvocationCount, 3)
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-jsc"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-jsc/Fabric"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-jsc"][:path], "../../ReactCommon/jsc")
assert_equal($podInvocation["React-jsc/Fabric"][:path], "../../ReactCommon/jsc")
end

# ================== #
Expand Down
4 changes: 2 additions & 2 deletions scripts/cocoapods/jsengine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# @parameter fabric_enabled: whether Fabirc is enabled
def setup_jsc!(react_native_path: "../node_modules/react-native", fabric_enabled: false)
pod 'React-jsi', :path => "#{react_native_path}/ReactCommon/jsi"
pod 'React-jsc', :path => "#{react_native_path}/ReactCommon/jsi"
pod 'React-jsc', :path => "#{react_native_path}/ReactCommon/jsc"
if fabric_enabled
pod 'React-jsc/Fabric', :path => "#{react_native_path}/ReactCommon/jsi"
pod 'React-jsc/Fabric', :path => "#{react_native_path}/ReactCommon/jsc"
end
end

Expand Down