react-native-tvos 0.72.4-0rc1 → 0.72.6-0

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.
Files changed (70) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +2 -2
  2. package/Libraries/vendor/emitter/EventEmitter.js +3 -1
  3. package/README-core.md +147 -0
  4. package/README.md +4 -3
  5. package/React/Base/RCTBundleURLProvider.h +33 -2
  6. package/React/Base/RCTBundleURLProvider.mm +78 -15
  7. package/React/Base/RCTVersion.m +2 -2
  8. package/React/CoreModules/RCTTiming.mm +5 -0
  9. package/ReactAndroid/gradle.properties +1 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  11. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +5 -0
  12. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java +4 -0
  13. package/ReactAndroid/src/main/jni/CMakeLists.txt +5 -0
  14. package/ReactCommon/React-Fabric.podspec +1 -1
  15. package/ReactCommon/ReactCommon.podspec +1 -1
  16. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  17. package/ReactCommon/jsc/JSCRuntime.cpp +10 -0
  18. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  19. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  20. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
  21. package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +2 -0
  22. package/ReactCommon/react/renderer/core/RawPropsParser.cpp +1 -0
  23. package/ReactCommon/react/renderer/core/RawPropsPrimitives.h +4 -4
  24. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
  25. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
  26. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
  27. package/ReactCommon/react/utils/React-utils.podspec +1 -1
  28. package/package.json +8 -7
  29. package/scripts/cocoapods/helpers.rb +16 -0
  30. package/scripts/cocoapods/utils.rb +104 -8
  31. package/scripts/react_native_pods.rb +6 -2
  32. package/sdks/hermes-engine/utils/build-apple-framework.sh +8 -1
  33. package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -0
  34. package/sdks/hermesc/linux64-bin/hermesc +0 -0
  35. package/sdks/hermesc/osx-bin/hermesc +0 -0
  36. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  37. package/template/Gemfile +2 -1
  38. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +95 -13
  39. package/template/package.json +2 -2
  40. package/types/index.d.ts +1 -0
  41. package/types/public/ReactNativeTVTypes.d.ts +192 -0
  42. package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +0 -98
  43. package/scripts/cocoapods/__tests__/codegen-test.rb +0 -242
  44. package/scripts/cocoapods/__tests__/codegen_utils-test.rb +0 -602
  45. package/scripts/cocoapods/__tests__/fabric-test.rb +0 -68
  46. package/scripts/cocoapods/__tests__/flipper-test.rb +0 -161
  47. package/scripts/cocoapods/__tests__/jsengine-test.rb +0 -130
  48. package/scripts/cocoapods/__tests__/local_podspec_patch-test.rb +0 -167
  49. package/scripts/cocoapods/__tests__/new_architecture-test.rb +0 -303
  50. package/scripts/cocoapods/__tests__/test_utils/CodegenScriptPhaseExtractorMock.rb +0 -21
  51. package/scripts/cocoapods/__tests__/test_utils/CodegenUtilsMock.rb +0 -108
  52. package/scripts/cocoapods/__tests__/test_utils/DirMock.rb +0 -72
  53. package/scripts/cocoapods/__tests__/test_utils/EnvironmentMock.rb +0 -21
  54. package/scripts/cocoapods/__tests__/test_utils/FileMock.rb +0 -113
  55. package/scripts/cocoapods/__tests__/test_utils/FileUtilsMock.rb +0 -40
  56. package/scripts/cocoapods/__tests__/test_utils/FinderMock.rb +0 -28
  57. package/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb +0 -222
  58. package/scripts/cocoapods/__tests__/test_utils/LocalPodspecPatchMock.rb +0 -14
  59. package/scripts/cocoapods/__tests__/test_utils/Open3Mock.rb +0 -43
  60. package/scripts/cocoapods/__tests__/test_utils/PathnameMock.rb +0 -42
  61. package/scripts/cocoapods/__tests__/test_utils/PodMock.rb +0 -144
  62. package/scripts/cocoapods/__tests__/test_utils/SpecMock.rb +0 -30
  63. package/scripts/cocoapods/__tests__/test_utils/SysctlCheckerMock.rb +0 -21
  64. package/scripts/cocoapods/__tests__/test_utils/TargetDefinitionMock.rb +0 -12
  65. package/scripts/cocoapods/__tests__/test_utils/podSpy.rb +0 -39
  66. package/scripts/cocoapods/__tests__/test_utils/systemUtils.rb +0 -14
  67. package/scripts/cocoapods/__tests__/utils-test.rb +0 -766
  68. package/scripts/codegen/__test_fixtures__/fixtures.js +0 -132
  69. package/scripts/codegen/__tests__/generate-artifacts-executor-test.js +0 -500
  70. package/scripts/codegen/__tests__/generate-specs-cli-executor-test.js +0 -88
