react-native-tvos 0.84.0-0rc0 → 0.84.1-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.md +16 -54
- package/React/Base/RCTVersion.m +2 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +12 -12
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +14 -16
- package/React/Views/RCTTVView.h +6 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +101 -22
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +1 -1
- package/ReactAndroid/src/main/jni/react/hermes/reactexecutor/CMakeLists.txt +0 -4
- package/ReactAndroid/src/main/jni/react/runtime/hermes/jni/CMakeLists.txt +0 -4
- package/ReactAndroid/src/main/jni/react/runtime/jni/CMakeLists.txt +0 -4
- package/ReactCommon/cmake-utils/react-native-flags.cmake +3 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/hermes/executor/CMakeLists.txt +0 -4
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +2 -0
- package/ReactCommon/hermes/inspector-modern/CMakeLists.txt +0 -4
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +44 -3
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +408 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedProps.h +66 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsBuilder.h +58 -2
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +52 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +6 -9
- package/ReactCommon/react/runtime/CMakeLists.txt +0 -4
- package/ReactCommon/react/runtime/hermes/CMakeLists.txt +0 -4
- package/package.json +11 -10
- package/react-native.config.js +17 -0
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +5 -5
- package/scripts/ios-configure-glog.sh +18 -0
- package/scripts/react_native_pods.rb +5 -0
- package/sdks/.hermesv1version +1 -1
- package/sdks/.hermesversion +1 -1
- package/sdks/hermes-engine/hermes-engine.podspec +15 -6
- package/sdks/hermes-engine/hermes-utils.rb +1 -1
- package/sdks/hermes-engine/version.properties +2 -2
- package/settings.gradle.kts +21 -1
- package/third-party-podspecs/glog.podspec +1 -0
- package/tvosCommands.js +51 -0
- package/types/public/ReactNativeTVTypes.d.ts +7 -0
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
export default class ReactNativeVersion {
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 84;
|
|
31
|
-
static patch: number =
|
|
32
|
-
static prerelease: string | null = '
|
|
31
|
+
static patch: number = 1;
|
|
32
|
+
static prerelease: string | null = '0';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
package/README.md
CHANGED
|
@@ -94,64 +94,26 @@ See the [Building Expo apps for TV](https://docs.expo.dev/guides/building-for-tv
|
|
|
94
94
|
|
|
95
95
|
Using Expo's [continuous native generation (CNG)](https://docs.expo.dev/workflow/continuous-native-generation/) model, projects created this way can be used to build either mobile or TV apps, taking advantage of the full support for both mobile and TV platforms in this repo.
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### Creating a new project with the Community CLI
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
We maintain [template-tv](https://github.com/react-native-tvos/template-tv), a TV-specific template for developers using the React Native Community CLI. This project extends the Community CLI with `run-tvos`, `build-tvos`, and `log-tvos` commands for tvOS development.
|
|
100
100
|
|
|
101
|
-
>
|
|
102
|
-
|
|
103
|
-
To create a new project for RNTV 0.81:
|
|
101
|
+
> [!NOTE]
|
|
102
|
+
> This template only supports Apple TV and Android TV. Multiple platform targets are no longer supported in React Native app Podfiles.
|
|
104
103
|
|
|
104
|
+
**Quick start:**
|
|
105
105
|
```sh
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
## ######################## ##
|
|
118
|
-
###### ### ### ######
|
|
119
|
-
### ## ## ## ## ###
|
|
120
|
-
### ## ### #### ### ## ###
|
|
121
|
-
## #### ######## #### ##
|
|
122
|
-
## ### ########## ### ##
|
|
123
|
-
## #### ######## #### ##
|
|
124
|
-
### ## ### #### ### ## ###
|
|
125
|
-
### ## ## ## ## ###
|
|
126
|
-
###### ### ### ######
|
|
127
|
-
## ######################## ##
|
|
128
|
-
## ### ### ##
|
|
129
|
-
## ## ## ##
|
|
130
|
-
## #### ##
|
|
131
|
-
## #### ##
|
|
132
|
-
## ### ### ##
|
|
133
|
-
### #### #### ###
|
|
134
|
-
###### ######
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Welcome to React Native 0.81!
|
|
138
|
-
Learn once, write anywhere
|
|
139
|
-
|
|
140
|
-
✔ Downloading template
|
|
141
|
-
✔ Copying template
|
|
142
|
-
✔ Processing template
|
|
143
|
-
✔ Installing dependencies
|
|
144
|
-
✔ Do you want to install CocoaPods now? Only needed if you run your project in Xcode directly … yes
|
|
145
|
-
✔ Installing Ruby Gems
|
|
146
|
-
✔ Installing CocoaPods dependencies (this may take a few minutes)
|
|
147
|
-
.
|
|
148
|
-
.
|
|
149
|
-
.
|
|
150
|
-
$ cd TVTest
|
|
151
|
-
# Now build and start the app in the tvOS Simulator - this will only work on a macOS machine.
|
|
152
|
-
npx react-native run-ios --simulator "Apple TV"
|
|
153
|
-
# This command builds and starts the app in an Android TV emulator (needs to be created in advance).
|
|
154
|
-
npx react-native run:android --device tv_api_31
|
|
106
|
+
# Initialize a new app called 'TVTest'
|
|
107
|
+
# This command should be run outside of any existing node project
|
|
108
|
+
npx @react-native-community/cli@latest init TVTest --template @react-native-tvos/template-tv
|
|
109
|
+
|
|
110
|
+
cd TVTest
|
|
111
|
+
|
|
112
|
+
# Build and run on tvOS Simulator (macOS only, requires Apple TV simulator)
|
|
113
|
+
npx react-native run-tvos --simulator "Apple TV"
|
|
114
|
+
|
|
115
|
+
# Build and run on Android TV emulator (requires Android TV emulator)
|
|
116
|
+
npx react-native run-android --device tv_api_31
|
|
155
117
|
```
|
|
156
118
|
|
|
157
119
|
## How to support TV specific file extensions
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(84),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(1),
|
|
27
|
+
RCTVersionPrerelease: @"0",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -1139,6 +1139,16 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
1139
1139
|
#pragma mark Apple TV swipe and focus handling
|
|
1140
1140
|
|
|
1141
1141
|
#if TARGET_OS_TV
|
|
1142
|
+
- (void)sendFocusEvent
|
|
1143
|
+
{
|
|
1144
|
+
self->_eventEmitter->onFocus();
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
- (void)sendBlurEvent
|
|
1148
|
+
{
|
|
1149
|
+
self->_eventEmitter->onBlur();
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1142
1152
|
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
|
|
1143
1153
|
withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
|
|
1144
1154
|
{
|
|
@@ -1148,13 +1158,13 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
1148
1158
|
if (context.nextFocusedView == self) {
|
|
1149
1159
|
[self becomeFirstResponder];
|
|
1150
1160
|
[self addSwipeGestureRecognizers];
|
|
1151
|
-
[self
|
|
1161
|
+
[self sendFocusEvent];
|
|
1152
1162
|
// if we enter the scroll view from different view then block first touch event since it is the event that triggered the focus
|
|
1153
1163
|
_blockFirstTouch = (unsigned long)context.focusHeading != 0;
|
|
1154
1164
|
[self addArrowsListeners];
|
|
1155
1165
|
} else if (context.previouslyFocusedView == self) {
|
|
1156
1166
|
[self removeArrowsListeners];
|
|
1157
|
-
[self
|
|
1167
|
+
[self sendBlurEvent];
|
|
1158
1168
|
[self removeSwipeGestureRecognizers];
|
|
1159
1169
|
[self resignFirstResponder];
|
|
1160
1170
|
// If scrolling is enabled:
|
|
@@ -1263,16 +1273,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
1263
1273
|
return [super shouldUpdateFocusInContext:context];
|
|
1264
1274
|
}
|
|
1265
1275
|
|
|
1266
|
-
- (void)sendFocusNotification
|
|
1267
|
-
{
|
|
1268
|
-
[[NSNotificationCenter defaultCenter] postNavigationFocusEventWithTag:@(self.tag) target:nil];
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
- (void)sendBlurNotification
|
|
1272
|
-
{
|
|
1273
|
-
[[NSNotificationCenter defaultCenter] postNavigationBlurEventWithTag:@(self.tag) target:nil];
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
1276
|
- (NSInteger)swipeVerticalInterval
|
|
1277
1277
|
{
|
|
1278
1278
|
RCTEnhancedScrollView *scrollView = (RCTEnhancedScrollView *)_scrollView;
|
|
@@ -88,6 +88,7 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
88
88
|
NSArray* _focusDestinations;
|
|
89
89
|
id<UIFocusItem> _previouslyFocusedItem;
|
|
90
90
|
RCTSwiftUIContainerViewWrapper *_swiftUIWrapper;
|
|
91
|
+
BOOL _shouldFocusOnMount;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
#ifdef RCT_DYNAMIC_FRAMEWORKS
|
|
@@ -113,6 +114,8 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
113
114
|
_tvParallaxProperties.pressMagnification = 1.0f;
|
|
114
115
|
_tvParallaxProperties.pressDuration = 0.3f;
|
|
115
116
|
_tvParallaxProperties.pressDelay = 0.0f;
|
|
117
|
+
|
|
118
|
+
_shouldFocusOnMount = false;
|
|
116
119
|
#else
|
|
117
120
|
self.multipleTouchEnabled = YES;
|
|
118
121
|
#endif
|
|
@@ -170,6 +173,15 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
170
173
|
|
|
171
174
|
#pragma mark - Apple TV methods
|
|
172
175
|
|
|
176
|
+
- (void)didMoveToWindow {
|
|
177
|
+
[super didMoveToWindow];
|
|
178
|
+
|
|
179
|
+
if (self->_shouldFocusOnMount) {
|
|
180
|
+
self->_shouldFocusOnMount = false;
|
|
181
|
+
[self focusSelf];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
173
185
|
- (RCTSurfaceHostingProxyRootView *)containingRootView
|
|
174
186
|
{
|
|
175
187
|
UIView *rootview = self;
|
|
@@ -205,10 +217,8 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
205
217
|
if (!focusedSync) {
|
|
206
218
|
// `focusSelf` function relies on `rootView` which may not be present on the first render.
|
|
207
219
|
// `focusSelf` fails and returns `false` in that case. We try re-executing the same action
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
[self focusSelf];
|
|
211
|
-
});
|
|
220
|
+
// when the view has moved to the window. This is tracked by the `_shouldFocusOnMount` flag.
|
|
221
|
+
self->_shouldFocusOnMount = true;
|
|
212
222
|
}
|
|
213
223
|
}
|
|
214
224
|
|
|
@@ -265,16 +275,6 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
265
275
|
[self handleFocusGuide];
|
|
266
276
|
}
|
|
267
277
|
|
|
268
|
-
- (void)sendFocusNotification:(__unused UIFocusUpdateContext *)context
|
|
269
|
-
{
|
|
270
|
-
[[NSNotificationCenter defaultCenter] postNavigationFocusEventWithTag:@(self.tag) target:@(self.tag)];
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
- (void)sendBlurNotification:(__unused UIFocusUpdateContext *)context
|
|
274
|
-
{
|
|
275
|
-
[[NSNotificationCenter defaultCenter] postNavigationBlurEventWithTag:@(self.tag) target:@(self.tag)];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
278
|
- (void)sendSelectNotification
|
|
279
279
|
{
|
|
280
280
|
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventSelect keyAction:RCTTVRemoteEventKeyActionUp tag:@(self.tag) target:@(self.tag)];
|
|
@@ -596,7 +596,6 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
596
596
|
[self enableDirectionalFocusGuides];
|
|
597
597
|
[coordinator addCoordinatedAnimations:^(void){
|
|
598
598
|
if (self->_eventEmitter) self->_eventEmitter->onFocus();
|
|
599
|
-
[self sendFocusNotification:context];
|
|
600
599
|
[self addParallaxMotionEffects];
|
|
601
600
|
} completion:^(void){}];
|
|
602
601
|
// Without this check, onBlur would also trigger when `TVFocusGuideView` transfers focus to its children.
|
|
@@ -607,7 +606,6 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
607
606
|
[coordinator addCoordinatedAnimations:^(void){
|
|
608
607
|
[self removeParallaxMotionEffects];
|
|
609
608
|
if (self->_eventEmitter) self->_eventEmitter->onBlur();
|
|
610
|
-
[self sendBlurNotification:context];
|
|
611
609
|
} completion:^(void){}];
|
|
612
610
|
[self resignFirstResponder];
|
|
613
611
|
}
|
package/React/Views/RCTTVView.h
CHANGED
|
@@ -70,11 +70,17 @@
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Send Focus Notifications to listeners
|
|
73
|
+
* @deprecated This method emits focus events to TVEventHandler, which is deprecated.
|
|
74
|
+
* Use onFocus/onBlur component props instead. Will be removed when old arch is removed.
|
|
75
|
+
* See: https://github.com/react-native-tvos/react-native-tvos/issues/1037
|
|
73
76
|
*/
|
|
74
77
|
- (void)sendFocusNotification:(UIFocusUpdateContext *)context;
|
|
75
78
|
|
|
76
79
|
/**
|
|
77
80
|
* Send Blur Notifications to listeners
|
|
81
|
+
* @deprecated This method emits blur events to TVEventHandler, which is deprecated.
|
|
82
|
+
* Use onFocus/onBlur component props instead. Will be removed when old arch is removed.
|
|
83
|
+
* See: https://github.com/react-native-tvos/react-native-tvos/issues/1037
|
|
78
84
|
*/
|
|
79
85
|
- (void)sendBlurNotification:(UIFocusUpdateContext *)context;
|
|
80
86
|
|
|
@@ -151,28 +151,55 @@ val installCMake by
|
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
fun configureBuildForHermesCommandLineArgs(
|
|
155
|
+
hermesBuildDir: File,
|
|
156
|
+
jsiDir: File,
|
|
157
|
+
enableDebugger: Boolean,
|
|
158
|
+
): List<String> {
|
|
159
|
+
var cmakeCommandLine =
|
|
160
|
+
windowsAwareCommandLine(
|
|
161
|
+
cmakeBinaryPath,
|
|
162
|
+
// Suppress all warnings as this is the Hermes build and we can't fix them.
|
|
163
|
+
"--log-level=ERROR",
|
|
164
|
+
"-Wno-dev",
|
|
165
|
+
"-S",
|
|
166
|
+
".",
|
|
167
|
+
"-B",
|
|
168
|
+
hermesBuildDir.toString(),
|
|
169
|
+
"-DJSI_DIR=" + jsiDir.absolutePath,
|
|
170
|
+
"-DCMAKE_BUILD_TYPE=Release",
|
|
171
|
+
)
|
|
172
|
+
if (enableDebugger) {
|
|
173
|
+
cmakeCommandLine = cmakeCommandLine + "-DHERMES_ENABLE_DEBUGGER=True"
|
|
174
|
+
}
|
|
175
|
+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
176
|
+
cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles"
|
|
177
|
+
}
|
|
178
|
+
if (hermesV1Enabled) {
|
|
179
|
+
cmakeCommandLine = cmakeCommandLine + "-DHERMESVM_HEAP_HV_MODE=HEAP_HV_PREFER32"
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return cmakeCommandLine
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
fun buildHermesCCommandLineArgs() =
|
|
186
|
+
listOf(
|
|
187
|
+
cmakeBinaryPath,
|
|
188
|
+
"--build",
|
|
189
|
+
hermesBuildDir.toString(),
|
|
190
|
+
"--target",
|
|
191
|
+
"hermesc",
|
|
192
|
+
"-j",
|
|
193
|
+
ndkBuildJobs,
|
|
194
|
+
)
|
|
195
|
+
|
|
154
196
|
val configureBuildForHermes by
|
|
155
197
|
tasks.registering(CustomExecTask::class) {
|
|
156
198
|
dependsOn(installCMake)
|
|
157
199
|
workingDir(hermesDir)
|
|
158
200
|
inputs.dir(hermesDir)
|
|
159
201
|
outputs.files(hermesBuildOutputFileTree)
|
|
160
|
-
|
|
161
|
-
windowsAwareCommandLine(
|
|
162
|
-
cmakeBinaryPath,
|
|
163
|
-
// Suppress all warnings as this is the Hermes build and we can't fix them.
|
|
164
|
-
"--log-level=ERROR",
|
|
165
|
-
"-Wno-dev",
|
|
166
|
-
"-S",
|
|
167
|
-
".",
|
|
168
|
-
"-B",
|
|
169
|
-
hermesBuildDir.toString(),
|
|
170
|
-
"-DJSI_DIR=" + jsiDir.absolutePath,
|
|
171
|
-
"-DCMAKE_BUILD_TYPE=Release",
|
|
172
|
-
)
|
|
173
|
-
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
174
|
-
cmakeCommandLine = cmakeCommandLine + "-GNMake Makefiles"
|
|
175
|
-
}
|
|
202
|
+
val cmakeCommandLine = configureBuildForHermesCommandLineArgs(hermesBuildDir, jsiDir, false)
|
|
176
203
|
commandLine(cmakeCommandLine)
|
|
177
204
|
standardOutputFile.set(project.file("$buildDir/configure-hermesc.log"))
|
|
178
205
|
}
|
|
@@ -183,22 +210,69 @@ val buildHermesC by
|
|
|
183
210
|
workingDir(hermesDir)
|
|
184
211
|
inputs.files(hermesBuildOutputFileTree)
|
|
185
212
|
outputs.file(hermesCOutputBinary)
|
|
213
|
+
val cmakeCommandLine = buildHermesCCommandLineArgs()
|
|
214
|
+
commandLine(cmakeCommandLine)
|
|
215
|
+
standardOutputFile.set(project.file("$buildDir/build-hermesc.log"))
|
|
216
|
+
errorOutputFile.set(project.file("$buildDir/build-hermesc.error.log"))
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
val prepareHeadersForPrefab by
|
|
220
|
+
tasks.registering(Copy::class) {
|
|
221
|
+
dependsOn(buildHermesC)
|
|
222
|
+
from("$hermesDir/API")
|
|
223
|
+
from("$hermesDir/public")
|
|
224
|
+
include("**/*.h")
|
|
225
|
+
exclude("jsi/**")
|
|
226
|
+
into(prefabHeadersDir)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
val buildHermesLib by
|
|
230
|
+
tasks.registering(CustomExecTask::class) {
|
|
231
|
+
dependsOn(buildHermesC)
|
|
232
|
+
workingDir(hermesDir)
|
|
233
|
+
inputs.files(hermesBuildOutputFileTree)
|
|
186
234
|
commandLine(
|
|
187
235
|
cmakeBinaryPath,
|
|
188
236
|
"--build",
|
|
189
237
|
hermesBuildDir.toString(),
|
|
190
238
|
"--target",
|
|
191
|
-
"
|
|
239
|
+
"hermesvm",
|
|
192
240
|
"-j",
|
|
193
241
|
ndkBuildJobs,
|
|
194
242
|
)
|
|
243
|
+
standardOutputFile.set(project.file("$buildDir/build-hermes-lib.log"))
|
|
244
|
+
errorOutputFile.set(project.file("$buildDir/build-hermes-lib.error.log"))
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// The repeated tasks below named "*WithDebugger" are required by Fantom.
|
|
248
|
+
// Hermes V1 by default builds with the debugger disabled, while Fantom needs
|
|
249
|
+
// it to be enabled as it does a debug build of React Native.
|
|
250
|
+
val configureBuildForHermesWithDebugger by
|
|
251
|
+
tasks.registering(CustomExecTask::class) {
|
|
252
|
+
dependsOn(installCMake)
|
|
253
|
+
workingDir(hermesDir)
|
|
254
|
+
inputs.dir(hermesDir)
|
|
255
|
+
outputs.files(hermesBuildOutputFileTree)
|
|
256
|
+
val cmakeCommandLine = configureBuildForHermesCommandLineArgs(hermesBuildDir, jsiDir, true)
|
|
257
|
+
commandLine(cmakeCommandLine)
|
|
258
|
+
standardOutputFile.set(project.file("$buildDir/configure-hermesc.log"))
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
val buildHermesCWithDebugger by
|
|
262
|
+
tasks.registering(CustomExecTask::class) {
|
|
263
|
+
dependsOn(configureBuildForHermesWithDebugger)
|
|
264
|
+
workingDir(hermesDir)
|
|
265
|
+
inputs.files(hermesBuildOutputFileTree)
|
|
266
|
+
outputs.file(hermesCOutputBinary)
|
|
267
|
+
val cmakeCommandLine = buildHermesCCommandLineArgs()
|
|
268
|
+
commandLine(cmakeCommandLine)
|
|
195
269
|
standardOutputFile.set(project.file("$buildDir/build-hermesc.log"))
|
|
196
270
|
errorOutputFile.set(project.file("$buildDir/build-hermesc.error.log"))
|
|
197
271
|
}
|
|
198
272
|
|
|
199
|
-
val
|
|
273
|
+
val prepareHeadersForPrefabWithDebugger by
|
|
200
274
|
tasks.registering(Copy::class) {
|
|
201
|
-
dependsOn(
|
|
275
|
+
dependsOn(buildHermesCWithDebugger)
|
|
202
276
|
from("$hermesDir/API")
|
|
203
277
|
from("$hermesDir/public")
|
|
204
278
|
include("**/*.h")
|
|
@@ -206,9 +280,9 @@ val prepareHeadersForPrefab by
|
|
|
206
280
|
into(prefabHeadersDir)
|
|
207
281
|
}
|
|
208
282
|
|
|
209
|
-
val
|
|
283
|
+
val buildHermesLibWithDebugger by
|
|
210
284
|
tasks.registering(CustomExecTask::class) {
|
|
211
|
-
dependsOn(
|
|
285
|
+
dependsOn(buildHermesCWithDebugger)
|
|
212
286
|
workingDir(hermesDir)
|
|
213
287
|
inputs.files(hermesBuildOutputFileTree)
|
|
214
288
|
commandLine(
|
|
@@ -349,7 +423,10 @@ android {
|
|
|
349
423
|
java.srcDirs("$hermesDir/lib/Platform/Intl/java", "$hermesDir/lib/Platform/Unicode/java")
|
|
350
424
|
}
|
|
351
425
|
|
|
352
|
-
buildFeatures {
|
|
426
|
+
buildFeatures {
|
|
427
|
+
prefab = true
|
|
428
|
+
prefabPublishing = true
|
|
429
|
+
}
|
|
353
430
|
|
|
354
431
|
dependencies {
|
|
355
432
|
implementation(libs.fbjni)
|
|
@@ -372,6 +449,8 @@ afterEvaluate {
|
|
|
372
449
|
// download/unzip Hermes from Github then.
|
|
373
450
|
tasks.getByName("configureBuildForHermes").dependsOn(unzipHermes)
|
|
374
451
|
tasks.getByName("prepareHeadersForPrefab").dependsOn(unzipHermes)
|
|
452
|
+
tasks.getByName("configureBuildForHermesWithDebugger").dependsOn(unzipHermes)
|
|
453
|
+
tasks.getByName("prepareHeadersForPrefabWithDebugger").dependsOn(unzipHermes)
|
|
375
454
|
}
|
|
376
455
|
tasks.getByName("preBuild").dependsOn(buildHermesC)
|
|
377
456
|
tasks.getByName("preBuild").dependsOn(prepareHeadersForPrefab)
|
|
@@ -109,13 +109,13 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
109
109
|
|
|
110
110
|
@ReactProp(name = "tvFocusable")
|
|
111
111
|
public open fun setTvFocusable(view: ReactViewGroup, focusable: Boolean) {
|
|
112
|
-
setFocusable(view, focusable)
|
|
113
112
|
if (!focusable) {
|
|
114
113
|
view.isFocusable = false
|
|
115
114
|
view.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
|
116
115
|
} else {
|
|
117
116
|
view.descendantFocusability = ViewGroup.FOCUS_AFTER_DESCENDANTS
|
|
118
117
|
}
|
|
118
|
+
setFocusable(view, focusable)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
@ReactProp(name = ViewProps.ACCESSIBILITY_ORDER)
|
|
@@ -27,8 +27,4 @@ target_link_libraries(
|
|
|
27
27
|
target_compile_reactnative_options(hermes_executor PRIVATE)
|
|
28
28
|
if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
|
|
29
29
|
target_compile_options(hermes_executor PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
|
|
30
|
-
|
|
31
|
-
if (HERMES_V1_ENABLED)
|
|
32
|
-
target_compile_options(hermes_executor PRIVATE -DHERMES_V1_ENABLED=1)
|
|
33
|
-
endif()
|
|
34
30
|
endif()
|
|
@@ -29,8 +29,4 @@ target_link_libraries(hermesinstancejni
|
|
|
29
29
|
target_compile_reactnative_options(hermesinstancejni PRIVATE)
|
|
30
30
|
if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
|
|
31
31
|
target_compile_options(hermesinstancejni PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
|
|
32
|
-
|
|
33
|
-
if (HERMES_V1_ENABLED)
|
|
34
|
-
target_compile_options(hermesinstancejni PRIVATE -DHERMES_V1_ENABLED=1)
|
|
35
|
-
endif()
|
|
36
32
|
endif ()
|
|
@@ -19,10 +19,6 @@ add_library(rninstance
|
|
|
19
19
|
target_compile_reactnative_options(rninstance PRIVATE)
|
|
20
20
|
if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
|
|
21
21
|
target_compile_options(rninstance PRIVATE -DHERMES_ENABLE_DEBUGGER=1)
|
|
22
|
-
|
|
23
|
-
if (HERMES_V1_ENABLED)
|
|
24
|
-
target_compile_options(rninstance PRIVATE -DHERMES_V1_ENABLED=1)
|
|
25
|
-
endif()
|
|
26
22
|
endif ()
|
|
27
23
|
|
|
28
24
|
target_merge_so(rninstance)
|
|
@@ -32,4 +32,7 @@ function(target_compile_reactnative_options target_name scope)
|
|
|
32
32
|
if(ANDROID)
|
|
33
33
|
target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE)
|
|
34
34
|
endif()
|
|
35
|
+
if(HERMES_V1_ENABLED)
|
|
36
|
+
target_compile_definitions(${target_name} ${scope} HERMES_V1_ENABLED=1)
|
|
37
|
+
endif()
|
|
35
38
|
endfunction()
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
#define REACT_NATIVE_VERSION_MAJOR 0
|
|
16
16
|
#define REACT_NATIVE_VERSION_MINOR 84
|
|
17
|
-
#define REACT_NATIVE_VERSION_PATCH
|
|
17
|
+
#define REACT_NATIVE_VERSION_PATCH 1
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
21
|
constexpr struct {
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 84;
|
|
24
|
-
int32_t Patch =
|
|
25
|
-
std::string_view Prerelease = "
|
|
24
|
+
int32_t Patch = 1;
|
|
25
|
+
std::string_view Prerelease = "0";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
|
28
28
|
} // namespace facebook::react
|
|
@@ -32,10 +32,6 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
|
|
|
32
32
|
PRIVATE
|
|
33
33
|
-DHERMES_ENABLE_DEBUGGER=1
|
|
34
34
|
)
|
|
35
|
-
|
|
36
|
-
if (HERMES_V1_ENABLED)
|
|
37
|
-
target_compile_options(hermes_executor_common PRIVATE -DHERMES_V1_ENABLED=1)
|
|
38
|
-
endif()
|
|
39
35
|
else()
|
|
40
36
|
target_compile_options(
|
|
41
37
|
hermes_executor_common
|
|
@@ -23,10 +23,6 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
|
|
|
23
23
|
PRIVATE
|
|
24
24
|
-DHERMES_ENABLE_DEBUGGER=1
|
|
25
25
|
)
|
|
26
|
-
|
|
27
|
-
if (HERMES_V1_ENABLED)
|
|
28
|
-
target_compile_options(hermes_inspector_modern PRIVATE -DHERMES_V1_ENABLED=1)
|
|
29
|
-
endif()
|
|
30
26
|
endif()
|
|
31
27
|
|
|
32
28
|
target_include_directories(hermes_inspector_modern PUBLIC ${REACT_COMMON_DIR})
|
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
#include "Registration.h"
|
|
9
9
|
#include "ConnectionDemux.h"
|
|
10
10
|
|
|
11
|
-
#if defined(HERMES_ENABLE_DEBUGGER)
|
|
11
|
+
#if defined(HERMES_ENABLE_DEBUGGER)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
#include <hermes/hermes.h>
|
|
14
|
+
|
|
15
|
+
#if !defined(HERMES_V1_ENABLED)
|
|
14
16
|
|
|
17
|
+
namespace facebook::hermes::inspector_modern::chrome {
|
|
15
18
|
namespace {
|
|
16
19
|
|
|
17
20
|
ConnectionDemux& demux() {
|
|
@@ -34,4 +37,42 @@ void disableDebugging(DebugSessionToken session) {
|
|
|
34
37
|
|
|
35
38
|
} // namespace facebook::hermes::inspector_modern::chrome
|
|
36
39
|
|
|
37
|
-
#
|
|
40
|
+
#else
|
|
41
|
+
|
|
42
|
+
namespace facebook::hermes::inspector_modern {
|
|
43
|
+
class RuntimeAdapter {
|
|
44
|
+
// Backwards compatibility definition fallback for libraries that are compiled
|
|
45
|
+
// without `HERMES_V1_ENABLED` but are linked against React Native with
|
|
46
|
+
// `HERMES_V1_ENABLED` which doesn't provide this symbol.
|
|
47
|
+
public:
|
|
48
|
+
virtual ~RuntimeAdapter() = 0;
|
|
49
|
+
virtual HermesRuntime& getRuntime() = 0;
|
|
50
|
+
virtual void tickleJs();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
namespace chrome {
|
|
54
|
+
|
|
55
|
+
using DebugSessionToken = int;
|
|
56
|
+
|
|
57
|
+
DebugSessionToken enableDebugging(
|
|
58
|
+
std::unique_ptr<RuntimeAdapter>,
|
|
59
|
+
const std::string&) {
|
|
60
|
+
// Backwards compatibility fallback for libraries that are compiled without
|
|
61
|
+
// `HERMES_V1_ENABLED` but are linked against React Native with
|
|
62
|
+
// `HERMES_V1_ENABLED` which doesn't provide this symbol.
|
|
63
|
+
return -1;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
void disableDebugging(DebugSessionToken) {
|
|
67
|
+
// Backwards compatibility fallback for libraries that are compiled without
|
|
68
|
+
// `HERMES_V1_ENABLED` but are linked against React Native with
|
|
69
|
+
// `HERMES_V1_ENABLED` which doesn't provide this symbol.
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
} // namespace chrome
|
|
73
|
+
|
|
74
|
+
} // namespace facebook::hermes::inspector_modern
|
|
75
|
+
|
|
76
|
+
#endif // !defined(HERMES_V1_ENABLED)
|
|
77
|
+
|
|
78
|
+
#endif // defined(HERMES_ENABLE_DEBUGGER)
|