Skip to content

Commit 15b0d4b

Browse files
authored
feat: use nightly version of React Native (#5)
1 parent c9e5f64 commit 15b0d4b

File tree

9 files changed

+820
-601
lines changed

9 files changed

+820
-601
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ yarn-error.log
5757

5858
# Ruby / CocoaPods
5959
**/Pods/
60-
/vendor/bundle/
60+
example/vendor/bundle/
6161

6262
# Temporary files created by Metro to check the health of the file watcher
6363
.metro-health-check*

React-jsc.podspec

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ require "json"
88
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
99
version = package['version']
1010

11+
folly_config = get_folly_config()
12+
folly_compiler_flags = folly_config[:compiler_flags]
13+
folly_version = folly_config[:version]
14+
boost_config = get_boost_config()
15+
boost_compiler_flags = boost_config[:compiler_flags]
16+
1117
Pod::Spec.new do |s|
1218
s.name = "React-jsc"
1319
s.version = version
@@ -16,14 +22,15 @@ Pod::Spec.new do |s|
1622
s.license = package["license"]
1723
s.author = "Meta Platforms, Inc. and its affiliates"
1824
s.platforms = { :ios => "15.1", :tvos => "15.1", :visionos => "1.0", :osx => "10.15" }
19-
s.source = { :git => "https://github.com/react-native-community/javascriptcore", :tag => "#{s.version}" }
25+
s.source = { :git => "https://github.com/react-native-community/javascriptcore.git", :tag => "#{s.version}" }
2026
s.source_files = "common/*.{cpp,h}", "ios/*.{mm,h}"
27+
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
2128
s.weak_framework = "JavaScriptCore"
2229

23-
# TODO: Figure this out. Probably we need a copy of JSI
24-
# s.dependency "React-jsi", version
25-
26-
s.subspec "Fabric" do |ss|
27-
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited)" }
28-
end
30+
s.dependency "RCT-Folly", folly_version
31+
s.dependency "DoubleConversion"
32+
# s.dependency "React-jsitooling" Uncomment once merged in React Native
33+
s.dependency "React-cxxreact"
34+
s.dependency "React-jsi"
35+
s.dependency "React-jsiexecutor"
2936
end

example/ios/JSCExample.xcodeproj/project.pbxproj

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
13B07F8C1A680F5B00A75B9A /* Frameworks */,
111111
13B07F8E1A680F5B00A75B9A /* Resources */,
112112
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
113-
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
114113
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
115114
);
116115
buildRules = (
@@ -183,23 +182,6 @@
183182
shellPath = /bin/sh;
184183
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
185184
};
186-
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
187-
isa = PBXShellScriptBuildPhase;
188-
buildActionMask = 2147483647;
189-
files = (
190-
);
191-
inputFileListPaths = (
192-
"${PODS_ROOT}/Target Support Files/Pods-JSCExample/Pods-JSCExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
193-
);
194-
name = "[CP] Embed Pods Frameworks";
195-
outputFileListPaths = (
196-
"${PODS_ROOT}/Target Support Files/Pods-JSCExample/Pods-JSCExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
197-
);
198-
runOnlyForDeploymentPostprocessing = 0;
199-
shellPath = /bin/sh;
200-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-JSCExample/Pods-JSCExample-frameworks.sh\"\n";
201-
showEnvVarsInLog = 0;
202-
};
203185
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
204186
isa = PBXShellScriptBuildPhase;
205187
buildActionMask = 2147483647;
@@ -311,6 +293,8 @@
311293
isa = XCBuildConfiguration;
312294
buildSettings = {
313295
ALWAYS_SEARCH_USER_PATHS = NO;
296+
CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
297+
CCACHE_BINARY = /opt/homebrew/bin/ccache;
314298
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
315299
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
316300
CLANG_CXX_LIBRARY = "libc++";
@@ -338,6 +322,7 @@
338322
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
339323
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
340324
COPY_PHASE_STRIP = NO;
325+
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
341326
ENABLE_STRICT_OBJC_MSGSEND = YES;
342327
ENABLE_TESTABILITY = YES;
343328
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@@ -357,6 +342,8 @@
357342
GCC_WARN_UNUSED_FUNCTION = YES;
358343
GCC_WARN_UNUSED_VARIABLE = YES;
359344
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
345+
LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
346+
LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
360347
LD_RUNPATH_SEARCH_PATHS = (
361348
/usr/lib/swift,
362349
"$(inherited)",
@@ -383,14 +370,16 @@
383370
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
384371
SDKROOT = iphoneos;
385372
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
386-
USE_HERMES = true;
373+
USE_HERMES = false;
387374
};
388375
name = Debug;
389376
};
390377
83CBBA211A601CBA00E9B192 /* Release */ = {
391378
isa = XCBuildConfiguration;
392379
buildSettings = {
393380
ALWAYS_SEARCH_USER_PATHS = NO;
381+
CC = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
382+
CCACHE_BINARY = /opt/homebrew/bin/ccache;
394383
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
395384
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
396385
CLANG_CXX_LIBRARY = "libc++";
@@ -418,6 +407,7 @@
418407
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
419408
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
420409
COPY_PHASE_STRIP = YES;
410+
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
421411
ENABLE_NS_ASSERTIONS = NO;
422412
ENABLE_STRICT_OBJC_MSGSEND = YES;
423413
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@@ -430,6 +420,8 @@
430420
GCC_WARN_UNUSED_FUNCTION = YES;
431421
GCC_WARN_UNUSED_VARIABLE = YES;
432422
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
423+
LD = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang.sh";
424+
LDPLUSPLUS = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
433425
LD_RUNPATH_SEARCH_PATHS = (
434426
/usr/lib/swift,
435427
"$(inherited)",
@@ -454,7 +446,7 @@
454446
);
455447
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
456448
SDKROOT = iphoneos;
457-
USE_HERMES = true;
449+
USE_HERMES = false;
458450
VALIDATE_PRODUCT = YES;
459451
};
460452
name = Release;

example/ios/Podfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ target 'JSCExample' do
2020
use_react_native!(
2121
:path => config[:reactNativePath],
2222
# An absolute path to your application root.
23-
:app_path => "#{Pod::Config.instance.installation_root}/.."
23+
:app_path => "#{Pod::Config.instance.installation_root}/..",
24+
:hermes_enabled => false
2425
)
2526

2627
post_install do |installer|
@@ -29,7 +30,7 @@ target 'JSCExample' do
2930
installer,
3031
config[:reactNativePath],
3132
:mac_catalyst_enabled => false,
32-
# :ccache_enabled => true
33+
:ccache_enabled => true
3334
)
3435
end
3536
end

0 commit comments

Comments
 (0)