Skip to content

Commit

Permalink
React-jsidynamic: Move JSIDynamic out of React-jsi
Browse files Browse the repository at this point in the history
Summary:
The jsi library itself is `jsi/jsi.{h,cpp}`. JSIDynamic provides support for converting between folly::dynamic and jsi::value, independent of the jsi library.

Changelog:
[iOS][Changed] Moved JSIDynamic out of React-jsi and into React-jsidynamic

Reviewed By: cipolleschi, dmytrorykun

Differential Revision: D40334023

fbshipit-source-id: d2c69e7afb7f43f93080301b88c81e1fa46279d7
  • Loading branch information
hramos authored and facebook-github-bot committed Oct 14, 2022
1 parent b7f0747 commit 0db5178
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Pod::Spec.new do |s|

s.subspec "core" do |ss|
ss.dependency folly_dep_name, folly_version
ss.dependency "React-jsidynamic", version
ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
ss.source_files = "react/renderer/core/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/core/tests"
Expand Down Expand Up @@ -302,6 +303,7 @@ Pod::Spec.new do |s|

s.subspec "uimanager" do |ss|
ss.dependency folly_dep_name, folly_version
ss.dependency "React-jsidynamic", version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/uimanager/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/uimanager/tests"
Expand Down
1 change: 1 addition & 0 deletions ReactCommon/ReactCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Pod::Spec.new do |s|
ss.subspec "core" do |sss|
sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}",
"react/nativemodule/core/platform/ios/**/*.{mm,cpp,h}"
sss.dependency "React-jsidynamic", version
end

s.subspec "react_debug_core" do |sss|
Expand Down
6 changes: 5 additions & 1 deletion ReactCommon/jsi/React-jsi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "12.4" }
s.source = source
s.source_files = "**/*.{cpp,h}"
s.exclude_files = "**/test/*"
s.exclude_files = [
"jsi/JSIDynamic.{h,cpp}",
"jsi/jsilib-*.{h,cpp}",
"**/test/*"
]
s.framework = "JavaScriptCore"
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\"" }
Expand Down
42 changes: 42 additions & 0 deletions ReactCommon/jsi/React-jsidynamic.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2021.07.22.00'
boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "React-jsidynamic"
s.version = version
s.summary = "Provides support for converting between folly::dynamic and jsi::value"
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "12.4" }
s.source = source
s.source_files = "jsi/JSIDynamic.{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\"" }
s.header_dir = 'jsi'

s.dependency "boost", "1.76.0"
s.dependency "DoubleConversion"
s.dependency "RCT-Folly", folly_version
s.dependency "glog"
s.dependency "React-jsi", version
end
1 change: 1 addition & 0 deletions ReactCommon/jsiexecutor/React-jsiexecutor.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Pod::Spec.new do |s|