@@ -1,28 +0,0 @@
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
- class Finder
7
- @@captured_paths = []
8
- @@files_for_paths = {}
9
-
10
-
11
- def self.find_codegen_file(path)
12
- @@captured_paths.push(path)
13
- return @@files_for_paths[path]
14
- end
15
-
16
- def self.set_files_for_paths(files_for_paths)
17
- @@files_for_paths = files_for_paths
18
- end
19
-
20
- def self.captured_paths
21
- return @@captured_paths
22
- end
23
-
24
- def self.reset()
25
- @@captured_paths = []
26
- @@files_for_paths = {}
27
- end
28
- end
@@ -1,222 +0,0 @@
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
-
7
- # This file replicate the structure of the Installer used Cocoapods in the post_install step.
8
- #
9
- # To use it, add `require_relative path/to/InstallerMock.rb` into your test file
10
- #
11
- # ## Initialization
12
- # You can create a new mock with the `InstallerMock.new` statement. In this case, you will
13
- # create an empty mock.
14
- #
15
- # It's possible to create complex with the initializer. To create an Installer with a pod, for example, we can
16
- # use the following code:
17
- #
18
- # ```ruby
19
- # installer = Installer.new(
20
- # PodsProjectMock.new([
21
- # TargetMock.new(
22
- # "MyPod",
23
- # [
24
- # BuildConfigurationMock.new("Debug"),
25
- # ]
26
- # )
27
- # )
28
- # )
29
- # ```
30
- #
31
- # ## Assert
32
- # All the properties of these objects are accessible in read mode.
33
- # To access the target's list, for example, you can use the following line:
34
- #
35
- # ```ruby
36
- # targets = installer.pods_project.targets
37
- # ```
38
-
39
- class InstallerMock
40
- attr_reader :pods_project
41
- attr_reader :aggregate_targets
42
- attr_reader :target_installation_results
43
-
44
- InstallationResults = Struct.new(:pod_target_installation_results, :aggregate_target_installation_results)
45
-
46
- def initialize(pods_project = PodsProjectMock.new, aggregate_targets = [AggregatedProjectMock.new],
47
- pod_target_installation_results: {},
48
- aggregate_target_installation_results: {})
49
- @pods_project = pods_project
50
- @aggregate_targets = aggregate_targets
51
-
52
- @target_installation_results = InstallationResults.new(pod_target_installation_results, aggregate_target_installation_results)
53
- aggregate_targets.each do |aggregate_target|
54
- aggregate_target.user_project.native_targets.each do |target|
55
- @target_installation_results.pod_target_installation_results[target.name] = TargetInstallationResultMock.new(target, target)
56
- end
57
- end
58
- pods_project.native_targets.each do |target|
59
- @target_installation_results.pod_target_installation_results[target.name] = TargetInstallationResultMock.new(target, target)
60
- end
61
- end
62
-
63
- def target_with_name(name)
64
- return @pods_project.targets
65
- .select { |target| target.name == name }
66
- .first
67
- end
68
- end
69
-
70
- class PodsProjectMock
71
- attr_reader :targets
72
- attr_reader :native_targets
73
- attr_reader :path
74
- attr_reader :build_configurations
75
- @pod_group
76
- attr_reader :save_invocation_count
77
-
78
- def initialize(targets = [], pod_group = {}, path = "test/path-pod.xcodeproj", build_configurations = [], native_targets: [])
79
- @targets = targets
80
- @pod_group = pod_group
81
- @path = path
82
- @build_configurations = build_configurations
83
- @save_invocation_count = 0
84
- @native_targets = native_targets
85
- end
86
-
87
- def pod_group(name)
88
- return @pod_group[name]
89
- end
90
-
91
- def save()
92
- @save_invocation_count += 1
93
- end
94
- end
95
-
96
- class AggregatedProjectMock
97
- attr_reader :user_project
98
- attr_reader :xcconfigs
99
-
100
- @base_path
101
-
102
- def initialize(user_project = UserProjectMock.new, xcconfigs: {}, base_path: "")
103
- @user_project = user_project
104
- @xcconfigs = xcconfigs
105
- @base_path = base_path
106
- end
107
-
108
- def xcconfig_path(config_name)
109
- return File.join(@base_path, "#{config_name}.xcconfig")
110
- end
111
- end
112
-
113
- class UserProjectMock
114
- attr_reader :path
115
- attr_reader :build_configurations
116
- attr_reader :native_targets
117
-
118
- attr_reader :save_invocation_count
119
-
120
-
121
- def initialize(path = "/test/path.xcproj", build_configurations = [], native_targets: [])
122
- @path = path
123
- @build_configurations = build_configurations
124
- @native_targets = native_targets
125
- @save_invocation_count = 0
126
- end
127
-
128
- def save()
129
- @save_invocation_count += 1
130
- end
131
- end
132
-
133
- class XCConfigMock
134
- attr_reader :name
135
- attr_accessor :attributes
136
- attr_reader :save_as_invocation
137
-
138
- def initialize(name, attributes: {})
139
- @name = name
140
- @attributes = attributes
141
- @save_as_invocation = []
142
- end
143
-
144
- def save_as(file_path)
145
- @save_as_invocation.push(file_path)
146
- end
147
- end
148
-
149
- ReceivedCommonResolvedBuildSettings = Struct.new(:key, :resolve_against_xcconfig)
150
-
151
- class TargetMock
152
- attr_reader :name
153
- attr_reader :build_configurations
154
- attr_reader :product_type
155
- attr_reader :received_resolved_build_setting_parameters
156
- attr_reader :dependencies
157
-
158
- def initialize(name, build_configurations = [], product_type = nil, dependencies = [])
159
- @name = name
160
- @build_configurations = build_configurations
161
- unless product_type.nil?
162
- @product_type = product_type
163
- end
164
- @received_resolved_build_setting_parameters = []
165
- @dependencies = dependencies
166
- end
167
-
168
- def resolved_build_setting(key, resolve_against_xcconfig: false)
169
- received_resolved_build_setting_parameters.append(ReceivedCommonResolvedBuildSettings.new(key, resolve_against_xcconfig))
170
-
171
- return {name: build_configurations[0].build_settings[key]}
172
- end
173
- end
174
-
175
- class BuildConfigurationMock
176
- attr_reader :name
177
- attr_reader :build_settings
178
- @is_debug
179
-
180
- def initialize(name, build_settings = {}, is_debug: false)
181
- @name = name
182
- @build_settings = build_settings
183
- @is_debug = is_debug
184
- end
185
-
186
- def debug?
187
- return @is_debug
188
- end
189
- end
190
-
191
- class TargetInstallationResultMock
192
- attr_reader :target
193
- attr_reader :native_target
194
- attr_reader :resource_bundle_targets
195
- attr_reader :test_native_targets
196
- attr_reader :test_resource_bundle_targets
197
- attr_reader :test_app_host_targets
198
- attr_reader :app_native_targets
199
- attr_reader :app_resource_bundle_targets
200
-
201
- def initialize(target = TargetMock, native_target = TargetMock,
202
- resource_bundle_targets = [], test_native_targets = [],
203
- test_resource_bundle_targets = {}, test_app_host_targets = [],
204
- app_native_targets = {}, app_resource_bundle_targets = {})
205
- @target = target
206
- @native_target = native_target
207
- @resource_bundle_targets = resource_bundle_targets
208
- @test_native_targets = test_native_targets
209
- @test_resource_bundle_targets = test_resource_bundle_targets
210
- @test_app_host_targets = test_app_host_targets
211
- @app_native_targets = app_native_targets
212
- @app_resource_bundle_targets = app_resource_bundle_targets
213
- end
214
- end
215
-
216
- class DependencyMock
217
- attr_reader :name
218
-
219
- def initialize(name)
220
- @name = name
221
- end
222
- end
@@ -1,14 +0,0 @@
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
- module LocalPodspecPatch
7
- def self.mock_local_podspecs(pods)
8
- @@local_podspecs = pods
9
- end
10
-
11
- def reset()
12
- @@local_podspecs = []
13
- end
14
- end
@@ -1,43 +0,0 @@
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
- class Open3
7
- @@collected_commands = []
8
- @@collected_dirs = []
9
-
10
- @@returned_text = ""
11
- @@returned_status = 0
12
-
13
- def self.capture2e(command, chdir: ".")
14
- @@collected_commands.push(command)
15
- @@collected_dirs.push(chdir)
16
-
17
- return [*@@returned_text, @@returned_status]
18
- end
19
-
20
- def self.collected_commands
21
- return @@collected_commands
22
- end
23
-
24
- def self.collected_dirs
25
- return @@collected_dirs
26
- end
27
-
28
- def self.set_returned_text(text)
29
- @@returned_text = text
30
- end
31
-
32
- def self.set_returned_status(status)
33
- @@returned_status = status
34
- end
35
-
36
- def self.reset()
37
- @@collected_commands = []
38
- @@collected_dirs = []
39
-
40
- @@returned_text = ""
41
- @@returned_status = 0
42
- end
43
- end
@@ -1,42 +0,0 @@
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
- class Pathname
7
- @@pwd = ""
8
- @@pwd_invocation_count = 0
9
-
10
- attr_reader :path
11
-
12
- def initialize(path)
13
- @path = path
14
- end
15
-
16
- def realpath
17
- return self
18
- end
19
-
20
- def relative_path_from(path)
21
- return @path
22
- end
23
-
24
- def self.pwd!(pwd)
25
- @@pwd = pwd
26
- end
27
-
28
- def self.pwd()
29
- @@pwd_invocation_count += 1
30
- return @@pwd
31
- end
32
-
33
- def self.pwd_invocation_count
34
- return @@pwd_invocation_count
35
- end
36
-
37
-
38
- def self.reset()
39
- @@pwd = ""
40
- @@pwd_invocation_count = 0
41
- end
42
- end
@@ -1,144 +0,0 @@
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
- module Pod
7
- class Config
8
- @@instance = Config.new()
9
-
10
- attr_reader :installation_root
11
-
12
- def initialize()
13
- @installation_root = InstallationRootMock.new()
14
- end
15
-
16
- def self.instance()
17
- return @@instance
18
- end
19
-
20
- def self.reset()
21
- @@instance = Config.new()
22
- end
23
- end
24
-
25
- class InstallationRootMock
26
-
27
- attr_accessor :relative_path_from
28
- attr_accessor :installation_root
29
-
30
- attr_reader :relative_path_from_invocation_count
31
- attr_reader :installation_root_invocation_count
32
-
33
- def initialize()
34
- @relative_path_from = ""
35
- @installation_root = ""
36
- @relative_path_from_invocation_count = 0
37
- @installation_root_invocation_count = 0
38
- end
39
-
40
- def relative_path_from(path)
41
- @relative_path_from_invocation_count += 1
42
- return @relative_path_from
43
- end
44
-
45
- def installation_root(root)
46
- @installation_root_invocation_count += 1
47
- return @installation_root
48
- end
49
-
50
- def set_installation_root(root)
51
- @installation_root = root
52
- end
53
-
54
- def join(path)
55
- return @installation_root + path
56
- end
57
-
58
- end
59
-
60
- class UI
61
-
62
- @@collected_infoes = []
63
- @@collected_messages = []
64
- @@collected_warns = []
65
-
66
- def self.puts(message)
67
- @@collected_messages.push(message)
68
- end
69
-
70
- def self.warn(warn)
71
- @@collected_warns.push(warn)
72
- end
73
-
74
- def self.info(info)
75
- @@collected_infoes.push(info)
76
- end
77
-
78
- def self.collected_messages()
79
- return @@collected_messages
80
- end
81
-
82
- def self.collected_warns()
83
- return @@collected_warns
84
- end
85
-
86
- def self.collected_infoes()
87
- return @@collected_infoes
88
- end
89
-
90
- def self.reset()
91
- @@collected_messages = []
92
- @@collected_warns = []
93
- @@collected_infoes = []
94
- end
95
- end
96
-
97
- class Executable
98
- @@executed_commands = []
99
-
100
- def self.execute_command(command, arguments)
101
- @@executed_commands.push({
102
- "command" => command,
103
- "arguments" => arguments
104
- })
105
- end
106
-
107
- def self.executed_commands
108
- return @@executed_commands
109
- end
110
-
111
- def self.reset()
112
- @@executed_commands = []
113
- end
114
- end
115
-
116
- class Specification
117
- @@specs_from_file = {}
118
-
119
- def self.specs_from_file(specs)
120
- @@specs_from_file = specs
121
- end
122
-
123
- def self.from_file(path)
124
- return @@specs_from_file[path]
125
- end
126
-
127
- def reset()
128
- @@specs_from_file = {}
129
- end
130
- end
131
-
132
- class PodSpecMock
133
- attr_reader :version
134
-
135
- def initialize(version: "0.0.1")
136
- @version = version
137
- end
138
- end
139
-
140
- class Lockfile
141
- def initialize()
142
- end
143
- end
144
- end
@@ -1,30 +0,0 @@
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
- class SpecMock
7
-
8
- attr_accessor :compiler_flags
9
- attr_accessor :pod_target_xcconfig
10
- attr_reader :dependencies
11
-
12
- def initialize
13
- @compiler_flags = ""
14
- @pod_target_xcconfig = Hash.new
15
- @dependencies = []
16
- end
17
-
18
- def dependency(dependency_name, version = nil)
19
- toPush = {"dependency_name": dependency_name}
20
- toPush["version"] = version if version
21
- @dependencies.push(toPush)
22
- end
23
-
24
- def to_hash
25
- return {
26
- "compiler_flags" => @compiler_flags,
27
- "pod_target_xcconfig" => @pod_target_xcconfig,
28
- }
29
- end
30
- end
@@ -1,21 +0,0 @@
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
- # Mock object for SysctlChecker
7
- class SysctlChecker
8
- @@call_sysctl_arm64_return_value = 1
9
-
10
- def call_sysctl_arm64
11
- return @@call_sysctl_arm64_return_value
12
- end
13
-
14
- def self.set_call_sysctl_arm64_return_value(newValue)
15
- @@call_sysctl_arm64_return_value = newValue
16
- end
17
-
18
- def self.reset()
19
- @@call_sysctl_arm64_return_value = 1
20
- end
21
- end
@@ -1,12 +0,0 @@
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
- class TargetDefinitionMock
7
- attr_reader :build_type
8
-
9
- def initialize(build_type)
10
- @build_type = build_type
11
- end
12
- end
@@ -1,39 +0,0 @@
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
- # This file contains the utilities required to mock properly the
7
- # usage of the `pod` function.
8
- #
9
- # To use this file, just add `require_relative "path/to/podSpy.rb"` to your test file.
10
- #
11
- # Remember to invoke `podSpy_cleanUp` in your setup/teardown method, to start from a clean situation.
12
- #
13
- # Whenever your ruby script uses the `pod` function, the invocation is recorded in the `$podInvocation` global
14
- # variable. A $podInvocationCount counter is increased as well.
15
- #
16
- # You can assert against these variables to check:
17
- # * The `pod` function has been invoked X times: `assert_equal($podInvocationCount, X)`
18
- # * A specific pod has been installed: `assert_equal($podInvocation["MyPod"][:version], "15.4.6")`
19
-
20
-
21
- $podInvocation = {}
22
- $podInvocationCount = 0
23
-
24
- def podSpy_cleanUp
25
- $podInvocation = {}
26
- $podInvocationCount = 0
27
- end
28
-
29
- def pod(name, version = nil, path: nil, configurations: nil, modular_headers: nil, podspec: nil, tag: nil)
30
- $podInvocationCount += 1
31
- params = {}
32
- if version != nil then params[:version] = version end
33
- if path != nil then params[:path] = path end
34
- if configurations != nil then params[:configurations] = configurations end
35
- if modular_headers != nil then params[:modular_headers] = modular_headers end
36
- if podspec != nil then params[:podspec] = podspec end
37
- if tag != nil then params[:tag] = tag end
38
- $podInvocation[name] = params
39
- end
@@ -1,14 +0,0 @@
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
- $collected_commands = []
7
-
8
- def system(command)
9
- $collected_commands.push(command)
10
- end
11
-
12
- def system_reset_commands()
13
- $collected_commands = []
14
- end