react-native-macos 0.0.0-9c5b39c5b → 0.0.0-9c995215a
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 +1 -1
- package/React/Base/RCTAssert.h +4 -3
- package/React/Base/RCTAssert.m +11 -2
- package/React/Base/RCTBridge.m +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +6 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +10 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +8 -1
- package/React/Fabric/RCTConversions.h +9 -1
- package/React/Fabric/RCTSurfaceTouchHandler.mm +0 -1
- package/React/Views/RCTViewManager.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
- package/package.json +1 -1
- package/template/Gemfile.lock +1 -1
- package/template/package.json +1 -1
package/React/Base/RCTAssert.h
CHANGED
|
@@ -183,7 +183,8 @@ __attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureViolationReporting
|
|
|
183
183
|
|
|
184
184
|
// When reporting is enabled, trigger an assertion.
|
|
185
185
|
__attribute__((used)) RCT_EXTERN void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra);
|
|
186
|
-
|
|
187
|
-
// When reporting is enabled, warn about the violation. Use this to prepare a specific callsite
|
|
186
|
+
// When reporting is enabled, trigger an error but do not crash. Use this to prepare a specific callsite
|
|
188
187
|
// for stricter enforcement. When ready, switch it to use the variant above.
|
|
189
|
-
__attribute__((used)) RCT_EXTERN void
|
|
188
|
+
__attribute__((used)) RCT_EXTERN void RCTErrorNotAllowedForNewArchitecture(id context, NSString *extra);
|
|
189
|
+
// When reporting is enabled, log an message. When ready, switch it to use the variant above.
|
|
190
|
+
__attribute__((used)) RCT_EXTERN void RCTLogNotAllowedForNewArchitecture(id context, NSString *extra);
|
package/React/Base/RCTAssert.m
CHANGED
|
@@ -274,11 +274,20 @@ void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra)
|
|
|
274
274
|
RCTAssert(0, @"%@", getNewArchitectureViolationMessage(context, extra));
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
void
|
|
277
|
+
void RCTErrorNotAllowedForNewArchitecture(id context, NSString *extra)
|
|
278
278
|
{
|
|
279
279
|
if (!newArchitectureViolationReporting) {
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
RCTLogError(@"%@", getNewArchitectureViolationMessage(context, extra));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
void RCTLogNotAllowedForNewArchitecture(id context, NSString *extra)
|
|
287
|
+
{
|
|
288
|
+
if (!newArchitectureViolationReporting) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
RCTLogInfo(@"%@", getNewArchitectureViolationMessage(context, extra));
|
|
284
293
|
}
|
package/React/Base/RCTBridge.m
CHANGED
|
@@ -60,7 +60,7 @@ NSArray<Class> *RCTGetModuleClasses(void)
|
|
|
60
60
|
void RCTRegisterModule(Class);
|
|
61
61
|
void RCTRegisterModule(Class moduleClass)
|
|
62
62
|
{
|
|
63
|
-
|
|
63
|
+
RCTLogNotAllowedForNewArchitecture(
|
|
64
64
|
@"RCTRegisterModule()", [NSString stringWithFormat:@"'%@' was registered unexpectedly", moduleClass]);
|
|
65
65
|
|
|
66
66
|
static dispatch_once_t onceToken;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -29,8 +29,6 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
29
29
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
30
30
|
{
|
|
31
31
|
if (self = [super initWithFrame:frame]) {
|
|
32
|
-
RCTWarnNotAllowedForNewArchitecture(
|
|
33
|
-
self, @"ViewManager with interop layer is not allowed in the new architecture.");
|
|
34
32
|
static const auto defaultProps = std::make_shared<const LegacyViewManagerInteropViewProps>();
|
|
35
33
|
_props = defaultProps;
|
|
36
34
|
_viewsToBeMounted = [NSMutableArray new];
|
|
@@ -67,6 +65,12 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
67
65
|
|
|
68
66
|
+ (BOOL)isSupported:(NSString *)componentName
|
|
69
67
|
{
|
|
68
|
+
RCTLogNotAllowedForNewArchitecture(
|
|
69
|
+
self,
|
|
70
|
+
[NSString
|
|
71
|
+
stringWithFormat:
|
|
72
|
+
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
|
|
73
|
+
componentName]);
|
|
70
74
|
return [[RCTLegacyViewManagerInteropComponentView supportedViewManagers] containsObject:componentName];
|
|
71
75
|
}
|
|
72
76
|
|
|
@@ -85,6 +85,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
85
85
|
// This helps to only update state from `scrollViewDidScroll` in case
|
|
86
86
|
// some other part of the system scrolls scroll view.
|
|
87
87
|
BOOL _isUserTriggeredScrolling;
|
|
88
|
+
BOOL _shouldUpdateContentInsetAdjustmentBehavior;
|
|
88
89
|
|
|
89
90
|
CGPoint _contentOffsetWhenClipped;
|
|
90
91
|
}
|
|
@@ -108,6 +109,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
108
109
|
_scrollView.delaysContentTouches = NO;
|
|
109
110
|
((RCTEnhancedScrollView *)_scrollView).overridingDelegate = self;
|
|
110
111
|
_isUserTriggeredScrolling = NO;
|
|
112
|
+
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
111
113
|
[self addSubview:_scrollView];
|
|
112
114
|
|
|
113
115
|
_containerView = [[UIView alloc] initWithFrame:CGRectZero];
|
|
@@ -253,7 +255,8 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
|
|
256
|
-
if (oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior)
|
|
258
|
+
if ((oldScrollViewProps.contentInsetAdjustmentBehavior != newScrollViewProps.contentInsetAdjustmentBehavior) ||
|
|
259
|
+
_shouldUpdateContentInsetAdjustmentBehavior) {
|
|
257
260
|
auto const contentInsetAdjustmentBehavior = newScrollViewProps.contentInsetAdjustmentBehavior;
|
|
258
261
|
if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Never) {
|
|
259
262
|
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
@@ -264,6 +267,7 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
264
267
|
} else if (contentInsetAdjustmentBehavior == ContentInsetAdjustmentBehavior::Always) {
|
|
265
268
|
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways;
|
|
266
269
|
}
|
|
270
|
+
_shouldUpdateContentInsetAdjustmentBehavior = NO;
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
MAP_SCROLL_VIEW_PROP(disableIntervalMomentum);
|
|
@@ -377,6 +381,11 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
377
381
|
{
|
|
378
382
|
const auto &props = *std::static_pointer_cast<const ScrollViewProps>(_props);
|
|
379
383
|
_scrollView.contentOffset = RCTCGPointFromPoint(props.contentOffset);
|
|
384
|
+
// We set the default behavior to "never" so that iOS
|
|
385
|
+
// doesn't do weird things to UIScrollView insets automatically
|
|
386
|
+
// and keeps it as an opt-in behavior.
|
|
387
|
+
_scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
388
|
+
_shouldUpdateContentInsetAdjustmentBehavior = YES;
|
|
380
389
|
_state.reset();
|
|
381
390
|
_isUserTriggeredScrolling = NO;
|
|
382
391
|
[super prepareForRecycle];
|
|
@@ -591,6 +591,12 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
591
591
|
|
|
592
592
|
RCTBorderColors borderColors = RCTCreateRCTBorderColorsFromBorderColors(borderMetrics.borderColors);
|
|
593
593
|
|
|
594
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
595
|
+
CGFloat scaleFactor = self.window.backingScaleFactor;
|
|
596
|
+
#else
|
|
597
|
+
// On iOS setting the scaleFactor to 0.0 will default to the device's native scale factor.
|
|
598
|
+
CGFloat scaleFactor = 0.0;
|
|
599
|
+
#endif // ]TODO(macOS GH#774)
|
|
594
600
|
UIImage *image = RCTGetBorderImage(
|
|
595
601
|
RCTBorderStyleFromBorderStyle(borderMetrics.borderStyles.left),
|
|
596
602
|
layer.bounds.size,
|
|
@@ -598,7 +604,8 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
598
604
|
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths),
|
|
599
605
|
borderColors,
|
|
600
606
|
_backgroundColor.CGColor,
|
|
601
|
-
self.clipsToBounds
|
|
607
|
+
self.clipsToBounds,
|
|
608
|
+
scaleFactor); // TODO(macOS GH#774)
|
|
602
609
|
|
|
603
610
|
RCTReleaseRCTBorderColors(borderColors);
|
|
604
611
|
|
|
@@ -173,9 +173,17 @@ inline facebook::react::Point RCTPointFromCGPoint(const CGPoint &point)
|
|
|
173
173
|
return {point.x, point.y};
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
inline facebook::react::Float RCTFloatFromCGFloat(CGFloat value)
|
|
177
|
+
{
|
|
178
|
+
if (value == CGFLOAT_MAX) {
|
|
179
|
+
return std::numeric_limits<facebook::react::Float>::infinity();
|
|
180
|
+
}
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
|
|
176
184
|
inline facebook::react::Size RCTSizeFromCGSize(const CGSize &size)
|
|
177
185
|
{
|
|
178
|
-
return {size.width, size.height};
|
|
186
|
+
return {RCTFloatFromCGFloat(size.width), RCTFloatFromCGFloat(size.height)};
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
inline facebook::react::Rect RCTRectFromCGRect(const CGRect &rect)
|
|
@@ -95,7 +95,7 @@ RCT_EXPORT_MODULE()
|
|
|
95
95
|
|
|
96
96
|
- (void)setBridge:(RCTBridge *)bridge
|
|
97
97
|
{
|
|
98
|
-
|
|
98
|
+
RCTErrorNotAllowedForNewArchitecture(self, @"RCTViewManager must not be initialized for the new architecture");
|
|
99
99
|
_bridge = bridge;
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#include "ManagedObjectWrapper.h"
|
|
9
9
|
|
|
10
|
-
#if
|
|
11
|
-
#if TARGET_OS_MAC && TARGET_OS_IPHONE
|
|
10
|
+
#if TARGET_OS_MAC
|
|
12
11
|
|
|
13
12
|
namespace facebook {
|
|
14
13
|
namespace react {
|
|
@@ -35,4 +34,3 @@ void wrappedManagedObjectDeleter(void *cfPointer) noexcept
|
|
|
35
34
|
@end
|
|
36
35
|
|
|
37
36
|
#endif
|
|
38
|
-
#endif
|
package/package.json
CHANGED
package/template/Gemfile.lock
CHANGED