diff --git a/.ado/templates/apple-job-javascript.yml b/.ado/templates/apple-job-javascript.yml index db58da8dffbcaa..fb4a65b92e6dab 100644 --- a/.ado/templates/apple-job-javascript.yml +++ b/.ado/templates/apple-job-javascript.yml @@ -2,11 +2,14 @@ parameters: apply_office_patches: '' steps: + - script: 'brew update' + displayName: 'brew update' + - script: 'brew bundle' displayName: 'brew bundle' - - script: brew link node@10 --overwrite --force - displayName: 'ensure node 10' + - script: brew link node@12 --overwrite --force + displayName: 'ensure node 12' - template: apple-xcode-select.yml diff --git a/.ado/templates/apple-job-react-native.yml b/.ado/templates/apple-job-react-native.yml index 32192ab8e36f71..3b1818b396fa61 100644 --- a/.ado/templates/apple-job-react-native.yml +++ b/.ado/templates/apple-job-react-native.yml @@ -15,10 +15,14 @@ steps: displayName: 'Clean DerivedData' # Install the required components specified in the Brewfile file. + - script: 'brew update' + displayName: 'brew update' + - script: 'brew bundle' displayName: 'brew bundle' - - script: brew link node@10 --overwrite --force + - script: brew link node@12 --overwrite --force + displayName: 'ensure node 12' # Task Group: XCode select proper version - template: apple-xcode-select.yml diff --git a/Brewfile b/Brewfile index 02dfa1bb2163e5..21eb8b1a032f48 100644 --- a/Brewfile +++ b/Brewfile @@ -1,2 +1,2 @@ -brew "node@10" +brew "node@12" brew "watchman" diff --git a/Brewfile.lock.json b/Brewfile.lock.json new file mode 100644 index 00000000000000..5ae86877f508d6 --- /dev/null +++ b/Brewfile.lock.json @@ -0,0 +1,60 @@ +{ + "entries": { + "brew": { + "node@12": { + "version": "12.18.3", + "bottle": { + "cellar": ":any", + "prefix": "/usr/local", + "files": { + "catalina": { + "url": "https://homebrew.bintray.com/bottles/node%4012-12.18.3.catalina.bottle.tar.gz", + "sha256": "8371625cae6cd2efa83e52a49d3c2e389e8d6be8261a0c80a710750e89ddf7d8" + }, + "mojave": { + "url": "https://homebrew.bintray.com/bottles/node%4012-12.18.3.mojave.bottle.tar.gz", + "sha256": "f410b99756e3247145b43f2775d4ad00b99dcdf4366fac74c05daef7c771cb60" + }, + "high_sierra": { + "url": "https://homebrew.bintray.com/bottles/node%4012-12.18.3.high_sierra.bottle.tar.gz", + "sha256": "5de456604c237daac3f9d3dd8b03cb13ce8d7c3efacf644093a4a3da4f8f1a53" + } + } + } + }, + "watchman": { + "version": "4.9.0_4", + "bottle": { + "cellar": "/usr/local/Cellar", + "prefix": "/usr/local", + "files": { + "catalina": { + "url": "https://homebrew.bintray.com/bottles/watchman-4.9.0_4.catalina.bottle.tar.gz", + "sha256": "7840f564c11d33425c9eb8985f9156e782e66ef2a3578329dba83ee15a9bf0be" + }, + "mojave": { + "url": "https://homebrew.bintray.com/bottles/watchman-4.9.0_4.mojave.bottle.tar.gz", + "sha256": "ba2338b0f23c8b8817fd7bfa92466b7a97ab416e93ec6c3a400041aef013de86" + }, + "high_sierra": { + "url": "https://homebrew.bintray.com/bottles/watchman-4.9.0_4.high_sierra.bottle.tar.gz", + "sha256": "150468653b5c5a8e4eb92a3ecf420f157ed0e4772513ee93425bb3f635964dad" + } + } + } + } + } + }, + "system": { + "macos": { + "catalina": { + "HOMEBREW_VERSION": "2.4.9", + "HOMEBREW_PREFIX": "/usr/local", + "Homebrew/homebrew-core": "8a19447722a5bd15a5ce806d5d35178f30990e4d", + "CLT": "", + "Xcode": "11.5", + "macOS": "10.15.6" + } + } + } +} diff --git a/Libraries/Text/Text/RCTTextView.m b/Libraries/Text/Text/RCTTextView.m index 655c250a11cd27..484f892f6ce3d0 100644 --- a/Libraries/Text/Text/RCTTextView.m +++ b/Libraries/Text/Text/RCTTextView.m @@ -63,6 +63,25 @@ - (instancetype)initWithFrame:(CGRect)frame } #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) +- (void)dealloc +{ + [self removeAllTextStorageLayoutManagers]; +} + +- (void)removeAllTextStorageLayoutManagers +{ + // On macOS AppKit can throw an uncaught exception + // (-[NSConcretePointerArray pointerAtIndex:]: attempt to access pointer at index ...) + // during the dealloc of NSLayoutManager. The _textStorage and its + // associated NSLayoutManager dealloc later in an autorelease pool. + // Manually removing the layout managers from _textStorage prior to release + // works around this issue in AppKit. + NSArray *managers = [[_textStorage layoutManagers] copy]; + for (NSLayoutManager *manager in managers) { + [_textStorage removeLayoutManager:manager]; + } +} + - (BOOL)canBecomeKeyView { // RCTText should not get any keyboard focus unless its `selectable` prop is true @@ -132,17 +151,7 @@ - (void)setTextStorage:(NSTextStorage *)textStorage descendantViews:(NSArray *)descendantViews // TODO(macOS ISS#3536887) { #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) - // On macOS when a large number of flex layouts are being performed, such - // as when a window is being resized, AppKit can throw an uncaught exception - // (-[NSConcretePointerArray pointerAtIndex:]: attempt to access pointer at index ...) - // during the dealloc of NSLayoutManager. The _textStorage and its - // associated NSLayoutManager dealloc later in an autorelease pool. - // Manually removing the layout manager from _textStorage prior to release - // works around this issue in AppKit. - NSArray *managers = [_textStorage layoutManagers]; - for (NSLayoutManager *manager in managers) { - [_textStorage removeLayoutManager:manager]; - } + [self removeAllTextStorageLayoutManagers]; #endif // ]TODO(macOS ISS#2323203) _textStorage = textStorage; diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 8c9d0a6d4ca01f..1d97b34ccef2bb 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -348,33 +348,33 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: a110407d9db2642fd2e1bcd7c5a51c81f2521dc9 DoubleConversion: a1bc12a74baa397a2609e0f10e19b8062d864053 - FBLazyVector: dd4758081b0f021c1143d98bfb9b9c417c4b9759 - FBReactNativeSpec: c6032881e58249a39922c173508a450a8c0fa84a + FBLazyVector: 681897af71189193fab35027ce8e7275c4549006 + FBReactNativeSpec: cfbced7241c878d9c864b363d069a6e2468285c3 Folly: feff29ba9d0b7c2e4f793a94942831d6cc5bbad7 glog: b3f6d74f3e2d33396addc0ee724d2b2b79fc3e00 - RCTRequired: 733f6fc9179aa8fcc87fb63f3f3aad9929241fc3 - RCTTypeSafety: c52f0b46836e84cb951d9c40c8209d10775b6bbc - React: b94e937a7271f35ee705c21d0c54990192cc1634 - React-ART: c55a2a4bc6f9bec3bb604606175f05ee081a7455 - React-Core: 5fc0c8ad37c5f0f6a40433be0524cee6058edd17 - React-CoreModules: 015ba93e2945bf810a6ef67f5b4086c87ae63009 - React-cxxreact: 07fae12835719892e7fe92dfc46103f69a1a8e39 - React-jsi: 20175357a063599ea4c8f969c4b325e76eae5aaa - React-jsiexecutor: 308871755c64cb5eacd94cd01ee34ba02a50f5da - React-jsinspector: 03688e20257352e97f0e69016743b90561a3b23f - React-RCTActionSheet: 3a6b052391c5fff7e1b27539ef9d7834f7cefed5 - React-RCTAnimation: 15e4bf4f576bb5f610dbaa016c2e555ea4a7c228 - React-RCTBlob: 4b22ab790b485e2d1b5bc0183ccc02dc15ae866d - React-RCTImage: 71640ec76e906b84d86af56f98421aeb4f82466b - React-RCTLinking: af1912929e4da9443ac128f6ded8eecca7fcde90 - React-RCTNetwork: fc021eb11dabf0100f570f89588df3e27b0499b1 - React-RCTPushNotification: 15e4ffb1d0db67e906afdecc8cacfab348f451e5 - React-RCTSettings: d5486cbc262bf0b1b76ab7a0c60e78e8973f5563 - React-RCTTest: 1ade3c47acd1eef8ed042be56d6d2ba153fca552 - React-RCTText: 89c4bc63088b38b68b9008c525b507edaa9277e8 - React-RCTVibration: 13734e1938ee92a3363e7d437602e3e0cbe0b1f9 - ReactCommon: cdaca147e8b50f4c424044db5055e602f9addf07 - Yoga: 39d21425da1d0e0463995aaa8f5af56db0b39ed3 + RCTRequired: fa143a98ccd5f5c952f07364a331c75b8dc4e663 + RCTTypeSafety: 1d976d01072f9968ab3c2cafb2eb7f6ca7c48fdd + React: 73d4569aed422237bfb5ec1f471aa4d8c045b331 + React-ART: 07fa82267a87e67e0c3523a5f595e86504658d0b + React-Core: 277537483a5b0c41beae832d1c7a9794561b6529 + React-CoreModules: 4e9e1c821a7a5fafb3ffd9f9ba085b40f477da83 + React-cxxreact: 22e64325458325149e51111832d1005fcf27c0b5 + React-jsi: 9d087842253c8d0775b318caeccbdee547c89316 + React-jsiexecutor: f0043f9030ec0c79b937fd6ab8f7c4f06a7be241 + React-jsinspector: 503fb0b052442aed724f735789174754b2b72687 + React-RCTActionSheet: 82b3af83ed5043659bc39316966571e4b1b7ef4e + React-RCTAnimation: a48f680c9c5e55c27bf945d5864eb5d638da1576 + React-RCTBlob: 9c266ac30bfbfb10bb62b3f74c049febf80fc2e5 + React-RCTImage: 5889e573cea7e140a447d4cd4658c87885669d81 + React-RCTLinking: 4699cfc4eba902b7f7f1652178af4d8cc18ee971 + React-RCTNetwork: 5fea7fcf7bbe49a37dfa9fddc499dff6506297b7 + React-RCTPushNotification: aba4d4cb1f0f851b2df81b11cb3c402dd3123cf0 + React-RCTSettings: ec7ee3a25d2f16a69936335bf7ef8f9d61c70fb0 + React-RCTTest: ed828653bca00aa9f5071f554b54b4d36a254648 + React-RCTText: d22b5f61ed6db5670e6aaedc183337b6f7c73337 + React-RCTVibration: 80c7b79af833447615624f16cf1ec6bed8babccc + ReactCommon: 10f21f50611c651a89b8323520ca71eac9f7df2b + Yoga: f18826821d9110f5d57c15dadabe63ba8b75c2e2 PODFILE CHECKSUM: 1a5700c13b2bc8ffc5ed4282d795e8909c883f63 diff --git a/RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m b/RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m index dd8c882c0d2711..21b28f90f153ef 100644 --- a/RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m +++ b/RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m @@ -43,9 +43,7 @@ - (void)test##name \ RCT_TEST(LayoutExample) RCT_TEST(ARTExample) RCT_TEST(ScrollViewExample) -#if !TARGET_OS_OSX // Reason: Intermittent failure: crash deallocating NSTextStorage of a TextView: tracked by https://github.com/microsoft/react-native-macos/issues/357 RCT_TEST(TextExample) -#endif #if !TARGET_OS_TV // No switch or slider available on tvOS RCT_TEST(SwitchExample)