From 77c84744f0c394a848d92898395bf69d13ea5c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 5 Oct 2020 19:27:29 +0200 Subject: [PATCH 1/9] [TextField] Remove now superfluous override --- Libraries/Text/TextInput/Singleline/RCTUITextField.m | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 420e7fea252fe4..71b7749f1fb781 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -374,16 +374,6 @@ - (CGRect)editingRectForBounds:(CGRect)bounds #pragma mark - NSTextViewDelegate methods -- (void)setScrollEnabled:(BOOL)enabled -{ - // Do noting, compatible with multiline textinput -} - -- (BOOL)scrollEnabled -{ - return NO; -} - - (void)textDidChange:(NSNotification *)notification { [super textDidChange:notification]; From 8ed55a866a7a71b696da6de464f7a32d99065153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 7 Oct 2020 16:07:30 +0200 Subject: [PATCH 2/9] [Text/TextInput] Use correct dynamic default color Reverts https://github.com/facebook/react-native/commit/5394c908ebe21ffb9d8b0764011b25e6a0973e6f in favour of seting a default in RCTTextAttributes. This fixes it in one place for both Text and TextInput. --- Libraries/Text/RCTTextAttributes.m | 10 +++++++--- Libraries/Text/TextInput/RCTBaseTextInputView.m | 8 +------- .../Text/TextInput/Singleline/RCTUITextField.m | 17 ++--------------- .../PlatformColor/PlatformColorExample.js | 6 ++---- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/Libraries/Text/RCTTextAttributes.m b/Libraries/Text/RCTTextAttributes.m index 27cf7b4ee50175..95eabfa41104f6 100644 --- a/Libraries/Text/RCTTextAttributes.m +++ b/Libraries/Text/RCTTextAttributes.m @@ -31,9 +31,13 @@ - (instancetype)init _textShadowRadius = NAN; _opacity = NAN; _textTransform = RCTTextTransformUndefined; -#if TARGET_OS_OSX // TODO(macOS ISS#2323203) - _foregroundColor = [NSColor labelColor]; -#endif // TODO(macOS ISS#2323203) + // [TODO(OSS Candidate ISS#2710739) + if (@available(iOS 13.0, *)) { + _foregroundColor = [RCTUIColor labelColor]; + } else { + _foregroundColor = [RCTUIColor blackColor]; + } + // ]TODO(OSS Candidate ISS#2710739) } return self; diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 1a63addbdc0a76..391dc87a5e564b 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -69,13 +69,7 @@ - (void)enforceTextAttributesIfNeeded { if (![self ignoresTextAttributes]) { // TODO(OSS Candidate ISS#2710739) id backedTextInputView = self.backedTextInputView; - - NSDictionary *textAttributes = [[_textAttributes effectiveTextAttributes] mutableCopy]; - if ([textAttributes valueForKey:NSForegroundColorAttributeName] == nil) { - [textAttributes setValue:[RCTUIColor blackColor] forKey:NSForegroundColorAttributeName]; // TODO(macOS ISS#2323203) - } - - backedTextInputView.defaultTextAttributes = textAttributes; + backedTextInputView.defaultTextAttributes = [_textAttributes effectiveTextAttributes]; } // TODO(OSS Candidate ISS#2710739) } diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 71b7749f1fb781..37e24448c414c9 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -91,12 +91,6 @@ @implementation RCTUITextField { #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) @dynamic delegate; - -static RCTUIColor *defaultPlaceholderTextColor() -{ - return [NSColor placeholderTextColor]; -} - #endif // ]TODO(macOS ISS#2323203) - (instancetype)initWithFrame:(CGRect)frame @@ -321,15 +315,8 @@ - (void)setSecureTextEntry:(BOOL)secureTextEntry { NSMutableDictionary *textAttributes = [_defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new]; - if (self.placeholderColor) { - [textAttributes setValue:self.placeholderColor forKey:NSForegroundColorAttributeName]; - } else { -#if TARGET_OS_OSX // [TODO(macOS ISS#2323203) - [textAttributes setValue:defaultPlaceholderTextColor() forKey:NSForegroundColorAttributeName]; -#else - [textAttributes removeObjectForKey:NSForegroundColorAttributeName]; -#endif // ]TODO(macOS ISS#2323203) - } + [textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor] + forKey:NSForegroundColorAttributeName]; // TODO(macOS ISS#2323203) return textAttributes; } diff --git a/RNTester/js/examples/PlatformColor/PlatformColorExample.js b/RNTester/js/examples/PlatformColor/PlatformColorExample.js index c440808d2123e1..cb785bc7899380 100644 --- a/RNTester/js/examples/PlatformColor/PlatformColorExample.js +++ b/RNTester/js/examples/PlatformColor/PlatformColorExample.js @@ -313,10 +313,8 @@ const styles = StyleSheet.create({ labelCell: { flex: 1, alignItems: 'stretch', - ...Platform.select({ - ios: {color: PlatformColor('labelColor')}, - default: {color: 'black'}, - }), + // TODO(macOS ISS#2323203) + // Remove need to specify label color }, colorCell: {flex: 0.25, alignItems: 'stretch'}, }); From b7e67a9e37899a51fb83e0433e05cfce6a6d29ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 7 Oct 2020 16:46:09 +0200 Subject: [PATCH 3/9] [PlatformColor] Properly add macOS version --- .../PlatformColorValueTypes.macos.js | 8 +-- ...cos.js => PlatformColorValueTypesMacOS.js} | 9 +-- .../PlatformColorValueTypesMacOS.macos.js | 26 ++++++++ RNTester/js/RNTesterApp.ios.js | 8 ++- .../PlatformColor/PlatformColorExample.js | 59 ++++++++++++++++--- index.js | 5 ++ 6 files changed, 99 insertions(+), 16 deletions(-) rename Libraries/StyleSheet/{PlatformColorValueTypesIOS.macos.js => PlatformColorValueTypesMacOS.js} (60%) create mode 100644 Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js diff --git a/Libraries/StyleSheet/PlatformColorValueTypes.macos.js b/Libraries/StyleSheet/PlatformColorValueTypes.macos.js index 29c62f7c93c33f..75f52deb457dfc 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +++ b/Libraries/StyleSheet/PlatformColorValueTypes.macos.js @@ -25,13 +25,13 @@ export const PlatformColor = (...names: Array): ColorValue => { return {semantic: names}; }; -export type DynamicColorIOSTuplePrivate = { +export type DynamicColorMacOSTuplePrivate = { light: ColorValue, dark: ColorValue, }; -export const DynamicColorIOSPrivate = ( - tuple: DynamicColorIOSTuplePrivate, +export const DynamicColorMacOSPrivate = ( + tuple: DynamicColorMacOSTuplePrivate, ): ColorValue => { return {dynamic: {light: tuple.light, dark: tuple.dark}}; }; @@ -40,7 +40,7 @@ export const normalizeColorObject = ( color: NativeColorValue, ): ?ProcessedColorValue => { if ('semantic' in color) { - // an ios semantic color + // a macOS semantic color return color; } else if ('dynamic' in color && color.dynamic !== undefined) { const normalizeColor = require('./normalizeColor'); diff --git a/Libraries/StyleSheet/PlatformColorValueTypesIOS.macos.js b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js similarity index 60% rename from Libraries/StyleSheet/PlatformColorValueTypesIOS.macos.js rename to Libraries/StyleSheet/PlatformColorValueTypesMacOS.js index 12fee85a5070d8..567205d2320088 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypesIOS.macos.js +++ b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js @@ -11,14 +11,15 @@ 'use strict'; import type {ColorValue} from './StyleSheetTypes'; -import {DynamicColorIOSPrivate} from './PlatformColorValueTypes'; -export type DynamicColorIOSTuple = { +export type DynamicColorMacOSTuple = { light: ColorValue, dark: ColorValue, }; -export const DynamicColorIOS = (tuple: DynamicColorIOSTuple): ColorValue => { - return DynamicColorIOSPrivate({light: tuple.light, dark: tuple.dark}); +export const DynamicColorMacOS = ( + tuple: DynamicColorMacOSTuple, +): ColorValue => { + throw new Error('DynamicColorMacOS is not available on this platform.'); }; // ]TODO(macOS ISS#2323203) diff --git a/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js new file mode 100644 index 00000000000000..613ed542aa1e5e --- /dev/null +++ b/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js @@ -0,0 +1,26 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow strict-local + */ +// [TODO(macOS ISS#2323203) +'use strict'; + +import type {ColorValue} from './StyleSheetTypes'; +import {DynamicColorMacOSPrivate} from './PlatformColorValueTypes'; + +export type DynamicColorMacOSTuple = { + light: ColorValue, + dark: ColorValue, +}; + +export const DynamicColorMacOS = ( + tuple: DynamicColorMacOSTuple, +): ColorValue => { + return DynamicColorMacOSPrivate({light: tuple.light, dark: tuple.dark}); +}; +// ]TODO(macOS ISS#2323203) diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js index 1786d4ddc8133b..3aff610259ae10 100644 --- a/RNTester/js/RNTesterApp.ios.js +++ b/RNTester/js/RNTesterApp.ios.js @@ -29,6 +29,7 @@ const { Platform, // TODO(OSS Candidate ISS#2710739) PlatformColor, // TODO(OSS Candidate ISS#2710739) DynamicColorIOS, // TODO(OSS Candidate ISS#2710739) + DynamicColorMacOS, // TODO(macOS ISS#2323203) SafeAreaView, StyleSheet, Text, @@ -249,7 +250,12 @@ const styles = StyleSheet.create({ fontSize: 19, fontWeight: '600', textAlign: 'center', - color: DynamicColorIOS({light: 'black', dark: 'white'}), // TODO(OSS Candidate ISS#2710739) + color: + // [TODO(macOS ISS#2323203) + Platform.OS === 'macos' + ? DynamicColorMacOS({light: 'black', dark: 'white'}) + : DynamicColorIOS({light: 'black', dark: 'white'}), // TODO(OSS Candidate ISS#2710739) + // ]TODO(macOS ISS#2323203) }, exampleContainer: { flex: 1, diff --git a/RNTester/js/examples/PlatformColor/PlatformColorExample.js b/RNTester/js/examples/PlatformColor/PlatformColorExample.js index cb785bc7899380..6968d0619bc765 100644 --- a/RNTester/js/examples/PlatformColor/PlatformColorExample.js +++ b/RNTester/js/examples/PlatformColor/PlatformColorExample.js @@ -16,6 +16,7 @@ import Platform from '../../../../Libraries/Utilities/Platform'; const { ColorAndroid, DynamicColorIOS, + DynamicColorMacOS, PlatformColor, StyleSheet, Text, @@ -228,7 +229,42 @@ function FallbackColorsExample() { } function DynamicColorsExample() { - return Platform.OS === 'ios' ? ( + // [TODO(macOS ISS#2323203) + return Platform.OS === 'macos' ? ( + + + + DynamicColorMacOS({'{\n'} + {' '}light: 'red', dark: 'blue'{'\n'} + {'}'}) + + + + + + DynamicColorMacOS({'{\n'} + {' '}light: PlatformColor('systemBlueColor'),{'\n'} + {' '}dark: PlatformColor('systemRedColor'),{'\n'} + {'}'}) + + + + + ) : // ]TODO(macOS ISS#2323203) + Platform.OS === 'ios' ? ( @@ -289,17 +325,26 @@ function VariantColorsExample() { - {Platform.OS === 'ios' || Platform.OS === 'macos' // TODO(macOS ISS#2323203) - ? "DynamicColorIOS({light: 'red', dark: 'blue'})" - : "ColorAndroid('?attr/colorAccent')"} + {// [TODO(OSS Candidate ISS#2710739) + Platform.select({ + ios: "DynamicColorIOS({light: 'red', dark: 'blue'})", + android: "ColorAndroid('?attr/colorAccent')", + macos: "DynamicColorMacOS({light: 'red', dark: 'blue'})", + }) + // ]TODO(OSS Candidate ISS#2710739) + } @@ -336,7 +381,7 @@ exports.examples = [ }, }, { - title: 'iOS Dynamic Colors', + title: 'Dynamic Colors', // TODO(OSS Candidate ISS#2710739) render(): React.Element { return ; }, diff --git a/index.js b/index.js index b3372d0946c32c..db266061e3083a 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,7 @@ import typeof Platform from './Libraries/Utilities/Platform'; 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 {ColorAndroid} from './Libraries/StyleSheet/PlatformColorValueTypesAndroid'; import typeof RootTagContext from './Libraries/ReactNative/RootTagContext'; import typeof DeprecatedColorPropType from './Libraries/DeprecatedPropTypes/DeprecatedColorPropType'; @@ -495,6 +496,10 @@ module.exports = { return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS') .DynamicColorIOS; }, + get DynamicColorMacOS(): DynamicColorMacOS { + return require('./Libraries/StyleSheet/PlatformColorValueTypesMacOS') + .DynamicColorMacOS; + }, get ColorAndroid(): ColorAndroid { return require('./Libraries/StyleSheet/PlatformColorValueTypesAndroid') .ColorAndroid; From db0bce3f1c926ecfb62634bad340815fe066d5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 8 Oct 2020 16:18:04 +0200 Subject: [PATCH 4/9] [RNTester] Make Podfile conform more to upstream --- RNTester/Podfile | 68 ++++------------------- RNTester/Podfile.lock | 126 +++++++++++++++++++++++------------------- 2 files changed, 80 insertions(+), 114 deletions(-) diff --git a/RNTester/Podfile b/RNTester/Podfile index 21927df825e301..3759a92d7a8bd7 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -1,4 +1,5 @@ require_relative '../scripts/react_native_pods' + source 'https://cdn.cocoapods.org/' platform :ios, '10.0' @@ -15,6 +16,7 @@ end def pods(options = {}) project 'RNTesterPods.xcodeproj' + # Enable TurboModule use_react_native!(options.merge(path: "..")) pod 'ReactCommon/turbomodule/samples', :path => '../ReactCommon' @@ -30,56 +32,19 @@ def pods(options = {}) # use_react_native!(path: "..", fabric_enabled: true) end -def flipper_pods() - flipperkit_version = '0.30.1' - pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug' - pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug' - pod 'FlipperKit/FlipperKitReactPlugin', '~>' + flipperkit_version, :configuration => 'Debug' - - if ENV['USE_FRAMEWORKS'] == '1' - static_frameworks = ['FlipperKit', 'Flipper', 'Flipper-Folly', - 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', - 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', - 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native'] - - pre_install do |installer| - Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} - installer.pod_targets.each do |pod| - if static_frameworks.include?(pod.name) - def pod.build_type - Pod::Target::BuildType.static_library - end - end - end - end - end +target 'RNTester' do + pods() + use_flipper! end -# Post Install processing for Flipper -def flipper_post_install(installer) - file_name = Dir.glob("*.xcodeproj")[0] - app_project = Xcodeproj::Project.open(file_name) - app_project.native_targets.each do |target| - target.build_configurations.each do |config| - cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) ' - unless cflags.include? '-DFB_SONARKIT_ENABLED=1' - puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...' - cflags << ' -DFB_SONARKIT_ENABLED=1 ' - end - config.build_settings['OTHER_CFLAGS'] = cflags - end - app_project.save - end - installer.pods_project.save +target 'RNTesterUnitTests' do + pods() + pod 'React-RCTTest', :path => "./RCTTest" end -target 'RNTester' do - platform :ios, '10.0' +target 'RNTesterIntegrationTests' do pods() - flipper_pods() - # use_flipper! + pod 'React-RCTTest', :path => "./RCTTest" end target 'RNTester-macOS' do @@ -87,24 +52,12 @@ target 'RNTester-macOS' do pods(:hermes_enabled => true) end -target 'RNTesterUnitTests' do - platform :ios, '10.0' - pods() - pod 'React-RCTTest', :path => "./RCTTest" -end - target 'RNTester-macOSUnitTests' do platform :osx, '10.14' pods() pod 'React-RCTTest', :path => "./RCTTest" end -target 'RNTesterIntegrationTests' do - platform :ios, '10.0' - pods() - pod 'React-RCTTest', :path => "./RCTTest" -end - target 'RNTester-macOSIntegrationTests' do platform :osx, '10.14' pods() @@ -129,7 +82,6 @@ end # ]TODO(macOS ISS#2323203) post_install do |installer| - # TODO(macOS): How do we reconcile flipper on macOS? For now disabling to unblock merge flipper_post_install(installer) installer.pods_project.targets.each do |target| puts target.name diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 6d28a1ff50f1af..b0d4fa16695b0f 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -11,9 +11,9 @@ PODS: - React-Core (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - Flipper (0.30.2): - - Flipper-Folly (~> 2.1) - - Flipper-RSocket (~> 1.0) + - Flipper (0.54.0): + - Flipper-Folly (~> 2.2) + - Flipper-RSocket (~> 1.1) - Flipper-DoubleConversion (1.1.7) - Flipper-Folly (2.2.0): - boost-for-react-native @@ -25,36 +25,36 @@ PODS: - Flipper-PeerTalk (0.0.4) - Flipper-RSocket (1.1.0): - Flipper-Folly (~> 2.2) - - FlipperKit (0.30.2): - - FlipperKit/Core (= 0.30.2) - - FlipperKit/Core (0.30.2): - - Flipper (~> 0.30.2) + - FlipperKit (0.54.0): + - FlipperKit/Core (= 0.54.0) + - FlipperKit/Core (0.54.0): + - Flipper (~> 0.54.0) - FlipperKit/CppBridge - FlipperKit/FBCxxFollyDynamicConvert - FlipperKit/FBDefines - FlipperKit/FKPortForwarding - - FlipperKit/CppBridge (0.30.2): - - Flipper (~> 0.30.2) - - FlipperKit/FBCxxFollyDynamicConvert (0.30.2): - - Flipper-Folly (~> 2.1) - - FlipperKit/FBDefines (0.30.2) - - FlipperKit/FKPortForwarding (0.30.2): + - FlipperKit/CppBridge (0.54.0): + - Flipper (~> 0.54.0) + - FlipperKit/FBCxxFollyDynamicConvert (0.54.0): + - Flipper-Folly (~> 2.2) + - FlipperKit/FBDefines (0.54.0) + - FlipperKit/FKPortForwarding (0.54.0): - CocoaAsyncSocket (~> 7.6) - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.30.2) - - FlipperKit/FlipperKitLayoutPlugin (0.30.2): + - FlipperKit/FlipperKitHighlightOverlay (0.54.0) + - FlipperKit/FlipperKitLayoutPlugin (0.54.0): - FlipperKit/Core - FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitLayoutTextSearchable - YogaKit (~> 1.18) - - FlipperKit/FlipperKitLayoutTextSearchable (0.30.2) - - FlipperKit/FlipperKitNetworkPlugin (0.30.2): + - FlipperKit/FlipperKitLayoutTextSearchable (0.54.0) + - FlipperKit/FlipperKitNetworkPlugin (0.54.0): - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.30.2): + - FlipperKit/FlipperKitReactPlugin (0.54.0): - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.30.2): + - FlipperKit/FlipperKitUserDefaultsPlugin (0.54.0): - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.30.2): + - FlipperKit/SKIOSNetworkPlugin (0.54.0): - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - glog (0.3.5) @@ -376,11 +376,25 @@ DEPENDENCIES: - DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../Libraries/FBLazyVector`) - FBReactNativeSpec (from `../Libraries/FBReactNativeSpec`) - - FlipperKit (~> 0.30.1) - - FlipperKit/FlipperKitLayoutPlugin (~> 0.30.1) - - FlipperKit/FlipperKitReactPlugin (~> 0.30.1) - - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.30.1) - - FlipperKit/SKIOSNetworkPlugin (~> 0.30.1) + - Flipper (~> 0.54.0) + - Flipper-DoubleConversion (= 1.1.7) + - Flipper-Folly (~> 2.2) + - Flipper-Glog (= 0.3.6) + - Flipper-PeerTalk (~> 0.0.4) + - Flipper-RSocket (~> 1.1) + - FlipperKit (~> 0.54.0) + - FlipperKit/Core (~> 0.54.0) + - FlipperKit/CppBridge (~> 0.54.0) + - FlipperKit/FBCxxFollyDynamicConvert (~> 0.54.0) + - FlipperKit/FBDefines (~> 0.54.0) + - FlipperKit/FKPortForwarding (~> 0.54.0) + - FlipperKit/FlipperKitHighlightOverlay (~> 0.54.0) + - FlipperKit/FlipperKitLayoutPlugin (~> 0.54.0) + - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.54.0) + - FlipperKit/FlipperKitNetworkPlugin (~> 0.54.0) + - FlipperKit/FlipperKitReactPlugin (~> 0.54.0) + - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.54.0) + - FlipperKit/SKIOSNetworkPlugin (~> 0.54.0) - glog (from `../third-party-podspecs/glog.podspec`) - hermes (from `../node_modules/hermes-engine-darwin`) - libevent (from `../third-party-podspecs/libevent.podspec`) @@ -417,7 +431,7 @@ DEPENDENCIES: - Yoga (from `../ReactCommon/yoga`) SPEC REPOS: - trunk: + https://cdn.cocoapods.org/: - CocoaAsyncSocket - CocoaLibEvent - Flipper @@ -505,48 +519,48 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: 56a44bcfd14ab2ff66f5a146b2e875eb4b69b19b - FBLazyVector: 9a39f2b3abdfad9c9786f2cbaa4a118d440859e8 - FBReactNativeSpec: 607019989c57833fe92d443cdc6af797d64a3f1c - Flipper: 10b225e352595f521be0e5badddd90e241336e89 + FBLazyVector: fce6fc7849c293fbc9ca91d4e30f9b2bb08e66c8 + FBReactNativeSpec: bd9ea166dad905c8e585bd99f79273a8a9af62b3 + Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 - FlipperKit: 88b7f0d0cf907ddc2137b85eeb7f3d4d8d9395c8 + FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d glog: 1cb7c408c781ae8f35bbababe459b45e3dee4ec1 hermes: 12d049af0d8e8379c5b3b54ffb1919d670045bdc libevent: ee9265726a1fc599dea382964fa304378affaa5f OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 RCT-Folly: 1347093ffe75e152d846f7e45a3ef901b60021aa - RCTRequired: 3eb8ee251620c300f971fb6adcd978fbe2969536 - RCTTypeSafety: 47f652917ebae60548eca9c8fcc7498862857cd4 - React: 1415fe99adbc6ceed4ac26d1b7dc34a91f1dc7e8 - React-ART: c43391b30b08d491259cc2cd6490759759496214 - React-callinvoker: 14fb9d64cfe58da1f9a9577197653a836e4f11f1 - React-Core: 55c9736a286275fe7cec2f0714f098b0401be603 - React-CoreModules: 649f3d11db1a0882bacd750870999a28d5360289 - React-cxxreact: 8e980788463570dbd613a0faf838e05accc123c5 - React-jsi: 6c101faa738788510e4e31943619ddb368bde28e - React-jsiexecutor: 760194253d880ae04bf18815b26c8fb19c460992 - React-jsinspector: 7886f2c3f1e97112979459ebac3d4ab2ad73ec36 - React-RCTActionSheet: 8b13faf77cb9c07d3fceff30297d21ed5e5b1938 - React-RCTAnimation: e94cf104b4de671f4153b3ee40cfeb6229c8a84f - React-RCTBlob: 558ac5759216eb47bda75cd8c90f72371f7bdb87 - React-RCTImage: 6a7987c19d67664ca9784696ad16f5b92f1af3b1 - React-RCTLinking: cd1a4fcc7d87978b36010be2c3d4a3b2d634bd8e - React-RCTNetwork: 5657fbac8c44c8199fd7fb3523fdf7ad2ac73726 - React-RCTPushNotification: f73dd8865f1f0a90d386e618b2382511892481d5 - React-RCTSettings: 20d92c7e33ef7fcfce4bf72fdd70dcfd3eec9e01 - React-RCTTest: 3baffa43098b97179f81ab0824b481001c7040a2 - React-RCTText: 4c8b3676894b4e2cd48d81bb9bcd0241c20190d4 - React-RCTVibration: 1bce1bc3b192c2822c1382c1b86167f8831d0087 + RCTRequired: 4d1d390c43656e03b97d7d038df2918ac00817c4 + RCTTypeSafety: b892392c4d74f7d7aaf1a964575a70c507be8141 + React: f568d3c7e882ef6262fd94e7e497bf1cf9c588f6 + React-ART: bce016d2e8b9797c0f7370a06200455435f3d5a6 + React-callinvoker: 6466f612f3b135942990c6dded6eb992d7067d32 + React-Core: 2797ceef1a22628e020ee4bc7d54a47b6786a527 + React-CoreModules: 2080a4c2a6c0c2cc9dcac2ccb72921772a8790a0 + React-cxxreact: 30bdd2a97d7bc68139b5627175425ed9a6aaa21c + React-jsi: 65c3bf2276fc82badb158d0ada74d1b8f4db40f3 + React-jsiexecutor: 03c09b85e1c6e0123bdc4f2d1d2a5fdfdefe6ac6 + React-jsinspector: 643a16643d55880b02628ef115f1bd5dfcbeeb75 + React-RCTActionSheet: 0b17aeb20dcd01d7b81f42e7859b0dc939df29dd + React-RCTAnimation: 38ba5416f23e385cc711a55166fbea76e9157618 + React-RCTBlob: c5d79af9d3bdf21e8f0f8ccc96213433b798d7d9 + React-RCTImage: ad6104be239b26e1fe2dc08b2c19d851020e8e70 + React-RCTLinking: de3f420f9014da200dc11a04289fbf3accb89b70 + React-RCTNetwork: 5131e2a748df3c00ebbc2e013b6e7fb7a9ef33dd + React-RCTPushNotification: 06e1ccb38c485ff217b93f8cf4203d5f4430cd62 + React-RCTSettings: 8ca3ad1d247d14c51d1e2cfafd6777bc64661143 + React-RCTTest: 6f269f59952fb34848bfc3159e8fc91509ffe9e5 + React-RCTText: 166a3d6719b881218445e0f2bdef2b297d94e668 + React-RCTVibration: df16faf0fb8d7273c47a1f886a238116e82fcce4 React-TurboModuleCxx-RNW: 4da8eb44b10ab3c5bbab9fcb0a8ae415c20ea3c9 - React-TurboModuleCxx-WinRTPort: b788130b879a977230f69c53ef3fd90f37e3a9c1 - ReactCommon: a7643198fafb97e35dc4dacbe21b72e37e08a7c8 - Yoga: 678e6017754467a6f19e132e6656db9c89b1d646 + React-TurboModuleCxx-WinRTPort: fecd086dff0ba6ae1f17c7e93f5490cccaeee0c9 + ReactCommon: 9c439e9892439054357eea6228185f8934ede3b6 + Yoga: f3fec1ffc2988e315d36b627b4a4e4b8c45b970d YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: e0807101d300cac8d30eae6d233bdec1a1f3614f +PODFILE CHECKSUM: 5229c1cb239d68e4e7cc0a11f27828710c2e68bc COCOAPODS: 1.8.4 From e616b763d60231b42fa7229d5905add515e6924d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 8 Oct 2020 16:19:16 +0200 Subject: [PATCH 5/9] [RNTester] Silence pod install output --- RNTester/Podfile | 3 --- RNTester/Podfile.lock | 56 +++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/RNTester/Podfile b/RNTester/Podfile index 3759a92d7a8bd7..6dfe6a31a45d94 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -84,19 +84,16 @@ end post_install do |installer| flipper_post_install(installer) installer.pods_project.targets.each do |target| - puts target.name # [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' - puts ' adding arm64e to ' + config.name 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' - puts ' adding arm64 to ' + config.name end end # ]TODO(macOS ISS#2323203) diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index b0d4fa16695b0f..4deab72f28eaed 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -519,8 +519,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: 56a44bcfd14ab2ff66f5a146b2e875eb4b69b19b - FBLazyVector: fce6fc7849c293fbc9ca91d4e30f9b2bb08e66c8 - FBReactNativeSpec: bd9ea166dad905c8e585bd99f79273a8a9af62b3 + FBLazyVector: bc7a5826efda3b1df099ffa1dc2bb8b69f62c418 + FBReactNativeSpec: 60ff5d97d3e0a65a835f417c4de6209832bb6262 Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -533,34 +533,34 @@ SPEC CHECKSUMS: libevent: ee9265726a1fc599dea382964fa304378affaa5f OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 RCT-Folly: 1347093ffe75e152d846f7e45a3ef901b60021aa - RCTRequired: 4d1d390c43656e03b97d7d038df2918ac00817c4 - RCTTypeSafety: b892392c4d74f7d7aaf1a964575a70c507be8141 - React: f568d3c7e882ef6262fd94e7e497bf1cf9c588f6 - React-ART: bce016d2e8b9797c0f7370a06200455435f3d5a6 - React-callinvoker: 6466f612f3b135942990c6dded6eb992d7067d32 - React-Core: 2797ceef1a22628e020ee4bc7d54a47b6786a527 - React-CoreModules: 2080a4c2a6c0c2cc9dcac2ccb72921772a8790a0 - React-cxxreact: 30bdd2a97d7bc68139b5627175425ed9a6aaa21c - React-jsi: 65c3bf2276fc82badb158d0ada74d1b8f4db40f3 - React-jsiexecutor: 03c09b85e1c6e0123bdc4f2d1d2a5fdfdefe6ac6 - React-jsinspector: 643a16643d55880b02628ef115f1bd5dfcbeeb75 - React-RCTActionSheet: 0b17aeb20dcd01d7b81f42e7859b0dc939df29dd - React-RCTAnimation: 38ba5416f23e385cc711a55166fbea76e9157618 - React-RCTBlob: c5d79af9d3bdf21e8f0f8ccc96213433b798d7d9 - React-RCTImage: ad6104be239b26e1fe2dc08b2c19d851020e8e70 - React-RCTLinking: de3f420f9014da200dc11a04289fbf3accb89b70 - React-RCTNetwork: 5131e2a748df3c00ebbc2e013b6e7fb7a9ef33dd - React-RCTPushNotification: 06e1ccb38c485ff217b93f8cf4203d5f4430cd62 - React-RCTSettings: 8ca3ad1d247d14c51d1e2cfafd6777bc64661143 - React-RCTTest: 6f269f59952fb34848bfc3159e8fc91509ffe9e5 - React-RCTText: 166a3d6719b881218445e0f2bdef2b297d94e668 - React-RCTVibration: df16faf0fb8d7273c47a1f886a238116e82fcce4 + RCTRequired: 8495f5115746c8ad4a0b7db015a74b77303f5271 + RCTTypeSafety: 0a4445852aac7597f3e12b4ab25c1b5169c0437c + React: e46527450ad6e8c21ebdd33aa1d0f4e1a622e4b7 + React-ART: 0502f614453ac14f2c5e8ce2c25825779b3a2ae5 + React-callinvoker: 9493f9fe4ad57834153cd5265bab15b1125a01ff + React-Core: dcffc68cf8e3764525bb7b6f92032fcc93179f1d + React-CoreModules: b5bd802601a6b8586d834a2f45d2f455f3e822e5 + React-cxxreact: 7bebc99bd6ab7fe62396bef306bd11a457f30256 + React-jsi: bb95e6144b5ba9cc10f31a5289ec007fedb99deb + React-jsiexecutor: 2ab9f32808f7d396b4db43d2f40b0f55b45d5348 + React-jsinspector: 050a845f6a64c0da6521948c7f6ffd63c945213c + React-RCTActionSheet: 787fc63ff5feea11ac2bcbb88a3aae8bf1826eb3 + React-RCTAnimation: 255e51871a0744e2e7cc4be1e8b7ea3114d617fa + React-RCTBlob: 0c3a2e97cc237b390816093e30fa9c705a57493e + React-RCTImage: 4af81afbecd118544b97d906da6eda0aa048e21c + React-RCTLinking: 135c4800178210954b2ae5b7d12819d56c614d5f + React-RCTNetwork: 76a16bfac4f2f686a299aa5f8daabf5558616c83 + React-RCTPushNotification: d5739e0d6c8f84d8b296ef4a694562fafdafe5eb + React-RCTSettings: 4a0cf3a15f1da794d00988c0c5ceab73f33691db + React-RCTTest: 78cb7960fe0cacc4cb006bfd8486d096621db49a + React-RCTText: ee8edf71224d11f6cd2527a7709704be13b08db6 + React-RCTVibration: 044e17bf5bcbe7184a54cc40a7ebb8cd28024476 React-TurboModuleCxx-RNW: 4da8eb44b10ab3c5bbab9fcb0a8ae415c20ea3c9 - React-TurboModuleCxx-WinRTPort: fecd086dff0ba6ae1f17c7e93f5490cccaeee0c9 - ReactCommon: 9c439e9892439054357eea6228185f8934ede3b6 - Yoga: f3fec1ffc2988e315d36b627b4a4e4b8c45b970d + React-TurboModuleCxx-WinRTPort: 0dbf7417bec666c64fb7a1cbc144d39fa9ba7755 + ReactCommon: 5af47049b7708fb4332338c6a3b5da11c30e9170 + Yoga: c143ab8e59835ec8507fb28950cde950188aa2c1 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 5229c1cb239d68e4e7cc0a11f27828710c2e68bc +PODFILE CHECKSUM: 18ca7d3b0e7db79041574a8bb6200b9e1c2d5359 COCOAPODS: 1.8.4 From 597a35117d72ccd19d01d470eb6063754d863a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 8 Oct 2020 20:35:56 +0200 Subject: [PATCH 6/9] [TextInput] Leave as-of-yet unsupported features disabled --- Libraries/Text/TextInput/Multiline/RCTUITextView.m | 4 ++-- Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/Text/TextInput/Multiline/RCTUITextView.m b/Libraries/Text/TextInput/Multiline/RCTUITextView.m index 522fc5c794ba7e..32b64531d2ab06 100644 --- a/Libraries/Text/TextInput/Multiline/RCTUITextView.m +++ b/Libraries/Text/TextInput/Multiline/RCTUITextView.m @@ -340,13 +340,13 @@ - (void)selectAll:(id)sender { [super selectAll:sender]; -#if !TARGET_OS_OSX // [TODO(macOS v0.63) +#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) For `selectTextOnFocus` prop, which isn't supported on macOS atm. // `selectAll:` does not work for UITextView when it's being called inside UITextView's delegate methods. dispatch_async(dispatch_get_main_queue(), ^{ UITextRange *selectionRange = [self textRangeFromPosition:self.beginningOfDocument toPosition:self.endOfDocument]; [self setSelectedTextRange:selectionRange notifyDelegate:NO]; }); -#endif // ]TODO(macOS v0.63) +#endif } #pragma mark - Layout diff --git a/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h b/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h index a9388f1c77b6b3..c2d4117561f727 100644 --- a/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +++ b/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h @@ -50,9 +50,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign, getter=isEditable) BOOL editable; @property (nonatomic, assign) BOOL caretHidden; @property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; -#if !TARGET_OS_OSX // [TODO(macOS v0.63) +#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) @property (nonatomic, assign) UITextFieldViewMode clearButtonMode; -#endif // ]TODO(macOS v0.63) +#endif // TODO(macOS ISS#2323203) @property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; // This protocol disallows direct access to `selectedTextRange` property because From 9843fe0fead5b872ee19e7931b04200677fe88b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 8 Oct 2020 20:36:27 +0200 Subject: [PATCH 7/9] [TextInput] Fix macOS support for setting selection --- Libraries/Text/TextInput/RCTBaseTextInputView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 391dc87a5e564b..68b9c8ac55ab70 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -235,7 +235,7 @@ - (void)setSelection:(RCTTextSelection *)selection - (void)setSelectionStart:(NSInteger)start selectionEnd:(NSInteger)end { -#if !TARGET_OS_OSX // [TODO(macOS v0.63) +#if !TARGET_OS_OSX // TODO(macOS ISS#2323203) UITextPosition *startPosition = [self.backedTextInputView positionFromPosition:self.backedTextInputView.beginningOfDocument offset:start]; UITextPosition *endPosition = [self.backedTextInputView positionFromPosition:self.backedTextInputView.beginningOfDocument @@ -244,7 +244,11 @@ - (void)setSelectionStart:(NSInteger)start UITextRange *range = [self.backedTextInputView textRangeFromPosition:startPosition toPosition:endPosition]; [self.backedTextInputView setSelectedTextRange:range notifyDelegate:NO]; } -#endif // ]TODO(macOS v0.63) +#else // [TODO(macOS ISS#2323203) + NSInteger startPosition = MIN(start, end); + NSInteger endPosition = MAX(start, end); + [self.backedTextInputView setSelectedTextRange:NSMakeRange(startPosition, endPosition - startPosition) notifyDelegate:NO]; +#endif // ]TODO(macOS ISS#2323203) } - (void)setTextContentType:(NSString *)type From c33f8950605c78411ac5316b82a6be96ede301a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 9 Oct 2020 12:44:21 +0200 Subject: [PATCH 8/9] [template] Update Podfile to conform to upstream --- .../generator-macos/templates/macos/Podfile | 135 ++++-------------- 1 file changed, 30 insertions(+), 105 deletions(-) diff --git a/local-cli/generator-macos/templates/macos/Podfile b/local-cli/generator-macos/templates/macos/Podfile index 722a32da5a8a59..22a1bed363aaa5 100644 --- a/local-cli/generator-macos/templates/macos/Podfile +++ b/local-cli/generator-macos/templates/macos/Podfile @@ -1,112 +1,37 @@ +require_relative '../node_modules/react-native-macos/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -def add_flipper_pods!(versions = {}) - versions['Flipper'] ||= '~> 0.33.1' - versions['DoubleConversion'] ||= '1.1.7' - versions['Flipper-Folly'] ||= '~> 2.1' - versions['Flipper-Glog'] ||= '0.3.6' - versions['Flipper-PeerTalk'] ||= '~> 0.0.4' - versions['Flipper-RSocket'] ||= '~> 1.0' - - pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug' - - # List all transitive dependencies for FlipperKit pods - # to avoid them being linked in Release builds - pod 'Flipper', versions['Flipper'], :configuration => 'Debug' - pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug' - pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug' - pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug' - pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug' - pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug' - pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug' +target 'HelloWorld-macOS' do + platform :macos, '10.13' + use_native_modules! + use_react_native!(:path => '../node_modules/react-native-macos') + + # Enables Hermes + # + # Be sure to first install the `hermes-engine-darwin` npm package, e.g.: + # + # $ yarn add 'hermes-engine-darwin@~0.5.0' + # + # pod 'React-Core/Hermes', :path => '../node_modules/react-native-macos/' + # pod 'hermes', :path => '../node_modules/hermes-engine-darwin' + # pod 'libevent', :podspec => '../node_modules/react-native-macos/third-party-podspecs/libevent.podspec' + + # Pods specifically for macOS target end -# Post Install processing for Flipper -def flipper_post_install(installer) - installer.pods_project.targets.each do |target| - if target.name == 'YogaKit' - target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '4.1' - end - end +target 'HelloWorld-iOS' do + platform :ios, '10' + use_native_modules! + use_react_native!(:path => '../node_modules/react-native-macos') + + # Enables Flipper. + # + # Note that if you have use_frameworks! enabled, Flipper will not work and + # you should disable these next few lines. + use_flipper! + post_install do |installer| + flipper_post_install(installer) end -end - -abstract_target 'Shared' do - # Pods for HelloWorld - pod 'FBLazyVector', :path => '../node_modules/react-native-macos/Libraries/FBLazyVector' - pod 'FBReactNativeSpec', :path => '../node_modules/react-native-macos/Libraries/FBReactNativeSpec' - pod 'RCTRequired', :path => '../node_modules/react-native-macos/Libraries/RCTRequired' - pod 'RCTTypeSafety', :path => '../node_modules/react-native-macos/Libraries/TypeSafety' - pod 'React', :path => '../node_modules/react-native-macos/' - pod 'React-Core', :path => '../node_modules/react-native-macos/' - pod 'React-CoreModules', :path => '../node_modules/react-native-macos/React/CoreModules' - pod 'React-Core/DevSupport', :path => '../node_modules/react-native-macos/' - pod 'React-RCTActionSheet', :path => '../node_modules/react-native-macos/Libraries/ActionSheetIOS' - pod 'React-RCTAnimation', :path => '../node_modules/react-native-macos/Libraries/NativeAnimation' - pod 'React-RCTBlob', :path => '../node_modules/react-native-macos/Libraries/Blob' - pod 'React-RCTImage', :path => '../node_modules/react-native-macos/Libraries/Image' - pod 'React-RCTLinking', :path => '../node_modules/react-native-macos/Libraries/LinkingIOS' - pod 'React-RCTNetwork', :path => '../node_modules/react-native-macos/Libraries/Network' - pod 'React-RCTSettings', :path => '../node_modules/react-native-macos/Libraries/Settings' - pod 'React-RCTText', :path => '../node_modules/react-native-macos/Libraries/Text' - pod 'React-RCTVibration', :path => '../node_modules/react-native-macos/Libraries/Vibration' - pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native-macos/' - - pod 'React-cxxreact', :path => '../node_modules/react-native-macos/ReactCommon/cxxreact' - pod 'React-jsi', :path => '../node_modules/react-native-macos/ReactCommon/jsi' - pod 'React-jsiexecutor', :path => '../node_modules/react-native-macos/ReactCommon/jsiexecutor' - pod 'React-jsinspector', :path => '../node_modules/react-native-macos/ReactCommon/jsinspector' - pod 'React-callinvoker', :path => '../node_modules/react-native-macos/ReactCommon/callinvoker' - pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native-macos/ReactCommon' - pod 'Yoga', :path => '../node_modules/react-native-macos/ReactCommon/yoga', :modular_headers => true - - pod 'DoubleConversion', :podspec => '../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec' - pod 'glog', :podspec => '../node_modules/react-native-macos/third-party-podspecs/glog.podspec' - pod 'RCT-Folly', :podspec => '../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec' - pod 'boost-for-react-native', :podspec => '../node_modules/react-native-macos/third-party-podspecs/boost-for-react-native.podspec' - - target 'HelloWorld-macOS' do - platform :macos, '10.13' - use_native_modules! - # Enables Hermes - # - # Be sure to first install the `hermes-engine-darwin` npm package, e.g.: - # - # $ yarn add 'hermes-engine-darwin@^0.4.3' - # - # pod 'React-Core/Hermes', :path => '../node_modules/react-native-macos/' - # pod 'hermes', :path => '../node_modules/hermes-engine-darwin' - # pod 'libevent', :podspec => '../node_modules/react-native-macos/third-party-podspecs/libevent.podspec' - - # Pods specifically for macOS target - end - - target 'HelloWorld-iOS' do - platform :ios, '10' - use_native_modules! - - # Enables Flipper. - # - # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - add_flipper_pods! - post_install do |installer| - flipper_post_install(installer) - end - - # Pods specifically for iOS target - end + # Pods specifically for iOS target end From 4f8252f3f2a56e0618ef293ad5ee1372125d6a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 28 Oct 2020 17:37:36 +0100 Subject: [PATCH 9/9] [TextInput] Fix iOS backwards compatibility --- .../Text/TextInput/Singleline/RCTUITextField.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 37e24448c414c9..4299115e96a491 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -315,8 +315,18 @@ - (void)setSecureTextEntry:(BOOL)secureTextEntry { NSMutableDictionary *textAttributes = [_defaultTextAttributes mutableCopy] ?: [NSMutableDictionary new]; - [textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor] - forKey:NSForegroundColorAttributeName]; // TODO(macOS ISS#2323203) + // [TODO(OSS Candidate ISS#2710739) + if (@available(iOS 13.0, *)) { + [textAttributes setValue:self.placeholderColor ?: [RCTUIColor placeholderTextColor] + forKey:NSForegroundColorAttributeName]; + } else { + // ]TODO(OSS Candidate ISS#2710739) + if (self.placeholderColor) { + [textAttributes setValue:self.placeholderColor forKey:NSForegroundColorAttributeName]; + } else { + [textAttributes removeObjectForKey:NSForegroundColorAttributeName]; + } + } return textAttributes; }