react-native 0.77.0-rc.1 → 0.77.0-rc.2
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/Animated/animations/Animation.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +4 -9
- package/ReactAndroid/api/ReactAndroid.api +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java +12 -13
- package/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt +18 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
- package/ReactCommon/react/runtime/ReactInstance.h +2 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
- package/package.json +8 -8
- package/scripts/codegen/generate-artifacts-executor.js +5 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
package/React/Base/RCTVersion.m
CHANGED
|
@@ -189,10 +189,11 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
189
189
|
|
|
190
190
|
UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
|
|
191
191
|
CGFloat inset = MAX(scrollViewLowerY - keyboardEndFrame.origin.y, 0);
|
|
192
|
+
const auto &props = static_cast<const ScrollViewProps &>(*_props);
|
|
192
193
|
if (isInverted) {
|
|
193
|
-
newEdgeInsets.top = MAX(inset,
|
|
194
|
+
newEdgeInsets.top = MAX(inset, props.contentInset.top);
|
|
194
195
|
} else {
|
|
195
|
-
newEdgeInsets.bottom = MAX(inset,
|
|
196
|
+
newEdgeInsets.bottom = MAX(inset, props.contentInset.bottom);
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
CGPoint newContentOffset = _scrollView.contentOffset;
|
|
@@ -210,12 +211,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
210
211
|
contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
|
|
211
212
|
}
|
|
212
213
|
} else {
|
|
213
|
-
CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
|
|
214
|
-
|
|
215
|
-
if (CGRectIsNull(viewIntersection)) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
214
|
// Inner text field focused
|
|
220
215
|
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
|
|
221
216
|
if (focusEnd > keyboardEndFrame.origin.y) {
|
|
@@ -247,7 +242,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
|
|
247
242
|
animations:^{
|
|
248
243
|
self->_scrollView.contentInset = newEdgeInsets;
|
|
249
244
|
self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
|
|
250
|
-
[self
|
|
245
|
+
[self scrollTo:newContentOffset.x y:newContentOffset.y animated:NO];
|
|
251
246
|
}
|
|
252
247
|
completion:nil];
|
|
253
248
|
}
|
|
@@ -2963,6 +2963,7 @@ public abstract interface annotation class com/facebook/react/module/annotations
|
|
|
2963
2963
|
public final class com/facebook/react/module/model/ReactModuleInfo {
|
|
2964
2964
|
public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion;
|
|
2965
2965
|
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
|
|
2966
|
+
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
|
|
2966
2967
|
public final fun canOverrideExistingModule ()Z
|
|
2967
2968
|
public static final fun classIsTurboModule (Ljava/lang/Class;)Z
|
|
2968
2969
|
public final fun className ()Ljava/lang/String;
|
|
@@ -179,31 +179,30 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
private void createReactContextAndScheduleTask(final HeadlessJsTaskConfig taskConfig) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
final ReactInstanceManager reactInstanceManager =
|
|
186
|
-
getReactNativeHost().getReactInstanceManager();
|
|
187
|
-
|
|
188
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
182
|
+
if (ReactNativeFeatureFlags.enableBridgelessArchitecture()) {
|
|
183
|
+
final ReactHost reactHost = getReactHost();
|
|
184
|
+
reactHost.addReactInstanceEventListener(
|
|
189
185
|
new ReactInstanceEventListener() {
|
|
190
186
|
@Override
|
|
191
187
|
public void onReactContextInitialized(@NonNull ReactContext reactContext) {
|
|
192
188
|
invokeStartTask(reactContext, taskConfig);
|
|
193
|
-
|
|
189
|
+
reactHost.removeReactInstanceEventListener(this);
|
|
194
190
|
}
|
|
195
191
|
});
|
|
196
|
-
|
|
197
|
-
} else {
|
|
198
|
-
|
|
192
|
+
reactHost.start();
|
|
193
|
+
} else {
|
|
194
|
+
final ReactInstanceManager reactInstanceManager =
|
|
195
|
+
getReactNativeHost().getReactInstanceManager();
|
|
196
|
+
|
|
197
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
199
198
|
new ReactInstanceEventListener() {
|
|
200
199
|
@Override
|
|
201
200
|
public void onReactContextInitialized(@NonNull ReactContext reactContext) {
|
|
202
201
|
invokeStartTask(reactContext, taskConfig);
|
|
203
|
-
|
|
202
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
204
203
|
}
|
|
205
204
|
});
|
|
206
|
-
|
|
205
|
+
reactInstanceManager.createReactContextInBackground();
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
}
|
|
@@ -21,6 +21,24 @@ public class ReactModuleInfo(
|
|
|
21
21
|
public val isCxxModule: Boolean,
|
|
22
22
|
public val isTurboModule: Boolean
|
|
23
23
|
) {
|
|
24
|
+
|
|
25
|
+
@Deprecated(
|
|
26
|
+
"This constructor is deprecated and will be removed in the future. Use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]",
|
|
27
|
+
replaceWith =
|
|
28
|
+
ReplaceWith(
|
|
29
|
+
expression =
|
|
30
|
+
"ReactModuleInfo(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)"),
|
|
31
|
+
level = DeprecationLevel.WARNING)
|
|
32
|
+
public constructor(
|
|
33
|
+
name: String,
|
|
34
|
+
className: String,
|
|
35
|
+
canOverrideExistingModule: Boolean,
|
|
36
|
+
needsEagerInit: Boolean,
|
|
37
|
+
@Suppress("UNUSED_PARAMETER") hasConstants: Boolean,
|
|
38
|
+
isCxxModule: Boolean,
|
|
39
|
+
isTurboModule: Boolean
|
|
40
|
+
) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)
|
|
41
|
+
|
|
24
42
|
public companion object {
|
|
25
43
|
/**
|
|
26
44
|
* Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
|
|
@@ -236,47 +236,51 @@ std::string simpleBasename(const std::string& path) {
|
|
|
236
236
|
*/
|
|
237
237
|
void ReactInstance::loadScript(
|
|
238
238
|
std::unique_ptr<const JSBigString> script,
|
|
239
|
-
const std::string& sourceURL
|
|
239
|
+
const std::string& sourceURL,
|
|
240
|
+
std::function<void(jsi::Runtime& runtime)>&& completion) {
|
|
240
241
|
auto buffer = std::make_shared<BigStringBuffer>(std::move(script));
|
|
241
242
|
std::string scriptName = simpleBasename(sourceURL);
|
|
242
243
|
|
|
243
|
-
runtimeScheduler_->scheduleWork(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
244
|
+
runtimeScheduler_->scheduleWork([this,
|
|
245
|
+
scriptName,
|
|
246
|
+
sourceURL,
|
|
247
|
+
buffer = std::move(buffer),
|
|
248
|
+
weakBufferedRuntimeExecuter =
|
|
249
|
+
std::weak_ptr<BufferedRuntimeExecutor>(
|
|
250
|
+
bufferedRuntimeExecutor_),
|
|
251
|
+
completion](jsi::Runtime& runtime) {
|
|
252
|
+
SystraceSection s("ReactInstance::loadScript");
|
|
253
|
+
bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl);
|
|
254
|
+
if (hasLogger) {
|
|
255
|
+
ReactMarker::logTaggedMarkerBridgeless(
|
|
256
|
+
ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
|
|
257
|
+
}
|
|
256
258
|
|
|
257
|
-
|
|
259
|
+
runtime.evaluateJavaScript(buffer, sourceURL);
|
|
258
260
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
/**
|
|
262
|
+
* TODO(T183610671): We need a safe/reliable way to enable the js
|
|
263
|
+
* pipeline from javascript. Remove this after we figure that out, or
|
|
264
|
+
* after we just remove the js pipeline.
|
|
265
|
+
*/
|
|
266
|
+
if (!jsErrorHandler_->hasHandledFatalError()) {
|
|
267
|
+
jsErrorHandler_->setRuntimeReady();
|
|
268
|
+
}
|
|
267
269
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
270
|
+
if (hasLogger) {
|
|
271
|
+
ReactMarker::logTaggedMarkerBridgeless(
|
|
272
|
+
ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
|
|
273
|
+
ReactMarker::logMarkerBridgeless(ReactMarker::INIT_REACT_RUNTIME_STOP);
|
|
274
|
+
ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
|
|
275
|
+
}
|
|
276
|
+
if (auto strongBufferedRuntimeExecuter =
|
|
277
|
+
weakBufferedRuntimeExecuter.lock()) {
|
|
278
|
+
strongBufferedRuntimeExecuter->flush();
|
|
279
|
+
}
|
|
280
|
+
if (completion) {
|
|
281
|
+
completion(runtime);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
280
284
|
}
|
|
281
285
|
|
|
282
286
|
/*
|
|
@@ -49,7 +49,8 @@ class ReactInstance final : private jsinspector_modern::InstanceTargetDelegate {
|
|
|
49
49
|
|
|
50
50
|
void loadScript(
|
|
51
51
|
std::unique_ptr<const JSBigString> script,
|
|
52
|
-
const std::string& sourceURL
|
|
52
|
+
const std::string& sourceURL,
|
|
53
|
+
std::function<void(jsi::Runtime& runtime)>&& completion = nullptr);
|
|
53
54
|
|
|
54
55
|
void registerSegment(uint32_t segmentId, const std::string& segmentPath);
|
|
55
56
|
|
|
@@ -472,8 +472,9 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
|
|
|
472
472
|
|
|
473
473
|
auto script = std::make_unique<NSDataBigString>(source.data);
|
|
474
474
|
const auto *url = deriveSourceURL(source.url).UTF8String;
|
|
475
|
-
_reactInstance->loadScript(std::move(script), url)
|
|
476
|
-
|
|
475
|
+
_reactInstance->loadScript(std::move(script), url, [](jsi::Runtime &_) {
|
|
476
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:@"RCTInstanceDidLoadBundle" object:nil];
|
|
477
|
+
});
|
|
477
478
|
}
|
|
478
479
|
|
|
479
480
|
- (void)_handleJSError:(const JsErrorHandler::ParsedError &)error withRuntime:(jsi::Runtime &)runtime
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.77.0-rc.
|
|
3
|
+
"version": "0.77.0-rc.2",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -108,13 +108,13 @@
|
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
111
|
-
"@react-native/assets-registry": "0.77.0-rc.
|
|
112
|
-
"@react-native/codegen": "0.77.0-rc.
|
|
113
|
-
"@react-native/community-cli-plugin": "0.77.0-rc.
|
|
114
|
-
"@react-native/gradle-plugin": "0.77.0-rc.
|
|
115
|
-
"@react-native/js-polyfills": "0.77.0-rc.
|
|
116
|
-
"@react-native/normalize-colors": "0.77.0-rc.
|
|
117
|
-
"@react-native/virtualized-lists": "0.77.0-rc.
|
|
111
|
+
"@react-native/assets-registry": "0.77.0-rc.2",
|
|
112
|
+
"@react-native/codegen": "0.77.0-rc.2",
|
|
113
|
+
"@react-native/community-cli-plugin": "0.77.0-rc.2",
|
|
114
|
+
"@react-native/gradle-plugin": "0.77.0-rc.2",
|
|
115
|
+
"@react-native/js-polyfills": "0.77.0-rc.2",
|
|
116
|
+
"@react-native/normalize-colors": "0.77.0-rc.2",
|
|
117
|
+
"@react-native/virtualized-lists": "0.77.0-rc.2",
|
|
118
118
|
"abort-controller": "^3.0.0",
|
|
119
119
|
"anser": "^1.4.9",
|
|
120
120
|
"ansi-regex": "^5.0.0",
|
|
@@ -778,6 +778,11 @@ function findFilesWithExtension(filePath, extension) {
|
|
|
778
778
|
// Given a filepath, read the file and look for a string that starts with 'Class<RCTComponentViewProtocol> '
|
|
779
779
|
// and ends with 'Cls(void)'. Return the string between the two.
|
|
780
780
|
function findRCTComponentViewProtocolClass(filepath) {
|
|
781
|
+
// Exclude files provided by react-native
|
|
782
|
+
if (filepath.includes(`${path.sep}react-native${path.sep}`)) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
|
|
781
786
|
const fileContent = fs.readFileSync(filepath, 'utf8');
|
|
782
787
|
const regex = /Class<RCTComponentViewProtocol> (.*)Cls\(/;
|
|
783
788
|
const match = fileContent.match(regex);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|