Skip to content

Commit 55cef4f

Browse files
authored
chore!: bump macOS minimum OS to 14.0 (#2687)
## Summary: Merge once macOS 26 is released. Keeping with our usual "N-2" policy (and given that I don't know of anyone asking for lower at the moment), bump the macOS minimum to macOS 14, which in turn allows us to delete some code and use newer APIs. ## Test Plan: CI should pass
1 parent 663b601 commit 55cef4f

File tree

9 files changed

+7
-136
lines changed

9 files changed

+7
-136
lines changed

packages/react-native/Libraries/Text/Text/RCTTextView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ - (void)drawRect:(CGRect)rect
295295
[self.layer addSublayer:_highlightLayer];
296296
}
297297
_highlightLayer.position = _contentFrame.origin;
298-
_highlightLayer.path = UIBezierPathCreateCGPathRef(highlightPath); // [macOS]
298+
_highlightLayer.path = highlightPath.CGPath;
299299
} else {
300300
[_highlightLayer removeFromSuperlayer];
301301
_highlightLayer = nil;

packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,8 @@ - (instancetype)init
2929
_heightConstraint = [_safeAreaContainer.heightAnchor constraintEqualToConstant:0];
3030
_heightConstraint.active = YES;
3131

32-
#if !TARGET_OS_OSX // [macOS]
3332
[_safeAreaContainer.bottomAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.bottomAnchor].active = YES;
3433
[_safeAreaContainer.topAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.topAnchor].active = YES;
35-
#else // [macOS
36-
if (@available(macOS 11.0, *)) {
37-
[_safeAreaContainer.bottomAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.bottomAnchor].active = YES;
38-
[_safeAreaContainer.topAnchor constraintEqualToAnchor:self.safeAreaLayoutGuide.topAnchor].active = YES;
39-
} else {
40-
[_safeAreaContainer.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES;
41-
[_safeAreaContainer.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
42-
}
43-
#endif // macOS]
4434
[_safeAreaContainer.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES;
4535
[_safeAreaContainer.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES;
4636
}

packages/react-native/React/Base/RCTUIKit.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ UIKIT_STATIC_INLINE void UIBezierPathAppendPath(UIBezierPath *path, UIBezierPath
5151
[path appendPath:appendPath];
5252
}
5353

54-
UIKIT_STATIC_INLINE CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path)
55-
{
56-
return [path CGPath];
57-
}
58-
5954
//
6055
// substantially different types
6156
//
@@ -376,8 +371,6 @@ UIBezierPath *UIBezierPathWithRoundedRect(CGRect rect, CGFloat cornerRadius);
376371

377372
void UIBezierPathAppendPath(UIBezierPath *path, UIBezierPath *appendPath);
378373

379-
CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path);
380-
381374
//
382375
// substantially different types
383376
//

packages/react-native/React/Base/macOS/RCTUIKit.m

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -116,56 +116,6 @@ void UIBezierPathAppendPath(UIBezierPath *path, UIBezierPath *appendPath)
116116
return [path appendBezierPath:appendPath];
117117
}
118118

119-
CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *bezierPath)
120-
{
121-
CGPathRef immutablePath = NULL;
122-
123-
// Draw the path elements.
124-
NSInteger numElements = [bezierPath elementCount];
125-
if (numElements > 0)
126-
{
127-
CGMutablePathRef path = CGPathCreateMutable();
128-
NSPoint points[3];
129-
BOOL didClosePath = YES;
130-
131-
for (NSInteger i = 0; i < numElements; i++)
132-
{
133-
switch ([bezierPath elementAtIndex:i associatedPoints:points])
134-
{
135-
case NSBezierPathElementMoveTo:
136-
CGPathMoveToPoint(path, NULL, points[0].x, points[0].y);
137-
break;
138-
139-
case NSBezierPathElementLineTo:
140-
CGPathAddLineToPoint(path, NULL, points[0].x, points[0].y);
141-
didClosePath = NO;
142-
break;
143-
144-
case NSBezierPathElementCurveTo:
145-
CGPathAddCurveToPoint(path, NULL, points[0].x, points[0].y,
146-
points[1].x, points[1].y,
147-
points[2].x, points[2].y);
148-
didClosePath = NO;
149-
break;
150-
151-
case NSBezierPathElementClosePath:
152-
CGPathCloseSubpath(path);
153-
didClosePath = YES;
154-
break;
155-
}
156-
}
157-
158-
// Be sure the path is closed or Quartz may not do valid hit detection.
159-
if (!didClosePath)
160-
CGPathCloseSubpath(path);
161-
162-
immutablePath = CGPathCreateCopy(path);
163-
CGPathRelease(path);
164-
}
165-
166-
return immutablePath;
167-
}
168-
169119
//
170120
// substantially different types
171121
//

