react-native 0.74.0-rc.2 → 0.74.0-rc.3

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 (45) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -8
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +56 -130
  3. package/Libraries/AppDelegate/RCTRootViewFactory.h +123 -0
  4. package/Libraries/AppDelegate/RCTRootViewFactory.mm +253 -0
  5. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  8. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +4 -0
  9. package/Libraries/StyleSheet/StyleSheetTypes.js +3 -0
  10. package/React/Base/RCTConvert.h +3 -0
  11. package/React/Base/RCTConvert.mm +9 -0
  12. package/React/Base/RCTVersion.m +1 -1
  13. package/React/CoreModules/RCTRedBox.mm +7 -1
  14. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +32 -0
  15. package/React/Views/RCTCursor.h +13 -0
  16. package/React/Views/RCTView.h +3 -0
  17. package/React/Views/RCTView.m +30 -0
  18. package/React/Views/RCTViewManager.m +2 -0
  19. package/ReactAndroid/api/ReactAndroid.api +2 -0
  20. package/ReactAndroid/build.gradle.kts +26 -0
  21. package/ReactAndroid/cmake-utils/ReactNative-application.cmake +6 -0
  22. package/ReactAndroid/gradle.properties +1 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +1 -2
  24. package/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt +9 -0
  25. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +5 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +0 -11
  27. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +1 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +11 -6
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  30. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +32 -0
  31. package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp +0 -1
  32. package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h +0 -4
  33. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  34. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +9 -0
  35. package/ReactCommon/react/renderer/components/view/BaseViewProps.h +2 -0
  36. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -1
  37. package/ReactCommon/react/renderer/components/view/conversions.h +22 -0
  38. package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
  39. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +37 -6
  40. package/package.json +2 -2
  41. package/sdks/hermesc/osx-bin/hermes +0 -0
  42. package/sdks/hermesc/osx-bin/hermesc +0 -0
  43. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  44. package/template/package.json +1 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt +0 -20
@@ -28,6 +28,8 @@
28
28
  #import <React/RCTLogBox.h>
29
29
  #import <React/RCTModuleData.h>
30
30
  #import <React/RCTPerformanceLogger.h>
31
+ #import <React/RCTRedBox.h>
32
+ #import <React/RCTReloadCommand.h>
31
33
  #import <React/RCTSurfacePresenter.h>
32
34
  #import <ReactCommon/RCTTurboModuleManager.h>
33
35
  #import <ReactCommon/RuntimeExecutor.h>
@@ -122,10 +124,17 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
122
124
  }];
123
125
  }
124
126
 
125
- [[NSNotificationCenter defaultCenter] addObserver:self
126
- selector:@selector(_notifyEventDispatcherObserversOfEvent_DEPRECATED:)
127
- name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
128
- object:nil];
127
+ NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
128
+
129
+ [defaultCenter addObserver:self
130
+ selector:@selector(_notifyEventDispatcherObserversOfEvent_DEPRECATED:)
131
+ name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
132
+ object:nil];
133
+
134
+ [defaultCenter addObserver:self
135
+ selector:@selector(didReceiveReloadCommand)
136
+ name:RCTTriggerReloadCommandNotification
137
+ object:nil];
129
138
 
130
139
  [self _start];
131
140
  }
@@ -389,6 +398,24 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
389
398
  }
390
399
  }
391
400
 
401
+ - (void)handleBundleLoadingError:(NSError *)error
402
+ {
403
+ if (!_valid) {
404
+ return;
405
+ }
406
+
407
+ RCTRedBox *redBox = [_turboModuleManager moduleForName:"RedBox"];
408
+
409
+ RCTExecuteOnMainQueue(^{
410
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptDidFailToLoadNotification
411
+ object:self
412
+ userInfo:@{@"error" : error}];
413
+ [redBox showErrorMessage:[error localizedDescription]];
414
+
415
+ RCTFatal(error);
416
+ });
417
+ }
418
+
392
419
  - (void)_loadJSBundle:(NSURL *)sourceURL
393
420
  {
394
421
  #if RCT_DEV_MENU && __has_include(<React/RCTDevLoadingViewProtocol.h>)
@@ -420,8 +447,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
420
447
  }
421
448
 
422
449
  if (error) {
423
- // TODO(T91461138): Properly address bundle loading errors.
424
- RCTLogError(@"RCTInstance: Error while loading bundle: %@", error);
450
+ [strongSelf handleBundleLoadingError:error];
425
451
  [strongSelf invalidate];
426
452
  return;
427
453
  }
@@ -490,4 +516,9 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
490
516
  isFatal:errorMap.getBool(JSErrorHandlerKey::kIsFatal)];
491
517
  }
492
518
 
519
+ - (void)didReceiveReloadCommand
520
+ {
521
+ [self _loadJSBundle:[_bridgeModuleDecorator.bundleManager bundleURL]];
522
+ }
523
+
493
524
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.74.0-rc.2",
3
+ "version": "0.74.0-rc.3",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -103,7 +103,7 @@
103
103
  "@react-native-community/cli-platform-ios": "13.6.1",
104
104
  "@react-native/assets-registry": "0.74.0",
105
105
  "@react-native/codegen": "0.74.2",
106
- "@react-native/community-cli-plugin": "0.74.4",
106
+ "@react-native/community-cli-plugin": "0.74.5",
107
107
  "@react-native/gradle-plugin": "0.74.1",
108
108
  "@react-native/js-polyfills": "0.74.0",
109
109
  "@react-native/normalize-colors": "0.74.1",
Binary file
Binary file
Binary file
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.74.0-rc.2"
14
+ "react-native": "0.74.0-rc.3"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",
@@ -1,20 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- package com.facebook.react.defaults
9
-
10
- import com.facebook.jni.annotations.DoNotStrip
11
- import com.facebook.react.common.annotations.UnstableReactNativeAPI
12
- import com.facebook.react.runtime.BindingsInstaller
13
-
14
- /**
15
- * A utility class that provides users a default [BindingsInstaller] class that's used to initialize
16
- * [ReactHostDelegate]
17
- */
18
- @DoNotStrip
19
- @UnstableReactNativeAPI
20
- public class DefaultBindingsInstaller : BindingsInstaller(null) {}