react-native-tvos 0.72.4-0rc1 → 0.72.5-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.
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/README-core.md +147 -0
- package/README.md +4 -3
- package/React/Base/RCTBundleURLProvider.h +33 -2
- package/React/Base/RCTBundleURLProvider.mm +78 -15
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTTiming.mm +5 -0
- package/React/Fabric/RCTThirdPartyFabricComponentsProvider.h +29 -0
- package/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm +29 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java +4 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +5 -0
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsc/JSCRuntime.cpp +10 -0
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +29 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp +111 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +186 -0
- package/ReactCommon/react/renderer/components/rncore/Props.cpp +157 -0
- package/ReactCommon/react/renderer/components/rncore/Props.h +395 -0
- package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h +257 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp +26 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +111 -0
- package/ReactCommon/react/renderer/components/rncore/States.cpp +18 -0
- package/ReactCommon/react/renderer/components/rncore/States.h +141 -0
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +2 -0
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +1 -0
- package/ReactCommon/react/renderer/core/RawPropsPrimitives.h +4 -4
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/package.json +7 -6
- package/scripts/cocoapods/helpers.rb +16 -0
- package/scripts/cocoapods/utils.rb +98 -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/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +95 -13
- package/template/package.json +2 -2
- package/types/index.d.ts +1 -0
- package/types/public/ReactNativeTVTypes.d.ts +192 -0
- package/scripts/cocoapods/__tests__/codegen-test.rb +0 -242
- package/scripts/cocoapods/__tests__/codegen_utils-test.rb +0 -602
- package/scripts/cocoapods/__tests__/fabric-test.rb +0 -68
- package/scripts/cocoapods/__tests__/flipper-test.rb +0 -161
- package/scripts/cocoapods/__tests__/jsengine-test.rb +0 -130
- package/scripts/cocoapods/__tests__/local_podspec_patch-test.rb +0 -167
- package/scripts/cocoapods/__tests__/new_architecture-test.rb +0 -303
- package/scripts/cocoapods/__tests__/test_utils/CodegenScriptPhaseExtractorMock.rb +0 -21
- package/scripts/cocoapods/__tests__/test_utils/CodegenUtilsMock.rb +0 -108
- package/scripts/cocoapods/__tests__/test_utils/DirMock.rb +0 -72
- package/scripts/cocoapods/__tests__/test_utils/EnvironmentMock.rb +0 -21
- package/scripts/cocoapods/__tests__/test_utils/FileMock.rb +0 -113
- package/scripts/cocoapods/__tests__/test_utils/FileUtilsMock.rb +0 -40
- package/scripts/cocoapods/__tests__/test_utils/FinderMock.rb +0 -28
- package/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb +0 -222
- package/scripts/cocoapods/__tests__/test_utils/LocalPodspecPatchMock.rb +0 -14
- package/scripts/cocoapods/__tests__/test_utils/Open3Mock.rb +0 -43
- package/scripts/cocoapods/__tests__/test_utils/PathnameMock.rb +0 -42
- package/scripts/cocoapods/__tests__/test_utils/PodMock.rb +0 -144
- package/scripts/cocoapods/__tests__/test_utils/SpecMock.rb +0 -30
- package/scripts/cocoapods/__tests__/test_utils/SysctlCheckerMock.rb +0 -21
- package/scripts/cocoapods/__tests__/test_utils/TargetDefinitionMock.rb +0 -12
- package/scripts/cocoapods/__tests__/test_utils/podSpy.rb +0 -39
- package/scripts/cocoapods/__tests__/test_utils/systemUtils.rb +0 -14
- package/scripts/cocoapods/__tests__/utils-test.rb +0 -766
- package/scripts/codegen/__test_fixtures__/fixtures.js +0 -132
- package/scripts/codegen/__tests__/generate-artifacts-executor-test.js +0 -500
- package/scripts/codegen/__tests__/generate-specs-cli-executor-test.js +0 -88
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_:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
270
|
-
#
|
|
271
|
-
|
|
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
|
-
|
|
323
|
+
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
|
|
285
324
|
}
|
|
286
|
-
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme
|
|
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];
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(72),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(5),
|
|
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,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by GenerateRCTThirdPartyFabricComponentsProviderH
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma GCC diagnostic push
|
|
12
|
+
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
|
|
13
|
+
|
|
14
|
+
#import <React/RCTComponentViewProtocol.h>
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
extern "C" {
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
#ifdef __cplusplus
|
|
25
|
+
}
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#pragma GCC diagnostic pop
|
|
29
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by GenerateRCTThirdPartyFabricComponentsProviderCpp
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// OSS-compatibility layer
|
|
12
|
+
|
|
13
|
+
#import "RCTThirdPartyFabricComponentsProvider.h"
|
|
14
|
+
|
|
15
|
+
#import <string>
|
|
16
|
+
#import <unordered_map>
|
|
17
|
+
|
|
18
|
+
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
|
|
19
|
+
static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
|
|
20
|
+
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
auto p = sFabricComponentsClassMap.find(name);
|
|
24
|
+
if (p != sFabricComponentsClassMap.end()) {
|
|
25
|
+
auto classFunc = p->second;
|
|
26
|
+
return classFunc();
|
|
27
|
+
}
|
|
28
|
+
return nil;
|
|
29
|
+
}
|
|
@@ -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)
|
|
@@ -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 =
|
|
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 =
|
|
21
|
-
std::string_view Prerelease = "
|
|
20
|
+
int32_t Patch = 5;
|
|
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() {
|
|
@@ -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 =
|
|
40
|
+
s.header_mappings_dir = './'
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
s.source_files = "ReactCommon/**/*.{mm,cpp,h}"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/rncore/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
|
|
20
|
+
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
|
|
21
|
+
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
|
|
22
|
+
using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidDrawerLayoutShadowNode>;
|
|
23
|
+
using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor<ActivityIndicatorViewShadowNode>;
|
|
24
|
+
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
|
|
25
|
+
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
|
|
26
|
+
using TraceUpdateOverlayComponentDescriptor = ConcreteComponentDescriptor<TraceUpdateOverlayShadowNode>;
|
|
27
|
+
|
|
28
|
+
} // namespace react
|
|
29
|
+
} // namespace facebook
|