packages/react-native/React/CoreModules/RCTDevMenu.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ - (void)setDefaultJSBundle
403403
[alert setMessageText:@"Change packager location"];
404404
[alert setInformativeText:@"Input packager IP, port and entrypoint"];
405405
[alert addButtonWithTitle:@"Use bundled JS"];
406-
[alert setAlertStyle:NSWarningAlertStyle];
406+
[alert setAlertStyle:NSAlertStyleWarning];
407407
[alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:nil];
408408
#endif // macOS]
409409
}]];
@@ -452,7 +452,7 @@ - (void)setDefaultJSBundle
452452
#else // [macOS
453453
NSMenu *menu = [self menu];
454454
NSWindow *window = [NSApp keyWindow];
455-
NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseUp location:CGPointMake(0, 0) modifierFlags:0 timestamp:NSTimeIntervalSince1970 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:0 pressure:0.1];
455+
NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeLeftMouseUp location:CGPointMake(0, 0) modifierFlags:0 timestamp:NSTimeIntervalSince1970 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:0 pressure:0.1];
456456
[NSMenu popUpContextMenu:menu withEvent:event forView:[window contentView]];
457457
#endif // macOS]
458458

@@ -664,4 +664,4 @@ - (RCTDevMenu *)devMenu
664664
Class RCTDevMenuCls(void)
665665
{
666666
return RCTDevMenu.class;
667-
}
667+
}

packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,7 @@ - (void)drawRect:(CGRect)rect
393393
[self.layer addSublayer:self->_highlightLayer];
394394
}
395395
self->_highlightLayer.position = frame.origin;
396-
397-
#if !TARGET_OS_OSX // [macOS]
398396
self->_highlightLayer.path = highlightPath.CGPath;
399-
#else // [macOS Update once our minimum is macOS 14
400-
self->_highlightLayer.path = UIBezierPathCreateCGPathRef(highlightPath);
401-
#endif // macOS]
402397
} else {
403398
[self->_highlightLayer removeFromSuperlayer];
404399
self->_highlightLayer = nil;
@@ -407,56 +402,3 @@ - (void)drawRect:(CGRect)rect
407402
}
408403

409404
@end
410-
411-
#if TARGET_OS_OSX // [macOS
412-
// Copied from RCTUIKit
413-
CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *bezierPath)
414-
{
415-
CGPathRef immutablePath = NULL;
416-
417-
// Draw the path elements.
418-
NSInteger numElements = [bezierPath elementCount];
419-
if (numElements > 0)
420-
{
421-
CGMutablePathRef path = CGPathCreateMutable();
422-
NSPoint points[3];
423-
BOOL didClosePath = YES;
424-
425-
for (NSInteger i = 0; i < numElements; i++)
426-
{
427-
switch ([bezierPath elementAtIndex:i associatedPoints:points])
428-
{
429-
case NSBezierPathElementMoveTo:
430-
CGPathMoveToPoint(path, NULL, points[0].x, points[0].y);
431-
break;
432-
433-
case NSBezierPathElementLineTo:
434-
CGPathAddLineToPoint(path, NULL, points[0].x, points[0].y);
435-
didClosePath = NO;
436-
break;
437-
438-
case NSBezierPathElementCurveTo:
439-
CGPathAddCurveToPoint(path, NULL, points[0].x, points[0].y,
440-
points[1].x, points[1].y,
441-
points[2].x, points[2].y);
442-
didClosePath = NO;
443-
break;
444-
445-
case NSBezierPathElementClosePath:
446-
CGPathCloseSubpath(path);
447-
didClosePath = YES;
448-
break;
449-
}
450-
}
451-
452-
// Be sure the path is closed or Quartz may not do valid hit detection.
453-
if (!didClosePath)
454-
CGPathCloseSubpath(path);
455-
456-
immutablePath = CGPathCreateCopy(path);
457-
CGPathRelease(path);
458-
}
459-
460-
return immutablePath;
461-
}
462-
#endif // macOS]

packages/react-native/React/Views/RCTActivityIndicatorView.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndi
6060

6161
switch (activityIndicatorViewStyle) {
6262
case UIActivityIndicatorViewStyleLarge:
63-
if (@available(macOS 11.0, *)) {
64-
self.controlSize = NSControlSizeLarge;
65-
} else {
66-
self.controlSize = NSControlSizeRegular;
67-
}
63+
self.controlSize = NSControlSizeLarge;
6864
break;
6965
case UIActivityIndicatorViewStyleMedium:
7066
self.controlSize = NSControlSizeRegular;

packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def min_ios_version_supported
2626

2727
# [macOS
2828
def min_macos_version_supported
29-
return '11.0'
29+
return '14.0'
3030
end
3131
# macOS]
3232

packages/react-native/scripts/cocoapods/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def self.min_ios_version_supported
7474
end
7575
# [macOS
7676
def self.min_macos_version_supported
77-
return '11.0'
77+
return '14.0'
7878
end
7979
# macOS]
8080
# [visionOS

0 commit comments

Comments
 (0)