s.dependency "React-cxxreact", version
s.dependency "React-jsi", version
s.dependency "React-jsidynamic", version
s.dependency "React-perflogger", version
s.dependency "RCT-Folly", folly_version
s.dependency "DoubleConversion"
Expand Down
24 changes: 19 additions & 5 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ PODS:
- RCTTypeSafety (= 1000.0.0)
- React-graphics (= 1000.0.0)
- React-jsi (= 1000.0.0)
- React-jsidynamic (= 1000.0.0)
- React-jsiexecutor (= 1000.0.0)
- ReactCommon/turbomodule/core (= 1000.0.0)
- React-Fabric/debug_core (1000.0.0):
Expand Down Expand Up @@ -593,6 +594,7 @@ PODS:
- RCTTypeSafety (= 1000.0.0)
- React-graphics (= 1000.0.0)
- React-jsi (= 1000.0.0)
- React-jsidynamic (= 1000.0.0)
- React-jsiexecutor (= 1000.0.0)
- ReactCommon/turbomodule/core (= 1000.0.0)
- React-Fabric/utils (1000.0.0):
Expand Down Expand Up @@ -633,12 +635,19 @@ PODS:
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-jsidynamic (1000.0.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-jsi (= 1000.0.0)
- React-jsiexecutor (1000.0.0):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 1000.0.0)
- React-jsi (= 1000.0.0)
- React-jsidynamic (= 1000.0.0)
- React-perflogger (= 1000.0.0)
- React-jsinspector (1000.0.0)
- React-logger (1000.0.0):
Expand Down Expand Up @@ -731,6 +740,7 @@ PODS:
- React-Core (= 1000.0.0)
- React-cxxreact (= 1000.0.0)
- React-jsi (= 1000.0.0)
- React-jsidynamic (= 1000.0.0)
- React-logger (= 1000.0.0)
- React-perflogger (= 1000.0.0)
- ReactCommon/turbomodule/samples (1000.0.0):
Expand Down Expand Up @@ -801,6 +811,7 @@ DEPENDENCIES:
- React-hermes (from `../../ReactCommon/hermes`)
- React-jsi (from `../../ReactCommon/jsi`)
- React-jsi/Fabric (from `../../ReactCommon/jsi`)
- React-jsidynamic (from `../../ReactCommon/jsi`)
- React-jsiexecutor (from `../../ReactCommon/jsiexecutor`)
- React-jsinspector (from `../../ReactCommon/jsinspector`)
- React-logger (from `../../ReactCommon/logger`)
Expand Down Expand Up @@ -884,6 +895,8 @@ EXTERNAL SOURCES:
:path: "../../ReactCommon/hermes"
React-jsi:
:path: "../../ReactCommon/jsi"
React-jsidynamic:
:path: "../../ReactCommon/jsi"
React-jsiexecutor:
:path: "../../ReactCommon/jsiexecutor"
React-jsinspector:
Expand Down Expand Up @@ -946,7 +959,7 @@ SPEC CHECKSUMS:
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 8aa7846f48430e8517285eb0ddf8a614eee39cb3
hermes-engine: 34601a4ede336b281b66fbcc4ec113c7813dbc9d
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
Expand All @@ -959,11 +972,12 @@ SPEC CHECKSUMS:
React-Core: ce4282fb714ffbe444b84d296d1728eaee4d0e9f
React-CoreModules: 675170bccf156da3a3348e04e2036ce401b2010d
React-cxxreact: 7276467c246302fedf598cc40d7003896ddb20ba
React-Fabric: a696c92be541f2015b9777956a3e7df8a8f34aed
React-Fabric: 141459e61c825acf02d26ece099acbd9cbd87b99
React-graphics: 5ccc9cc0d91794fd42bc1c693e9aea207554bbef
React-hermes: 7b9306aee1d58ba030614e54eb8041056119430f
React-jsi: a042596cb558abea721ab5e23cb175647610a73d
React-jsiexecutor: f7fbac5dff7e7ff110a66edf2626b4f4f4600ef5
React-jsi: c2a71fdc55642893768c517199fb8a71805159dc
React-jsidynamic: 2b14ac1b6d3a1b7daa1e5a424b98de87da981698
React-jsiexecutor: 14e899380e3fe9ca74c4e19727540a03e7574721
React-jsinspector: 7733dd522d044aef87caa39f3eda77593358a7eb
React-logger: c7960346b021767ed90971aff592a44e3d69f8bb
React-perflogger: c4fdd48988c2d3047186fc1bc1772d634cfca2ea
Expand All @@ -982,7 +996,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 0386f50996a153b3f39cecbe7d139763ac9a9fdf
React-rncore: 665c70690f404bbfa3948148de72689672a906d2
React-runtimeexecutor: 97dca9247f4d3cfe0733384b189c6930fbd402b7
ReactCommon: 8e39c4b24da570ea2b631accbf779b5891befe0c
ReactCommon: b1f213aa09e3dfd0a89389b5023fdb1cd6528e96
ScreenshotManager: 3fc534a218e7b8dde632158411d0f15b0ca8893c
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: 1b1a12ff3d86a10565ea7cbe057d42f5e5fb2a07
Expand Down
1 change: 1 addition & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def use_react_native! (
pod 'React-bridging', :path => "#{prefix}/ReactCommon"
pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact"
pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi"
pod 'React-jsidynamic', :path => "#{prefix}/ReactCommon/jsi"
pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"
pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker"
Expand Down

0 comments on commit 0db5178

Please sign in to comment.