react-native-macos 0.0.0-e28e9e314 → 0.0.0-e2ffa3f99
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/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h +14 -0
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +7 -0
- package/Libraries/Text/RCTTextAttributes.h +9 -3
- package/Libraries/Text/RCTTextAttributes.m +17 -0
- package/Libraries/Text/Text/RCTTextView.m +5 -11
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/React/Base/RCTConstants.h +6 -0
- package/React/Base/RCTConstants.m +15 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +35 -19
- package/React/CoreModules/RCTLogBoxView.h +8 -5
- package/React/CoreModules/RCTLogBoxView.mm +64 -23
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +0 -8
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +14 -14
- package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +5 -4
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -4
- package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +17 -1
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewRegistry.h +6 -1
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +39 -0
- package/React/Fabric/Mounting/RCTMountingManager.h +1 -1
- package/React/Fabric/Mounting/RCTMountingManager.mm +9 -2
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +1 -1
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +2 -2
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +1 -1
- package/React/Fabric/RCTConversions.h +1 -1
- package/React/Fabric/RCTImageResponseDelegate.h +1 -1
- package/React/Fabric/RCTLocalizationProvider.h +1 -1
- package/React/Fabric/RCTScheduler.h +1 -1
- package/React/Fabric/RCTSurfacePresenter.h +7 -1
- package/React/Fabric/RCTSurfacePresenter.mm +13 -1
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
- package/React/Fabric/RCTSurfaceRegistry.h +1 -1
- package/React/Fabric/RCTSurfaceTouchHandler.h +1 -1
- package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/React-RCTFabric.podspec +1 -1
- package/React/Tests/Mounting/RCTComponentViewRegistryTests.mm +0 -1
- package/React/Views/RCTMaskedView.h +1 -1
- package/React/Views/RCTModalHostView.h +1 -1
- package/React/Views/RCTModalHostViewController.h +1 -1
- package/React/Views/RCTModalManager.h +1 -1
- package/React/Views/RCTView.m +1 -1
- package/React/Views/RCTWrapperViewController.h +1 -1
- package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
- package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
- package/React/Views/ScrollView/RCTScrollView.m +0 -30
- package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/Application.mk +1 -1
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/cxxreact/tests/BUCK +1 -1
- package/ReactCommon/microprofiler/BUCK +1 -1
- package/ReactCommon/react/debug/react_native_assert.h +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
- package/ReactCommon/react/renderer/animations/conversions.h +11 -11
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
- package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +1 -1
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
- package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
- package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
- package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
- package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
- package/ReactCommon/react/renderer/core/Props.h +0 -4
- package/ReactCommon/react/renderer/core/RawProps.h +1 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
- package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
- package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
- package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +1 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +8 -8
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +1 -1
- package/ReactCommon/react/utils/ContextContainer.h +2 -2
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/package.json +4 -1
- package/scripts/react_native_pods.rb +1 -1
- package/template/Gemfile.lock +1 -1
- package/template/package.json +1 -1
- package/ReactCommon/butter/optional.h +0 -38
|
@@ -71,6 +71,13 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
|
|
|
71
71
|
dispatch_once(&onceToken, ^{
|
|
72
72
|
componentViewFactory = [RCTComponentViewFactory new];
|
|
73
73
|
[componentViewFactory registerComponentViewClass:[RCTRootComponentView class]];
|
|
74
|
+
[componentViewFactory registerComponentViewClass:[RCTViewComponentView class]];
|
|
75
|
+
[componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]];
|
|
76
|
+
[componentViewFactory registerComponentViewClass:[RCTTextInputComponentView class]];
|
|
77
|
+
|
|
78
|
+
Class<RCTComponentViewProtocol> imageClass = RCTComponentViewClassWithName("Image");
|
|
79
|
+
[componentViewFactory registerComponentViewClass:imageClass];
|
|
80
|
+
|
|
74
81
|
componentViewFactory->_providerRegistry.setComponentDescriptorProviderRequest(
|
|
75
82
|
[](ComponentName requestedComponentName) {
|
|
76
83
|
[componentViewFactory registerComponentIfPossible:requestedComponentName];
|
|
@@ -110,7 +117,16 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
|
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
// Fallback 2: Try to use Paper Interop.
|
|
113
|
-
|
|
120
|
+
NSString *componentNameString = RCTNSStringFromString(name);
|
|
121
|
+
if ([RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) {
|
|
122
|
+
RCTLogNewArchitectureValidation(
|
|
123
|
+
RCTNotAllowedInBridgeless,
|
|
124
|
+
self,
|
|
125
|
+
[NSString
|
|
126
|
+
stringWithFormat:
|
|
127
|
+
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
|
|
128
|
+
componentNameString]);
|
|
129
|
+
|
|
114
130
|
auto flavor = std::make_shared<std::string const>(name);
|
|
115
131
|
auto componentName = ComponentName{flavor->c_str()};
|
|
116
132
|
auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <react/renderer/componentregistry/ComponentDescriptorProvider.h>
|
|
11
11
|
#import <react/renderer/core/EventEmitter.h>
|
|
@@ -114,7 +114,7 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
|
|
|
114
114
|
/*
|
|
115
115
|
* Read the last props used to update the view.
|
|
116
116
|
*/
|
|
117
|
-
- (facebook::react::
|
|
117
|
+
- (facebook::react::Props::Shared)props;
|
|
118
118
|
|
|
119
119
|
- (BOOL)isJSResponder;
|
|
120
120
|
- (void)setIsJSResponder:(BOOL)isJSResponder;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTComponentViewDescriptor.h>
|
|
11
11
|
#import <React/RCTComponentViewFactory.h>
|
|
@@ -50,6 +50,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
50
50
|
*/
|
|
51
51
|
- (nullable UIView<RCTComponentViewProtocol> *)findComponentViewWithTag:(facebook::react::Tag)tag;
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Creates a component view with a given type and puts it to the recycle pool.
|
|
55
|
+
*/
|
|
56
|
+
- (void)optimisticallyCreateComponentViewWithComponentHandle:(facebook::react::ComponentHandle)componentHandle;
|
|
57
|
+
|
|
53
58
|
@end
|
|
54
59
|
|
|
55
60
|
NS_ASSUME_NONNULL_END
|
|
@@ -35,11 +35,42 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
35
35
|
selector:@selector(handleApplicationDidReceiveMemoryWarningNotification)
|
|
36
36
|
name:UIApplicationDidReceiveMemoryWarningNotification
|
|
37
37
|
object:nil];
|
|
38
|
+
|
|
39
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
40
|
+
// Calling this a bit later, when the main thread is probably idle while JavaScript thread is busy.
|
|
41
|
+
[self preallocateViewComponents];
|
|
42
|
+
});
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
return self;
|
|
41
46
|
}
|
|
42
47
|
|
|
48
|
+
- (void)preallocateViewComponents
|
|
49
|
+
{
|
|
50
|
+
if (RCTExperimentGetPreemptiveViewAllocationDisabled()) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// This data is based on empirical evidence which should represent the reality pretty well.
|
|
55
|
+
// Regular `<View>` has magnitude equals to `1` by definition.
|
|
56
|
+
std::vector<std::pair<ComponentHandle, float>> componentMagnitudes = {
|
|
57
|
+
{[RCTViewComponentView componentDescriptorProvider].handle, 1},
|
|
58
|
+
{[RCTImageComponentView componentDescriptorProvider].handle, 0.3},
|
|
59
|
+
{[RCTParagraphComponentView componentDescriptorProvider].handle, 0.3},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// `complexity` represents the complexity of a typical surface in a number of `<View>` components (with Flattening
|
|
63
|
+
// enabled).
|
|
64
|
+
float complexity = 100;
|
|
65
|
+
|
|
66
|
+
// The whole process should not take more than 10ms in the worst case, so there is no need to split it up.
|
|
67
|
+
for (const auto &componentMagnitude : componentMagnitudes) {
|
|
68
|
+
for (int i = 0; i < complexity * componentMagnitude.second; i++) {
|
|
69
|
+
[self optimisticallyCreateComponentViewWithComponentHandle:componentMagnitude.first];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
43
74
|
- (RCTComponentViewDescriptor const &)dequeueComponentViewWithComponentHandle:(ComponentHandle)componentHandle
|
|
44
75
|
tag:(Tag)tag
|
|
45
76
|
{
|
|
@@ -69,6 +100,14 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
69
100
|
[self _enqueueComponentViewWithComponentHandle:componentHandle componentViewDescriptor:componentViewDescriptor];
|
|
70
101
|
}
|
|
71
102
|
|
|
103
|
+
- (void)optimisticallyCreateComponentViewWithComponentHandle:(ComponentHandle)componentHandle
|
|
104
|
+
{
|
|
105
|
+
RCTAssertMainQueue();
|
|
106
|
+
[self _enqueueComponentViewWithComponentHandle:componentHandle
|
|
107
|
+
componentViewDescriptor:[self.componentViewFactory
|
|
108
|
+
createComponentViewWithComponentHandle:componentHandle]];
|
|
109
|
+
}
|
|
110
|
+
|
|
72
111
|
- (RCTComponentViewDescriptor const &)componentViewDescriptorWithTag:(Tag)tag
|
|
73
112
|
{
|
|
74
113
|
RCTAssertMainQueue();
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RCTMountingManager.h"
|
|
9
9
|
|
|
10
|
+
#import <QuartzCore/QuartzCore.h>
|
|
10
11
|
#import <butter/map.h>
|
|
11
12
|
|
|
12
13
|
#import <React/RCTAssert.h>
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
#import <React/RCTFollyConvert.h>
|
|
15
16
|
#import <React/RCTLog.h>
|
|
16
17
|
#import <React/RCTUtils.h>
|
|
18
|
+
#import <react/config/ReactNativeConfig.h>
|
|
17
19
|
#import <react/renderer/components/root/RootShadowNode.h>
|
|
18
20
|
#import <react/renderer/core/LayoutableShadowNode.h>
|
|
19
21
|
#import <react/renderer/core/RawProps.h>
|
|
@@ -297,8 +299,8 @@ static void RCTPerformMountInstructions(
|
|
|
297
299
|
RCTAssertMainQueue();
|
|
298
300
|
UIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag];
|
|
299
301
|
SurfaceId surfaceId = RCTSurfaceIdForView(componentView);
|
|
300
|
-
|
|
301
|
-
|
|
302
|
+
Props::Shared oldProps = [componentView props];
|
|
303
|
+
Props::Shared newProps = componentDescriptor.cloneProps(
|
|
302
304
|
PropsParserContext{surfaceId, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
|
|
303
305
|
|
|
304
306
|
NSSet<NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new];
|
|
@@ -317,6 +319,11 @@ static void RCTPerformMountInstructions(
|
|
|
317
319
|
if (props[@"opacity"] && componentView.layer.opacity != (float)newViewProps.opacity) {
|
|
318
320
|
componentView.layer.opacity = newViewProps.opacity;
|
|
319
321
|
}
|
|
322
|
+
|
|
323
|
+
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<ReactNativeConfig const>>("ReactNativeConfig");
|
|
324
|
+
if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:finalize_updates_on_synchronous_update_view_ios")) {
|
|
325
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMaskProps];
|
|
326
|
+
}
|
|
320
327
|
}
|
|
321
328
|
|
|
322
329
|
- (void)synchronouslyDispatchCommandOnUIThread:(ReactTag)reactTag
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTComponentViewProtocol.h>
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
37
37
|
|
|
38
38
|
- (void)prepareForRecycle;
|
|
39
39
|
|
|
40
|
-
- (facebook::react::
|
|
40
|
+
- (facebook::react::Props::Shared)props;
|
|
41
41
|
|
|
42
42
|
- (void)setIsJSResponder:(BOOL)isJSResponder;
|
|
43
43
|
|
|
@@ -129,7 +129,7 @@ using namespace facebook::react;
|
|
|
129
129
|
// Default implementation does nothing.
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
- (facebook::react::
|
|
132
|
+
- (facebook::react::Props::Shared)props
|
|
133
133
|
{
|
|
134
134
|
RCTAssert(NO, @"props access should be implemented by RCTViewComponentView.");
|
|
135
135
|
return nullptr;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <react/renderer/components/view/AccessibilityPrimitives.h>
|
|
11
11
|
#import <react/renderer/components/view/primitives.h>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTPrimitives.h>
|
|
11
11
|
#import <React/RCTSurfacePresenterStub.h>
|
|
@@ -56,6 +56,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
56
56
|
@property (readonly) RCTMountingManager *mountingManager;
|
|
57
57
|
@property (readonly, nullable) RCTScheduler *scheduler;
|
|
58
58
|
|
|
59
|
+
/*
|
|
60
|
+
* Allow callers to initialize a new fabric surface without adding Fabric as a Buck dependency.
|
|
61
|
+
*/
|
|
62
|
+
- (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
|
|
63
|
+
initialProperties:(NSDictionary *)initialProperties;
|
|
64
|
+
|
|
59
65
|
- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag;
|
|
60
66
|
|
|
61
67
|
- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props;
|
|
@@ -163,6 +163,14 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
|
|
|
163
163
|
return [_surfaceRegistry surfaceForRootTag:rootTag];
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
- (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
|
|
167
|
+
initialProperties:(NSDictionary *)initialProperties
|
|
168
|
+
{
|
|
169
|
+
return [[RCTFabricSurface alloc] initWithSurfacePresenter:self
|
|
170
|
+
moduleName:moduleName
|
|
171
|
+
initialProperties:initialProperties];
|
|
172
|
+
}
|
|
173
|
+
|
|
166
174
|
- (UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag
|
|
167
175
|
{
|
|
168
176
|
UIView<RCTComponentViewProtocol> *componentView =
|
|
@@ -249,6 +257,10 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
|
|
|
249
257
|
{
|
|
250
258
|
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<ReactNativeConfig const>>("ReactNativeConfig");
|
|
251
259
|
|
|
260
|
+
if (reactNativeConfig && reactNativeConfig->getBool("react_fabric:preemptive_view_allocation_disabled_ios")) {
|
|
261
|
+
RCTExperimentSetPreemptiveViewAllocationDisabled(YES);
|
|
262
|
+
}
|
|
263
|
+
|
|
252
264
|
if (reactNativeConfig && reactNativeConfig->getBool("rn_convergence:dispatch_pointer_events")) {
|
|
253
265
|
RCTSetDispatchW3CPointerEvents(YES);
|
|
254
266
|
}
|
|
@@ -267,7 +279,7 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
|
|
|
267
279
|
toolbox.componentRegistryFactory = componentRegistryFactory;
|
|
268
280
|
|
|
269
281
|
auto weakRuntimeScheduler = _contextContainer->find<std::weak_ptr<RuntimeScheduler>>("RuntimeScheduler");
|
|
270
|
-
auto runtimeScheduler = weakRuntimeScheduler.
|
|
282
|
+
auto runtimeScheduler = weakRuntimeScheduler.has_value() ? weakRuntimeScheduler.value().lock() : nullptr;
|
|
271
283
|
if (runtimeScheduler) {
|
|
272
284
|
runtimeExecutor = [runtimeScheduler](std::function<void(jsi::Runtime & runtime)> &&callback) {
|
|
273
285
|
runtimeScheduler->scheduleWork(std::move(callback));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
#import <react/renderer/components/view/TouchEventEmitter.h>
|
|
10
10
|
|
|
11
11
|
@protocol RCTTouchableComponentViewProtocol <NSObject>
|
|
@@ -34,7 +34,7 @@ using namespace facebook::react;
|
|
|
34
34
|
// `SurfaceHandler` is a thread-safe object, so we don't need additional synchronization.
|
|
35
35
|
// Objective-C++ classes cannot have instance variables without default constructors,
|
|
36
36
|
// hence we wrap a value into `optional` to workaround it.
|
|
37
|
-
|
|
37
|
+
std::optional<SurfaceHandler> _surfaceHandler;
|
|
38
38
|
|
|
39
39
|
// Protects Surface's start and stop processes.
|
|
40
40
|
// Even though SurfaceHandler is tread-safe, it will crash if we try to stop a surface that is not running.
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
11
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
12
12
|
|
|
13
|
+
@protocol RCTSurfaceProtocol;
|
|
14
|
+
|
|
13
15
|
NS_ASSUME_NONNULL_BEGIN
|
|
14
16
|
|
|
15
17
|
// TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but
|
|
@@ -27,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
27
29
|
|
|
28
30
|
@protocol RCTSurfacePresenterStub <NSObject>
|
|
29
31
|
|
|
32
|
+
- (id<RCTSurfaceProtocol>)createFabricSurfaceForModuleName:(NSString *)moduleName
|
|
33
|
+
initialProperties:(NSDictionary *)initialProperties;
|
|
30
34
|
- (nullable RCTPlatformView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; // TODO(macOS GH#774)
|
|
31
35
|
- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props;
|
|
32
36
|
- (void)addObserver:(id<RCTSurfacePresenterObserver>)observer;
|
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
s.header_dir = "React"
|
|
38
38
|
s.framework = "JavaScriptCore"
|
|
39
39
|
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
|
|
40
|
-
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
|
|
40
|
+
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
41
41
|
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
|
|
42
42
|
|
|
43
43
|
s.dependency "React-Core", version
|
|
@@ -22,7 +22,6 @@ using namespace facebook::react;
|
|
|
22
22
|
{
|
|
23
23
|
[super setUp];
|
|
24
24
|
_componentViewRegistry = [RCTComponentViewRegistry new];
|
|
25
|
-
[_componentViewRegistry.componentViewFactory registerComponentViewClass:[RCTViewComponentView class]];
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
- (void)testComponentViewDescriptorWithTag
|
package/React/Views/RCTView.m
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import "RCTView.h"
|
|
9
9
|
|
|
10
|
-
#import <QuartzCore/QuartzCore.h>
|
|
10
|
+
#import <QuartzCore/QuartzCore.h>
|
|
11
11
|
|
|
12
12
|
#import "RCTAutoInsetsProtocol.h"
|
|
13
13
|
#import "RCTBorderDrawing.h"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#import <
|
|
8
|
+
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTComponent.h>
|
|
11
11
|
#import <React/RCTScrollableProtocol.h>
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
@property (nonatomic, copy) NSString *title;
|
|
16
16
|
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
|
|
17
|
-
@property (nonatomic, weak)
|
|
17
|
+
@property (nonatomic, weak) RCTUIScrollView *scrollView; // TODO(macOS GH#774)
|
|
18
18
|
|
|
19
19
|
@end
|
|
@@ -339,21 +339,6 @@
|
|
|
339
339
|
#endif // TODO(macOS GH#774)
|
|
340
340
|
|
|
341
341
|
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
342
|
-
- (BOOL)canBecomeFirstResponder
|
|
343
|
-
{
|
|
344
|
-
return YES;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
- (BOOL)becomeFirstResponder
|
|
348
|
-
{
|
|
349
|
-
return YES;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
- (BOOL)resignFirstResponder
|
|
353
|
-
{
|
|
354
|
-
return YES;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
342
|
- (void)setAccessibilityLabel:(NSString *)accessibilityLabel
|
|
358
343
|
{
|
|
359
344
|
[super setAccessibilityLabel:accessibilityLabel];
|
|
@@ -538,21 +523,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
|
|
538
523
|
return _scrollView.documentView;
|
|
539
524
|
}
|
|
540
525
|
|
|
541
|
-
- (BOOL)canBecomeFirstResponder
|
|
542
|
-
{
|
|
543
|
-
return [_scrollView canBecomeFirstResponder];
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
- (BOOL)becomeFirstResponder
|
|
547
|
-
{
|
|
548
|
-
return [_scrollView becomeFirstResponder];
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
- (BOOL)resignFirstResponder
|
|
552
|
-
{
|
|
553
|
-
return [_scrollView resignFirstResponder];
|
|
554
|
-
}
|
|
555
|
-
|
|
556
526
|
- (void)setAccessibilityLabel:(NSString *)accessibilityLabel
|
|
557
527
|
{
|
|
558
528
|
[_scrollView setAccessibilityLabel:accessibilityLabel];
|