react-native-macos 0.76.11 → 0.76.12
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/Blob/RCTBlobManager.h +0 -0
- package/Libraries/Blob/RCTBlobManager.mm +0 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +0 -0
- package/React/Base/RCTJavaScriptLoader.h +0 -0
- package/React/Base/RCTJavaScriptLoader.mm +0 -0
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/local-cli/cli.js +0 -0
- package/package.json +3 -3
- package/scripts/cocoapods/autolinking.rb +206 -0
- package/scripts/cocoapods/autolinking_utils.rb +25 -0
- package/scripts/cocoapods/codegen.rb +59 -0
- package/scripts/cocoapods/codegen_script_phase_extractor.rb +13 -0
- package/scripts/cocoapods/codegen_utils.rb +363 -0
- package/scripts/cocoapods/fabric.rb +18 -0
- package/scripts/cocoapods/helpers.rb +148 -0
- package/scripts/cocoapods/jsengine.rb +33 -0
- package/scripts/cocoapods/local_podspec_patch.rb +51 -0
- package/scripts/cocoapods/new_architecture.rb +193 -0
- package/scripts/cocoapods/privacy_manifest_utils.rb +194 -0
- package/scripts/cocoapods/runtime.rb +18 -0
- package/scripts/cocoapods/spm.rb +94 -0
- package/scripts/cocoapods/utils.rb +729 -0
- package/scripts/codegen/codegen-utils.js +51 -0
- package/scripts/codegen/generate-artifacts-executor.js +815 -0
- package/scripts/codegen/generate-specs-cli-executor.js +128 -0
- package/scripts/codegen/templates/RCTModulesConformingToProtocolsProviderH.template +18 -0
- package/scripts/codegen/templates/RCTModulesConformingToProtocolsProviderMM.template +33 -0
- package/scripts/compose-source-maps.js +0 -0
- package/scripts/ios-configure-glog.sh +0 -0
- package/scripts/node-binary.sh +0 -0
- package/scripts/packager.sh +0 -0
- package/scripts/react-native-xcode.sh +0 -0
- package/scripts/react_native_pods_utils/script_phases.sh +0 -0
- package/scripts/xcode/ccache-clang++.sh +0 -0
- package/scripts/xcode/ccache-clang.sh +0 -0
- package/scripts/xcode/with-environment.sh +0 -0
- package/sdks/hermes-engine/hermes-engine.podspec +160 -0
- package/sdks/hermes-engine/hermes-utils.rb +337 -0
- package/sdks/hermes-engine/utils/build-apple-framework.sh +225 -0
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +100 -0
- package/sdks/hermes-engine/utils/build-hermesc-xcode.sh +18 -0
- package/sdks/hermes-engine/utils/build-ios-framework.sh +85 -0
- package/sdks/hermes-engine/utils/build-mac-framework.sh +22 -0
- package/sdks/hermes-engine/utils/copy-hermes-xcode.sh +7 -0
- package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +32 -0
- package/sdks/hermes-engine/utils/replace_hermes_version.js +106 -0
- package/scripts/featureflags/README.md +0 -156
- package/scripts/featureflags/index.js +0 -14
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
const utils = require('./codegen-utils');
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const mkdirp = require('mkdirp');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
|
|
17
|
+
const GENERATORS = {
|
|
18
|
+
all: {
|
|
19
|
+
android: ['componentsAndroid', 'modulesAndroid', 'modulesCxx'],
|
|
20
|
+
ios: ['componentsIOS', 'modulesIOS', 'modulesCxx'],
|
|
21
|
+
},
|
|
22
|
+
components: {
|
|
23
|
+
android: ['componentsAndroid'],
|
|
24
|
+
ios: ['componentsIOS'],
|
|
25
|
+
},
|
|
26
|
+
modules: {
|
|
27
|
+
android: ['modulesAndroid', 'modulesCxx'],
|
|
28
|
+
ios: ['modulesIOS', 'modulesCxx'],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function createOutputDirectoryIfNeeded(outputDirectory, libraryName) {
|
|
33
|
+
if (!outputDirectory) {
|
|
34
|
+
outputDirectory = path.resolve(__dirname, '..', 'Libraries', libraryName);
|
|
35
|
+
}
|
|
36
|
+
mkdirp.sync(outputDirectory);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This function read a JSON schema from a path and parses it.
|
|
41
|
+
* It throws if the schema don't exists or it can't be parsed.
|
|
42
|
+
*
|
|
43
|
+
* @parameter schemaPath: the path to the schema
|
|
44
|
+
* @return a valid schema
|
|
45
|
+
* @throw an Error if the schema doesn't exists in a given path or if it can't be parsed.
|
|
46
|
+
*/
|
|
47
|
+
function readAndParseSchema(schemaPath) {
|
|
48
|
+
const schemaText = fs.readFileSync(schemaPath, 'utf-8');
|
|
49
|
+
|
|
50
|
+
if (schemaText == null) {
|
|
51
|
+
throw new Error(`Can't find schema at ${schemaPath}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse(schemaText);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
throw new Error(`Can't parse schema to JSON. ${schemaPath}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function validateLibraryType(libraryType) {
|
|
62
|
+
if (GENERATORS[libraryType] == null) {
|
|
63
|
+
throw new Error(`Invalid library type. ${libraryType}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function generateSpecFromInMemorySchema(
|
|
68
|
+
platform,
|
|
69
|
+
schema,
|
|
70
|
+
outputDirectory,
|
|
71
|
+
libraryName,
|
|
72
|
+
packageName,
|
|
73
|
+
libraryType,
|
|
74
|
+
useLocalIncludePaths,
|
|
75
|
+
) {
|
|
76
|
+
validateLibraryType(libraryType);
|
|
77
|
+
createOutputDirectoryIfNeeded(outputDirectory, libraryName);
|
|
78
|
+
utils.getCodegen().generate(
|
|
79
|
+
{
|
|
80
|
+
libraryName,
|
|
81
|
+
schema,
|
|
82
|
+
outputDirectory,
|
|
83
|
+
packageName,
|
|
84
|
+
useLocalIncludePaths,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
generators: GENERATORS[libraryType][platform],
|
|
88
|
+
},
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
if (platform === 'android') {
|
|
92
|
+
// Move all components C++ files to a structured jni folder for now.
|
|
93
|
+
// Note: this should've been done by RNCodegen's generators, but:
|
|
94
|
+
// * the generators don't support platform option yet
|
|
95
|
+
// * this subdir structure is Android-only, not applicable to iOS
|
|
96
|
+
const files = fs.readdirSync(outputDirectory);
|
|
97
|
+
const jniOutputDirectory = `${outputDirectory}/jni/react/renderer/components/${libraryName}`;
|
|
98
|
+
mkdirp.sync(jniOutputDirectory);
|
|
99
|
+
files
|
|
100
|
+
.filter(f => f.endsWith('.h') || f.endsWith('.cpp'))
|
|
101
|
+
.forEach(f => {
|
|
102
|
+
fs.renameSync(`${outputDirectory}/${f}`, `${jniOutputDirectory}/${f}`);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function generateSpec(
|
|
108
|
+
platform,
|
|
109
|
+
schemaPath,
|
|
110
|
+
outputDirectory,
|
|
111
|
+
libraryName,
|
|
112
|
+
packageName,
|
|
113
|
+
libraryType,
|
|
114
|
+
) {
|
|
115
|
+
generateSpecFromInMemorySchema(
|
|
116
|
+
platform,
|
|
117
|
+
readAndParseSchema(schemaPath),
|
|
118
|
+
outputDirectory,
|
|
119
|
+
libraryName,
|
|
120
|
+
packageName,
|
|
121
|
+
libraryType,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
module.exports = {
|
|
126
|
+
execute: generateSpec,
|
|
127
|
+
generateSpecFromInMemorySchema: generateSpecFromInMemorySchema,
|
|
128
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
+
|
|
14
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
+
|
|
16
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
+
|
|
10
|
+
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
+
{
|
|
14
|
+
return @[
|
|
15
|
+
{imageURLLoaderClassNames}
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
20
|
+
{
|
|
21
|
+
return @[
|
|
22
|
+
{imageDataDecoderClassNames}
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
27
|
+
{
|
|
28
|
+
return @[
|
|
29
|
+
{requestHandlersClassNames}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
File without changes
|
|
File without changes
|
package/scripts/node-binary.sh
CHANGED
|
File without changes
|
package/scripts/packager.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
require "json"
|
|
7
|
+
require_relative "./hermes-utils.rb"
|
|
8
|
+
|
|
9
|
+
# [macOS]
|
|
10
|
+
react_native_path = File.dirname(Pod::Executable.execute_command('node', ['-p',
|
|
11
|
+
'require.resolve(
|
|
12
|
+
"react-native-macos",
|
|
13
|
+
{paths: [process.argv[1]]},
|
|
14
|
+
)', __dir__]).strip
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# package.json
|
|
18
|
+
package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
|
|
19
|
+
version = findMatchingHermesVersion(package) # [macOS] Use special logic instead of just package['version']
|
|
20
|
+
|
|
21
|
+
source_type = hermes_source_type(version, react_native_path)
|
|
22
|
+
source = podspec_source(source_type, version, react_native_path)
|
|
23
|
+
|
|
24
|
+
version = version || package['version'] # [macOS] If version is nil, fall back to package version so CocoaPods doesn't fail
|
|
25
|
+
|
|
26
|
+
Pod::Spec.new do |spec|
|
|
27
|
+
spec.name = "hermes-engine"
|
|
28
|
+
spec.version = version
|
|
29
|
+
spec.summary = "Hermes is a small and lightweight JavaScript engine optimized for running React Native."
|
|
30
|
+
spec.description = "Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode."
|
|
31
|
+
spec.homepage = "https://hermesengine.dev"
|
|
32
|
+
spec.license = package['license']
|
|
33
|
+
spec.author = "Facebook"
|
|
34
|
+
spec.source = source
|
|
35
|
+
spec.platforms = { :osx => "10.13", :ios => "15.1", :visionos => "1.0" }
|
|
36
|
+
|
|
37
|
+
spec.preserve_paths = '**/*.*'
|
|
38
|
+
spec.source_files = ''
|
|
39
|
+
|
|
40
|
+
spec.pod_target_xcconfig = {
|
|
41
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
42
|
+
"CLANG_CXX_LIBRARY" => "compiler-default"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework"
|
|
46
|
+
spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
|
|
47
|
+
spec.visionos.vendored_frameworks = "destroot/Library/Frameworks/xros/hermes.framework"
|
|
48
|
+
|
|
49
|
+
if HermesEngineSourceType::isPrebuilt(source_type) then
|
|
50
|
+
|
|
51
|
+
spec.subspec 'Pre-built' do |ss|
|
|
52
|
+
ss.preserve_paths = ["destroot/bin/*"].concat(["**/*.{h,c,cpp}"])
|
|
53
|
+
ss.source_files = "destroot/include/hermes/**/*.h"
|
|
54
|
+
ss.header_mappings_dir = "destroot/include"
|
|
55
|
+
ss.ios.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
|
|
56
|
+
ss.visionos.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
|
|
57
|
+
ss.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Right now, even reinstalling pods with the PRODUCTION flag turned on, does not change the version of hermes that is downloaded
|
|
62
|
+
# To remove the PRODUCTION flag, we want to download the right version of hermes on the flight
|
|
63
|
+
# we do so in a pre-build script we invoke from the Xcode build pipeline
|
|
64
|
+
# We use this only for Apps created using the template. RNTester and Nightlies should not be used to build for Release.
|
|
65
|
+
# We ignore this if we provide a specific tarball: the assumption here is that if you are providing a tarball, is because you want to
|
|
66
|
+
# test something specific for that tarball.
|
|
67
|
+
if source_type == HermesEngineSourceType::DOWNLOAD_PREBUILD_RELEASE_TARBALL
|
|
68
|
+
spec.script_phase = {
|
|
69
|
+
:name => "[Hermes] Replace Hermes for the right configuration, if needed",
|
|
70
|
+
:execution_position => :before_compile,
|
|
71
|
+
:script => <<-EOS
|
|
72
|
+
. "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
|
|
73
|
+
|
|
74
|
+
CONFIG="Release"
|
|
75
|
+
if echo $GCC_PREPROCESSOR_DEFINITIONS | grep -q "DEBUG=1"; then
|
|
76
|
+
CONFIG="Debug"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
"$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
|
|
80
|
+
EOS
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
elsif HermesEngineSourceType::isFromSource(source_type) then
|
|
85
|
+
|
|
86
|
+
spec.subspec 'Hermes' do |ss|
|
|
87
|
+
ss.source_files = ''
|
|
88
|
+
ss.public_header_files = 'API/hermes/*.h'
|
|
89
|
+
ss.header_dir = 'hermes'
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
spec.subspec 'cdp' do |ss|
|
|
93
|
+
ss.source_files = ''
|
|
94
|
+
ss.public_header_files = 'API/hermes/cdp/*.h'
|
|
95
|
+
ss.header_dir = 'hermes/cdp'
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
spec.subspec 'inspector' do |ss|
|
|
99
|
+
ss.source_files = ''
|
|
100
|
+
ss.public_header_files = 'API/hermes/inspector/*.h'
|
|
101
|
+
ss.header_dir = 'hermes/inspector'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
spec.subspec 'inspector_chrome' do |ss|
|
|
105
|
+
ss.source_files = ''
|
|
106
|
+
ss.public_header_files = 'API/hermes/inspector/chrome/*.h'
|
|
107
|
+
ss.header_dir = 'hermes/inspector/chrome'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
spec.subspec 'Public' do |ss|
|
|
111
|
+
ss.source_files = ''
|
|
112
|
+
ss.public_header_files = 'public/hermes/Public/*.h'
|
|
113
|
+
ss.header_dir = 'hermes/Public'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
hermesc_path = "${PODS_ROOT}/hermes-engine/build_host_hermesc"
|
|
117
|
+
|
|
118
|
+
if ENV.has_key?('HERMES_OVERRIDE_HERMESC_PATH') && File.exist?(ENV['HERMES_OVERRIDE_HERMESC_PATH']) then
|
|
119
|
+
hermesc_path = ENV['HERMES_OVERRIDE_HERMESC_PATH']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
spec.user_target_xcconfig = {
|
|
123
|
+
'HERMES_CLI_PATH' => "#{hermesc_path}/bin/hermesc"
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
spec.prepare_command = ". '#{react_native_path}/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh'"
|
|
127
|
+
|
|
128
|
+
# This podspec is also run in CI to build Hermes without using Pod install
|
|
129
|
+
# and sometimes CI fails because `Pod::Executable` does not exist if it is not run with Pod Install.
|
|
130
|
+
if defined?(Pod::Executable.to_s)
|
|
131
|
+
CMAKE_BINARY = Pod::Executable::which!('cmake')
|
|
132
|
+
# NOTE: Script phases are sorted alphabetically inside Xcode project
|
|
133
|
+
spec.script_phases = [
|
|
134
|
+
{
|
|
135
|
+
:name => '[RN] [1] Build Hermesc',
|
|
136
|
+
:output_files => [
|
|
137
|
+
"#{hermesc_path}/ImportHermesc.cmake"
|
|
138
|
+
],
|
|
139
|
+
:script => <<-EOS
|
|
140
|
+
. "${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh"
|
|
141
|
+
export CMAKE_BINARY=${CMAKE_BINARY:-#{CMAKE_BINARY}}
|
|
142
|
+
. ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/build-hermesc-xcode.sh #{hermesc_path} ${REACT_NATIVE_PATH}/ReactCommon/jsi
|
|
143
|
+
EOS
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
:name => '[RN] [2] Build Hermes',
|
|
147
|
+
:input_files => ["#{hermesc_path}/ImportHermesc.cmake"],
|
|
148
|
+
:output_files => [
|
|
149
|
+
"${PODS_ROOT}/hermes-engine/build/iphonesimulator/API/hermes/hermes.framework/hermes"
|
|
150
|
+
],
|
|
151
|
+
:script => <<-EOS
|
|
152
|
+
. "${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh"
|
|
153
|
+
export CMAKE_BINARY=${CMAKE_BINARY:-#{CMAKE_BINARY}}
|
|
154
|
+
. ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/build-hermes-xcode.sh #{version} #{hermesc_path}/ImportHermesc.cmake ${REACT_NATIVE_PATH}/ReactCommon/jsi
|
|
155
|
+
EOS
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|