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
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 72,
15
- patch: 4,
16
- prerelease: '0rc1',
15
+ patch: 6,
16
+ prerelease: '0',
17
17
  };
@@ -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
- for (const registration of [...registrations]) {
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/README-core.md ADDED
@@ -0,0 +1,147 @@
1
+ <h1 align="center">
2
+ <a href="https://reactnative.dev/">
3
+ React Native
4
+ </a>
5
+ </h1>
6
+
7
+ <p align="center">
8
+ <strong>Learn once, write anywhere:</strong><br>
9
+ Build mobile apps with React.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://github.com/facebook/react-native/blob/HEAD/LICENSE">
14
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="React Native is released under the MIT license." />
15
+ </a>
16
+ <a href="https://circleci.com/gh/facebook/react-native">
17
+ <img src="https://circleci.com/gh/facebook/react-native.svg?style=shield" alt="Current CircleCI build status." />
18
+ </a>
19
+ <a href="https://www.npmjs.org/package/react-native">
20
+ <img src="https://img.shields.io/npm/v/react-native?color=brightgreen&label=npm%20package" alt="Current npm package version." />
21
+ </a>
22
+ <a href="https://reactnative.dev/docs/contributing">
23
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
24
+ </a>
25
+ <a href="https://twitter.com/intent/follow?screen_name=reactnative">
26
+ <img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative" />
27
+ </a>
28
+ </p>
29
+
30
+ <h3 align="center">
31
+ <a href="https://reactnative.dev/docs/getting-started">Getting Started</a>
32
+ <span> · </span>
33
+ <a href="https://reactnative.dev/docs/tutorial">Learn the Basics</a>
34
+ <span> · </span>
35
+ <a href="https://reactnative.dev/showcase">Showcase</a>
36
+ <span> · </span>
37
+ <a href="https://reactnative.dev/docs/contributing">Contribute</a>
38
+ <span> · </span>
39
+ <a href="https://reactnative.dev/help">Community</a>
40
+ <span> · </span>
41
+ <a href="https://github.com/facebook/react-native/blob/HEAD/.github/SUPPORT.md">Support</a>
42
+ </h3>
43
+
44
+ React Native brings [**React**'s][r] declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.
45
+
46
+ - **Declarative.** React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug.
47
+ - **Component-Based.** Build encapsulated components that manage their state, then compose them to make complex UIs.
48
+ - **Developer Velocity.** See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app.
49
+ - **Portability.** Reuse code across iOS, Android, and [other platforms][p].
50
+
51
+ React Native is developed and supported by many companies and individual core contributors. Find out more in our [ecosystem overview][e].
52
+
53
+ [r]: https://reactjs.org/
54
+ [p]: https://reactnative.dev/docs/out-of-tree-platforms
55
+ [e]: https://github.com/facebook/react-native/blob/HEAD/ECOSYSTEM.md
56
+
57
+ ## Contents
58
+
59
+ - [Requirements](#-requirements)
60
+ - [Building your first React Native app](#-building-your-first-react-native-app)
61
+ - [Documentation](#-documentation)
62
+ - [Upgrading](#-upgrading)
63
+ - [How to Contribute](#-how-to-contribute)
64
+ - [Code of Conduct](#code-of-conduct)
65
+ - [License](#-license)
66
+
67
+
68
+ ## 📋 Requirements
69
+
70
+ React Native apps may target iOS 12.4 and Android 5.0 (API 21) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this.
71
+
72
+ ## 🎉 Building your first React Native app
73
+
74
+ Follow the [Getting Started guide](https://reactnative.dev/docs/getting-started). The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:
75
+
76
+ - [Trying out React Native][hello-world]
77
+ - [Creating a New Application][new-app]
78
+ - [Adding React Native to an Existing Application][existing]
79
+
80
+ [hello-world]: https://snack.expo.dev/@samples/hello-world
81
+ [new-app]: https://reactnative.dev/docs/getting-started
82
+ [existing]: https://reactnative.dev/docs/integration-with-existing-apps
83
+
84
+ ## 📖 Documentation
85
+
86
+ The full documentation for React Native can be found on our [website][docs].
87
+
88
+ The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
89
+
90
+ The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
91
+
92
+ [docs]: https://reactnative.dev/docs/getting-started
93
+ [r-docs]: https://reactjs.org/docs/getting-started.html
94
+ [repo-website]: https://github.com/facebook/react-native-website
95
+
96
+ ## 🚀 Upgrading
97
+
98
+ Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the [Upgrading Guide][u] for instructions.
99
+
100
+ React Native releases are discussed [in this discussion repo](https://github.com/reactwg/react-native-releases/discussions).
101
+
102
+ [u]: https://reactnative.dev/docs/upgrading
103
+ [repo-releases]: https://github.com/react-native-community/react-native-releases
104
+
105
+ ## 👏 How to Contribute
106
+
107
+ The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving React Native.
108
+
109
+ ### [Code of Conduct][code]
110
+
111
+ Facebook has adopted a Code of Conduct that we expect project participants to adhere to.
112
+ Please read the [full text][code] so that you can understand what actions will and will not be tolerated.
113
+
114
+ [code]: https://code.fb.com/codeofconduct/
115
+
116
+ ### [Contributing Guide][contribute]
117
+
118
+ Read our [**Contributing Guide**][contribute] to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native.
119
+
120
+ [contribute]: https://reactnative.dev/docs/contributing
121
+
122
+ ### [Open Source Roadmap][roadmap]
123
+
124
+ You can learn more about our vision for React Native in the [**Roadmap**][roadmap].
125
+
126
+ [roadmap]: https://github.com/facebook/react-native/wiki/Roadmap
127
+
128
+ ### Good First Issues
129
+
130
+ We have a list of [good first issues][gfi] that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
131
+
132
+ [gfi]: https://github.com/facebook/react-native/labels/good%20first%20issue
133
+
134
+ ### Discussions
135
+
136
+ Larger discussions and proposals are discussed in [**@react-native-community/discussions-and-proposals**][repo-meta].
137
+
138
+ [repo-meta]: https://github.com/react-native-community/discussions-and-proposals
139
+
140
+ ## 📄 License
141
+
142
+ React Native is MIT licensed, as found in the [LICENSE][l] file.
143
+
144
+ React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file.
145
+
146
+ [l]: https://github.com/facebook/react-native/blob/HEAD/LICENSE
147
+ [ld]: https://github.com/facebook/react-native/blob/HEAD/LICENSE-docs
package/README.md CHANGED
@@ -22,7 +22,7 @@ As of the 0.71 release, Hermes is fully working on both Apple TV and Android TV,
22
22
 
23
23
  ### React Native new architecture (Fabric) support
24
24
 
25
- - _Apple TV_: Set the environment variable `RCT_FABRIC_ENABLED=1`, or modify your app's Podfile to set the `:fabric_enabled` value to `true` in both iOS and tvOS targets. After that, run `pod install` to pick up the additional pods needed for the new architecture. Some components (TVTextScrollView, TabBarIOS) have not been reimplemented in the new architecture so they will show up as an "unimplemented component".
25
+ - _Apple TV_: Modify your app's Podfile to set the `:fabric_enabled` value to `true` in both iOS and tvOS targets. After that, run `pod install` to pick up the additional pods needed for the new architecture. Some components (TVTextScrollView, TabBarIOS) have not been reimplemented in the new architecture so they will show up as an "unimplemented component".
26
26
  - _Android TV_: To enable Fabric, modify `android/gradle.properties` in your app and set `newArchEnabled=true`, then rebuild your app.
27
27
 
28
28
  ### Typescript
@@ -73,9 +73,10 @@ To run Apple TV (and Android TV) targets from the command line, it is now possib
73
73
  - Add a file `react-native.config.js` at the top level of your app directory, with [these contents](https://github.com/byCedric/custom-prebuild-example/blob/main/app/react-native.config.js).
74
74
  - Then an Apple TV target can be run: `npx expo run:ios --scheme MyApp-tvOS --device "Apple TV"`
75
75
  - To run Android TV: `npx expo run:android`
76
- - The above features are now built into
77
76
 
78
- See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. Note that many of these features require that Expo SDK modules be built into your app, which is not yet supported on Apple TV.)
77
+ The Expo dependency and `react-native.config.js` are included in the new app template.
78
+
79
+ See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app, which is not yet supported on Apple TV.)
79
80
 
80
81
  ## Code changes
81
82
 
@@ -101,6 +101,7 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
101
101
 
102
102
  @property (nonatomic, assign) BOOL enableMinification;
103
103
  @property (nonatomic, assign) BOOL enableDev;
104
+ @property (nonatomic, assign) BOOL inlineSourceMap;
104
105
 
105
106
  /**
106
107
  * The scheme/protocol used of the packager, the default is the http protocol
@@ -125,13 +126,32 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
125
126
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
126
127
  packagerHost:(NSString *)packagerHost
127
128
  enableDev:(BOOL)enableDev
128
- enableMinification:(BOOL)enableMinification;
129
+ enableMinification:(BOOL)enableMinification
130
+ __deprecated_msg(
131
+ "Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");
132
+
133
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
134
+ packagerHost:(NSString *)packagerHost
135
+ packagerScheme:(NSString *)scheme
136
+ enableDev:(BOOL)enableDev
137
+ enableMinification:(BOOL)enableMinification
138
+ modulesOnly:(BOOL)modulesOnly
139
+ runModule:(BOOL)runModule
140
+ __deprecated_msg(
141
+ "Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");
142
+
143
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
144
+ packagerHost:(NSString *)packagerHost
145
+ enableDev:(BOOL)enableDev
146
+ enableMinification:(BOOL)enableMinification
147
+ inlineSourceMap:(BOOL)inlineSourceMap;
129
148
 
130
149
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
131
150
  packagerHost:(NSString *)packagerHost
132
151
  packagerScheme:(NSString *)scheme
133
152
  enableDev:(BOOL)enableDev
134
153
  enableMinification:(BOOL)enableMinification
154
+ inlineSourceMap:(BOOL)inlineSourceMap
135
155
  modulesOnly:(BOOL)modulesOnly
136
156
  runModule:(BOOL)runModule;
137
157
  /**
@@ -142,6 +162,17 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
142
162
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
143
163
  packagerHost:(NSString *)packagerHost
144
164
  scheme:(NSString *)scheme
145
- query:(NSString *)query;
165
+ query:(NSString *)query
166
+ __deprecated_msg("Use version with queryItems parameter instead");
167
+
168
+ /**
169
+ * Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
170
+ * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
171
+ * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
172
+ */
173
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
174
+ packagerHost:(NSString *)packagerHost
175
+ scheme:(NSString *)scheme
176
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems;
146
177
 
147
178
  @end
@@ -22,10 +22,12 @@ void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
22
22
  kRCTAllowPackagerAccess = allowed;
23
23
  }
24
24
  #endif
25
+ static NSString *const kRCTPlatformName = @"ios";
25
26
  static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
26
27
  static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
27
28
  static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
28
29
  static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
30
+ static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";
29
31
 
30
32
  @implementation RCTBundleURLProvider
31
33
 
@@ -187,6 +189,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
187
189
  packagerScheme:[self packagerScheme]
188
190
  enableDev:[self enableDev]
189
191
  enableMinification:[self enableMinification]
192
+ inlineSourceMap:[self inlineSourceMap]
190
193
  modulesOnly:NO
191
194
  runModule:YES];
192
195
  }
@@ -199,6 +202,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
199
202
  packagerScheme:[self packagerScheme]
200
203
  enableDev:[self enableDev]
201
204
  enableMinification:[self enableMinification]
205
+ inlineSourceMap:[self inlineSourceMap]
202
206
  modulesOnly:YES
203
207
  runModule:NO];
204
208
  }
@@ -238,13 +242,29 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
238
242
  return [[self class] resourceURLForResourcePath:path
239
243
  packagerHost:packagerServerHostPort
240
244
  scheme:packagerServerScheme
241
- query:nil];
245
+ queryItems:nil];
242
246
  }
243
247
 
244
248
  + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
245
249
  packagerHost:(NSString *)packagerHost
246
250
  enableDev:(BOOL)enableDev
247
251
  enableMinification:(BOOL)enableMinification
252
+ {
253
+ return [self jsBundleURLForBundleRoot:bundleRoot
254
+ packagerHost:packagerHost
255
+ packagerScheme:nil
256
+ enableDev:enableDev
257
+ enableMinification:enableMinification
258
+ inlineSourceMap:NO
259
+ modulesOnly:NO
260
+ runModule:YES];
261
+ }
262
+
263
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
264
+ packagerHost:(NSString *)packagerHost
265
+ enableDev:(BOOL)enableDev
266
+ enableMinification:(BOOL)enableMinification
267
+ inlineSourceMap:(BOOL)inlineSourceMap
248
268
 
249
269
  {
250
270
  return [self jsBundleURLForBundleRoot:bundleRoot
@@ -252,6 +272,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
252
272
  packagerScheme:nil
253
273
  enableDev:enableDev
254
274
  enableMinification:enableMinification
275
+ inlineSourceMap:inlineSourceMap
255
276
  modulesOnly:NO
256
277
  runModule:YES];
257
278
  }
@@ -263,27 +284,45 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
263
284
  enableMinification:(BOOL)enableMinification
264
285
  modulesOnly:(BOOL)modulesOnly
265
286
  runModule:(BOOL)runModule
287
+ {
288
+ return [self jsBundleURLForBundleRoot:bundleRoot
289
+ packagerHost:packagerHost
290
+ packagerScheme:nil
291
+ enableDev:enableDev
292
+ enableMinification:enableMinification
293
+ inlineSourceMap:NO
294
+ modulesOnly:modulesOnly
295
+ runModule:runModule];
296
+ }
297
+
298
+ + (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
299
+ packagerHost:(NSString *)packagerHost
300
+ packagerScheme:(NSString *)scheme
301
+ enableDev:(BOOL)enableDev
302
+ enableMinification:(BOOL)enableMinification
303
+ inlineSourceMap:(BOOL)inlineSourceMap
304
+ modulesOnly:(BOOL)modulesOnly
305
+ runModule:(BOOL)runModule
266
306
  {
267
307
  NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
308
+ BOOL lazy = enableDev;
309
+ NSArray<NSURLQueryItem *> *queryItems = @[
310
+ [[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
311
+ [[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
312
+ [[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
313
+ [[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
314
+ [[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
315
+ [[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
268
316
  #ifdef HERMES_BYTECODE_VERSION
269
- NSString *runtimeBytecodeVersion = [NSString stringWithFormat:@"&runtimeBytecodeVersion=%u", HERMES_BYTECODE_VERSION];
270
- #else
271
- NSString *runtimeBytecodeVersion = @"";
272
- #endif
273
-
274
- // When we support only iOS 8 and above, use queryItems for a better API.
275
- NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
276
- enableDev ? @"true" : @"false",
277
- enableMinification ? @"true" : @"false",
278
- modulesOnly ? @"true" : @"false",
279
- runModule ? @"true" : @"false",
280
- runtimeBytecodeVersion];
317
+ [[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
318
+ #endif
319
+ ];
281
320
 
282
321
  NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
283
322
  if (bundleID) {
284
- query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
323
+ queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
285
324
  }
286
- return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme query:query];
325
+ return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
287
326
  }
288
327
 
289
328
  + (NSURL *)resourceURLForResourcePath:(NSString *)path
@@ -300,6 +339,20 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
300
339
  return components.URL;
301
340
  }
302
341
 
342
+ + (NSURL *)resourceURLForResourcePath:(NSString *)path
343
+ packagerHost:(NSString *)packagerHost
344
+ scheme:(NSString *)scheme
345
+ queryItems:(NSArray<NSURLQueryItem *> *)queryItems
346
+ {
347
+ NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
348
+ resolvingAgainstBaseURL:NO];
349
+ components.path = path;
350
+ if (queryItems != nil) {
351
+ components.queryItems = queryItems;
352
+ }
353
+ return components.URL;
354
+ }
355
+
303
356
  - (void)updateValue:(id)object forKey:(NSString *)key
304
357
  {
305
358
  [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
@@ -317,6 +370,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
317
370
  return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
318
371
  }
319
372
 
373
+ - (BOOL)inlineSourceMap
374
+ {
375
+ return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
376
+ }
377
+
320
378
  - (NSString *)jsLocation
321
379
  {
322
380
  return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
@@ -346,6 +404,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
346
404
  [self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
347
405
  }
348
406
 
407
+ - (void)setInlineSourceMap:(BOOL)inlineSourceMap
408
+ {
409
+ [self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
410
+ }
411
+
349
412
  - (void)setPackagerScheme:(NSString *)packagerScheme
350
413
  {
351
414
  [self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(72),
26
- RCTVersionPatch: @(4),
27
- RCTVersionPrerelease: @"0rc1",
26
+ RCTVersionPatch: @(6),
27
+ RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -128,6 +128,11 @@ RCT_EXPORT_MODULE()
128
128
  _paused = YES;
129
129
  _timers = [NSMutableDictionary new];
130
130
  _inBackground = NO;
131
+ RCTExecuteOnMainQueue(^{
132
+ if (!self->_inBackground && [RCTSharedApplication() applicationState] == UIApplicationStateBackground) {
133
+ [self appDidMoveToBackground];
134
+ }
135
+ });
131
136
 
132
137
  for (NSString *name in @[
133
138
  UIApplicationWillResignActiveNotification,
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.72.4-0rc1
1
+ VERSION_NAME=0.72.6-0
2
2
 
3
3
  # GROUP=com.facebook.react
4
4
  # Group for the TV repo
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 72,
20
- "patch", 4,
21
- "prerelease", "0rc1");
20
+ "patch", 6,
21
+ "prerelease", "0");
22
22
  }
@@ -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,
@@ -103,6 +103,10 @@ public class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup &
103
103
  }
104
104
 
105
105
  View firstVisibleView = mFirstVisibleView.get();
106
+ if (firstVisibleView == null) {
107
+ return;
108
+ }
109
+
106
110
  Rect newFrame = new Rect();
107
111
  firstVisibleView.getHitRect(newFrame);
108
112
 
@@ -8,6 +8,11 @@ set(CMAKE_VERBOSE_MAKEFILE on)
8
8
 
9
9
  project(ReactAndroid)
10
10
 
11
+ # Convert input paths to CMake format (with forward slashes)
12
+ file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
13
+ file(TO_CMAKE_PATH "${REACT_BUILD_DIR}" REACT_BUILD_DIR)
14
+ file(TO_CMAKE_PATH "${REACT_COMMON_DIR}" REACT_COMMON_DIR)
15
+
11
16
  # If you have ccache installed, we're going to honor it.
12
17
  find_program(CCACHE_FOUND ccache)
13
18
  if(CCACHE_FOUND)
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
36
36
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
37
37
 
38
38
  if ENV['USE_FRAMEWORKS']
39
- s.header_mappings_dir = File.absolute_path('./')
39
+ s.header_mappings_dir = './'
40
40
  s.module_name = 'React_Fabric'
41
41
  end
42
42
 
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "GCC_WARN_PEDANTIC" => "YES" }
39
39
  if ENV['USE_FRAMEWORKS']
40
- s.header_mappings_dir = File.absolute_path("./")
40
+ s.header_mappings_dir = './'
41
41
  end
42
42
 
43
43
  # TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
@@ -17,8 +17,8 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 72;
20
- int32_t Patch = 4;
21
- std::string_view Prerelease = "0rc1";
20
+ int32_t Patch = 6;
21
+ std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -309,6 +309,9 @@ class JSCRuntime : public jsi::Runtime {
309
309
  #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0
310
310
  #define _JSC_NO_ARRAY_BUFFERS
311
311
  #endif
312
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
313
+ #define _JSC_HAS_INSPECTABLE
314
+ #endif
312
315
  #endif
313
316
  #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
314
317
  #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11
@@ -405,6 +408,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
405
408
  stringCounter_(0)
406
409
  #endif
407
410
  {
411
+ #ifndef NDEBUG
412
+ #ifdef _JSC_HAS_INSPECTABLE
413
+ if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
414
+ JSGlobalContextSetInspectable(ctx_, true);
415
+ }
416
+ #endif
417
+ #endif
408
418
  }
409
419
 
410
420
  JSCRuntime::~JSCRuntime() {
@@ -31,6 +31,6 @@ Pod::Spec.new do |s|
31
31
 
32
32
  if ENV['USE_FRAMEWORKS']
33
33
  s.module_name = "React_debug"
34
- s.header_mappings_dir = File.absolute_path("../..")
34
+ s.header_mappings_dir = "../.."
35
35
  end
36
36
  end
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "GCC_WARN_PEDANTIC" => "YES" }
39
39
  if ENV['USE_FRAMEWORKS']
40
- s.header_mappings_dir = File.absolute_path('./')
40
+ s.header_mappings_dir = './'
41
41
  end
42
42
 
43
43
  s.source_files = "ReactCommon/**/*.{mm,cpp,h}"
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
38
38
  "GCC_WARN_PEDANTIC" => "YES" }
39
39
  if ENV['USE_FRAMEWORKS']
40
- s.header_mappings_dir = File.absolute_path('./')
40
+ s.header_mappings_dir = './'
41
41
  end
42
42
 
43
43
 
@@ -38,6 +38,8 @@ void RawPropsKeyMap::insert(
38
38
  item.value = value;
39
39
  key.render(item.name, &item.length);
40
40
  items_.push_back(item);
41
+ react_native_assert(
42
+ items_.size() < std::numeric_limits<RawPropsPropNameLength>::max());
41
43
  }
42
44
 
43
45
  void RawPropsKeyMap::reindex() noexcept {
@@ -42,6 +42,7 @@ RawValue const *RawPropsParser::at(
42
42
  // This is not thread-safe part; this happens only during initialization of
43
43
  // a `ComponentDescriptor` where it is actually safe.
44
44
  keys_.push_back(key);
45
+ react_native_assert(size < std::numeric_limits<RawPropsValueIndex>::max());
45
46
  nameToIndex_.insert(key, static_cast<RawPropsValueIndex>(size));
46
47
  return nullptr;
47
48
  }
@@ -16,11 +16,11 @@ namespace react {
16
16
  /*
17
17
  * Type used to represent an index of some stored values in small arrays.
18
18
  */
19
- using RawPropsValueIndex = uint8_t;
19
+ using RawPropsValueIndex = uint16_t;
20
20
  static_assert(
21
- sizeof(RawPropsValueIndex) == 1,
22
- "RawPropsValueIndex must be one byte size.");
23
- using RawPropsPropNameLength = uint8_t;
21
+ sizeof(RawPropsValueIndex) == 2,
22
+ "RawPropsValueIndex must be two byte size.");
23
+ using RawPropsPropNameLength = uint16_t;
24
24
  using RawPropsPropNameHash = uint32_t;
25
25
 
26
26
  /*