Skip to content

Commit b3040ec

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Restore Dynamic framework with Hermes in the Old Architecture
Summary: I discovered that 0.69 could run React Native as Dynamic framework with Hermes and starting from 0.70 that's not possible anymore. This diff restore that possibility. Notice that now Hermes provisdes JSI and Dynamic Frameworks requires that all the dependencies are explicitly defined, therefore, whenever we have a pod that depended on `React-jsi`, now it also has to explicitly depends on `hermes-engine` ## Changelog [iOS][Fixed] - Add Back dynamic framework support for the Old Architecture with Hermes Reviewed By: cortinico Differential Revision: D42829728 fbshipit-source-id: a660e3b1e346ec6cf3ceb8771dd8bceb0dbcb13a
1 parent da270d0 commit b3040ec

File tree

6 files changed

+37
-7
lines changed

6 files changed

+37
-7
lines changed

Libraries/Blob/React-RCTBlob.podspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@ Pod::Spec.new do |s|
4545
s.dependency "React-Core/RCTBlobHeaders", version
4646
s.dependency "React-Core/RCTWebSocket", version
4747
s.dependency "React-RCTNetwork", version
48+
49+
if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
50+
s.dependency "hermes-engine"
51+
end
4852
end

React-Core.podspec

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,20 @@ Pod::Spec.new do |s|
7575

7676
s.subspec "Default" do |ss|
7777
ss.source_files = "React/**/*.{c,h,m,mm,S,cpp}"
78-
ss.exclude_files = "React/CoreModules/**/*",
79-
"React/DevSupport/**/*",
80-
"React/Fabric/**/*",
81-
"React/FBReactNativeSpec/**/*",
82-
"React/Tests/**/*",
83-
"React/Inspector/**/*"
78+
exclude_files = [
79+
"React/CoreModules/**/*",
80+
"React/DevSupport/**/*",
81+
"React/Fabric/**/*",
82+
"React/FBReactNativeSpec/**/*",
83+
"React/Tests/**/*",
84+
"React/Inspector/**/*"
85+
]
86+
# If we are using Hermes (the default is use hermes, so USE_HERMES can be nil), we don't have jsc installed
87+
# So we have to exclude the JSCExecutorFactory
88+
if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
89+
exclude_files = exclude_files.append("React/CxxBridge/JSCExecutorFactory.{h,mm}")
90+
end
91+
ss.exclude_files = exclude_files
8492
ss.private_header_files = "React/Cxx*/*.h"
8593
end
8694

@@ -117,5 +125,8 @@ Pod::Spec.new do |s|
117125

118126
if ENV['USE_HERMES'] == "0"
119127
s.dependency 'React-jsc'
128+
else
129+
s.dependency 'React-hermes'
130+
s.dependency 'hermes-engine'
120131
end
121132
end

ReactCommon/ReactCommon.podspec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
2020
folly_version = '2021.07.22.00'
2121
boost_compiler_flags = '-Wno-documentation'
22-
22+
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
2323
Pod::Spec.new do |s|
2424
s.name = "ReactCommon"
2525
s.module_name = "ReactCommon"
@@ -49,13 +49,19 @@ Pod::Spec.new do |s|
4949
s.dependency "React-logger", version
5050
ss.dependency "DoubleConversion"
5151
ss.dependency "glog"
52+
if using_hermes
53+
ss.dependency "hermes-engine"
54+
end
5255

5356
ss.subspec "bridging" do |sss|
5457
sss.dependency "React-jsi", version
5558
sss.source_files = "react/bridging/**/*.{cpp,h}"
5659
sss.exclude_files = "react/bridging/tests"
5760
sss.header_dir = "react/bridging"
5861
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
62+
if using_hermes
63+
sss.dependency "hermes-engine"
64+
end
5965
end
6066

6167
ss.subspec "core" do |sss|

ReactCommon/cxxreact/React-cxxreact.podspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,8 @@ Pod::Spec.new do |s|
4747
s.dependency "React-perflogger", version
4848
s.dependency "React-jsi", version
4949
s.dependency "React-logger", version
50+
51+
if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
52+
s.dependency 'hermes-engine'
53+
end
5054
end

ReactCommon/hermes/React-hermes.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
5353
s.dependency "glog"
5454
s.dependency "RCT-Folly/Futures", folly_version
5555
s.dependency "hermes-engine"
56+
s.dependency "React-jsi"
5657
end

ReactCommon/jsiexecutor/React-jsiexecutor.podspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ Pod::Spec.new do |s|
4141
s.dependency "RCT-Folly", folly_version
4242
s.dependency "DoubleConversion"
4343
s.dependency "glog"
44+
45+
if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
46+
s.dependency 'hermes-engine'
47+
end
4448
end

0 commit comments

Comments
 (0)