diff --git a/.ado/ado-test-cleanup.sh b/.ado/ado-test-cleanup.sh index d58c56aea87b2c..683194dcc50b25 100755 --- a/.ado/ado-test-cleanup.sh +++ b/.ado/ado-test-cleanup.sh @@ -2,7 +2,7 @@ set -ex # Script used by the Azure DevOps build agent to cleanup the packager and web socket server -# after the XCode test step has completed +# after the Xcode test step has completed # kill whatever is occupying port 8081 (packager) lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill diff --git a/.ado/apple-pr.yml b/.ado/apple-pr.yml index 6514e5219e2646..10498a87aa98b2 100644 --- a/.ado/apple-pr.yml +++ b/.ado/apple-pr.yml @@ -31,6 +31,8 @@ jobs: - template: templates/apple-job-javascript.yml parameters: apply_office_patches: $(apply_office_patches) + slice_name: $(slice_name) + xcode_version: $(xcode_version) - job: AppleRNPR displayName: Apple React Native PR @@ -84,6 +86,8 @@ jobs: xcode_actions_release: $(xcode_actions_release) xcode_destination: $(xcode_destination) apply_office_patches: $(apply_office_patches) + slice_name: $(slice_name) + xcode_version: $(xcode_version) - job: CliInit displayName: Verify react-native-macos-init diff --git a/.ado/templates/apple-job-javascript.yml b/.ado/templates/apple-job-javascript.yml index fba8fe60c44875..ccdf9a3ce1f2c8 100644 --- a/.ado/templates/apple-job-javascript.yml +++ b/.ado/templates/apple-job-javascript.yml @@ -1,10 +1,16 @@ parameters: apply_office_patches: '' + slice_name: '' + xcode_version: '' steps: - template: apple-node-setup.yml + # Task Group: Xcode select proper version - template: apple-xcode-select.yml + parameters: + slice_name: ${{ parameters.slice_name }} + xcode_version: ${{ parameters.xcode_version }} - template: apple-droid-node-patching.yml parameters: diff --git a/.ado/templates/apple-job-react-native.yml b/.ado/templates/apple-job-react-native.yml index f39d588e6f05e1..c74069067a08e4 100644 --- a/.ado/templates/apple-job-react-native.yml +++ b/.ado/templates/apple-job-react-native.yml @@ -7,6 +7,8 @@ parameters: xcode_actions_release: '' xcode_destination: '' apply_office_patches: '' + slice_name: '' + xcode_version: '' steps: # Clean DerivedData @@ -18,6 +20,9 @@ steps: # Task Group: Xcode select proper version - template: apple-xcode-select.yml + parameters: + slice_name: ${{ parameters.slice_name }} + xcode_version: ${{ parameters.xcode_version }} - template: apple-droid-node-patching.yml parameters: diff --git a/.ado/templates/apple-xcode-build.yml b/.ado/templates/apple-xcode-build.yml index cd6437c749325f..c0ee51376ba7cf 100644 --- a/.ado/templates/apple-xcode-build.yml +++ b/.ado/templates/apple-xcode-build.yml @@ -10,7 +10,7 @@ parameters: steps: - task: Xcode@5 - displayName: 'XCode ${{ parameters.xcode_actions }} ${{ parameters.xcode_configuration }} ${{ parameters.xcode_sdk }} ${{ parameters.xcode_scheme }}' + displayName: 'Xcode ${{ parameters.xcode_actions }} ${{ parameters.xcode_configuration }} ${{ parameters.xcode_sdk }} ${{ parameters.xcode_scheme }}' inputs: actions: '${{ parameters.xcode_actions }}' configuration: ${{ parameters.xcode_configuration }} @@ -21,7 +21,7 @@ steps: signingOption: auto packageApp: false teamId: '$(XCodeSigningMicrosoftTeamID)' - args: '-destination "${{ parameters.xcode_destination }}" ONLY_ACTIVE_ARCH=NO -verbose -UseModernBuildSystem=NO -derivedDataPath DerivedData ${{ parameters.xcode_extraArgs }}' + args: '-destination "${{ parameters.xcode_destination }}" ONLY_ACTIVE_ARCH=YES -verbose -derivedDataPath DerivedData ${{ parameters.xcode_extraArgs }}' exportPath: '$(agent.builddirectory)/output/${{ parameters.xcode_sdk }}/${{ parameters.xcode_configuration }}' useXcpretty: ${{ parameters.xcode_useXcpretty }} publishJUnitResults: ${{ parameters.xcode_useXcpretty }} diff --git a/.ado/templates/apple-xcode-select.yml b/.ado/templates/apple-xcode-select.yml index 5451b1ad0db3bc..09ed6cd29f5c3c 100644 --- a/.ado/templates/apple-xcode-select.yml +++ b/.ado/templates/apple-xcode-select.yml @@ -1,8 +1,13 @@ # -# Task Group: XCode select proper version +# Task Group: Xcode select proper version # + +parameters: + slice_name: '' + xcode_version: '' + steps: - bash: | - sudo xcode-select --switch '/Applications/Xcode_11.2.1.app' - displayName: 'Switch to XCode 11.2.1' + sudo xcode-select --switch '${{ parameters.xcode_version }}' + displayName: Switch Xcode version ${{ parameters.slice_name }} failOnStderr: true diff --git a/.ado/variables/mac.yml b/.ado/variables/mac.yml index f81f780ec1b166..f19c8aff920309 100644 --- a/.ado/variables/mac.yml +++ b/.ado/variables/mac.yml @@ -1,2 +1,4 @@ variables: - VmImage: macOS-10.14 + VmImage: macOS-10.15 + slice_name: 'Xcode_12_4' + xcode_version: '/Applications/Xcode_12.4.app' \ No newline at end of file diff --git a/Libraries/ART/React-ART.podspec b/Libraries/ART/React-ART.podspec index e04351c9dca68a..7f33d56724fba9 100644 --- a/Libraries/ART/React-ART.podspec +++ b/Libraries/ART/React-ART.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "**/*.{m}" s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" diff --git a/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec b/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec index 1ba2b9c8d4d284..ed7d9fb30ccac5 100644 --- a/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +++ b/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/actionsheetios" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "*.{m}" s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" diff --git a/Libraries/Blob/React-RCTBlob.podspec b/Libraries/Blob/React-RCTBlob.podspec index f13d6b5a403d42..4ccdef4a905a56 100644 --- a/Libraries/Blob/React-RCTBlob.podspec +++ b/Libraries/Blob/React-RCTBlob.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js index 9a99eb6fb6bae9..07556bf488d3c8 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js @@ -52,6 +52,13 @@ const AccessibilityInfo = { return Promise.resolve(false); }, + /** + * macOS only + */ + isHighContrastEnabled: function(): Promise { + return Promise.resolve(false); + }, + /** * iOS only */ diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js index 9e721a776b75cc..66080bfecca0fa 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js @@ -85,6 +85,13 @@ const AccessibilityInfo = { }); }, + /** + * macOS only + */ + isHighContrastEnabled: function(): Promise { + return Promise.resolve(false); + }, + /** * Query whether inverted colors are currently enabled. * diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.macos.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.macos.js index 095cf67c30860b..620f1e33e83d21 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.macos.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.macos.js @@ -18,6 +18,7 @@ const RCTDeviceEventEmitter = require('../../EventEmitter/RCTDeviceEventEmitter' import NativeAccessibilityManager from './NativeAccessibilityManager'; const CHANGE_EVENT_NAME = { + highContrastChanged: 'highContrastChanged', invertColorsChanged: 'invertColorsChanged', reduceMotionChanged: 'reduceMotionChanged', reduceTransparencyChanged: 'reduceTransparencyChanged', @@ -26,6 +27,7 @@ const CHANGE_EVENT_NAME = { type ChangeEventName = $Keys<{ change: string, + highContrastChanged: string, invertColorsChanged: string, reduceMotionChanged: string, reduceTransparencyChanged: string, @@ -58,6 +60,22 @@ const AccessibilityInfo = { return Promise.resolve(false); }, + /** + * Query whether high contrast is currently enabled. + * + * Returns a promise which resolves to a boolean. + * The result is `true` when invert color is enabled and `false` otherwise. + */ + isHighContrastEnabled: function(): Promise { + return new Promise((resolve, reject) => { + if (NativeAccessibilityManager) { + NativeAccessibilityManager.getCurrentHighContrastState(resolve, reject); + } else { + reject(reject); + } + }); + }, + /** * Query whether inverted colors are currently enabled. * diff --git a/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js b/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js index 0a1abe5792492b..cade5c63acec77 100644 --- a/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +++ b/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js @@ -22,6 +22,12 @@ export interface Spec extends TurboModule { onSuccess: (isGrayscaleEnabled: boolean) => void, onError: (error: Object) => void, ) => void; + // [TODO(macOS ISS#2323203) + +getCurrentHighContrastState: ( + onSuccess: (isHighContrastEnabled: boolean) => void, + onError: (error: Object) => void, + ) => void; + // ]TODO(macOS ISS#2323203) +getCurrentInvertColorsState: ( onSuccess: (isInvertColorsEnabled: boolean) => void, onError: (error: Object) => void, diff --git a/Libraries/FBLazyVector/FBLazyVector.podspec b/Libraries/FBLazyVector/FBLazyVector.podspec index 2589deedb00f28..316a5c8066e8a7 100644 --- a/Libraries/FBLazyVector/FBLazyVector.podspec +++ b/Libraries/FBLazyVector/FBLazyVector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "FBLazyVector" diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec b/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec index 918eb2f371c314..f77fd854467089 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" diff --git a/Libraries/Image/React-RCTImage.podspec b/Libraries/Image/React-RCTImage.podspec index 3cfb96ee430476..a74baca2cb3545 100644 --- a/Libraries/Image/React-RCTImage.podspec +++ b/Libraries/Image/React-RCTImage.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/image" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/LinkingIOS/React-RCTLinking.podspec b/Libraries/LinkingIOS/React-RCTLinking.podspec index a262a0f6b4376d..786ecfcfddc781 100644 --- a/Libraries/LinkingIOS/React-RCTLinking.podspec +++ b/Libraries/LinkingIOS/React-RCTLinking.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/linking" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/NativeAnimation/React-RCTAnimation.podspec b/Libraries/NativeAnimation/React-RCTAnimation.podspec index f79a098a76fa33..b79d854edf7365 100644 --- a/Libraries/NativeAnimation/React-RCTAnimation.podspec +++ b/Libraries/NativeAnimation/React-RCTAnimation.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "{Drivers/*,Nodes/*,*}.{m,mm}" diff --git a/Libraries/Network/React-RCTNetwork.podspec b/Libraries/Network/React-RCTNetwork.podspec index f2275bcb9cd6af..0839802ee3e5d5 100644 --- a/Libraries/Network/React-RCTNetwork.podspec +++ b/Libraries/Network/React-RCTNetwork.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec b/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec index 05c056cfea415a..28b0ebfae93201 100644 --- a/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +++ b/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/pushnotificationios" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/RCTRequired/RCTRequired.podspec b/Libraries/RCTRequired/RCTRequired.podspec index 063d4fce0b2f45..753d67b382a4da 100644 --- a/Libraries/RCTRequired/RCTRequired.podspec +++ b/Libraries/RCTRequired/RCTRequired.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "RCTRequired" diff --git a/Libraries/Settings/React-RCTSettings.podspec b/Libraries/Settings/React-RCTSettings.podspec index dc8d449d345ca0..42995840793f80 100644 --- a/Libraries/Settings/React-RCTSettings.podspec +++ b/Libraries/Settings/React-RCTSettings.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/settings" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/StyleSheet/PlatformColorValueTypes.macos.js b/Libraries/StyleSheet/PlatformColorValueTypes.macos.js index 75f52deb457dfc..3e8a05f2222e07 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +++ b/Libraries/StyleSheet/PlatformColorValueTypes.macos.js @@ -19,12 +19,35 @@ export opaque type NativeColorValue = { light: ?(ColorValue | ProcessedColorValue), dark: ?(ColorValue | ProcessedColorValue), }, + colorWithSystemEffect?: { + baseColor: ?(ColorValue | ProcessedColorValue), + systemEffect: SystemEffectMacOSPrivate, + }, }; export const PlatformColor = (...names: Array): ColorValue => { return {semantic: names}; }; +export type SystemEffectMacOSPrivate = + | 'none' + | 'pressed' + | 'deepPressed' + | 'disabled' + | 'rollover'; + +export const ColorWithSystemEffectMacOSPrivate = ( + color: ColorValue, + effect: SystemEffectMacOSPrivate, +): ColorValue => { + return { + colorWithSystemEffect: { + baseColor: color, + systemEffect: effect, + }, + }; +}; + export type DynamicColorMacOSTuplePrivate = { light: ColorValue, dark: ColorValue, @@ -54,8 +77,20 @@ export const normalizeColorObject = ( }, }; return dynamicColor; + } else if ( + 'colorWithSystemEffect' in color && + color.colorWithSystemEffect != null + ) { + const processColor = require('./processColor'); + const colorWithSystemEffect = color.colorWithSystemEffect; + const colorObject: NativeColorValue = { + colorWithSystemEffect: { + baseColor: processColor(colorWithSystemEffect.baseColor), + systemEffect: colorWithSystemEffect.systemEffect, + }, + }; + return colorObject; } - return null; }; @@ -72,6 +107,19 @@ export const processColorObject = ( }, }; return dynamicColor; + } else if ( + 'colorWithSystemEffect' in color && + color.colorWithSystemEffect != null + ) { + const processColor = require('./processColor'); + const colorWithSystemEffect = color.colorWithSystemEffect; + const colorObject: NativeColorValue = { + colorWithSystemEffect: { + baseColor: processColor(colorWithSystemEffect.baseColor), + systemEffect: colorWithSystemEffect.systemEffect, + }, + }; + return colorObject; } return color; }; diff --git a/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js index 567205d2320088..5a665d9e99fa56 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +++ b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js @@ -22,4 +22,20 @@ export const DynamicColorMacOS = ( ): ColorValue => { throw new Error('DynamicColorMacOS is not available on this platform.'); }; + +export type SystemEffectMacOS = + | 'none' + | 'pressed' + | 'deepPressed' + | 'disabled' + | 'rollover'; + +export const ColorWithSystemEffectMacOS = ( + color: ColorValue, + effect: SystemEffectMacOS, +): ColorValue => { + throw new Error( + 'ColorWithSystemEffectMacOS is not available on this platform.', + ); +}; // ]TODO(macOS ISS#2323203) diff --git a/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js index 613ed542aa1e5e..f66e7356951f77 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +++ b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js @@ -11,7 +11,10 @@ 'use strict'; import type {ColorValue} from './StyleSheetTypes'; -import {DynamicColorMacOSPrivate} from './PlatformColorValueTypes'; +import { + DynamicColorMacOSPrivate, + ColorWithSystemEffectMacOSPrivate, +} from './PlatformColorValueTypes'; export type DynamicColorMacOSTuple = { light: ColorValue, @@ -23,4 +26,18 @@ export const DynamicColorMacOS = ( ): ColorValue => { return DynamicColorMacOSPrivate({light: tuple.light, dark: tuple.dark}); }; + +export type SystemEffectMacOS = + | 'none' + | 'pressed' + | 'deepPressed' + | 'disabled' + | 'rollover'; + +export const ColorWithSystemEffectMacOS = ( + color: ColorValue, + effect: SystemEffectMacOS, +): ColorValue => { + return ColorWithSystemEffectMacOSPrivate(color, effect); +}; // ]TODO(macOS ISS#2323203) diff --git a/Libraries/Text/React-RCTText.podspec b/Libraries/Text/React-RCTText.podspec index 276ee8ba25787c..e7a55482a37a05 100644 --- a/Libraries/Text/React-RCTText.podspec +++ b/Libraries/Text/React-RCTText.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/text" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "**/*.{h,m}" s.ios.exclude_files = "**/macOS/*" # TODO(macOS ISS#2323203) diff --git a/Libraries/TypeSafety/RCTTypeSafety.podspec b/Libraries/TypeSafety/RCTTypeSafety.podspec index 5cd02a9f8119ca..94d21256cbe7d1 100644 --- a/Libraries/TypeSafety/RCTTypeSafety.podspec +++ b/Libraries/TypeSafety/RCTTypeSafety.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.compiler_flags = folly_compiler_flags s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" diff --git a/Libraries/Vibration/React-RCTVibration.podspec b/Libraries/Vibration/React-RCTVibration.podspec index 4b4bb0512eae0e..46384ce09e6012 100644 --- a/Libraries/Vibration/React-RCTVibration.podspec +++ b/Libraries/Vibration/React-RCTVibration.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/vibration" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/README.md b/README.md index 07bda51d9f120c..ca535ec912a306 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ You can read more about the macOS implementation in our website - [React Native ## Requirements -You can run React Native for macOS apps on Mac devices with versions [High Sierra (10.13)](https://www.apple.com/newsroom/2017/09/macos-high-sierra-now-available-as-a-free-update/) or newer. +You can run React Native for macOS apps on Mac devices with versions Mojave (10.14) or newer. For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnm-dependencies) documentation on our website. diff --git a/RNTester/Podfile b/RNTester/Podfile index 6dfe6a31a45d94..b9cbc443e1096e 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -83,19 +83,4 @@ end post_install do |installer| flipper_post_install(installer) - installer.pods_project.targets.each do |target| - # [TODO(macOS ISS#2323203): the internal Microsoft build pipeline needs iOS arm64e slices - if target.platform_name == :ios - target.build_configurations.each do |config| - (config.build_settings['ARCHS'] ||= ['$(ARCHS_STANDARD)']) << 'arm64e' - end - end - # TODO(macOS ISS#2323203): the internal Microsoft build pipeline needs macOS arm64 slices - if target.platform_name == :osx - target.build_configurations.each do |config| - (config.build_settings['ARCHS'] ||= ['$(ARCHS_STANDARD)']) << ' arm64' - end - end - # ]TODO(macOS ISS#2323203) - end end diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 6fb054f18fe47b..6eddf3da80b324 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -516,12 +516,12 @@ EXTERNAL SOURCES: :path: "../ReactCommon/yoga" SPEC CHECKSUMS: - boost-for-react-native: dabda8622e76020607c2ae1e65cc0cda8b61479d + boost-for-react-native: a110407d9db2642fd2e1bcd7c5a51c81f2521dc9 CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f - DoubleConversion: 56a44bcfd14ab2ff66f5a146b2e875eb4b69b19b - FBLazyVector: 33306016e21286a3ebf05b2e74758ecb51b487cb - FBReactNativeSpec: eba7c1b592e557c3d328af72fcd04fa5ad9dc732 + DoubleConversion: 2b45d0f8e156a5b02354c8a4062de64d41ccb4e0 + FBLazyVector: 29fb6e7901d1f0a80f920b6f40e29b459e3ec4d1 + FBReactNativeSpec: 2abf54e37e2606a820a73b437b997605c563c2ff Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -529,39 +529,39 @@ SPEC CHECKSUMS: Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d - glog: 1cb7c408c781ae8f35bbababe459b45e3dee4ec1 + glog: 789873d01e4b200777d0a09bc23d548446758699 hermes: 12d049af0d8e8379c5b3b54ffb1919d670045bdc - libevent: ee9265726a1fc599dea382964fa304378affaa5f + libevent: 59938c595b8c19e50c83250628ffed9ebf662183 OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCT-Folly: 1347093ffe75e152d846f7e45a3ef901b60021aa - RCTRequired: c1be2a438c43a3bbaae1c648944e74f09bf7b6df - RCTTypeSafety: 8a51d44eafbc4d6b845f4bf158973cb15017af4a - React: cd84a8114f257b60d426051214bb220e01f31853 - React-ART: dc713fc5e6fc9d91111ac8dcc36f423edaf726db - React-callinvoker: 22c4350c8d512f0c4d28c652de164d261790eee3 - React-Core: 301a9137b800e78e100804b201a2751eba784396 - React-CoreModules: 1f63ebf5afc57f1182c29d071f1d0b36729d3c1e - React-cxxreact: 4d4c317d32055a60063d6788962df6d8e5e959a9 - React-jsi: 5130ca982064487449da1e916815a2ab17c8b5f0 - React-jsiexecutor: fbc8b1046ca4a8a9b5fc1e92e506a96e22600f5f - React-jsinspector: dbed1bb565004515d7470a54673da99cd36d6ac8 - React-RCTActionSheet: 8d7d186c02a07c96ff8b4193c39c829003d5e401 - React-RCTAnimation: 769775382fcb0fd801bc0e8c4ba69b112b605e97 - React-RCTBlob: c0e2dba349e77aa3ccbc99b1c61f0f8ba53b6add - React-RCTImage: d1424690347182fd14183d471fb756542b9645b8 - React-RCTLinking: f8d483d3e8e4bcc2749e67d5f68b8006dfe5eb3d - React-RCTNetwork: 7d4f1caaae3b87a9c3e924eeea4805a3bcaf9144 - React-RCTPushNotification: 03dc947964f5c2a3c53389e7c386b5b8bcef2b17 - React-RCTSettings: 6be17236bffccbcfa3a57dd961b7682998a92a11 - React-RCTTest: 0de4043839e8b9782e9ca4c3ecaf7c6dace48027 - React-RCTText: efcbbf74281e0c42f0c7737c8cc0f148b3cf8983 - React-RCTVibration: 45f0a1b6780752f516bf81717cfdf901896e93a7 - React-TurboModuleCxx-RNW: 4da8eb44b10ab3c5bbab9fcb0a8ae415c20ea3c9 - React-TurboModuleCxx-WinRTPort: 723f549e1b886bae14bf16b6ef8420aef0d3f190 - ReactCommon: 24aa1f1de935591060e0730148c0d85da7567214 - Yoga: e009ba9e81fe6c0b4067e62295faa522982b3860 + RCT-Folly: 55d0039b24e192081ec0b2257f7bd9f42e382fb7 + RCTRequired: 57e1ef095e22d885256164d8c6df479dbd21da07 + RCTTypeSafety: f72f3ec5db9ee5fa6bb29fe9f7fa7dacf50adfdf + React: b97bad9179f2d53c1c1bb1d0c66e2acef1742872 + React-ART: 0ad249875e1b8884b3cd1c489e4647ff34996485 + React-callinvoker: 9d92ac3e7ede9a0a85f037a83910a4d66b0c92ca + React-Core: 51a5896743a633f4156873166f8df2ed9cb0b0d5 + React-CoreModules: e2b16910bbce831fba4ca8ac829b816d82c8eef1 + React-cxxreact: a32457255e1ec50d5a07f9af396870f4b9ed5bdd + React-jsi: 651f42a24396052d7597fec149a7f81ca812165b + React-jsiexecutor: bfe7c0dbc6682c6beb1202c0c6afac92493e6cea + React-jsinspector: 76b4c121774407834f4e595bffbab9ab2b52b32c + React-RCTActionSheet: d2197778c865bbcfb1017ee3fd2c50a19318005b + React-RCTAnimation: c9bc756f8fe2bf0b3bd6940c7ab03cd757d8a032 + React-RCTBlob: 1109c2570e7eb5fb33385b4cca2eec4dc302478c + React-RCTImage: 8390b4f788ffc069d0a7c284bb9b21650bc66116 + React-RCTLinking: 11d1b2a7cbc16e38c717cc4a5e77fe30870ba19f + React-RCTNetwork: 5e1de525f5e12e74dae2f34e534dbf2cca1d63d3 + React-RCTPushNotification: 3d65a4c1e7024261d74c764dd6faff4938cc01cb + React-RCTSettings: 73c143d2537688995cac0511e1285f9bec202a46 + React-RCTTest: f8ad362f336933a7ac2aca51bb72d351b62d0655 + React-RCTText: dba6bfe53bb0ecf817492cda78f6da8c4677e1ab + React-RCTVibration: a1e909ab9ae0b1f4090530e2e90b30ba598d67b4 + React-TurboModuleCxx-RNW: 18bb71af41fe34c8b12a56bef60aae7ee32b0817 + React-TurboModuleCxx-WinRTPort: 91af7d60f381ea47e2b43a2c0951175dda50218f + ReactCommon: eaa845b24197ed3e1f7a3f77d17cb45d98173975 + Yoga: 8b5431dfe1c915fb925390f0769410304a86e04c YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 18ca7d3b0e7db79041574a8bb6200b9e1c2d5359 +PODFILE CHECKSUM: baaa75a5807a228f32c4218f28c9260336518038 -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.1 diff --git a/RNTester/RCTTest/React-RCTTest.podspec b/RNTester/RCTTest/React-RCTTest.podspec index fa90f9eed2ebc2..e59791cae35843 100644 --- a/RNTester/RCTTest/React-RCTTest.podspec +++ b/RNTester/RCTTest/React-RCTTest.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{h,m,mm}" diff --git a/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testLayoutExample_1-iOS14@2x.png b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testLayoutExample_1-iOS14@2x.png new file mode 100644 index 00000000000000..b9e88a87ae316d Binary files /dev/null and b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testLayoutExample_1-iOS14@2x.png differ diff --git a/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testScrollViewExample_1-iOS14@2x.png b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testScrollViewExample_1-iOS14@2x.png new file mode 100644 index 00000000000000..be30f368dff242 Binary files /dev/null and b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testScrollViewExample_1-iOS14@2x.png differ diff --git a/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testSwitchExample_1-iOS14@2x.png b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testSwitchExample_1-iOS14@2x.png new file mode 100644 index 00000000000000..01aebc6813dcba Binary files /dev/null and b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testSwitchExample_1-iOS14@2x.png differ diff --git a/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testTextExample_1-iOS14@2x.png b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testTextExample_1-iOS14@2x.png new file mode 100644 index 00000000000000..eb37b21e2c5ef0 Binary files /dev/null and b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testTextExample_1-iOS14@2x.png differ diff --git a/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testViewExample_1-iOS14@2x.png b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testViewExample_1-iOS14@2x.png new file mode 100644 index 00000000000000..6cb548931249cc Binary files /dev/null and b/RNTester/RNTesterIntegrationTests/ReferenceImages/RNTester-js-RNTesterApp.ios/testViewExample_1-iOS14@2x.png differ diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index 9408341a8587f4..c101a29bc80990 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -1711,7 +1711,7 @@ CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; EXECUTABLE_PREFIX = lib; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( @@ -1736,7 +1736,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; EXECUTABLE_PREFIX = lib; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( "$(inherited)", @@ -1931,7 +1931,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( @@ -1971,7 +1971,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( "$(inherited)", @@ -2005,7 +2005,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( @@ -2041,7 +2041,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( "$(inherited)", @@ -2076,7 +2076,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( @@ -2109,7 +2109,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( "$(inherited)", diff --git a/RNTester/js/examples/Accessibility/AccessibilityExample.js b/RNTester/js/examples/Accessibility/AccessibilityExample.js index bf92e28a0c9699..3b68f8884cc023 100644 --- a/RNTester/js/examples/Accessibility/AccessibilityExample.js +++ b/RNTester/js/examples/Accessibility/AccessibilityExample.js @@ -739,6 +739,16 @@ class DisplayOptionsStatusExample extends React.Component<{}> { state = {}; componentDidMount() { + AccessibilityInfo.addEventListener( + 'highContrastChanged', + this._handleHighContrastToggled, + ); + AccessibilityInfo.isHighContrastEnabled().done(isEnabled => { + this.setState({ + highContrastEnabled: isEnabled, + }); + }); + AccessibilityInfo.addEventListener( 'invertColorsChanged', this._handleInvertColorsToggled, @@ -771,6 +781,10 @@ class DisplayOptionsStatusExample extends React.Component<{}> { } componentWillUnmount() { + AccessibilityInfo.removeEventListener( + 'highContrastChanged', + this._handleHighContrastToggled, + ); AccessibilityInfo.removeEventListener( 'invertColorsChanged', this._handleInvertColorsToggled, @@ -785,6 +799,12 @@ class DisplayOptionsStatusExample extends React.Component<{}> { ); } + _handleHighContrastToggled = isEnabled => { + this.setState({ + highContrastEnabled: isEnabled, + }); + }; + _handleInvertColorsToggled = isEnabled => { this.setState({ invertColorsEnabled: isEnabled, @@ -806,6 +826,12 @@ class DisplayOptionsStatusExample extends React.Component<{}> { render() { return ( + + + High contrast is{' '} + {this.state.highContrastEnabled ? 'enabled' : 'disabled'}. + + Invert colors is{' '} diff --git a/RNTester/js/examples/PlatformColor/PlatformColorExample.js b/RNTester/js/examples/PlatformColor/PlatformColorExample.js index 6968d0619bc765..33079fcffa8cd0 100644 --- a/RNTester/js/examples/PlatformColor/PlatformColorExample.js +++ b/RNTester/js/examples/PlatformColor/PlatformColorExample.js @@ -15,6 +15,7 @@ const ReactNative = require('react-native'); import Platform from '../../../../Libraries/Utilities/Platform'; const { ColorAndroid, + ColorWithSystemEffectMacOS, // TODO(macOS GH#750) DynamicColorIOS, DynamicColorMacOS, PlatformColor, @@ -352,6 +353,144 @@ function VariantColorsExample() { ); } +// [TODO(macOS GH#750) +function ColorWithSystemEffectMacOSExample() { + function createTable() { + let colors = [ + {label: 'gray', color: 'gray'}, + { + label: "ColorWithSystemEffectMacOS('gray', 'none')", + color: ColorWithSystemEffectMacOS('gray', 'none'), + }, + { + label: "ColorWithSystemEffectMacOS('gray', 'pressed')", + color: ColorWithSystemEffectMacOS('gray', 'pressed'), + }, + { + label: "ColorWithSystemEffectMacOS('gray', 'deepPressed')", + color: ColorWithSystemEffectMacOS('gray', 'deepPressed'), + }, + { + label: "ColorWithSystemEffectMacOS('gray', 'disabled')", + color: ColorWithSystemEffectMacOS('gray', 'disabled'), + }, + { + label: "ColorWithSystemEffectMacOS('gray', 'rollover')", + color: ColorWithSystemEffectMacOS('gray', 'rollover'), + }, + { + label: "PlatformColor('systemBlueColor')", + color: PlatformColor('systemBlueColor'), + }, + { + label: + "ColorWithSystemEffectMacOS(PlatformColor('systemBlueColor'), 'none')", + color: ColorWithSystemEffectMacOS( + PlatformColor('systemBlueColor'), + 'none', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(PlatformColor('systemBlueColor'), 'pressed')", + color: ColorWithSystemEffectMacOS( + PlatformColor('systemBlueColor'), + 'pressed', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(PlatformColor('systemBlueColor'), 'deepPressed')", + color: ColorWithSystemEffectMacOS( + PlatformColor('systemBlueColor'), + 'deepPressed', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(PlatformColor('systemBlueColor'), 'disabled')", + color: ColorWithSystemEffectMacOS( + PlatformColor('systemBlueColor'), + 'disabled', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(PlatformColor('systemBlueColor'), 'rollover')", + color: ColorWithSystemEffectMacOS( + PlatformColor('systemBlueColor'), + 'rollover', + ), + }, + { + label: "DynamicColorMacOS({light: 'red', dark: 'blue'})", + color: DynamicColorMacOS({light: 'red', dark: 'blue'}), + }, + { + label: + "ColorWithSystemEffectMacOS(DynamicColorMacOS({light: 'red', dark: 'blue'}), 'none')", + color: ColorWithSystemEffectMacOS( + DynamicColorMacOS({light: 'red', dark: 'blue'}), + 'none', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(DynamicColorMacOS({light: 'red', dark: 'blue'}), 'pressed')", + color: ColorWithSystemEffectMacOS( + DynamicColorMacOS({light: 'red', dark: 'blue'}), + 'pressed', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(DynamicColorMacOS({light: 'red', dark: 'blue'}), 'deepPressed')", + color: ColorWithSystemEffectMacOS( + DynamicColorMacOS({light: 'red', dark: 'blue'}), + 'deepPressed', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(DynamicColorMacOS({light: 'red', dark: 'blue'}), 'disabled')", + color: ColorWithSystemEffectMacOS( + DynamicColorMacOS({light: 'red', dark: 'blue'}), + 'disabled', + ), + }, + { + label: + "ColorWithSystemEffectMacOS(DynamicColorMacOS({light: 'red', dark: 'blue'}), 'rollover')", + color: ColorWithSystemEffectMacOS( + DynamicColorMacOS({light: 'red', dark: 'blue'}), + 'rollover', + ), + }, + ]; + + let table = []; + for (let color of colors) { + table.push( + + {color.label} + + , + ); + } + return table; + } + return Platform.OS === 'macos' ? ( + {createTable()} + ) : ( + Not applicable on this platform + ); +} // ]TODO(macOS GH#750) + const styles = StyleSheet.create({ column: {flex: 1, flexDirection: 'column'}, row: {flex: 0.75, flexDirection: 'row'}, @@ -398,4 +537,11 @@ exports.examples = [ return ; }, }, + // [TODO(macOS GH#750) + { + title: 'Color With System Effect macOS', + render(): React.Element { + return ; + }, + }, // ]TODO(macOS GH#750) ]; diff --git a/React-Core.podspec b/React-Core.podspec index c8d1f050fa5c86..beeffd4351756d 100644 --- a/React-Core.podspec +++ b/React-Core.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.source = source s.resource_bundle = { "AccessibilityResources" => ["React/AccessibilityResources/*.lproj"]} s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags @@ -86,7 +86,7 @@ Pod::Spec.new do |s| # [TODO(macOS GH#214) s.subspec "Hermes" do |ss| - ss.platforms = { :osx => "10.13" } + ss.platforms = { :osx => "10.14" } ss.source_files = "ReactCommon/hermes/executor/*.{cpp,h}", "ReactCommon/hermes/inspector/*.{cpp,h}", "ReactCommon/hermes/inspector/chrome/*.{cpp,h}", diff --git a/React.podspec b/React.podspec index 811e062b143306..daf2d96cb1d394 100644 --- a/React.podspec +++ b/React.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.cocoapods_version = ">= 1.2.0" diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 31f973429b5fc0..b5e005b306416a 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -951,6 +951,28 @@ + (RCTUIColor *)NSColor:(id)json } // ]TODO(macOS ISS#2323203) +// [TODO(macOS GH#750) +#if TARGET_OS_OSX +static NSColor *RCTColorWithSystemEffect(NSColor* color, NSString *systemEffectString) { + NSColor *colorWithEffect = color; + if (systemEffectString != nil) { + if ([systemEffectString isEqualToString:@"none"]) { + colorWithEffect = [color colorWithSystemEffect:NSColorSystemEffectNone]; + } else if ([systemEffectString isEqualToString:@"pressed"]) { + colorWithEffect = [color colorWithSystemEffect:NSColorSystemEffectPressed]; + } else if ([systemEffectString isEqualToString:@"deepPressed"]) { + colorWithEffect = [color colorWithSystemEffect:NSColorSystemEffectDeepPressed]; + } else if ([systemEffectString isEqualToString:@"disabled"]) { + colorWithEffect = [color colorWithSystemEffect:NSColorSystemEffectDisabled]; + } else if ([systemEffectString isEqualToString:@"rollover"]) { + colorWithEffect = [color colorWithSystemEffect:NSColorSystemEffectRollover]; + } + } + return colorWithEffect; +} +#endif //TARGET_OS_OSX +// ]TODO(macOS GH#750) + + (RCTUIColor *)UIColor:(id)json // TODO(OSS Candidate ISS#2710739) { if (!json) { @@ -1030,8 +1052,24 @@ + (RCTUIColor *)UIColor:(id)json // TODO(OSS Candidate ISS#2710739) RCTLogConvertError(json, @"a UIColor. Expected a dynamic appearance aware color."); return nil; } +// [TODO(macOS GH#750) +#if TARGET_OS_OSX + } else if((value = [dictionary objectForKey:@"colorWithSystemEffect"])) { + NSDictionary *colorWithSystemEffect = value; + id base = [colorWithSystemEffect objectForKey:@"baseColor"]; + NSColor *baseColor = [RCTConvert UIColor:base]; + NSString * systemEffectString = [colorWithSystemEffect objectForKey:@"systemEffect"]; + if (baseColor != nil && systemEffectString != nil) { + return RCTColorWithSystemEffect(baseColor, systemEffectString); + } else { + RCTLogConvertError( + json, @"a UIColor. Expected a color with a system effect string, but got something else"); + return nil; + } +#endif //TARGET_OS_OSX +// ]TODO(macOS GH#750) } else { - RCTLogConvertError(json, @"a UIColor. Expected a semantic color or dynamic appearance aware color."); + RCTLogConvertError(json, @"a UIColor. Expected a semantic color, dynamic appearance aware color, or color with system effect"); //TODO(macOS GH#750) return nil; } // ]TODO(macOS ISS#2323203) diff --git a/React/Base/macOS/RCTDynamicColor.m b/React/Base/macOS/RCTDynamicColor.m index 31b8e13a160dfd..e6899f63eabf7e 100644 --- a/React/Base/macOS/RCTDynamicColor.m +++ b/React/Base/macOS/RCTDynamicColor.m @@ -178,7 +178,9 @@ - (nullable NSColor *)blendedColorWithFraction:(CGFloat)fraction ofColor:(NSColo - (NSColor *)colorWithSystemEffect:(NSColorSystemEffect)systemEffect NS_AVAILABLE_MAC(10_14) { - return [[self effectiveColor] colorWithSystemEffect:systemEffect]; + NSColor *aquaColorWithSystemEffect = [_aquaColor colorWithSystemEffect:systemEffect]; + NSColor *darkAquaColorWithSystemEffect = [_darkAquaColor colorWithSystemEffect:systemEffect]; + return [[RCTDynamicColor alloc] initWithAquaColor:aquaColorWithSystemEffect darkAquaColor:darkAquaColorWithSystemEffect]; } - (NSUInteger)hash diff --git a/React/CoreModules/RCTAccessibilityManager.h b/React/CoreModules/RCTAccessibilityManager.h index 7b5a132d262621..310dd8d0600424 100644 --- a/React/CoreModules/RCTAccessibilityManager.h +++ b/React/CoreModules/RCTAccessibilityManager.h @@ -21,6 +21,7 @@ extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; / @property (nonatomic, assign) BOOL isBoldTextEnabled; @property (nonatomic, assign) BOOL isGrayscaleEnabled; +@property (nonatomic, assign) BOOL isHighContrastEnabled; // TODO(macOS ISS#2323203) - maps to shouldIncreaseContrast on macOS @property (nonatomic, assign) BOOL isInvertColorsEnabled; @property (nonatomic, assign) BOOL isReduceMotionEnabled; @property (nonatomic, assign) BOOL isReduceTransparencyEnabled; diff --git a/React/CoreModules/RCTDevSettings.mm b/React/CoreModules/RCTDevSettings.mm index 849b374db5500c..7c5dc8c9c03042 100644 --- a/React/CoreModules/RCTDevSettings.mm +++ b/React/CoreModules/RCTDevSettings.mm @@ -119,7 +119,11 @@ - (void)_reloadWithDefaults:(NSDictionary *)defaultValues _settings[key] = defaultValues[key]; } } - [_userDefaults setObject:_settings forKey:kRCTDevSettingsUserDefaultsKey]; + + // TODO(macOS ISS#2323203): protect against race conditions where another thread holds a mutext trying to set this at the same time + RCTExecuteOnMainQueue(^{ + [self->_userDefaults setObject:self->_settings forKey:kRCTDevSettingsUserDefaultsKey]; + }); } @end diff --git a/React/CoreModules/React-CoreModules.podspec b/React/CoreModules/React-CoreModules.podspec index e547a3f1f2852f..30177e3aecc4b8 100644 --- a/React/CoreModules/React-CoreModules.podspec +++ b/React/CoreModules/React-CoreModules.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS ISS#2323203) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS ISS#2323203) s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{c,m,mm,cpp}" diff --git a/React/Modules/MacOS/RCTAccessibilityManager.m b/React/Modules/MacOS/RCTAccessibilityManager.m index 416048a278c748..58974ffbb2afcd 100644 --- a/React/Modules/MacOS/RCTAccessibilityManager.m +++ b/React/Modules/MacOS/RCTAccessibilityManager.m @@ -23,12 +23,12 @@ @implementation RCTAccessibilityManager static void *AccessibilityVoiceOverChangeContext = &AccessibilityVoiceOverChangeContext; -+ (BOOL)requiresMainQueueSetup ++ (BOOL)requiresMainQueueSetup { - return NO; + return YES; } -- (instancetype)init +- (instancetype)init { if (self = [super init]) { [[NSWorkspace sharedWorkspace] addObserver:self @@ -39,11 +39,11 @@ - (instancetype)init selector:@selector(accessibilityDisplayOptionsChange:) name:NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification object:nil]; + _isHighContrastEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]; _isInvertColorsEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors]; _isReduceMotionEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]; _isReduceTransparencyEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceTransparency]; _isVoiceOverEnabled = [[NSWorkspace sharedWorkspace] isVoiceOverEnabled]; - } return self; } @@ -53,7 +53,6 @@ - (void)dealloc [[NSWorkspace sharedWorkspace] removeObserver:self forKeyPath:@"voiceOverEnabled" context:AccessibilityVoiceOverChangeContext]; - [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self]; } RCT_EXPORT_METHOD(announceForAccessibility:(NSString *)announcement) @@ -67,6 +66,12 @@ - (void)dealloc ); } +RCT_EXPORT_METHOD(getCurrentHighContrastState:(RCTResponseSenderBlock)callback + error:(__unused RCTResponseSenderBlock)error) +{ + callback(@[@(_isHighContrastEnabled)]); +} + RCT_EXPORT_METHOD(getCurrentInvertColorsState:(RCTResponseSenderBlock)callback error:(__unused RCTResponseSenderBlock)error) { @@ -124,9 +129,16 @@ - (void)observeValueForKeyPath:(NSString *)keyPath - (void)accessibilityDisplayOptionsChange:(NSNotification *)notification { + BOOL newHighContrastEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast]; BOOL newInvertColorsEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldInvertColors]; BOOL newReduceMotionEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]; BOOL newReduceTransparencyEnabled = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceTransparency]; + + if (_isHighContrastEnabled != newHighContrastEnabled) { + _isHighContrastEnabled = newHighContrastEnabled; + [_bridge.eventDispatcher sendDeviceEventWithName:@"highContrastChanged" + body:@(_isHighContrastEnabled)]; + } if (_isInvertColorsEnabled != newInvertColorsEnabled) { _isInvertColorsEnabled = newInvertColorsEnabled; [_bridge.eventDispatcher sendDeviceEventWithName:@"invertColorsChanged" diff --git a/React/Views/RCTViewManager.m b/React/Views/RCTViewManager.m index 8a41562516976d..fbc4f8c0487ab5 100644 --- a/React/Views/RCTViewManager.m +++ b/React/Views/RCTViewManager.m @@ -124,6 +124,24 @@ - (RCTShadowView *)shadowView ]; } +#if TARGET_OS_OSX // [TODO(macOS ISS#2323203) +RCT_EXPORT_METHOD(focus : (nonnull NSNumber *)viewTag) +{ + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { + RCTUIView *view = viewRegistry[viewTag]; + [view reactFocus]; + }]; +} + +RCT_EXPORT_METHOD(blur : (nonnull NSNumber *)viewTag) +{ + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { + RCTUIView *view = viewRegistry[viewTag]; + [view reactBlur]; + }]; +} +#endif // ]TODO(macOS ISS#2323203) + #pragma mark - View properties #if TARGET_OS_TV diff --git a/ReactCommon/ReactCommon.podspec b/ReactCommon/ReactCommon.podspec index 0948e9d3da9dc1..82b42b6c0a2280 100644 --- a/ReactCommon/ReactCommon.podspec +++ b/ReactCommon/ReactCommon.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/ReactCommon/callinvoker/React-callinvoker.podspec b/ReactCommon/callinvoker/React-callinvoker.podspec index c983bfa5980836..21e1d9ed7eeaab 100644 --- a/ReactCommon/callinvoker/React-callinvoker.podspec +++ b/ReactCommon/callinvoker/React-callinvoker.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "ReactCommon" diff --git a/ReactCommon/cxxreact/React-cxxreact.podspec b/ReactCommon/cxxreact/React-cxxreact.podspec index 5d79b221dca346..12c0ac858aa5bb 100644 --- a/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/ReactCommon/cxxreact/React-cxxreact.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "*.{cpp,h}" s.exclude_files = "SampleCxxModule.*" diff --git a/ReactCommon/jsi/React-jsi.podspec b/ReactCommon/jsi/React-jsi.podspec index 6bc99df93b3f24..00fa87c93dc1f4 100644 --- a/ReactCommon/jsi/React-jsi.podspec +++ b/ReactCommon/jsi/React-jsi.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "**/*.{cpp,h}" s.exclude_files = "**/test/*" diff --git a/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index b67a03eaca9436..eef1279ac5e33f 100644 --- a/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "jsireact/*.{cpp,h}" s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/ReactCommon/jsinspector/React-jsinspector.podspec b/ReactCommon/jsinspector/React-jsinspector.podspec index 17677010eeb6a5..ff5e71660cc408 100644 --- a/ReactCommon/jsinspector/React-jsinspector.podspec +++ b/ReactCommon/jsinspector/React-jsinspector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) s.source = source s.source_files = "*.{cpp,h}" s.header_dir = 'jsinspector' diff --git a/ReactCommon/yoga/Yoga.podspec b/ReactCommon/yoga/Yoga.podspec index d2943e6138f4e6..38e087939f71ad 100644 --- a/ReactCommon/yoga/Yoga.podspec +++ b/ReactCommon/yoga/Yoga.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |spec| ] # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } + spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # Set this environment variable when *not* using the `:path` option to install the pod. # E.g. when publishing this spec to a spec repo. diff --git a/ReactTurboModuleCxx/React-TurboModuleCxx-RNW.podspec b/ReactTurboModuleCxx/React-TurboModuleCxx-RNW.podspec index 5367ab41e65ece..42dac31a0dcced 100644 --- a/ReactTurboModuleCxx/React-TurboModuleCxx-RNW.podspec +++ b/ReactTurboModuleCxx/React-TurboModuleCxx-RNW.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/microsoft/react-native-windows" s.license = package["license"] s.author = "Microsoft Corporation" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } s.compiler_flags = folly_compiler_flags s.source = { :git => 'https://github.com/microsoft/react-native-windows.git', :commit => "d9077991441889ddaa18a8af6a2cc8514ca7714d" } diff --git a/ReactTurboModuleCxx/React-TurboModuleCxx-WinRTPort.podspec b/ReactTurboModuleCxx/React-TurboModuleCxx-WinRTPort.podspec index 3becd32bef960c..8e0bfc601d8107 100644 --- a/ReactTurboModuleCxx/React-TurboModuleCxx-WinRTPort.podspec +++ b/ReactTurboModuleCxx/React-TurboModuleCxx-WinRTPort.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/microsoft/react-native-macos" s.license = package["license"] s.author = "Microsoft Corporation" - s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } + s.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } s.compiler_flags = folly_compiler_flags s.source = source diff --git a/index.js b/index.js index db266061e3083a..a250d1b8e7c05d 100644 --- a/index.js +++ b/index.js @@ -99,6 +99,7 @@ import typeof processColor from './Libraries/StyleSheet/processColor'; import typeof {PlatformColor} from './Libraries/StyleSheet/PlatformColorValueTypes'; import typeof {DynamicColorIOS} from './Libraries/StyleSheet/PlatformColorValueTypesIOS'; import typeof {DynamicColorMacOS} from './Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // TODO(macOS ISS#2323203) +import typeof {ColorWithSystemEffectMacOS} from './Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // TODO(macOS GH#750) import typeof {ColorAndroid} from './Libraries/StyleSheet/PlatformColorValueTypesAndroid'; import typeof RootTagContext from './Libraries/ReactNative/RootTagContext'; import typeof DeprecatedColorPropType from './Libraries/DeprecatedPropTypes/DeprecatedColorPropType'; @@ -496,10 +497,16 @@ module.exports = { return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS') .DynamicColorIOS; }, + // [TODO(macOS ISS#2323203) get DynamicColorMacOS(): DynamicColorMacOS { return require('./Libraries/StyleSheet/PlatformColorValueTypesMacOS') .DynamicColorMacOS; - }, + }, // [TODO(macOS ISS#2323203) + // [TODO(macOS GH#750) + get ColorWithSystemEffectMacOS(): ColorWithSystemEffectMacOS { + return require('./Libraries/StyleSheet/PlatformColorValueTypesMacOS') + .ColorWithSystemEffectMacOS; + }, // ]TODO(macOS GH#750) get ColorAndroid(): ColorAndroid { return require('./Libraries/StyleSheet/PlatformColorValueTypesAndroid') .ColorAndroid; diff --git a/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj b/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj index 54e3200f96b4fc..933b32730bceb2 100644 --- a/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj +++ b/local-cli/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj @@ -465,7 +465,7 @@ DEAD_CODE_STRIPPING = NO; INFOPLIST_FILE = "HelloWorld-macos/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -485,7 +485,7 @@ CURRENT_PROJECT_VERSION = 1; INFOPLIST_FILE = "HelloWorld-macos/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.14; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/local-cli/generator-macos/templates/macos/Podfile b/local-cli/generator-macos/templates/macos/Podfile index 44ba1589fed528..b0c122413b3fe3 100644 --- a/local-cli/generator-macos/templates/macos/Podfile +++ b/local-cli/generator-macos/templates/macos/Podfile @@ -2,7 +2,7 @@ require_relative '../node_modules/react-native-macos/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'HelloWorld-macOS' do - platform :macos, '10.13' + platform :macos, '10.14' use_native_modules! use_react_native!( :path => '../node_modules/react-native-macos', diff --git a/scripts/vsto-test-ci.sh b/scripts/vsto-test-ci.sh index 2843bff8947bd0..8711f77701313b 100755 --- a/scripts/vsto-test-ci.sh +++ b/scripts/vsto-test-ci.sh @@ -18,27 +18,27 @@ npm install # Setup packager and WebSocket test server . ./scripts/vsto-test-setup.sh -# XCode macOS test +# Xcode macOS test xcodebuild -sdk macosx -configuration Debug -project ./RNTester/RNTester.xcodeproj -scheme RNTester-macOS build test DSTROOT=$OUTPUTDIR/macosx/Debug/build.dst OBJROOT=$OUTPUTDIR/macosx/Debug/build.obj SYMROOT=$OUTPUTDIR/macosx/Debug/build.sym SHARED_PRECOMPS_DIR=$OUTPUTDIR/macosx/Debug/build.pch -destination platform=macOS,arch=x86_64 ONLY_ACTIVE_ARCH=NO DEVELOPMENT_TEAM=UBF8T346G9 | /usr/local/bin/xcpretty -r junit --no-color if [ $? -ne 0 ]; then - echo "XCode macOS test FAILED" + echo "Xcode macOS test FAILED" exit 1 else - # XCode iOS test + # Xcode iOS test xcodebuild -sdk iphonesimulator -configuration Debug -project ./RNTester/RNTester.xcodeproj -scheme RNTester build test DSTROOT=$OUTPUTDIR/iphonesimulator/Debug/build.dst OBJROOT=$OUTPUTDIR/iphonesimulator/Debug/build.obj SYMROOT=$OUTPUTDIR/iphonesimulator/Debug/build.sym SHARED_PRECOMPS_DIR=$OUTPUTDIR/iphonesimulator/Debug/build.pch -destination platform="iOS Simulator,OS=latest,name=iPhone 5s" ONLY_ACTIVE_ARCH=NO DEVELOPMENT_TEAM=UBF8T346G9 | /usr/local/bin/xcpretty -r junit --no-color if [ $? -ne 0 ]; then - echo "XCode iOS test FAILED" + echo "Xcode iOS test FAILED" exit 1 else - # XCode tvOS test + # Xcode tvOS test xcodebuild -configuration Debug -project ./RNTester/RNTester.xcodeproj -scheme RNTester-tvOS build test DSTROOT=$OUTPUTDIR/iphoneos/Debug/build.dst OBJROOT=$OUTPUTDIR/iphoneos/Debug/build.obj SYMROOT=$OUTPUTDIR/iphoneos/Debug/build.sym SHARED_PRECOMPS_DIR=$OUTPUTDIR/iphoneos/Debug/build.pch -destination platform="tvOS Simulator,OS=latest,name=Apple TV" ONLY_ACTIVE_ARCH=NO DEVELOPMENT_TEAM=UBF8T346G9 | /usr/local/bin/xcpretty -r junit --no-color if [ $? -ne 0 ]; then - echo "XCode tvOS test FAILED" + echo "Xcode tvOS test FAILED" exit 1 fi fi diff --git a/scripts/vsto-test-cleanup.sh b/scripts/vsto-test-cleanup.sh index d249743550a02b..0d8e976893a075 100755 --- a/scripts/vsto-test-cleanup.sh +++ b/scripts/vsto-test-cleanup.sh @@ -2,7 +2,7 @@ set -ex # Script used by the VSTO build agent to cleanup the packager and web socket server -# after the XCode test step has completed +# after the Xcode test step has completed # kill whatever is occupying port 8081 (packager) lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill diff --git a/third-party-podspecs/DoubleConversion.podspec b/third-party-podspecs/DoubleConversion.podspec index 3a0d0051319d02..24e4f11c9cab54 100644 --- a/third-party-podspecs/DoubleConversion.podspec +++ b/third-party-podspecs/DoubleConversion.podspec @@ -19,6 +19,6 @@ Pod::Spec.new do |spec| spec.compiler_flags = '-Wno-unreachable-code' # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) end diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index 1c4643ac89c9cf..c50bbaa6393b07 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -124,5 +124,5 @@ Pod::Spec.new do |spec| end # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) end diff --git a/third-party-podspecs/boost-for-react-native.podspec b/third-party-podspecs/boost-for-react-native.podspec index fa9be88325021b..b18301127f502c 100644 --- a/third-party-podspecs/boost-for-react-native.podspec +++ b/third-party-podspecs/boost-for-react-native.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |spec| # Pinning to the same version as React.podspec. # TODO: Move this osx addition back upstream to https://github.com/react-native-community/boost-for-react-native - spec.platforms = { :ios => '8.0', :tvos => '9.2', :osx => "10.13" } + spec.platforms = { :ios => '8.0', :tvos => '9.2', :osx => "10.14" } spec.requires_arc = false spec.module_name = 'boost' diff --git a/third-party-podspecs/glog.podspec b/third-party-podspecs/glog.podspec index 6ecaa142bc34fc..be6d96e7b2463d 100644 --- a/third-party-podspecs/glog.podspec +++ b/third-party-podspecs/glog.podspec @@ -34,6 +34,6 @@ Pod::Spec.new do |spec| "HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src" } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.13" } # TODO(macOS GH#214) + spec.platforms = { :ios => "10.0", :tvos => "10.0", :osx => "10.14" } # TODO(macOS GH#214) end diff --git a/third-party-podspecs/libevent.podspec b/third-party-podspecs/libevent.podspec index 61eb60f919ce41..f8a94ad588e74a 100644 --- a/third-party-podspecs/libevent.podspec +++ b/third-party-podspecs/libevent.podspec @@ -544,7 +544,7 @@ Pod::Spec.new do |spec| spec.homepage = "https://libevent.org" spec.license = { :type => "BSD 3-Clause", :file => "LICENSE" } spec.author = "Niels Provos and Nick Mathewson" - spec.platforms = { :osx => "10.13" } + spec.platforms = { :osx => "10.14" } spec.source = { :git => "https://github.com/libevent/libevent.git", :tag => "release-#{spec.version}-stable" } spec.default_subspec = "core" spec.prepare_command = "touch evconfig-private.h; echo -e #{Shellwords.escape(CONFIG_WITHOUT_OPENSSL)} > include/event2/event-config.h"