react-native-macos 0.72.0 → 0.72.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +3 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTTiming.mm +9 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +5 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +6 -6
- package/scripts/cocoapods/helpers.rb +16 -0
- package/scripts/cocoapods/utils.rb +103 -8
- package/scripts/react_native_pods.rb +6 -2
- package/sdks/hermes-engine/utils/build-apple-framework.sh +8 -1
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -0
- package/template/Gemfile +2 -1
- package/template/package.json +1 -1
|
@@ -109,7 +109,9 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
109
109
|
Registration<$ElementType<TEventToArgsMap, TEvent>>,
|
|
110
110
|
> = this._registry[eventType];
|
|
111
111
|
if (registrations != null) {
|
|
112
|
-
|
|
112
|
+
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
|
|
113
|
+
// registrations are added or removed when listeners are invoked.
|
|
114
|
+
for (const registration of Array.from(registrations)) {
|
|
113
115
|
registration.listener.apply(registration.context, args);
|
|
114
116
|
}
|
|
115
117
|
}
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -128,6 +128,15 @@ RCT_EXPORT_MODULE()
|
|
|
128
128
|
_paused = YES;
|
|
129
129
|
_timers = [NSMutableDictionary new];
|
|
130
130
|
_inBackground = NO;
|
|
131
|
+
RCTExecuteOnMainQueue(^{
|
|
132
|
+
#if !TARGET_OS_OSX // [macOS]
|
|
133
|
+
if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
|
|
134
|
+
#else // [macOS
|
|
135
|
+
if (!self->_inBackground && ![RCTSharedApplication() isHidden]) {
|
|
136
|
+
#endif
|
|
137
|
+
[self appDidMoveToBackground];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
131
140
|
|
|
132
141
|
#if !TARGET_OS_OSX // [macOS]
|
|
133
142
|
for (NSString *name in @[
|
|
@@ -25,6 +25,7 @@ import com.facebook.react.modules.blob.BlobModule;
|
|
|
25
25
|
import com.facebook.react.modules.blob.FileReaderModule;
|
|
26
26
|
import com.facebook.react.modules.camera.ImageStoreManager;
|
|
27
27
|
import com.facebook.react.modules.clipboard.ClipboardModule;
|
|
28
|
+
import com.facebook.react.modules.devloading.DevLoadingModule;
|
|
28
29
|
import com.facebook.react.modules.devtoolssettings.DevToolsSettingsManagerModule;
|
|
29
30
|
import com.facebook.react.modules.dialog.DialogModule;
|
|
30
31
|
import com.facebook.react.modules.fresco.FrescoModule;
|
|
@@ -72,6 +73,7 @@ import javax.inject.Provider;
|
|
|
72
73
|
AppearanceModule.class,
|
|
73
74
|
AppStateModule.class,
|
|
74
75
|
BlobModule.class,
|
|
76
|
+
DevLoadingModule.class,
|
|
75
77
|
FileReaderModule.class,
|
|
76
78
|
ClipboardModule.class,
|
|
77
79
|
DialogModule.class,
|
|
@@ -113,6 +115,8 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
|
|
|
113
115
|
return new AppStateModule(context);
|
|
114
116
|
case BlobModule.NAME:
|
|
115
117
|
return new BlobModule(context);
|
|
118
|
+
case DevLoadingModule.NAME:
|
|
119
|
+
return new DevLoadingModule(context);
|
|
116
120
|
case FileReaderModule.NAME:
|
|
117
121
|
return new FileReaderModule(context);
|
|
118
122
|
case ClipboardModule.NAME:
|
|
@@ -371,6 +375,7 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
|
|
|
371
375
|
AppearanceModule.class,
|
|
372
376
|
AppStateModule.class,
|
|
373
377
|
BlobModule.class,
|
|
378
|
+
DevLoadingModule.class,
|
|
374
379
|
FileReaderModule.class,
|
|
375
380
|
ClipboardModule.class,
|
|
376
381
|
DialogModule.class,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.72.
|
|
3
|
+
"version": "0.72.2",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "React Native for macOS",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
83
|
-
"@react-native-community/cli": "11.3.
|
|
84
|
-
"@react-native-community/cli-platform-android": "11.3.
|
|
85
|
-
"@react-native-community/cli-platform-ios": "11.3.
|
|
83
|
+
"@react-native-community/cli": "11.3.7",
|
|
84
|
+
"@react-native-community/cli-platform-android": "11.3.7",
|
|
85
|
+
"@react-native-community/cli-platform-ios": "11.3.7",
|
|
86
86
|
"@react-native/assets-registry": "^0.72.0",
|
|
87
|
-
"@react-native/codegen": "^0.72.
|
|
87
|
+
"@react-native/codegen": "^0.72.7",
|
|
88
88
|
"@react-native/gradle-plugin": "^0.72.11",
|
|
89
89
|
"@react-native/js-polyfills": "^0.72.1",
|
|
90
90
|
"@react-native/normalize-colors": "^0.72.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"abort-controller": "^3.0.0",
|
|
93
93
|
"anser": "^1.4.9",
|
|
94
94
|
"base64-js": "^1.1.2",
|
|
95
|
-
"deprecated-react-native-prop-types": "4.
|
|
95
|
+
"deprecated-react-native-prop-types": "^4.2.3",
|
|
96
96
|
"event-target-shim": "^5.0.1",
|
|
97
97
|
"flow-enums-runtime": "^0.0.5",
|
|
98
98
|
"invariant": "^2.2.4",
|
|
@@ -11,6 +11,14 @@ class SysctlChecker
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Helper class that is used to easily send commands to Xcodebuild
|
|
15
|
+
# And that can be subclassed for testing purposes.
|
|
16
|
+
class Xcodebuild
|
|
17
|
+
def self.version
|
|
18
|
+
`xcodebuild -version`
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
# Helper object to wrap system properties like RUBY_PLATFORM
|
|
15
23
|
# This makes it easier to mock the behaviour in tests
|
|
16
24
|
class Environment
|
|
@@ -26,3 +34,11 @@ class Finder
|
|
|
26
34
|
return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort()
|
|
27
35
|
end
|
|
28
36
|
end
|
|
37
|
+
|
|
38
|
+
module Helpers
|
|
39
|
+
class Constants
|
|
40
|
+
def self.min_ios_version_supported
|
|
41
|
+
return '12.4'
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -121,16 +121,31 @@ class ReactNativePodsUtils
|
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
-
def self.apply_xcode_15_patch(installer)
|
|
125
|
-
installer
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
|
|
125
|
+
projects = self.extract_projects(installer)
|
|
126
|
+
|
|
127
|
+
gcc_preprocessor_definition_key = 'GCC_PREPROCESSOR_DEFINITIONS'
|
|
128
|
+
other_ld_flags_key = 'OTHER_LDFLAGS'
|
|
129
|
+
libcpp_cxx17_fix = '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'
|
|
130
|
+
xcode15_compatibility_flags = '-Wl -ld_classic '
|
|
131
|
+
|
|
132
|
+
projects.each do |project|
|
|
133
|
+
project.build_configurations.each do |config|
|
|
134
|
+
# fix for unary_function and binary_function
|
|
135
|
+
self.safe_init(config, gcc_preprocessor_definition_key)
|
|
136
|
+
self.add_value_to_setting_if_missing(config, gcc_preprocessor_definition_key, libcpp_cxx17_fix)
|
|
137
|
+
|
|
138
|
+
# fix for weak linking
|
|
139
|
+
self.safe_init(config, other_ld_flags_key)
|
|
140
|
+
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
|
|
141
|
+
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
142
|
+
else
|
|
143
|
+
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
144
|
+
end
|
|
132
145
|
end
|
|
146
|
+
project.save()
|
|
133
147
|
end
|
|
148
|
+
|
|
134
149
|
end
|
|
135
150
|
|
|
136
151
|
def self.apply_flags_for_fabric(installer, fabric_enabled: false)
|
|
@@ -232,6 +247,37 @@ class ReactNativePodsUtils
|
|
|
232
247
|
end
|
|
233
248
|
end
|
|
234
249
|
|
|
250
|
+
def self.updateIphoneOSDeploymentTarget(installer)
|
|
251
|
+
pod_to_update = Set.new([
|
|
252
|
+
"boost",
|
|
253
|
+
"CocoaAsyncSocket",
|
|
254
|
+
"Flipper",
|
|
255
|
+
"Flipper-DoubleConversion",
|
|
256
|
+
"Flipper-Fmt",
|
|
257
|
+
"Flipper-Boost-iOSX",
|
|
258
|
+
"Flipper-Folly",
|
|
259
|
+
"Flipper-Glog",
|
|
260
|
+
"Flipper-PeerTalk",
|
|
261
|
+
"FlipperKit",
|
|
262
|
+
"fmt",
|
|
263
|
+
"libevent",
|
|
264
|
+
"OpenSSL-Universal",
|
|
265
|
+
"RCT-Folly",
|
|
266
|
+
"SocketRocket",
|
|
267
|
+
"YogaKit"
|
|
268
|
+
])
|
|
269
|
+
|
|
270
|
+
installer.target_installation_results.pod_target_installation_results
|
|
271
|
+
.each do |pod_name, target_installation_result|
|
|
272
|
+
unless pod_to_update.include?(pod_name)
|
|
273
|
+
next
|
|
274
|
+
end
|
|
275
|
+
target_installation_result.native_target.build_configurations.each do |config|
|
|
276
|
+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
235
281
|
# ========= #
|
|
236
282
|
# Utilities #
|
|
237
283
|
# ========= #
|
|
@@ -243,6 +289,55 @@ class ReactNativePodsUtils
|
|
|
243
289
|
.push(installer.pods_project)
|
|
244
290
|
end
|
|
245
291
|
|
|
292
|
+
def self.safe_init(config, setting_name)
|
|
293
|
+
old_config = config.build_settings[setting_name]
|
|
294
|
+
if old_config == nil
|
|
295
|
+
config.build_settings[setting_name] ||= '$(inherited) '
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def self.add_value_to_setting_if_missing(config, setting_name, value)
|
|
300
|
+
old_config = config.build_settings[setting_name]
|
|
301
|
+
if old_config.is_a?(Array)
|
|
302
|
+
old_config = old_config.join(" ")
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
trimmed_value = value.strip()
|
|
306
|
+
if !old_config.include?(trimmed_value)
|
|
307
|
+
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
def self.remove_value_from_setting_if_present(config, setting_name, value)
|
|
312
|
+
old_config = config.build_settings[setting_name]
|
|
313
|
+
if old_config.is_a?(Array)
|
|
314
|
+
old_config = old_config.join(" ")
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
trimmed_value = value.strip()
|
|
318
|
+
if old_config.include?(trimmed_value)
|
|
319
|
+
new_config = old_config.gsub(trimmed_value, "")
|
|
320
|
+
config.build_settings[setting_name] = new_config.strip()
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def self.is_using_xcode15_or_greter(xcodebuild_manager: Xcodebuild)
|
|
325
|
+
xcodebuild_version = xcodebuild_manager.version
|
|
326
|
+
|
|
327
|
+
# The output of xcodebuild -version is something like
|
|
328
|
+
# Xcode 15.0
|
|
329
|
+
# or
|
|
330
|
+
# Xcode 14.3.1
|
|
331
|
+
# We want to capture the version digits
|
|
332
|
+
regex = /(\d+)\.(\d+)(?:\.(\d+))?/
|
|
333
|
+
if match_data = xcodebuild_version.match(regex)
|
|
334
|
+
major = match_data[1].to_i
|
|
335
|
+
return major >= 15
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
return false
|
|
339
|
+
end
|
|
340
|
+
|
|
246
341
|
def self.add_compiler_flag_to_project(installer, flag, configuration: nil)
|
|
247
342
|
projects = self.extract_projects(installer)
|
|
248
343
|
|
|
@@ -15,6 +15,7 @@ require_relative './cocoapods/codegen_utils.rb'
|
|
|
15
15
|
require_relative './cocoapods/utils.rb'
|
|
16
16
|
require_relative './cocoapods/new_architecture.rb'
|
|
17
17
|
require_relative './cocoapods/local_podspec_patch.rb'
|
|
18
|
+
require_relative './cocoapods/helpers.rb'
|
|
18
19
|
|
|
19
20
|
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
|
|
20
21
|
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
|
|
@@ -34,11 +35,12 @@ require Pod::Executable.execute_command('node', ['-p',
|
|
|
34
35
|
{paths: [process.argv[1]]},
|
|
35
36
|
)', __dir__]).strip
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
# This function returns the min supported OS versions supported by React Native
|
|
38
40
|
# By using this function, you won't have to manually change your Podfile
|
|
39
41
|
# when we change the minimum version supported by the framework.
|
|
40
42
|
def min_ios_version_supported
|
|
41
|
-
return
|
|
43
|
+
return Helpers::Constants.min_ios_version_supported
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
# This function prepares the project for React Native, before processing
|
|
@@ -245,11 +247,13 @@ def react_native_post_install(
|
|
|
245
247
|
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
|
|
246
248
|
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
|
|
247
249
|
ReactNativePodsUtils.apply_xcode_15_patch(installer)
|
|
250
|
+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
|
|
248
251
|
|
|
249
252
|
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
|
|
250
253
|
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
|
|
251
254
|
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
|
|
252
255
|
|
|
256
|
+
|
|
253
257
|
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
|
|
254
258
|
end
|
|
255
259
|
|
|
@@ -52,7 +52,7 @@ function build_host_hermesc {
|
|
|
52
52
|
|
|
53
53
|
# Utility function to configure an Apple framework
|
|
54
54
|
function configure_apple_framework {
|
|
55
|
-
local build_cli_tools enable_bitcode enable_debugger cmake_build_type
|
|
55
|
+
local build_cli_tools enable_bitcode enable_debugger cmake_build_type xcode_15_flags xcode_major_version
|
|
56
56
|
|
|
57
57
|
if [[ $1 == iphoneos || $1 == catalyst ]]; then
|
|
58
58
|
enable_bitcode="true"
|
|
@@ -77,8 +77,15 @@ function configure_apple_framework {
|
|
|
77
77
|
cmake_build_type="MinSizeRel"
|
|
78
78
|
fi
|
|
79
79
|
|
|
80
|
+
xcode_15_flags=""
|
|
81
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
82
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
83
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
84
|
+
fi
|
|
85
|
+
|
|
80
86
|
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
81
87
|
cmake -S . -B "build_$1" \
|
|
88
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
82
89
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \
|
|
83
90
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$2" \
|
|
84
91
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \
|
|
@@ -33,6 +33,13 @@ if [ -z "$deployment_target" ]; then
|
|
|
33
33
|
deployment_target=${MACOSX_DEPLOYMENT_TARGET}
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
|
+
xcode_15_flags=""
|
|
37
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
38
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
39
|
+
echo "########### Using LINKER:-ld_classic ###########"
|
|
40
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
41
|
+
fi
|
|
42
|
+
|
|
36
43
|
architectures=$( echo "$ARCHS" | tr " " ";" )
|
|
37
44
|
|
|
38
45
|
echo "Configure Apple framework"
|
|
@@ -40,6 +47,7 @@ echo "Configure Apple framework"
|
|
|
40
47
|
"$CMAKE_BINARY" \
|
|
41
48
|
-S "${PODS_ROOT}/hermes-engine" \
|
|
42
49
|
-B "${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}" \
|
|
50
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
43
51
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$PLATFORM_NAME" \
|
|
44
52
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$architectures" \
|
|
45
53
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$deployment_target" \
|
package/template/Gemfile
CHANGED