From cd13c99d001d25296dcf991ea3cb32929d872102 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 9 Apr 2020 10:27:12 -0700 Subject: [PATCH 001/235] Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 --- template/ios/Podfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/template/ios/Podfile b/template/ios/Podfile index d6f78d75e05171..6e1ebd6181167f 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -4,16 +4,15 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ platform :ios, '10.0' target 'HelloWorld' do - # Pods for HelloWorld - use_react_native! + config = use_native_modules! + + use_react_native!(:path => config["reactNativePath"]) target 'HelloWorldTests' do inherit! :complete # Pods for testing end - use_native_modules! - # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and From cd347a7e0ed29ae1049e041fcb34588e1aac76f9 Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Thu, 9 Apr 2020 10:55:48 -0700 Subject: [PATCH 002/235] Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d --- IntegrationTests/AsyncStorageTest.js | 5 +- .../Animated/src/NativeAnimatedHelper.js | 4 +- .../src/__tests__/AnimatedNative-test.js | 60 +++++++++++++++---- .../__tests__/MessageQueue-test.js | 16 ++++- Libraries/Blob/URL.js | 4 +- .../ActivityIndicator/ActivityIndicator.js | 5 +- .../Keyboard/KeyboardAvoidingView.js | 19 ++---- .../Picker/PickerAndroid.android.js | 5 +- Libraries/Components/Slider/Slider.js | 5 +- Libraries/Components/StatusBar/StatusBar.js | 4 +- Libraries/Interaction/TaskQueue.js | 4 +- Libraries/Lists/FlatList.js | 6 +- Libraries/Lists/VirtualizedList.js | 5 +- .../Lists/__tests__/ViewabilityHelper-test.js | 5 +- .../LogBox/Data/__tests__/LogBoxLog-test.js | 2 +- Libraries/Modal/Modal.js | 4 +- .../__flowtests__/StyleSheet-flowtest.js | 40 +++---------- .../differ/__tests__/deepDiffer-test.js | 24 ++++++-- .../polyfills/__tests__/Object.es7-test.js | 10 +++- Libraries/polyfills/console.js | 4 +- .../js/examples/XHR/XHRExampleDownload.js | 8 +-- package.json | 2 +- .../src/cli/verify_with_old_codegen.js | 4 +- .../generators/components/GeneratePropsCpp.js | 4 +- .../generators/components/GeneratePropsH.js | 8 +-- .../components/GeneratePropsJavaDelegate.js | 16 ++--- .../components/GenerateViewConfigJs.js | 4 +- .../src/generators/modules/GenerateModuleH.js | 8 +-- .../modules/GenerateModuleHObjCpp.js | 8 +-- .../modules/ObjCppUtils/GenerateStructs.js | 4 +- .../src/parsers/flow/components/index.js | 4 +- .../src/parsers/flow/components/props.js | 4 +- .../src/parsers/flow/modules/methods.js | 4 +- .../run-android-ci-instrumentation-tests.js | 4 +- yarn.lock | 8 +-- 35 files changed, 150 insertions(+), 171 deletions(-) diff --git a/IntegrationTests/AsyncStorageTest.js b/IntegrationTests/AsyncStorageTest.js index e33cedfdd82482..12d9f3d620f331 100644 --- a/IntegrationTests/AsyncStorageTest.js +++ b/IntegrationTests/AsyncStorageTest.js @@ -152,7 +152,10 @@ function testMerge() { } function testOptimizedMultiGet() { - let batch = [[KEY_1, VAL_1], [KEY_2, VAL_2]]; + let batch = [ + [KEY_1, VAL_1], + [KEY_2, VAL_2], + ]; let keys = batch.map(([key, value]) => key); AsyncStorage.multiSet(batch, err1 => { // yes, twice on purpose diff --git a/Libraries/Animated/src/NativeAnimatedHelper.js b/Libraries/Animated/src/NativeAnimatedHelper.js index f21066bb07ff65..8cc6aa25b5bd70 100644 --- a/Libraries/Animated/src/NativeAnimatedHelper.js +++ b/Libraries/Animated/src/NativeAnimatedHelper.js @@ -235,9 +235,7 @@ function validateTransform( configs.forEach(config => { if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { throw new Error( - `Property '${ - config.property - }' is not supported by native animated module`, + `Property '${config.property}' is not supported by native animated module`, ); } }); diff --git a/Libraries/Animated/src/__tests__/AnimatedNative-test.js b/Libraries/Animated/src/__tests__/AnimatedNative-test.js index 89024cdb883fe4..4a68f78f3addb6 100644 --- a/Libraries/Animated/src/__tests__/AnimatedNative-test.js +++ b/Libraries/Animated/src/__tests__/AnimatedNative-test.js @@ -357,11 +357,19 @@ describe('Native Animated', () => { expect(additionConnectionCalls.length).toBe(2); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( additionCall[1].input[0], - {type: 'value', value: 1, offset: 0}, + { + type: 'value', + value: 1, + offset: 0, + }, ); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( additionCall[1].input[1], - {type: 'value', value: 2, offset: 0}, + { + type: 'value', + value: 2, + offset: 0, + }, ); }); @@ -391,11 +399,19 @@ describe('Native Animated', () => { expect(subtractionConnectionCalls.length).toBe(2); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( subtractionCall[1].input[0], - {type: 'value', value: 2, offset: 0}, + { + type: 'value', + value: 2, + offset: 0, + }, ); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( subtractionCall[1].input[1], - {type: 'value', value: 1, offset: 0}, + { + type: 'value', + value: 1, + offset: 0, + }, ); }); @@ -425,11 +441,19 @@ describe('Native Animated', () => { expect(multiplicationConnectionCalls.length).toBe(2); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( multiplicationCall[1].input[0], - {type: 'value', value: 2, offset: 0}, + { + type: 'value', + value: 2, + offset: 0, + }, ); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( multiplicationCall[1].input[1], - {type: 'value', value: 1, offset: 0}, + { + type: 'value', + value: 1, + offset: 0, + }, ); }); @@ -459,11 +483,19 @@ describe('Native Animated', () => { expect(divisionConnectionCalls.length).toBe(2); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( divisionCall[1].input[0], - {type: 'value', value: 4, offset: 0}, + { + type: 'value', + value: 4, + offset: 0, + }, ); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( divisionCall[1].input[1], - {type: 'value', value: 2, offset: 0}, + { + type: 'value', + value: 2, + offset: 0, + }, ); }); @@ -491,7 +523,11 @@ describe('Native Animated', () => { expect(moduloConnectionCalls.length).toBe(1); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( moduloCall[1].input, - {type: 'value', value: 4, offset: 0}, + { + type: 'value', + value: 4, + offset: 0, + }, ); }); @@ -588,7 +624,11 @@ describe('Native Animated', () => { expect(diffClampConnectionCalls.length).toBe(1); expect(NativeAnimatedModule.createAnimatedNode).toBeCalledWith( diffClampCall[1].input, - {type: 'value', value: 2, offset: 0}, + { + type: 'value', + value: 2, + offset: 0, + }, ); }); diff --git a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js index 42abd597dd867e..fb720c7b9ba991 100644 --- a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js @@ -81,13 +81,25 @@ describe('MessageQueue', function() { }); it('should throw when calling the same callback twice', () => { - queue.enqueueNativeCall(0, 1, [], () => {}, () => {}); + queue.enqueueNativeCall( + 0, + 1, + [], + () => {}, + () => {}, + ); queue.__invokeCallback(1, []); expect(() => queue.__invokeCallback(1, [])).toThrow(); }); it('should throw when calling both success and failure callback', () => { - queue.enqueueNativeCall(0, 1, [], () => {}, () => {}); + queue.enqueueNativeCall( + 0, + 1, + [], + () => {}, + () => {}, + ); queue.__invokeCallback(1, []); expect(() => queue.__invokeCallback(0, [])).toThrow(); }); diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index f2b6f7f277cb7e..bf9ab01bf1a786 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -119,9 +119,7 @@ export class URL { if (BLOB_URL_PREFIX === null) { throw new Error('Cannot create URL for blob!'); } - return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${ - blob.data.offset - }&size=${blob.size}`; + return `${BLOB_URL_PREFIX}${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.size}`; } static revokeObjectURL(url: string) { diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 9d0df8f0a739e7..62bc6664305a04 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -101,10 +101,7 @@ const ActivityIndicator = (props: Props, forwardedRef?: any) => { return ( + style={StyleSheet.compose(styles.container, style)}> {Platform.OS === 'android' ? ( // $FlowFixMe Flow doesn't know when this is the android component diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 7c794ea5e8dcaf..07513e253b7041 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -170,10 +170,7 @@ class KeyboardAvoidingView extends React.Component { return ( {children} @@ -188,12 +185,9 @@ class KeyboardAvoidingView extends React.Component { onLayout={this._onLayout} {...props}> + style={StyleSheet.compose(contentContainerStyle, { + bottom: bottomHeight, + })}> {children} @@ -203,10 +197,7 @@ class KeyboardAvoidingView extends React.Component { return ( {children} diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index a47d29bd5ec6a7..3b2156c204a369 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -121,10 +121,7 @@ function PickerAndroid(props: Props): React.Node { prompt: props.prompt, ref: pickerRef, selected, - style: StyleSheet.compose( - styles.pickerAndroid, - props.style, - ), + style: StyleSheet.compose(styles.pickerAndroid, props.style), backgroundColor: props.backgroundColor, testID: props.testID, }; diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 28c7ff5a72306a..1a5d23f049b884 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -198,10 +198,7 @@ const Slider = ( props: Props, forwardedRef?: ?React.Ref, ) => { - const style = StyleSheet.compose( - styles.slider, - props.style, - ); + const style = StyleSheet.compose(styles.slider, props.style); const { disabled = false, diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 81ab87e4d3747a..482149fb7be6b0 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -467,9 +467,7 @@ class StatusBar extends React.Component { const processedColor = processColor(mergedProps.backgroundColor.value); if (processedColor == null) { console.warn( - `\`StatusBar._updatePropsStack\`: Color ${ - mergedProps.backgroundColor.value - } parsed to null or undefined`, + `\`StatusBar._updatePropsStack\`: Color ${mergedProps.backgroundColor.value} parsed to null or undefined`, ); } else { invariant( diff --git a/Libraries/Interaction/TaskQueue.js b/Libraries/Interaction/TaskQueue.js index bf15d06a090707..15eb69388dc30a 100644 --- a/Libraries/Interaction/TaskQueue.js +++ b/Libraries/Interaction/TaskQueue.js @@ -172,9 +172,7 @@ class TaskQueue { this.hasTasksToProcess() && this._onMoreTasks(); }) .catch(ex => { - ex.message = `TaskQueue: Error resolving Promise in task ${ - task.name - }: ${ex.message}`; + ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`; throw ex; }) .done(); diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index 6c268ddeba985a..d72228d33ceaa2 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -593,11 +593,7 @@ class FlatList extends React.PureComponent, void> { 'Expected array of items with numColumns > 1', ); return ( - + {item.map((it, kk) => { const element = renderer({ item: it, diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 9ec105fc32ac92..6a71f04d017065 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1117,10 +1117,7 @@ class VirtualizedList extends React.PureComponent { element.props.onLayout(event); } }, - style: StyleSheet.compose( - inversionStyle, - element.props.style, - ), + style: StyleSheet.compose(inversionStyle, element.props.style), }), ); } diff --git a/Libraries/Lists/__tests__/ViewabilityHelper-test.js b/Libraries/Lists/__tests__/ViewabilityHelper-test.js index 81ffdb731cc7f5..6240824b68c0a2 100644 --- a/Libraries/Lists/__tests__/ViewabilityHelper-test.js +++ b/Libraries/Lists/__tests__/ViewabilityHelper-test.js @@ -429,7 +429,10 @@ describe('onUpdate', function() { expect(onViewableItemsChanged.mock.calls.length).toBe(2); expect(onViewableItemsChanged.mock.calls[1][0]).toEqual({ - changed: [{isViewable: true, key: 'c'}, {isViewable: false, key: 'a'}], + changed: [ + {isViewable: true, key: 'c'}, + {isViewable: false, key: 'a'}, + ], viewabilityConfig: {viewAreaCoveragePercentThreshold: 0}, viewableItems: [{isViewable: true, key: 'c'}], }); diff --git a/Libraries/LogBox/Data/__tests__/LogBoxLog-test.js b/Libraries/LogBox/Data/__tests__/LogBoxLog-test.js index c08d16786d16d5..2ff36f2292126c 100644 --- a/Libraries/LogBox/Data/__tests__/LogBoxLog-test.js +++ b/Libraries/LogBox/Data/__tests__/LogBoxLog-test.js @@ -19,7 +19,7 @@ jest.mock('../LogBoxSymbolication', () => { }); function getLogBoxLog() { - return new (require('../LogBoxLog')).default({ + return new (require('../LogBoxLog').default)({ level: 'warn', isComponentError: false, message: {content: '...', substitutions: []}, diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 71293402c36186..ba842b1746431a 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -190,9 +190,7 @@ class Modal extends React.Component { props.transparent ) { console.warn( - `Modal with '${ - props.presentationStyle - }' presentation style and 'transparent' value is not supported.`, + `Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`, ); } } diff --git a/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js b/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js index c93c8de63cd9d8..fddb4158f69e1d 100644 --- a/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +++ b/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js @@ -18,53 +18,29 @@ const textStyle = {color: 'rgb(0, 0, 0)'}; module.exports = { testGoodCompose() { - (StyleSheet.compose( - imageStyle, - imageStyle, - ): ImageStyleProp); + (StyleSheet.compose(imageStyle, imageStyle): ImageStyleProp); - (StyleSheet.compose( - textStyle, - textStyle, - ): TextStyleProp); + (StyleSheet.compose(textStyle, textStyle): TextStyleProp); - (StyleSheet.compose( - null, - null, - ): TextStyleProp); + (StyleSheet.compose(null, null): TextStyleProp); - (StyleSheet.compose( - textStyle, - null, - ): TextStyleProp); + (StyleSheet.compose(textStyle, null): TextStyleProp); (StyleSheet.compose( textStyle, Math.random() < 0.5 ? textStyle : null, ): TextStyleProp); - (StyleSheet.compose( - [textStyle], - null, - ): TextStyleProp); + (StyleSheet.compose([textStyle], null): TextStyleProp); - (StyleSheet.compose( - [textStyle], - null, - ): TextStyleProp); + (StyleSheet.compose([textStyle], null): TextStyleProp); - (StyleSheet.compose( - [textStyle], - [textStyle], - ): TextStyleProp); + (StyleSheet.compose([textStyle], [textStyle]): TextStyleProp); }, testBadCompose() { // $FlowExpectedError - Incompatible type. - (StyleSheet.compose( - textStyle, - textStyle, - ): ImageStyleProp); + (StyleSheet.compose(textStyle, textStyle): ImageStyleProp); // $FlowExpectedError - Incompatible type. (StyleSheet.compose( diff --git a/Libraries/Utilities/differ/__tests__/deepDiffer-test.js b/Libraries/Utilities/differ/__tests__/deepDiffer-test.js index a2aca448f33f37..d1a35a20589a08 100644 --- a/Libraries/Utilities/differ/__tests__/deepDiffer-test.js +++ b/Libraries/Utilities/differ/__tests__/deepDiffer-test.js @@ -129,13 +129,23 @@ describe('deepDiffer', function() { ).toBe(false); }); it('should consider all functions equal', () => { - expect(deepDiffer(() => {}, x => x)).toBe(false); + expect( + deepDiffer( + () => {}, + x => x, + ), + ).toBe(false); const f = () => {}; expect(deepDiffer(f, f)).toBe(false); }); it('should compare functions if unsafelyIgnoreFunctions is false', () => { expect( - deepDiffer(() => {}, x => x, undefined, {unsafelyIgnoreFunctions: false}), + deepDiffer( + () => {}, + x => x, + undefined, + {unsafelyIgnoreFunctions: false}, + ), ).toBe(true); const f = () => {}; expect(deepDiffer(f, f, undefined, {unsafelyIgnoreFunctions: false})).toBe( @@ -143,9 +153,13 @@ describe('deepDiffer', function() { ); // shorthand, omitting maxDepth - expect(deepDiffer(() => {}, x => x, {unsafelyIgnoreFunctions: false})).toBe( - true, - ); + expect( + deepDiffer( + () => {}, + x => x, + {unsafelyIgnoreFunctions: false}, + ), + ).toBe(true); expect(deepDiffer(f, f, {unsafelyIgnoreFunctions: false})).toBe(false); }); it('should log when implicitly considering two different functions equal', () => { diff --git a/Libraries/polyfills/__tests__/Object.es7-test.js b/Libraries/polyfills/__tests__/Object.es7-test.js index a4aa966e646ac4..c51c32c7f9ae76 100644 --- a/Libraries/polyfills/__tests__/Object.es7-test.js +++ b/Libraries/polyfills/__tests__/Object.es7-test.js @@ -48,7 +48,10 @@ describe('Object (ES7)', () => { expect(Object.entries(foo)).toEqual([['x', 10]]); const bar = {x: 10, y: 20}; - expect(Object.entries(bar)).toEqual([['x', 10], ['y', 20]]); + expect(Object.entries(bar)).toEqual([ + ['x', 10], + ['y', 20], + ]); }); it('should work with proto-less objects', () => { @@ -73,7 +76,10 @@ describe('Object (ES7)', () => { }); it('should convert to object primitive string', () => { - expect(Object.entries('ab')).toEqual([['0', 'a'], ['1', 'b']]); + expect(Object.entries('ab')).toEqual([ + ['0', 'a'], + ['1', 'b'], + ]); }); }); diff --git a/Libraries/polyfills/console.js b/Libraries/polyfills/console.js index 585a1a3c872ce6..962e52b5e985ba 100644 --- a/Libraries/polyfills/console.js +++ b/Libraries/polyfills/console.js @@ -65,9 +65,7 @@ const inspect = (function() { function formatValue(ctx, value, recurseTimes) { ctx.formatValueCalls++; if (ctx.formatValueCalls > 200) { - return `[TOO BIG formatValueCalls ${ - ctx.formatValueCalls - } exceeded limit of 200]`; + return `[TOO BIG formatValueCalls ${ctx.formatValueCalls} exceeded limit of 200]`; } // Primitive types cannot have properties diff --git a/RNTester/js/examples/XHR/XHRExampleDownload.js b/RNTester/js/examples/XHR/XHRExampleDownload.js index 41c414c108c06f..f203a7d9a1d068 100644 --- a/RNTester/js/examples/XHR/XHRExampleDownload.js +++ b/RNTester/js/examples/XHR/XHRExampleDownload.js @@ -112,13 +112,9 @@ class XHRExampleDownload extends React.Component<{...}, Object> { return; } if (xhr.status === 200) { - let responseType = `Response is a string, ${ - xhr.response.length - } characters long.`; + let responseType = `Response is a string, ${xhr.response.length} characters long.`; if (xhr.response instanceof ArrayBuffer) { - responseType = `Response is an ArrayBuffer, ${ - xhr.response.byteLength - } bytes long.`; + responseType = `Response is an ArrayBuffer, ${xhr.response.byteLength} bytes long.`; } Alert.alert('Download complete!', responseType); } else if (xhr.status !== 0) { diff --git a/package.json b/package.json index a7c5f920f7812b..abd8835dc34f2b 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "jest-junit": "^6.3.0", "jscodeshift": "^0.7.0", "mkdirp": "^0.5.1", - "prettier": "1.17.0", + "prettier": "1.19.1", "react": "16.13.1", "react-test-renderer": "16.13.1", "shelljs": "^0.7.8", diff --git a/packages/react-native-codegen/src/cli/verify_with_old_codegen.js b/packages/react-native-codegen/src/cli/verify_with_old_codegen.js index f46f6f76fa9ea3..60192bfab7d852 100755 --- a/packages/react-native-codegen/src/cli/verify_with_old_codegen.js +++ b/packages/react-native-codegen/src/cli/verify_with_old_codegen.js @@ -45,9 +45,7 @@ if (t1.length !== t2.length) { for (let i = 0; i < t1.length; i++) { if (t1[i] !== t2[i]) { throw new Error( - `Old and new codegen does not produce similar output! ${i} ${ - t1[i] - } | ${t2[i]}`, + `Old and new codegen does not produce similar output! ${i} ${t1[i]} | ${t2[i]}`, ); } } diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js index dfa114376a7167..0cfe41fa8c66ef 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js @@ -49,9 +49,7 @@ function generatePropsString(componentName: string, component: ComponentShape) { return component.props .map(prop => { const defaultValue = convertDefaultTypeToString(componentName, prop); - return `${prop.name}(convertRawProp(rawProps, "${ - prop.name - }", sourceProps.${prop.name}, {${defaultValue}}))`; + return `${prop.name}(convertRawProp(rawProps, "${prop.name}", sourceProps.${prop.name}, {${defaultValue}}))`; }) .join(',\n' + ' '); } diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js index 557a7e4d27baa3..fd12096e297854 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js @@ -275,9 +275,7 @@ function getNativeTypeFromAnnotation( default: (typeAnnotation: empty); throw new Error( - `Received invalid typeAnnotation for ${componentName} prop ${ - prop.name - }, received ${typeAnnotation.type}`, + `Received invalid typeAnnotation for ${componentName} prop ${prop.name}, received ${typeAnnotation.type}`, ); } } @@ -727,9 +725,7 @@ function generateStruct( default: (property.typeAnnotation.type: empty); throw new Error( - `Received invalid component property type ${ - property.typeAnnotation.type - }`, + `Received invalid component property type ${property.typeAnnotation.type}`, ); } }); diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index 239bf887e3ca4b..a92f7e445f1b51 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -82,14 +82,10 @@ function getJavaValueForProp( : `"${typeAnnotation.default}"`; return `value == null ? ${defaultValueString} : (String) value`; case 'Int32TypeAnnotation': - return `value == null ? ${ - typeAnnotation.default - } : ((Double) value).intValue()`; + return `value == null ? ${typeAnnotation.default} : ((Double) value).intValue()`; case 'DoubleTypeAnnotation': if (prop.optional) { - return `value == null ? ${ - typeAnnotation.default - }f : ((Double) value).doubleValue()`; + return `value == null ? ${typeAnnotation.default}f : ((Double) value).doubleValue()`; } else { return 'value == null ? Double.NaN : ((Double) value).doubleValue()'; } @@ -97,9 +93,7 @@ function getJavaValueForProp( if (typeAnnotation.default === null) { return 'value == null ? null : ((Double) value).floatValue()'; } else if (prop.optional) { - return `value == null ? ${ - typeAnnotation.default - }f : ((Double) value).floatValue()`; + return `value == null ? ${typeAnnotation.default}f : ((Double) value).floatValue()`; } else { return 'value == null ? Float.NaN : ((Double) value).floatValue()'; } @@ -126,9 +120,7 @@ function getJavaValueForProp( case 'StringEnumTypeAnnotation': return '(String) value'; case 'Int32EnumTypeAnnotation': - return `value == null ? ${ - typeAnnotation.default - } : ((Double) value).intValue()`; + return `value == null ? ${typeAnnotation.default} : ((Double) value).intValue()`; default: (typeAnnotation: empty); throw new Error('Received invalid typeAnnotation'); diff --git a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js index 5ccb3dad12cc78..22e76aa785baad 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js +++ b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js @@ -78,9 +78,7 @@ function getReactDiffProcessValue(typeAnnotation) { return j.literal(true); default: throw new Error( - `Received unknown array native typeAnnotation: "${ - typeAnnotation.elementType.name - }"`, + `Received unknown array native typeAnnotation: "${typeAnnotation.elementType.name}"`, ); } } diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index d731fe0a3cdf89..afb1b9c2f747ad 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -110,9 +110,7 @@ module.exports = { .map(param => { const translatedParam = translatePrimitiveJSTypeToCpp( param.typeAnnotation, - `Unspopported type for param "${param.name}" in ${ - prop.name - }. Found: ${param.typeAnnotation.type}`, + `Unspopported type for param "${param.name}" in ${prop.name}. Found: ${param.typeAnnotation.type}`, ); const isObject = translatedParam.startsWith('jsi::'); return ( @@ -128,9 +126,7 @@ module.exports = { '::_RETURN_VALUE_::', translatePrimitiveJSTypeToCpp( prop.typeAnnotation.returnTypeAnnotation, - `Unspopported return type for ${prop.name}. Found: ${ - prop.typeAnnotation.returnTypeAnnotation.type - }`, + `Unspopported return type for ${prop.name}. Found: ${prop.typeAnnotation.returnTypeAnnotation.type}`, ), ) .replace( diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js index 184612663b9bbe..1018323e960c77 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js @@ -201,9 +201,7 @@ module.exports = { } else { paramObjCType = translatePrimitiveJSTypeToObjCType( param, - `Unspopported type for param "${param.name}" in ${ - prop.name - }. Found: ${param.typeAnnotation.type}`, + `Unspopported type for param "${param.name}" in ${prop.name}. Found: ${param.typeAnnotation.type}`, ); } return `${i === 0 ? '' : param.name}:(${paramObjCType})${ @@ -232,9 +230,7 @@ module.exports = { '::_RETURN_VALUE_::', translatePrimitiveJSTypeToObjCTypeForReturn( returnTypeAnnotation, - `Unspopported return type for ${prop.name}. Found: ${ - prop.typeAnnotation.returnTypeAnnotation.type - }`, + `Unspopported return type for ${prop.name}. Found: ${prop.typeAnnotation.returnTypeAnnotation.type}`, ), ) .replace('::_ARGS_::', nativeArgs); diff --git a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js index 73614202abf857..3c44ef81ec1ab5 100644 --- a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js +++ b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js @@ -66,9 +66,7 @@ function getInlineMethodSignature( case 'AnyTypeAnnotation': return `id ${property.name}() const;`; case 'ArrayTypeAnnotation': - return `facebook::react::LazyVector> ${ - property.name - }() const;`; + return `facebook::react::LazyVector> ${property.name}() const;`; case 'FunctionTypeAnnotation': default: throw new Error(`Unknown prop type, found: ${typeAnnotation.type}"`); diff --git a/packages/react-native-codegen/src/parsers/flow/components/index.js b/packages/react-native-codegen/src/parsers/flow/components/index.js index 2ae19153b94a89..eb8867401d5372 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/index.js +++ b/packages/react-native-codegen/src/parsers/flow/components/index.js @@ -127,9 +127,7 @@ function getCommandProperties(commandTypeName, types, commandOptions) { if (typeAlias.type !== 'InterfaceDeclaration') { throw new Error( - `The type argument for codegenNativeCommands must be an interface, received ${ - typeAlias.type - }`, + `The type argument for codegenNativeCommands must be an interface, received ${typeAlias.type}`, ); } diff --git a/packages/react-native-codegen/src/parsers/flow/components/props.js b/packages/react-native-codegen/src/parsers/flow/components/props.js index 404289cc8a7dc7..24e5889d4a3f56 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/props.js +++ b/packages/react-native-codegen/src/parsers/flow/components/props.js @@ -345,8 +345,8 @@ function buildPropSchema(property, types: TypeMap): ?PropTypeShape { } if ( value.type === 'NullableTypeAnnotation' && - (typeAnnotation.type === 'GenericTypeAnnotation' && - typeAnnotation.id.name === 'WithDefault') + typeAnnotation.type === 'GenericTypeAnnotation' && + typeAnnotation.id.name === 'WithDefault' ) { throw new Error( 'WithDefault<> is optional and does not need to be marked as optional. Please remove the ? annotation in front of it.', diff --git a/packages/react-native-codegen/src/parsers/flow/modules/methods.js b/packages/react-native-codegen/src/parsers/flow/modules/methods.js index 2c07b29dc7ea28..79f0b413716e4a 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/methods.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/methods.js @@ -406,9 +406,7 @@ function buildMethodSchema( const value = getValueFromTypes(property.value, types); if (value.type !== 'FunctionTypeAnnotation') { throw new Error( - `Only methods are supported as module properties. Found ${ - value.type - } in ${property.key.name}`, + `Only methods are supported as module properties. Found ${value.type} in ${property.key.name}`, ); } const params = value.params.map(param => diff --git a/scripts/run-android-ci-instrumentation-tests.js b/scripts/run-android-ci-instrumentation-tests.js index e4812b004166dc..ec9b61a4074c8b 100644 --- a/scripts/run-android-ci-instrumentation-tests.js +++ b/scripts/run-android-ci-instrumentation-tests.js @@ -56,9 +56,7 @@ testClasses.forEach(testClass => { // any faster means Circle CI crashes exec('sleep 10s'); return exec( - `./scripts/run-instrumentation-tests-via-adb-shell.sh ${ - argv.package - } ${testClass}`, + `./scripts/run-instrumentation-tests-via-adb-shell.sh ${argv.package} ${testClass}`, ).code; }, numberOfRetries) ) { diff --git a/yarn.lock b/yarn.lock index 9dc1fd5552f9ba..14c20dd0311dd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6202,10 +6202,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@1.17.0: - version "1.17.0" - resolved "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" - integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== +prettier@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-format@^24.0.0: version "24.0.0" From ccb7dbe895a4d98e25be181db666578bfeba745b Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Thu, 9 Apr 2020 12:24:14 -0700 Subject: [PATCH 003/235] Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 --- React/CoreModules/BUCK | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/CoreModules/BUCK b/React/CoreModules/BUCK index 2410d229f665ba..6f3cc25677e544 100644 --- a/React/CoreModules/BUCK +++ b/React/CoreModules/BUCK @@ -1,4 +1,4 @@ -load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "OBJC_ARC_PREPROCESSOR_FLAGS", "get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED", "get_preprocessor_flags_for_build_mode") +load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "OBJC_ARC_PREPROCESSOR_FLAGS", "get_preprocessor_flags_for_build_mode") load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_apple_library", "rn_extra_build_flags") load( "@fbsource//xplat/configurations/buck/apple/plugins/sad_xplat_hosted_configurations:react_module_registration.bzl", @@ -19,6 +19,7 @@ rn_apple_library( "-Wno-unknown-warning-option", ], contacts = ["oncall+react_native@xmail.facebook.com"], + enable_exceptions = True, exported_linker_flags = [ "-weak_framework", "UserNotifications", @@ -33,7 +34,6 @@ rn_apple_library( ], header_path_prefix = "React", labels = ["supermodule:ios/default/public.react_native.infra"], - lang_compiler_flags = get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED(), link_whole = True, platform_preprocessor_flags = [( "linux", From 449dc37720b24d9d88661314424c9f982e70ec3a Mon Sep 17 00:00:00 2001 From: Radek Czemerys Date: Thu, 9 Apr 2020 13:46:13 -0700 Subject: [PATCH 004/235] Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## Changelog [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d --- ReactAndroid/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactAndroid/proguard-rules.pro b/ReactAndroid/proguard-rules.pro index 7eeef601f7189a..e13dfef7ec70ad 100644 --- a/ReactAndroid/proguard-rules.pro +++ b/ReactAndroid/proguard-rules.pro @@ -51,6 +51,9 @@ -dontwarn com.facebook.react.** -keep,includedescriptorclasses class com.facebook.react.bridge.** { *; } +# hermes +-keep class com.facebook.jni.** { *; } + # okhttp -keepattributes Signature From dff17effe54dc58dda19fcc81ebacbd8f46e9005 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 9 Apr 2020 15:30:28 -0700 Subject: [PATCH 005/235] Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 --- .../AndroidCheckBoxNativeComponent.js | 74 ------ .../Components/CheckBox/CheckBox.android.js | 228 ------------------ Libraries/Components/CheckBox/CheckBox.ios.js | 13 - .../js/examples/CheckBox/CheckBoxExample.js | 148 ------------ RNTester/js/utils/RNTesterList.android.js | 4 - index.js | 23 +- 6 files changed, 13 insertions(+), 477 deletions(-) delete mode 100644 Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js delete mode 100644 Libraries/Components/CheckBox/CheckBox.android.js delete mode 100644 Libraries/Components/CheckBox/CheckBox.ios.js delete mode 100644 RNTester/js/examples/CheckBox/CheckBoxExample.js diff --git a/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js b/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js deleted file mode 100644 index 2afb9892690d05..00000000000000 --- a/Libraries/Components/CheckBox/AndroidCheckBoxNativeComponent.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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. - * - * @flow strict-local - * @format - */ - -'use strict'; - -import * as React from 'react'; - -import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; - -const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); - -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; -import type {ViewProps} from '../View/ViewPropTypes'; -import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -import type {ProcessedColorValue} from '../../StyleSheet/processColor'; - -type CheckBoxEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - value: boolean, - |}>, ->; - -type NativeProps = $ReadOnly<{| - ...ViewProps, - - /** - * Used in case the props change removes the component. - */ - onChange?: ?(event: CheckBoxEvent) => mixed, - - /** - * Invoked with the new value when the value changes. - */ - onValueChange?: ?(value: boolean) => mixed, - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: ?string, - - on?: ?boolean, - enabled?: boolean, - tintColors: - | {| - true: ?ProcessedColorValue, - false: ?ProcessedColorValue, - |} - | typeof undefined, -|}>; - -type NativeType = HostComponent; - -interface NativeCommands { - +setNativeValue: ( - viewRef: React.ElementRef, - value: boolean, - ) => void; -} - -export const Commands: NativeCommands = codegenNativeCommands({ - supportedCommands: ['setNativeValue'], -}); - -export default (requireNativeComponent( - 'AndroidCheckBox', -): NativeType); diff --git a/Libraries/Components/CheckBox/CheckBox.android.js b/Libraries/Components/CheckBox/CheckBox.android.js deleted file mode 100644 index aed9cd9eb389c4..00000000000000 --- a/Libraries/Components/CheckBox/CheckBox.android.js +++ /dev/null @@ -1,228 +0,0 @@ -/** - * 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. - * - * @flow strict-local - * @format - */ - -'use strict'; - -const React = require('react'); -const StyleSheet = require('../../StyleSheet/StyleSheet'); -const invariant = require('invariant'); -const processColor = require('../../StyleSheet/processColor'); - -const nullthrows = require('nullthrows'); -const setAndForwardRef = require('../../Utilities/setAndForwardRef'); - -import AndroidCheckBoxNativeComponent, { - Commands as AndroidCheckBoxCommands, -} from './AndroidCheckBoxNativeComponent'; - -import type {ViewProps} from '../View/ViewPropTypes'; -import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; - -type CheckBoxEvent = SyntheticEvent< - $ReadOnly<{| - target: number, - value: boolean, - |}>, ->; - -type CommonProps = $ReadOnly<{| - ...ViewProps, - - /** - * Used in case the props change removes the component. - */ - onChange?: ?(event: CheckBoxEvent) => mixed, - - /** - * Invoked with the new value when the value changes. - */ - onValueChange?: ?(value: boolean) => mixed, - - /** - * Used to locate this view in end-to-end tests. - */ - testID?: ?string, -|}>; - -type Props = $ReadOnly<{| - ...CommonProps, - - /** - * The value of the checkbox. If true the checkbox will be turned on. - * Default value is false. - */ - value?: ?boolean, - - /** - * If true the user won't be able to toggle the checkbox. - * Default value is false. - */ - disabled?: ?boolean, - - /** - * Used to get the ref for the native checkbox - */ - forwardedRef?: ?React.Ref, - - /** - * Controls the colors the checkbox has in checked and unchecked states. - */ - tintColors?: {|true?: ?ColorValue, false?: ?ColorValue|}, -|}>; - -/** - * Renders a boolean input (Android only). - * - * This is a controlled component that requires an `onValueChange` callback that - * updates the `value` prop in order for the component to reflect user actions. - * If the `value` prop is not updated, the component will continue to render - * the supplied `value` prop instead of the expected result of any user actions. - * - * ``` - * import React from 'react'; - * import { AppRegistry, StyleSheet, Text, View, CheckBox } from 'react-native'; - * - * export default class App extends React.Component { - * constructor(props) { - * super(props); - * this.state = { - * checked: false - * } - * } - * - * toggle() { - * this.setState(({checked}) => { - * return { - * checked: !checked - * }; - * }); - * } - * - * render() { - * const {checked} = this.state; - * return ( - * - * Checked - * - * - * ); - * } - * } - * - * const styles = StyleSheet.create({ - * container: { - * flex: 1, - * flexDirection: 'row', - * alignItems: 'center', - * justifyContent: 'center', - * }, - * }); - * - * // skip this line if using Create React Native App - * AppRegistry.registerComponent('App', () => App); - * ``` - * - * @keyword checkbox - * @keyword toggle - */ -class CheckBox extends React.Component { - _nativeRef: ?React.ElementRef = null; - _setNativeRef = setAndForwardRef({ - getForwardedRef: () => this.props.forwardedRef, - setLocalRef: ref => { - this._nativeRef = ref; - }, - }); - - _onChange = (event: CheckBoxEvent) => { - const value = this.props.value ?? false; - AndroidCheckBoxCommands.setNativeValue(nullthrows(this._nativeRef), value); - // Change the props after the native props are set in case the props - // change removes the component - this.props.onChange && this.props.onChange(event); - this.props.onValueChange && - this.props.onValueChange(event.nativeEvent.value); - }; - - _getTintColors(tintColors) { - if (tintColors) { - const processedTextColorTrue = processColor(tintColors.true); - invariant( - processedTextColorTrue == null || - typeof processedTextColorTrue === 'number', - 'Unexpected color given for tintColors.true', - ); - const processedTextColorFalse = processColor(tintColors.true); - invariant( - processedTextColorFalse == null || - typeof processedTextColorFalse === 'number', - 'Unexpected color given for tintColors.false', - ); - return { - true: processedTextColorTrue, - false: processedTextColorFalse, - }; - } else { - return undefined; - } - } - - render() { - const { - disabled: _, - value: __, - tintColors, - style, - forwardedRef, - ...props - } = this.props; - const disabled = this.props.disabled ?? false; - const value = this.props.value ?? false; - - const nativeProps = { - ...props, - onStartShouldSetResponder: () => true, - onResponderTerminationRequest: () => false, - enabled: !disabled, - on: value, - tintColors: this._getTintColors(tintColors), - style: [styles.rctCheckBox, style], - }; - return ( - - ); - } -} - -const styles = StyleSheet.create({ - rctCheckBox: { - height: 32, - width: 32, - }, -}); - -type CheckBoxType = React.AbstractComponent< - Props, - React.ElementRef, ->; - -const CheckBoxWithRef = React.forwardRef< - Props, - React.ElementRef, ->(function CheckBoxWithRef(props, ref) { - return ; -}); - -module.exports = (CheckBoxWithRef: CheckBoxType); diff --git a/Libraries/Components/CheckBox/CheckBox.ios.js b/Libraries/Components/CheckBox/CheckBox.ios.js deleted file mode 100644 index d3a201fce59c21..00000000000000 --- a/Libraries/Components/CheckBox/CheckBox.ios.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * 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. - * - * @flow strict-local - * @format - */ - -'use strict'; - -module.exports = require('../UnimplementedViews/UnimplementedView'); diff --git a/RNTester/js/examples/CheckBox/CheckBoxExample.js b/RNTester/js/examples/CheckBox/CheckBoxExample.js deleted file mode 100644 index c9e795f638db07..00000000000000 --- a/RNTester/js/examples/CheckBox/CheckBoxExample.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * 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. - * - * @flow - * @format - */ - -'use strict'; - -const React = require('react'); -const {CheckBox, Text, View, StyleSheet} = require('react-native'); - -type BasicState = {| - trueCheckBoxIsOn: boolean, - falseCheckBoxIsOn: boolean, -|}; - -type BasicProps = $ReadOnly<{||}>; -class BasicCheckBoxExample extends React.Component { - state = { - trueCheckBoxIsOn: true, - falseCheckBoxIsOn: false, - }; - - render() { - return ( - - this.setState({falseCheckBoxIsOn: value})} - style={styles.checkbox} - value={this.state.falseCheckBoxIsOn} - tintColors={{false: 'red'}} - /> - this.setState({trueCheckBoxIsOn: value})} - value={this.state.trueCheckBoxIsOn} - tintColors={{true: 'green'}} - /> - - ); - } -} - -type DisabledProps = $ReadOnly<{||}>; -class DisabledCheckBoxExample extends React.Component { - render() { - return ( - - - - - ); - } -} - -type EventProps = $ReadOnly<{||}>; -type EventState = {| - eventCheckBoxIsOn: boolean, - eventCheckBoxRegressionIsOn: boolean, -|}; - -class EventCheckBoxExample extends React.Component { - state = { - eventCheckBoxIsOn: false, - eventCheckBoxRegressionIsOn: true, - }; - - render() { - return ( - - - this.setState({eventCheckBoxIsOn: value})} - style={styles.checkbox} - value={this.state.eventCheckBoxIsOn} - /> - this.setState({eventCheckBoxIsOn: value})} - style={styles.checkbox} - value={this.state.eventCheckBoxIsOn} - /> - {this.state.eventCheckBoxIsOn ? 'On' : 'Off'} - - - - this.setState({eventCheckBoxRegressionIsOn: value}) - } - style={styles.checkbox} - value={this.state.eventCheckBoxRegressionIsOn} - /> - - this.setState({eventCheckBoxRegressionIsOn: value}) - } - style={styles.checkbox} - value={this.state.eventCheckBoxRegressionIsOn} - /> - {this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'} - - - ); - } -} - -const styles = StyleSheet.create({ - container: { - flexDirection: 'row', - justifyContent: 'space-around', - }, - checkbox: { - marginBottom: 10, - }, -}); - -exports.title = ''; -exports.displayName = 'CheckBoxExample'; -exports.description = 'Native boolean input'; -exports.examples = [ - { - title: - 'CheckBoxes can be set to true or false, and the color of both states can be specified.', - render(): React.Element { - return ; - }, - }, - { - title: 'CheckBoxes can be disabled', - render(): React.Element { - return ; - }, - }, - { - title: 'Change events can be detected', - render(): React.Element { - return ; - }, - }, - { - title: 'CheckBoxes are controlled components', - render(): React.Element { - return ; - }, - }, -]; diff --git a/RNTester/js/utils/RNTesterList.android.js b/RNTester/js/utils/RNTesterList.android.js index 1de9d42a00c7b6..66962af515439d 100644 --- a/RNTester/js/utils/RNTesterList.android.js +++ b/RNTester/js/utils/RNTesterList.android.js @@ -21,10 +21,6 @@ const ComponentExamples: Array = [ key: 'ButtonExample', module: require('../examples/Button/ButtonExample'), }, - { - key: 'CheckBoxExample', - module: require('../examples/CheckBox/CheckBoxExample'), - }, { key: 'FlatListExample', module: require('../examples/FlatList/FlatListExample'), diff --git a/index.js b/index.js index c8f7ae4656f156..944964c171fb37 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,6 @@ import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo'; import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator'; import typeof Button from './Libraries/Components/Button'; -import typeof CheckBox from './Libraries/Components/CheckBox/CheckBox'; import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS'; import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid'; import typeof FlatList from './Libraries/Lists/FlatList'; @@ -121,15 +120,6 @@ module.exports = { get Button(): Button { return require('./Libraries/Components/Button'); }, - get CheckBox(): CheckBox { - warnOnce( - 'checkBox-moved', - 'CheckBox has been extracted from react-native core and will be removed in a future release. ' + - "It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " + - 'See https://github.com/react-native-community/react-native-checkbox', - ); - return require('./Libraries/Components/CheckBox/CheckBox'); - }, get DatePickerIOS(): DatePickerIOS { warnOnce( 'DatePickerIOS-merged', @@ -650,4 +640,17 @@ if (__DEV__) { ); }, }); + + // $FlowFixMe This is intentional: Flow will error when attempting to access CheckBox. + Object.defineProperty(module.exports, 'CheckBox', { + configurable: true, + get() { + invariant( + false, + 'CheckBox has been removed from React Native. ' + + "It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " + + 'See https://github.com/react-native-community/react-native-checkbox', + ); + }, + }); } From 44ec762e41029bf43530b1ff9b36ca3512c526e2 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Thu, 9 Apr 2020 15:34:49 -0700 Subject: [PATCH 006/235] fix: ripple should be applied even when borderless == false (#28526) Summary: With current master, when you render ``, there is no ripple effect at all. I think the expected behavior is to have ripple with default color and radius, just not borderless. This was how it was done (by me) in https://github.com/facebook/react-native/pull/28156/files but in the import process, the implementation was changed: https://github.com/facebook/react-native/commit/bd3868643d29e93610e19312571a9736df2cbdf8 so either this PR is a fix or you can just close it (but I'd be curious why). ## Changelog [Android] [fixed] - ripple should be applied even when borderless == false Pull Request resolved: https://github.com/facebook/react-native/pull/28526 Test Plan: `` on master ![SVID_20200404_123614_1](https://user-images.githubusercontent.com/1566403/78424971-6b315a80-7671-11ea-8be4-5fea428bc556.gif) `` in this PR ![SVID_20200404_122754_1](https://user-images.githubusercontent.com/1566403/78424986-8bf9b000-7671-11ea-9804-37cd58dbb61e.gif) Differential Revision: D20952026 Pulled By: TheSavior fbshipit-source-id: df2b95fc6f20d7e958e91805b1a928c4f85904f1 --- Libraries/Components/Pressable/Pressable.js | 1 - .../Pressable/useAndroidRippleForView.js | 13 ++--- .../js/examples/Pressable/PressableExample.js | 56 +++++++++++-------- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Libraries/Components/Pressable/Pressable.js b/Libraries/Components/Pressable/Pressable.js index 963933d13ca11b..545ecd4ec1312d 100644 --- a/Libraries/Components/Pressable/Pressable.js +++ b/Libraries/Components/Pressable/Pressable.js @@ -24,7 +24,6 @@ import type { } from '../View/ViewAccessibility'; import usePressability from '../../Pressability/usePressability'; import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; import type {LayoutEvent, PressEvent} from '../../Types/CoreEventTypes'; import View from '../View/View'; diff --git a/Libraries/Components/Pressable/useAndroidRippleForView.js b/Libraries/Components/Pressable/useAndroidRippleForView.js index 44972fb860f669..6aafbedf2c1cde 100644 --- a/Libraries/Components/Pressable/useAndroidRippleForView.js +++ b/Libraries/Components/Pressable/useAndroidRippleForView.js @@ -26,9 +26,9 @@ type NativeBackgroundProp = $ReadOnly<{| |}>; export type RippleConfig = {| - color?: ?ColorValue, - borderless?: ?boolean, - radius?: ?number, + color?: ColorValue, + borderless?: boolean, + radius?: number, |}; /** @@ -47,13 +47,12 @@ export default function useAndroidRippleForView( |}>, |}> { const {color, borderless, radius} = rippleConfig ?? {}; - const normalizedBorderless = borderless === true; return useMemo(() => { if ( Platform.OS === 'android' && Platform.Version >= 21 && - (color != null || normalizedBorderless || radius != null) + (color != null || borderless != null || radius != null) ) { const processedColor = processColor(color); invariant( @@ -67,7 +66,7 @@ export default function useAndroidRippleForView( nativeBackgroundAndroid: { type: 'RippleAndroid', color: processedColor, - borderless: normalizedBorderless, + borderless: borderless === true, rippleRadius: radius, }, }, @@ -101,5 +100,5 @@ export default function useAndroidRippleForView( }; } return null; - }, [color, normalizedBorderless, radius, viewRef]); + }, [color, borderless, radius, viewRef]); } diff --git a/RNTester/js/examples/Pressable/PressableExample.js b/RNTester/js/examples/Pressable/PressableExample.js index 1dadac6b1c4c13..e57f6320098e54 100644 --- a/RNTester/js/examples/Pressable/PressableExample.js +++ b/RNTester/js/examples/Pressable/PressableExample.js @@ -378,7 +378,7 @@ exports.examples = [ }, { title: 'Pressable with custom Ripple', - description: ("Pressable can specify ripple's radius and borderless params": string), + description: ("Pressable can specify ripple's radius, color and borderless params": string), platform: 'android', render: function(): React.Node { const nativeFeedbackButton = { @@ -386,32 +386,42 @@ exports.examples = [ margin: 10, }; return ( - - - - - radius 30 - - - + + + + + + radius 30 + + + - - - - radius 150 - - - + + + + radius 150 + + + + + + + + radius 70, with border + + + + - + - radius 70, with border + with border, default color and radius From 411c3447946c18743476e7d613358233464d6f58 Mon Sep 17 00:00:00 2001 From: Tom Underhill Date: Thu, 9 Apr 2020 18:38:08 -0700 Subject: [PATCH 007/235] Remove ColorAndroid function as it adds no value over PlatfromColor (#28577) Summary: This change removes the `ColorAndroid` API. It was added more as a validation tool than as something useful to a developer. When making the original [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) we felt it was valuable and useful to have working platform specific methods for the two platforms in core to test that the pattern worked in app code (PlatformColorExample.js in RNTester) and that the Flow validation worked, etc. Practically `PlatformColor()` is more useful to a developer on Android than `ColorAndroid()`. Now that the construct has served its purpose, this PR removes the `ColorAndroid` function and its related tests and other collateral. ## Changelog [Android] [Removed] - Remove ColorAndroid function as it adds no value over PlatfromColor Pull Request resolved: https://github.com/facebook/react-native/pull/28577 Test Plan: RNTester in both iOS and Android was tested. Jest tests, Flow checks, Lint checks all pass. Reviewed By: cpojer Differential Revision: D20952613 Pulled By: TheSavior fbshipit-source-id: 7d2cbaa2a347fffe59a1f3a26a210676008fdac0 --- .../PlatformColorValueTypes.android.js | 4 -- .../PlatformColorValueTypesAndroid.android.js | 18 --------- .../PlatformColorValueTypesAndroid.js | 17 --------- .../PlatformColor/PlatformColorExample.js | 37 ++----------------- index.js | 5 --- .../__tests__/platform-colors-test.js | 10 ----- .../platform-colors.js | 13 +------ 7 files changed, 4 insertions(+), 100 deletions(-) delete mode 100644 Libraries/StyleSheet/PlatformColorValueTypesAndroid.android.js delete mode 100644 Libraries/StyleSheet/PlatformColorValueTypesAndroid.js diff --git a/Libraries/StyleSheet/PlatformColorValueTypes.android.js b/Libraries/StyleSheet/PlatformColorValueTypes.android.js index 1458a9b4396d54..16772d2d6832ba 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypes.android.js +++ b/Libraries/StyleSheet/PlatformColorValueTypes.android.js @@ -21,10 +21,6 @@ export const PlatformColor = (...names: Array): ColorValue => { return {resource_paths: names}; }; -export const ColorAndroidPrivate = (color: string): ColorValue => { - return {resource_paths: [color]}; -}; - export const normalizeColorObject = ( color: NativeColorValue, ): ?ProcessedColorValue => { diff --git a/Libraries/StyleSheet/PlatformColorValueTypesAndroid.android.js b/Libraries/StyleSheet/PlatformColorValueTypesAndroid.android.js deleted file mode 100644 index 58f551098fb5db..00000000000000 --- a/Libraries/StyleSheet/PlatformColorValueTypesAndroid.android.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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 - */ - -'use strict'; - -import type {ColorValue} from './StyleSheetTypes'; -import {ColorAndroidPrivate} from './PlatformColorValueTypes'; - -export const ColorAndroid = (color: string): ColorValue => { - return ColorAndroidPrivate(color); -}; diff --git a/Libraries/StyleSheet/PlatformColorValueTypesAndroid.js b/Libraries/StyleSheet/PlatformColorValueTypesAndroid.js deleted file mode 100644 index 647000b3b1e9d0..00000000000000 --- a/Libraries/StyleSheet/PlatformColorValueTypesAndroid.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * 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 - */ - -'use strict'; - -import type {ColorValue} from './StyleSheetTypes'; - -export const ColorAndroid = (color: string): ColorValue => { - throw new Error('ColorAndroid is not available on this platform.'); -}; diff --git a/RNTester/js/examples/PlatformColor/PlatformColorExample.js b/RNTester/js/examples/PlatformColor/PlatformColorExample.js index 8417ff6d2d8062..d0b04e21930087 100644 --- a/RNTester/js/examples/PlatformColor/PlatformColorExample.js +++ b/RNTester/js/examples/PlatformColor/PlatformColorExample.js @@ -13,14 +13,7 @@ const React = require('react'); const ReactNative = require('react-native'); import Platform from '../../../../Libraries/Utilities/Platform'; -const { - ColorAndroid, - DynamicColorIOS, - PlatformColor, - StyleSheet, - Text, - View, -} = ReactNative; +const {DynamicColorIOS, PlatformColor, StyleSheet, Text, View} = ReactNative; function PlatformColorsExample() { function createTable() { @@ -263,24 +256,6 @@ function DynamicColorsExample() { ); } -function AndroidColorsExample() { - return Platform.OS === 'android' ? ( - - - ColorAndroid('?attr/colorAccent') - - - - ) : ( - Not applicable on this platform - ); -} - function VariantColorsExample() { return ( @@ -288,7 +263,7 @@ function VariantColorsExample() { {Platform.OS === 'ios' ? "DynamicColorIOS({light: 'red', dark: 'blue'})" - : "ColorAndroid('?attr/colorAccent')"} + : "PlatformColor('?attr/colorAccent')"} @@ -340,12 +315,6 @@ exports.examples = [ return ; }, }, - { - title: 'Android Colors', - render(): React.Element { - return ; - }, - }, { title: 'Variant Colors', render(): React.Element { diff --git a/index.js b/index.js index 944964c171fb37..1290bb728b5cdb 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,6 @@ 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 {ColorAndroid} from './Libraries/StyleSheet/PlatformColorValueTypesAndroid'; import typeof RootTagContext from './Libraries/ReactNative/RootTagContext'; import typeof DeprecatedColorPropType from './Libraries/DeprecatedPropTypes/DeprecatedColorPropType'; import typeof DeprecatedEdgeInsetsPropType from './Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'; @@ -463,10 +462,6 @@ module.exports = { return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS') .DynamicColorIOS; }, - get ColorAndroid(): ColorAndroid { - return require('./Libraries/StyleSheet/PlatformColorValueTypesAndroid') - .ColorAndroid; - }, get requireNativeComponent(): ( uiViewClassName: string, ) => HostComponent { diff --git a/packages/eslint-plugin-react-native-community/__tests__/platform-colors-test.js b/packages/eslint-plugin-react-native-community/__tests__/platform-colors-test.js index 9d1168272ecdc6..75343c25864993 100644 --- a/packages/eslint-plugin-react-native-community/__tests__/platform-colors-test.js +++ b/packages/eslint-plugin-react-native-community/__tests__/platform-colors-test.js @@ -22,7 +22,6 @@ eslintTester.run('../platform-colors', rule, { "const color = PlatformColor('controlAccentColor', 'controlColor');", "const color = DynamicColorIOS({light: 'black', dark: 'white'});", "const color = DynamicColorIOS({light: PlatformColor('black'), dark: PlatformColor('white')});", - "const color = ColorAndroid('?attr/colorAccent')", ], invalid: [ { @@ -49,14 +48,5 @@ eslintTester.run('../platform-colors', rule, { "const white = 'white'; const color = DynamicColorIOS({light: 'black', dark: white});", errors: [{message: rule.meta.messages.dynamicColorIOSDark}], }, - { - code: 'const color = ColorAndroid();', - errors: [{message: rule.meta.messages.colorAndroidArg}], - }, - { - code: - "const colorAccent = '?attr/colorAccent'; const color = ColorAndroid(colorAccent);", - errors: [{message: rule.meta.messages.colorAndroidArg}], - }, ], }); diff --git a/packages/eslint-plugin-react-native-community/platform-colors.js b/packages/eslint-plugin-react-native-community/platform-colors.js index 4d20496f8772d8..d2d720527e64a6 100644 --- a/packages/eslint-plugin-react-native-community/platform-colors.js +++ b/packages/eslint-plugin-react-native-community/platform-colors.js @@ -12,7 +12,7 @@ module.exports = { type: 'problem', docs: { description: - 'Ensure that PlatformColor(), DynamicColorIOS(), and ColorAndroid() are passed literals of the expected shape.', + 'Ensure that PlatformColor() and DynamicColorIOS() are passed literals of the expected shape.', }, messages: { platformColorArgsLength: @@ -25,8 +25,6 @@ module.exports = { 'DynamicColorIOS() light value must be either a literal or a PlatformColor() call.', dynamicColorIOSDark: 'DynamicColorIOS() dark value must be either a literal or a PlatformColor() call.', - colorAndroidArg: - 'ColorAndroid() must take a single argument that is a literal.', }, schema: [], }, @@ -103,15 +101,6 @@ module.exports = { }); return; } - } else if (node.callee.name === 'ColorAndroid') { - const args = node.arguments; - if (!(args.length === 1 && args[0].type === 'Literal')) { - context.report({ - node, - messageId: 'colorAndroidArg', - }); - return; - } } }, }; From d4d6dff6ec2e1b358e8c516ce1d854ae988b7572 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 10 Apr 2020 01:20:22 -0700 Subject: [PATCH 008/235] iOS: mark some old NativeModule targets with depslint_never_remove Summary: Label some BUCK targets properly. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20960917 fbshipit-source-id: 42fa2266105b6c3dd5108a1b56035a19a95cd61f --- React/CoreModules/BUCK | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/React/CoreModules/BUCK b/React/CoreModules/BUCK index 6f3cc25677e544..155d6378fa3c09 100644 --- a/React/CoreModules/BUCK +++ b/React/CoreModules/BUCK @@ -33,7 +33,10 @@ rn_apple_library( "UIKit", ], header_path_prefix = "React", - labels = ["supermodule:ios/default/public.react_native.infra"], + labels = [ + "depslint_never_remove", # Some old NativeModule still relies on +load unfortunately. + "supermodule:ios/default/public.react_native.infra", + ], link_whole = True, platform_preprocessor_flags = [( "linux", From 8988a073b48df0f0cd4a7126edf1a421f4537d58 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 10 Apr 2020 11:02:42 -0700 Subject: [PATCH 009/235] Update Gradle Wrapper to 6.3 (#28173) Summary: ``` Welcome to Gradle 6.3! Here are the highlights of this release: - Java 14 support - Improved error messages for unexpected failures For more details see https://docs.gradle.org/6.3/release-notes.html ``` ## Changelog [Android] [Changed] - Update Gradle Wrapper to 6.3 Pull Request resolved: https://github.com/facebook/react-native/pull/28173 Test Plan: Build project Differential Revision: D20958894 Pulled By: mdvacca fbshipit-source-id: a02ab0eb6aff97148c12b844fdd1f9f2617ae53f --- gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 58694 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 206 +++++++++--------- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 58694 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- template/android/gradlew.bat | 206 +++++++++--------- 6 files changed, 208 insertions(+), 208 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2faf2fc91d853cd5d4242b5547257070..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 GIT binary patch delta 6577 zcmYkAbyQT*w}4>)kxq%Bq>+@Al)yql!t+#+E>53IV^;nKUp^h z4s3gkgN%3})P~|EIG7tA>p3fA-P09~3?!BA;4bImM)6XMVtxPCsNO*R8`BM+7JTT( z%DMK_X0u;^`W#m#Ec6g#cs0%#ER_VbZbDE;Xfo6SxH#Jk{G(@Ad9*Ni==)yN&+Rs+ z!c5TRmq9CHM7*0Q{Uj9E>5GhmX#~DLb;+ll z-!FDVFymGnKRbAxQ0Rzpxzf2^IIJZ1>a*fh3^K^l2iUjT$-gD*2u?zG!9_ig1Ulvk zVy#gFy&uq-r`L2o`taG$t$-ROOh@WB(V7|PSzLEhBel)=tr_h5q~-=lfBiIaG-@wk zBq3>qaP`ZEdoQnNbun7EP_R74YiH^8;&y3c`JXY2C}9eWD~SoPu(5u~BT-ou705&# z(j53;{6KX%ts|QD8 zmei!%J?bD0pGB6rrzF3Ql4*rgVKrN33Y||4vWuVRKs>deCPbA_CvjUl;RXEOrT4(m zxINRPIa9#uO~1D1Q#bsM9eukHf}6O{pGw;+ppWNgFcO`3yrOJ5y(f`P;lLa*;FbRM zB@6#w0+(7p)M&JU*^0=M55Aoo4{;;*yUD~nK0+Oa6Wk=2f3o#?BO2E}-q{g_3H_wg z0;-~+W22xve~yBJB8{@|3ve$aMM2@_LP2>6s|At4rllw#)_$CkVXs~Am0ogKD*|j_ zgiI6wW=_0?pQ`6cF%!hwoxE7)ja4t2s;W$!XAP>%4?b0uF*&iXt(lmnIlq5b)v-z5 z@o_CEs960G(Va2M1b+Ve&u{3Tt&W=wujzA1L{0!A;<4?7f{1J9D<+5sp{o0Gl5$Qh zvBaG^vwV&eGKy$?nc}Imhos%j6{jeAIh|0KF*kvI?($YQ(>(!ky77|cTSHMssfR~G z$!TD|WuAv}uxh9`c^b%!wg_oPRMgR?<4-nbn$pQN=jV~oM~!_>Yym71wP48|FE*y1 z96R%lnZ`e5kFBux^GVnme^+#ojZ%|>Xp;`YTt;t&7%2RdyYrDTqAOysp!;^Q-zL2m z{<3O67MM#{q;G@|kDYT#DpCIJl3H#GxYt0ge(`7+S_gDW^oSMNIwm;Zn$I<&Bf(q6 zXRfi^Ts7qA$iN`Y1fg>%(2}%hvhO1!6{>4Wyb#F1d4sm-*u{B+XkX)35({w=e9p@w z!Pg7I))TN#nc`rdU`tKl&M>kWI4ayM{EB@QRb%u*hp0?(Z|kK`q<%-Mn|Rk$Kry&x z=mbY6CaVbil`u$ZZ(N{TTq$+NqK_^ai;mb{lDg>40G|0=XRo2tJyC3p-5k}f^7?0m z!}f`0iJ$zgCO+DX83Hi1e4nescg=5HJKW77vKP%&cungqf-bJ@?y8f`cxo82Am4tdK5irHk!Zy(hjoC+G|8`B*GSSqK!XpB3>XX;C&&ThUp z(T{Z|%<&VjZseczWppu0qfOIq$Lpwg#xP`3*axm&594YRNEg^VdLLbql&Crh zxk@ZEo?micfn~+C=G#?x?rA~#u&fZ4B$0|oO=>5vz&Kr7CNNmEd3)%nX`0iU3>HC! zT?bwEC1;a$T-+#3;`a*P5!UkiVw=dO4u;bWwdE8VOW8ZCEPG&c8+TG;hC!Qi?L4?I zpC)lC*?uKaF3_iZ?^3Bi#f72TX`BY)$Sz@TFjGb|Zko819O%|kphiM-?J-}y*4>24 z1Z`uQG#^U(&XK9hTXJ7k*3IpxwO28-Dcqg~T2-zRcbnj>tQ;LXWH2x&vxfUL{jOGO z3G7epiCpEHPXb!vwOG}1y?}zf&~r@rl2pr0FJBLQe`Zx7xHwB+JF#v)zK?|P1iX%qe47=-$dP5eQmJLn)-7P*Q!|X_fg;{OP$8M}6aFDyBn9pp zAG@AQAIDED;?BF7i8eLnRcFHyi)s-y#2l}t%q{o~>R{|~BTF`M^WV@5Cp9RwF;YB6 z<;I-(^`&Co1awRat-Ba9hLnXWmjQi;b*q2AmBvwGJ*HLuGRtUGBr-<{d2^Hu9VCZ` zEmOQhVN;&3KEb$l;r&K7A0?lp9EmdU&B;|uK(khuYyBj6%w^jdc&x#vzIGg$3?Hm8 z@&DKtMcG{Syi=P=@)YSR&oIsVgN%b7)F$*IQZ&0Za*om#%Wi<02tTVqyF>I4B3MWt z$6TfNCMHLfuNPIvoPmrVvin(*Mh=UE#s_GL15-#6WAt#bomte?X~%J9PErp?aWm_n z6lC5s;l4)APgN^F#?aa2m|4Q`;UwvKYujR)bBgi{_!r2nF?gepca~A@k$Q-lOW9J@ zT}hH0!rO#xTxp@eRMm^NN=@IJWL+;(YROkv8}+tG!s*uW>Q8j@ z8yI`^Q1vgVB+2|UR@B92xet~aB{n8TyP3Tk_Fj3<8o;FK;@Z5{Gg>9^7N=Q;5{>05 z?gpL*2unrhmi!!Ns>5h4>9`#B4c;3@=pp;6=&OFGw$~@ z9Y6gX{2KFq*mUYB(M5GKeOJH@BzLxEN4wMMkP& zbZd=x`^V5OBR^aQz-jX^ef%>lW|0AxwHk&qir#mGAB{?bfHO#7H$G0T!6G}XdKt;y zZc@qt${l)haQ|wn=A!ggAy$%+4%53k(rxLsA&}pBq(uty$Hw|v1n#zDnlDow{`uwy zo?r@Fpm%qyWPIK<%_NqMdvJB27(^PubDrk?z-L){A^m{u86QAdaAxT90ECz$WCJ6n zw!gWlc$H2?+$z9N3dl3KMKwpMrnp}8;Y7i3`i`;qDdSj=Ub7ple;(*p=p?WsYhDg3 zYJl$CU0Oh>nn`x>?apggqu-0Hky~UJADVt4^=tRgQoMReTK!sFe)PN4;2&SS8W zGIaS8t1|V~wXlXvDc)Mdp3H+2z795??E|9^aaGeDdpnrjbPKoZ zuU~yQPN-*{EAb2vp4|}=+_3IxJNAm&8$2TmUQdCrI9x(IVpJ#HD?mg2%|wT(3@N?2Ch8K}NQP5-Veg)fb^46sXoW4y10LgLp>&pXJ6ZL0<68iSn68NFv#Q3fB)8gl>sZdbrt485)IyFEm9l=S*!Je&xWea7c*N9-;LD*Kr#-&UeRz zad>a;uZ=i4>lcMsZqbIIAu%E&t==)^#MxS(qUoWse#ukF6Z2v}ZSol;W&?|Jr131@ zMtl}@2kRk*DR%yZp#*&iupcJ%T`0^|^K< z3I^_?k9s2xUww#5&!)YD!Xecc4M}3rLqF0RvBrK9mpgStQ75;3?p1?R{i5ae?x(@3 z5aql@kOL)4FD`Z|xDw4M6bDPsa74e3@PO{?r)o|sL?4qN&>h;+w+pw+_f&AmIOMCW z@=p^Y>P7fDdt;J3Mv-(w{BI4b$NXWSAyevLFOMWsjUVo7OZLqE z*?ZdqiHo?-m%L}ZecB>T-1DR@5FI@@O3@KF$SI*Tt9QdyUJLLc^IGYcH7z-=n=C^p ziVaaw>_ zz6kp8%4Iy$Moa{Inys8lHMdLni*TK<>prSjVxnv`)1mFAkVe%5eiLIEY@WiQW7uRx z|K4S?+sOIa%WP2e>H_`-Lb-}_=>Kh$mu&oQmFwso2^JN-mA9J={gMk+Di>`!(|3!) z#Hd2HS|Q*;#&Hk_KQ*)Q$JCjusbivMi)FM^U3`4J*@J>(5cp4s;WO4 zaZ~J1_IHyYdhi4^y=X)|W4%8+6R#sv1(#$llI=pm)70JHa2&2*qNP*1qKmySp>KK+ zwoK}Im2^ODta_af$&3@pa8qp$cFcsRs8&z8d-^)98trqt2Y6j8mSu-5vS$gh_$Msk zjY2X6Jway6GlU@yCqLpytlFhFWmsr%+bqVRDxO_}=Q1ujX^9)jwG($`l%b}CID2~z zHSh=O<6IZOtQ9u`dzNl}&&)F-JW=q+c?G-SGSPAX>!(^s4d!~ZvX>K23UOk*%q41j zOgi_lA??Qm?ENX!6AVw({2ar%w^yA})k7D!GZwOR@_%>(&GGRq#1ScYGp+T~*v+Id z)1`{flq6+H#>V0k3=BNN?(I_)op!C8`i5sUSS8om(kV+`d6U_tD>jrttEYbUzCvT~*T815Plap2EGI3m6BGFADJWSzH2gNbXK zAMevc_gV`Hwqv_d6t2nD#8mRtLj}5u1A`p|zy^L7tn)2^#cmn5ttx>AzWu|}4319d zmTCBd3DG$iJAc12RQBtaqtaDO<(lhp)saUjc}ckOF-?*CILc)CHQ3-c&R_bIx^RC(Uh>H=?Hc!Jfq*uf^5pvZ1qUEjUGFLA48xlJ@Id&^o~ zAxnaPkQJ{5`miM|3u`!5Yl>vOG3{InE)J-^?GFBYhs^S3{f%XmmMDbY929%)tXDK^ z4&0msZpvP=Oj^{;CiXzs=(d5-Tj9y&vR~?%ulrK|3M7R8AoRPFd*Jh%S=Iyda9Ke_ zrF5}XI&XAA(WM2qY$-Iw=VH7%AroF4;p~b8;9td1F#2cg%y^x}8|g+T(nMU&Zr#zB z-RYWpGePM7mRPYj^xvwV5!U1{Qb-VxZQ=%)g%P$JAS;+A)+%LtlNZ;uSA+=6xC;W1 zZ&!}Qje-aZE$+yMeC&-WJLqg}I+P*%A{y4Qaq5y97gk+F4qy~fVTW7#R8qx7{kLj@ z_Ak&Hi`GnE(YIf+nBX>YuN&8z>0+n8Y4Mw_D`*=uT-^XHMD;CpOPj0`pX1G}5>QX= zPS1iRQ#%re7!OK%X6W0M^BrF0IHK`4^^7#J+x`8GKi86ZU=OWN9Rd zbc#BaTYr?doP4Q$Tbac6h=c1Tcuy;l?Gu<2wG$iKh^=kN1p-~6nuHE#vN&}$>STjm zpd>NS?sZTc`Yti+^Jx(&e|e>jw51=3B!N5zF}}Z+dmjmLgD^?|K2t{vCP(Y5cxl45 z^#&!362V;(_~IFmEp7G&NyG+08Lf|URTC2r&e;9YS?LAO`7_Iiod$D!uB3}mMv5NZLM!7V8_tEyUwc&kFa1isI?26Eogw$4lsNRB(#c3Ssm(>CFP`< zuem=>#4!%PU48QZO*F)iwJsf#~c=|+1W5feb` z44pz7si?Qj-K8bF6sL7&%FICc1M1vBmTxRa~P2hdeYJpZ#955J&b zqeVyms=gR(%w^R?^1A&w#Ap@G%}hbE=bp6}sf~VMdpZjHb}bxykA59XXKm?+-Sd~% z;Xw}ENaem6xp{yUqkQ@z^x;+Il6-@d59N}XiYXGL6;QWzd#QUz8R&)Ql$)Ph=q4%t z2Unt^=Ru1Mji9_%K^h15uS`f6VVOTS&b2=_dU&nt%RSrsMUY+vWcC91ej!2YKzLFi z7o|5#RqpAxW)fo!>%GSC=QWq}-chx2_7Cw$HaRJ14sv$m%L#iajDtdxcqEnql!qgs1EZuI-bz*5EO zAWxzL1X}g$g^3JgM8S%;%wjN|95AK3o{Z`BBlLV(B_zdIva)EKP4Y8FOYwp;$Raw@wT4E<{pj3{hDai8KZje zcEuA-{d?JgLv!WnmKq5MyMEX52loR(6fdEA-RV<{G8H5Igxq1>w}%2S)_ju;wF_ZM z$7!A^lLCtCZdv033jL{f&eI>9ISF2x$~~6;tnOzYI*(I*?>+6ozHgn+iutW-50rn% ztIAoG0!guTBfvFW3Thg_WtLf?4+*6q61dY`qXbfO*(>@w!l|u3&BIZu84UE^j!yro z^oi)PjvWObd1M?(HjP?Hjc1s_HH?DvC)%cciIXHNQnqKY1Mg3}aOh6*=l4mzd4Txc zLVTFGo>@6$+loh+i-?qdkxJD?$#HzVN62jNChy z4YB@j$_b-hu>?T$VRfJvu%s0s0Ef{(lrq7C9j(X!@J;?lNnl2+?0`t?f7)S9^Q45Z zG6zDOr=jV;rzj)?wzFyiNCrKXu>VVcSOWr1JYl$A%&@I}YQk6lTl(}a3eog}xp;BF z2-ewA(_y0P;(%cL?=XaO+#VrrP#hBP1}@E>Nc z)4|rBGPfW9Y4aX6jC&IZkPLfLMi?Xv6E-?e2or%4;{NZwMIr3ae@SO35VpC=4w(A< zPw^v(VQ;tC0lm@xG)9oQ zxqJfxZgT&HB=QJh)Z2tGvcms=GiKqxqjKmdC2Q%Df@d50Zk!pNuo|L1uQJKl2yY)r#$r^WuYHGdz7S_A9cR|BBV!D#1L$+T24p8a>Pgr3$< MViXjGx&OBR0?kH%b^rhX delta 6547 zcmYkAbx_pNyT)OqL%K`4yFnJ0Ub0fbkcY00Ec`v8pw# zP1%=K=fTZQx1pfej+Ro3pZ{H+B$tvoY7*_j#twUpZpfOnC9Xc>mcgedjEy*!&BAw+ z!Pb8qzSx)i-geP%Y&mo93hXitf4u*5hTDllPosG z#)a_-^*6(UY8N`S7#Hmosbzg7Pl<;TElEZd0hEZc|TV zsfGsW_Cs|WF=Fk4&PWdE3~w?1)ajZRB`0|;a45l@mC9V@1@RVN@ykVBK8wj$z=wr@aDeA*lqRvbqEYcJ++2G(*rVbDu7M7;lVb@s zUpiabP+>}OT-jh)W+<}$*eWiZ!a{(GunZh*`?>0O^2Pop%YFQ-&u%m(0r8~z!-&?N zYn(_=J{6xvr3iEFhzT?{vM~CW%j8)1I6t@AfImYf>vJhH!Xrw5h_lkT}!v{y-23=jSt)Sxt`>B z(!Au<2-0p1MQWh`&bz(aR;aC0Ywui+>UmdxbpB&%mezJJ*n&xThv`}u!B~E(N6-K3 z3_8U>zN>1nxd(h1iZ4Rq7~R3ap1mtva6>is57nm3v~T=d4VC6NTP-$W3|T+EOHnOs z6tTAIq*mP>cz`uFr^&$b^x`)MujcOSgT=Yceij*Y2cU~z8-M<+1mERc*)H-}DR&(h zw?8L`cL$at6C$(3&N&zm$_4RI;qh@^|D<^Q1j)=%Hg<)&3a~S>T?6fn(Y2$jXta6S zO*-lYV;1+QIO#)S7L)%6kv;6q8ytk%rpw(R;ZohTbgfkyhu`}w@D}dQrJTkg$+${qm4m?HteM^(ho{20(c64>NjM2%I9G12_vO{<(vZQd zeYr)er=*_dY|4^hg-E$#nyQ03GpQ4-Q>6Mi+kNh?FK_xpfIl`MPV4Yy3cqmDKrpYQ zesF@i+ZSGz(@?*!1V@TSA=|@^9YkoSsgwI8i46HP#)kQLQx{t)nUusL!hR_fp_d86 zt6zUwGi1>GCU1(kw9Tn*Z*I4U?>Bm*Gn!a26D8kkO%asgWz9h?L?M`Aamwl&@P$p8 z-0z1ko0m^H#GcxW?8A@Qr~$iG<1%aA=Y(bR-G`#gEI$V!O^dX_dwmioj(5~kcZc}q z!j}a(&4VKAIw7#H5%M(h8rbr}@-_RxC5_YaHM%uX&ADKNdnWvcPF=7P{=yoTljgvk z6!VD4fE~l^=#+;87bGzasykginl9YLMr2J*O+NeCPMyo2Gra8fsqiQ`7s-BU8kRw} z=mQ^6!JW;kd*js3IK%X_n$F2?gnyPdmMz;<}hhX8vL8# zDwb%YeX5HF4~B8Zit^3_wRA8m_7pTF3j1!)mdP4XLSH2=$J-dPiqH6Dh@j@?CD;r` zR$IQ+WWpb>Xw^^DmRHcmN+#F^#-;d8?l%bvl|*4MN7OhV)mNH&72YV%wl(zBp+! zp{cou)D(g0n+xXCANKg!ER|_wPC>bx7-khT3EI#3PL)x9?_em_p`|iUe;3QW2p4Uc zv$CIRUL;gYhF`->`J<_bMn!l*UX&>W{xC7-XnRWc1|lH6m4ygrIo&mVs`>#Pb1v8>{GX-P4kK_KxSuyies;QBq1e->cP5+I;eAg9LbM^wtQ6eSW_zWF8 zI^>q<)j(@pva4?EE_PMo%gu%y`?E7d?e(WTWB>9&u`(yaalT)+pV9kcLPsL0KfV%u zc`H~JJ^Mh-J-BS0P}*69ouWEE<<9j7`A|5;d{M00Q6yV@At949h5jx_bv?(4%R{?J z_4E1c!gX?~p~<^gRf=g=E+_Vx$91C{%zJsH*EwHU74kDfi9elX)j7Vu%$osz1mq6S z+B0uR{A^U4QBOY9fAqYUmBU~EL2x~|c|3g-%f>aR(w}?1@Z7oGd`J3P^A-Ibj>6_w z{k0xhog3$NkbWcm+%+P{D8VWVW?dkh{@(R^1TWWEv_V^> zSaBI*x8WKK6-py7SIMl02$MS^6zBz{1@ z;bPeEOV*SwCmd}1zQ9Bt<1dP>ANcVrX`sqZ#Lctm56lic7SnjvsdF;>)i~)4)}6<8 zw>3kuJ6R?7lqCYM4+5leLIB{FKq@^Srr;_e9vKqp49!1e$Mo?uyV%V<^c}k0JY$e141jJkVTsm>WF? zzUm(myxyEf#<`GTnpaS5;b$-*bddR+=ipA45;OVx0Ci>}3ay2L1rZ&dWRo=voeU)U zukSaL`h57RPMmtbU6(#zA_lo?M$T~-&?rm`EIP1}2tL8<<{_<907tgqeEL3SsAI!k z2jgOUsW&{QL9N^1M$%VrXYb}SSI09g{%-q=@X+@NcaGE;Sk$ED=7Ox*;0*3Wi3^HW zfICY#b-$>~7%kFL&inoFFjq%+hvAJu*EQCjZXD-^tNyY(*JC&W!5tIGKI+i+N%gZY zSI5{_ZHY*1*6KBtgiF3f{Xo5ez5t)u!c$YO$IQpv|5==g7wqgwAyp*JJEs<+<#2Rb{s&@eV z;2pLXV}CIoejpWOF`HSeP>^@;wg--*snbwmz`h7Km33$+4sZ4=Hmpex-O zqJ1uQVCQliL8^Z2hc8r1pwrjeeG2L?3*AUK8hh7QV|M3XApI#FY-5`B0)FYsr+=TV zW?AHTHxy>#QbyO{Hb$0bq!##z*Ym!$b|RRW%<5ZHstN4rCK^^7pXU)ZD$diO;3SMm z-`5g7n|)S@A4GiKE1ec08xG$SOOPM=Ca1DfbRDca!_%7>sjyFiOWb;e>%9W&D$+?cLXYCh4ba##?-1<&69 zaH<~z9paWS)W!bcJ>&>%5zAt1xWSIIq5I>NE=@0mFzu$HKeDf>M`UydKzZyyx3FPV zeRI)5yX39+UAoH#@F)&0l$T-Q32(vjWcJ8eIYr*4HhHYu%Gzp;u^`rY^W9 z9F01NSn zDq+@Ud?UjbN4hEecEWu;zy1v)2|B(eJ@>Y7Tx@Gh>-?RsXZ|m`h$HcGdoCYKwmdKt z!(gspq5CDyr$8fzL?5HV6GmaPn2^yS@h89yg7P zv>kt>NjC;EWQ^Fk5ru=wy$FaZ-QCgW9%v=u{A~W?Tclu3=TMA6jUg>Q%z z0DZE&sp8FZymao0;o)X{%Kqin7mz{+-}O9v=eaHJm*EyfbIhlxL9)+En^Fen+s9N8 z?9Ax9wJ!8+3B12oy|Xcu{_u^c3VR%TaC=L%`u^wPqiI^v5FuzD97y?^zu;%?ANsX1Oib}xXjsN4^999+mULA4 zgAz^MtI5vp+<<&i@}JBu)`MW``uU|zgiw9nK(r^5AqHH64wH&)Qevoo`c(_9aG01@ zOK>GiZKeWSW2QnW&mnZ%&H5dtc^FZGo$L)1(otL-f>EU)oZoVaN*x-JV|xu-6Vyj&P0i{$#{T=~MwSw&I{A?F84i1gv( z)hRc=+_D2|mF=9Hi-23y=4-gvA3{SnYbVCzd5b9L(c9g?RP7|X zfs^d06B_u77gR!RA#r8+96}-`o@w!3Ua}0@QXG~eTeTy#G2yvRp$i%!$*HKZgl67s zu|>QhVci1yp>ajz$vxQsho-|ozQ!k%SwpGlrDD35d#FL5P0j9;aVK~M5V~R&*^=+L zSCzmzQciQYuf=0RCpt@)51vxm3rMU&y&##ir%NGZ&Zk(@TKmq)9z>pPm|7MW(fbxl zxZwmY; zN}{MPKvPp3B+<7pUV#b^t*{b12zyQPbh;WkjXCz}Ru>nJ#lDvm^~g+2m2&Ci#rf=W zlJ_Ne%V*;Dx(!}T2D|P6(VS$XM*iB2tVXeM6k^E?d+?5QXHqc1K{0n$%%*tB^=D>C z{Rv@&Y!C1X_)ss(h1eJ5{yqpOSSDRwxO1!itaD>RV1%dmf;F}BSF>z$+!ZNCm9>%3 zB$H}@JlE71f7KotsYWn%*}UuP-u5Lk4KCN2ahPFJs6v=g4a{r>xdoBi>Ku#l+Z>K= zwezjvKQ#3mdA(SahO=mcpI~JXIP!P>a*IrMJHz{yqYw^43@u);$e^P?Gl5N#L7VQX zb<;DDo;5P(0!j*-Ol}^`?3^Xd62%kK*S5*8(>qs@nJ8z%hMxE6519pfM|vn27qDE} zaJ>x&>A|+9=<^>R+%%8!d%3@~L?_MoFch9k8I9>)gNs0!m?%lJ@1~%hFpIc)ymh0K zd|UJS+{$Q#W+iY{stH?!&L(ymcFmPp%e!D^=o;<%1)qad$Ec-kK<%kdOG^}6NJy$G z)-+x^HXfcue(T86JkI|61%F15!*t1QUQa~Zk?9V@%;2+9n1|TEn<#9XV56}1AgZXl zEh`qo?!^}YIboKsV&BnqLav{2(1Y+83WbvGuyYYPD9q+)<7S|B zv-f*t`|zOOR4wEft=PL?k(rp6xJk;UDDyB{zVT`P3c`{8>*$4wl)kAd6io(Cm^}aF z@C!An4E3sss?9XD7k6BLFka4g)>Tcp@K(zv^>w~9bj{;Xq`%KV|84fFZ+^RDD5 z&D||R7u@IaMNW;>*F1*|X9|Zd_bnyKvu5EamB_jG`JPsUj_cXtfG9+Gjipd&=k*=@ zSAhOH1m8eW(icWXDUj9~ZfM}7GM$VC!a9aC-m z$9&}vXeQ@XN!yio)>wnSzdn=;q=i?)3mhg93pVMVBsjb;$m27x6+9D7HHXZ%-ySdS z%3-ymPnpOtY1D7si5fq6BpxnqYV$BGQ`pqmw2tS?7BLGj=p*uFAyE(xmF>T8^XMzz zw6z-2|HajrqxK4b-%h7+T@usb1> z->hmpIo^MR&k=ug(hd`I0w7tJq^B~q6snow@@qlwFrL0U_=9red9nQV!BLB*n%au_ z7SnFMfboKV`|!#-oxrN~aRU2-@%*wMv2nra9iSwbJ^W%l?!oMq_Pzy9gWK=ig7*ih zB4=|XT0P7ng?xD0PG3&1^@!%hf88|Yw;)fv9#>!EWu<)Ax(s=2e1TwHbCi+=oj+08 zYBbA9IG4oN*_Z#e$jD{DF%?^1`f9_>PM~~3ITW_pk)`WtDBgMk1&kTF^j1$1=|$tJ zjtNrAbC8($17KUyjjj)^@<#sc>1}DWs&?n>sE4Im$OpCZ^NIkktFI`#ivyY!GJ81& z3AJgh3$7e@uki@7pOuM3VcMnN-@w(jd&ay>k_L(%yKLOfHOtmDSNr6C3u$I%N$SQHW%=$FPV6i$Fz%`f zvTF|4kS7dRnJ>42(TDsLqaLY5@&Ey0u$q}4o#Y||v|WUqL1NK1mLOKneC`^BVDKV^ z+z6G7-OEnW<=4(hE4U}46Ng}{OS8|)el0=}!}g3YXD{bM1NRr-cDVaKP2}q4tH-0Q zC<%qSM}j(pfkZIce@5`Y*LfrC|DAIJGz*rXAcKFC&T0cZAY*|G#AE!=%EIu0!v#4I z0qlP)2{5=q2-q)DgFaaQLoL>H|4@+~A@1Mt>A#i#J{8zlgn^K7U~`cc7=b?pFy{#Y z&n0TqQy^hU8>HsmB*F;s{;wwP zuzw*uj2c*3KQ=Lj=5I&{G_6sCC_nz&@Ow=QG?@5LzFAj7 zy#Q*~;hNUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/template/android/gradle/wrapper/gradle-wrapper.jar b/template/android/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2faf2fc91d853cd5d4242b5547257070..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 GIT binary patch delta 6577 zcmYkAbyQT*w}4>)kxq%Bq>+@Al)yql!t+#+E>53IV^;nKUp^h z4s3gkgN%3})P~|EIG7tA>p3fA-P09~3?!BA;4bImM)6XMVtxPCsNO*R8`BM+7JTT( z%DMK_X0u;^`W#m#Ec6g#cs0%#ER_VbZbDE;Xfo6SxH#Jk{G(@Ad9*Ni==)yN&+Rs+ z!c5TRmq9CHM7*0Q{Uj9E>5GhmX#~DLb;+ll z-!FDVFymGnKRbAxQ0Rzpxzf2^IIJZ1>a*fh3^K^l2iUjT$-gD*2u?zG!9_ig1Ulvk zVy#gFy&uq-r`L2o`taG$t$-ROOh@WB(V7|PSzLEhBel)=tr_h5q~-=lfBiIaG-@wk zBq3>qaP`ZEdoQnNbun7EP_R74YiH^8;&y3c`JXY2C}9eWD~SoPu(5u~BT-ou705&# z(j53;{6KX%ts|QD8 zmei!%J?bD0pGB6rrzF3Ql4*rgVKrN33Y||4vWuVRKs>deCPbA_CvjUl;RXEOrT4(m zxINRPIa9#uO~1D1Q#bsM9eukHf}6O{pGw;+ppWNgFcO`3yrOJ5y(f`P;lLa*;FbRM zB@6#w0+(7p)M&JU*^0=M55Aoo4{;;*yUD~nK0+Oa6Wk=2f3o#?BO2E}-q{g_3H_wg z0;-~+W22xve~yBJB8{@|3ve$aMM2@_LP2>6s|At4rllw#)_$CkVXs~Am0ogKD*|j_ zgiI6wW=_0?pQ`6cF%!hwoxE7)ja4t2s;W$!XAP>%4?b0uF*&iXt(lmnIlq5b)v-z5 z@o_CEs960G(Va2M1b+Ve&u{3Tt&W=wujzA1L{0!A;<4?7f{1J9D<+5sp{o0Gl5$Qh zvBaG^vwV&eGKy$?nc}Imhos%j6{jeAIh|0KF*kvI?($YQ(>(!ky77|cTSHMssfR~G z$!TD|WuAv}uxh9`c^b%!wg_oPRMgR?<4-nbn$pQN=jV~oM~!_>Yym71wP48|FE*y1 z96R%lnZ`e5kFBux^GVnme^+#ojZ%|>Xp;`YTt;t&7%2RdyYrDTqAOysp!;^Q-zL2m z{<3O67MM#{q;G@|kDYT#DpCIJl3H#GxYt0ge(`7+S_gDW^oSMNIwm;Zn$I<&Bf(q6 zXRfi^Ts7qA$iN`Y1fg>%(2}%hvhO1!6{>4Wyb#F1d4sm-*u{B+XkX)35({w=e9p@w z!Pg7I))TN#nc`rdU`tKl&M>kWI4ayM{EB@QRb%u*hp0?(Z|kK`q<%-Mn|Rk$Kry&x z=mbY6CaVbil`u$ZZ(N{TTq$+NqK_^ai;mb{lDg>40G|0=XRo2tJyC3p-5k}f^7?0m z!}f`0iJ$zgCO+DX83Hi1e4nescg=5HJKW77vKP%&cungqf-bJ@?y8f`cxo82Am4tdK5irHk!Zy(hjoC+G|8`B*GSSqK!XpB3>XX;C&&ThUp z(T{Z|%<&VjZseczWppu0qfOIq$Lpwg#xP`3*axm&594YRNEg^VdLLbql&Crh zxk@ZEo?micfn~+C=G#?x?rA~#u&fZ4B$0|oO=>5vz&Kr7CNNmEd3)%nX`0iU3>HC! zT?bwEC1;a$T-+#3;`a*P5!UkiVw=dO4u;bWwdE8VOW8ZCEPG&c8+TG;hC!Qi?L4?I zpC)lC*?uKaF3_iZ?^3Bi#f72TX`BY)$Sz@TFjGb|Zko819O%|kphiM-?J-}y*4>24 z1Z`uQG#^U(&XK9hTXJ7k*3IpxwO28-Dcqg~T2-zRcbnj>tQ;LXWH2x&vxfUL{jOGO z3G7epiCpEHPXb!vwOG}1y?}zf&~r@rl2pr0FJBLQe`Zx7xHwB+JF#v)zK?|P1iX%qe47=-$dP5eQmJLn)-7P*Q!|X_fg;{OP$8M}6aFDyBn9pp zAG@AQAIDED;?BF7i8eLnRcFHyi)s-y#2l}t%q{o~>R{|~BTF`M^WV@5Cp9RwF;YB6 z<;I-(^`&Co1awRat-Ba9hLnXWmjQi;b*q2AmBvwGJ*HLuGRtUGBr-<{d2^Hu9VCZ` zEmOQhVN;&3KEb$l;r&K7A0?lp9EmdU&B;|uK(khuYyBj6%w^jdc&x#vzIGg$3?Hm8 z@&DKtMcG{Syi=P=@)YSR&oIsVgN%b7)F$*IQZ&0Za*om#%Wi<02tTVqyF>I4B3MWt z$6TfNCMHLfuNPIvoPmrVvin(*Mh=UE#s_GL15-#6WAt#bomte?X~%J9PErp?aWm_n z6lC5s;l4)APgN^F#?aa2m|4Q`;UwvKYujR)bBgi{_!r2nF?gepca~A@k$Q-lOW9J@ zT}hH0!rO#xTxp@eRMm^NN=@IJWL+;(YROkv8}+tG!s*uW>Q8j@ z8yI`^Q1vgVB+2|UR@B92xet~aB{n8TyP3Tk_Fj3<8o;FK;@Z5{Gg>9^7N=Q;5{>05 z?gpL*2unrhmi!!Ns>5h4>9`#B4c;3@=pp;6=&OFGw$~@ z9Y6gX{2KFq*mUYB(M5GKeOJH@BzLxEN4wMMkP& zbZd=x`^V5OBR^aQz-jX^ef%>lW|0AxwHk&qir#mGAB{?bfHO#7H$G0T!6G}XdKt;y zZc@qt${l)haQ|wn=A!ggAy$%+4%53k(rxLsA&}pBq(uty$Hw|v1n#zDnlDow{`uwy zo?r@Fpm%qyWPIK<%_NqMdvJB27(^PubDrk?z-L){A^m{u86QAdaAxT90ECz$WCJ6n zw!gWlc$H2?+$z9N3dl3KMKwpMrnp}8;Y7i3`i`;qDdSj=Ub7ple;(*p=p?WsYhDg3 zYJl$CU0Oh>nn`x>?apggqu-0Hky~UJADVt4^=tRgQoMReTK!sFe)PN4;2&SS8W zGIaS8t1|V~wXlXvDc)Mdp3H+2z795??E|9^aaGeDdpnrjbPKoZ zuU~yQPN-*{EAb2vp4|}=+_3IxJNAm&8$2TmUQdCrI9x(IVpJ#HD?mg2%|wT(3@N?2Ch8K}NQP5-Veg)fb^46sXoW4y10LgLp>&pXJ6ZL0<68iSn68NFv#Q3fB)8gl>sZdbrt485)IyFEm9l=S*!Je&xWea7c*N9-;LD*Kr#-&UeRz zad>a;uZ=i4>lcMsZqbIIAu%E&t==)^#MxS(qUoWse#ukF6Z2v}ZSol;W&?|Jr131@ zMtl}@2kRk*DR%yZp#*&iupcJ%T`0^|^K< z3I^_?k9s2xUww#5&!)YD!Xecc4M}3rLqF0RvBrK9mpgStQ75;3?p1?R{i5ae?x(@3 z5aql@kOL)4FD`Z|xDw4M6bDPsa74e3@PO{?r)o|sL?4qN&>h;+w+pw+_f&AmIOMCW z@=p^Y>P7fDdt;J3Mv-(w{BI4b$NXWSAyevLFOMWsjUVo7OZLqE z*?ZdqiHo?-m%L}ZecB>T-1DR@5FI@@O3@KF$SI*Tt9QdyUJLLc^IGYcH7z-=n=C^p ziVaaw>_ zz6kp8%4Iy$Moa{Inys8lHMdLni*TK<>prSjVxnv`)1mFAkVe%5eiLIEY@WiQW7uRx z|K4S?+sOIa%WP2e>H_`-Lb-}_=>Kh$mu&oQmFwso2^JN-mA9J={gMk+Di>`!(|3!) z#Hd2HS|Q*;#&Hk_KQ*)Q$JCjusbivMi)FM^U3`4J*@J>(5cp4s;WO4 zaZ~J1_IHyYdhi4^y=X)|W4%8+6R#sv1(#$llI=pm)70JHa2&2*qNP*1qKmySp>KK+ zwoK}Im2^ODta_af$&3@pa8qp$cFcsRs8&z8d-^)98trqt2Y6j8mSu-5vS$gh_$Msk zjY2X6Jway6GlU@yCqLpytlFhFWmsr%+bqVRDxO_}=Q1ujX^9)jwG($`l%b}CID2~z zHSh=O<6IZOtQ9u`dzNl}&&)F-JW=q+c?G-SGSPAX>!(^s4d!~ZvX>K23UOk*%q41j zOgi_lA??Qm?ENX!6AVw({2ar%w^yA})k7D!GZwOR@_%>(&GGRq#1ScYGp+T~*v+Id z)1`{flq6+H#>V0k3=BNN?(I_)op!C8`i5sUSS8om(kV+`d6U_tD>jrttEYbUzCvT~*T815Plap2EGI3m6BGFADJWSzH2gNbXK zAMevc_gV`Hwqv_d6t2nD#8mRtLj}5u1A`p|zy^L7tn)2^#cmn5ttx>AzWu|}4319d zmTCBd3DG$iJAc12RQBtaqtaDO<(lhp)saUjc}ckOF-?*CILc)CHQ3-c&R_bIx^RC(Uh>H=?Hc!Jfq*uf^5pvZ1qUEjUGFLA48xlJ@Id&^o~ zAxnaPkQJ{5`miM|3u`!5Yl>vOG3{InE)J-^?GFBYhs^S3{f%XmmMDbY929%)tXDK^ z4&0msZpvP=Oj^{;CiXzs=(d5-Tj9y&vR~?%ulrK|3M7R8AoRPFd*Jh%S=Iyda9Ke_ zrF5}XI&XAA(WM2qY$-Iw=VH7%AroF4;p~b8;9td1F#2cg%y^x}8|g+T(nMU&Zr#zB z-RYWpGePM7mRPYj^xvwV5!U1{Qb-VxZQ=%)g%P$JAS;+A)+%LtlNZ;uSA+=6xC;W1 zZ&!}Qje-aZE$+yMeC&-WJLqg}I+P*%A{y4Qaq5y97gk+F4qy~fVTW7#R8qx7{kLj@ z_Ak&Hi`GnE(YIf+nBX>YuN&8z>0+n8Y4Mw_D`*=uT-^XHMD;CpOPj0`pX1G}5>QX= zPS1iRQ#%re7!OK%X6W0M^BrF0IHK`4^^7#J+x`8GKi86ZU=OWN9Rd zbc#BaTYr?doP4Q$Tbac6h=c1Tcuy;l?Gu<2wG$iKh^=kN1p-~6nuHE#vN&}$>STjm zpd>NS?sZTc`Yti+^Jx(&e|e>jw51=3B!N5zF}}Z+dmjmLgD^?|K2t{vCP(Y5cxl45 z^#&!362V;(_~IFmEp7G&NyG+08Lf|URTC2r&e;9YS?LAO`7_Iiod$D!uB3}mMv5NZLM!7V8_tEyUwc&kFa1isI?26Eogw$4lsNRB(#c3Ssm(>CFP`< zuem=>#4!%PU48QZO*F)iwJsf#~c=|+1W5feb` z44pz7si?Qj-K8bF6sL7&%FICc1M1vBmTxRa~P2hdeYJpZ#955J&b zqeVyms=gR(%w^R?^1A&w#Ap@G%}hbE=bp6}sf~VMdpZjHb}bxykA59XXKm?+-Sd~% z;Xw}ENaem6xp{yUqkQ@z^x;+Il6-@d59N}XiYXGL6;QWzd#QUz8R&)Ql$)Ph=q4%t z2Unt^=Ru1Mji9_%K^h15uS`f6VVOTS&b2=_dU&nt%RSrsMUY+vWcC91ej!2YKzLFi z7o|5#RqpAxW)fo!>%GSC=QWq}-chx2_7Cw$HaRJ14sv$m%L#iajDtdxcqEnql!qgs1EZuI-bz*5EO zAWxzL1X}g$g^3JgM8S%;%wjN|95AK3o{Z`BBlLV(B_zdIva)EKP4Y8FOYwp;$Raw@wT4E<{pj3{hDai8KZje zcEuA-{d?JgLv!WnmKq5MyMEX52loR(6fdEA-RV<{G8H5Igxq1>w}%2S)_ju;wF_ZM z$7!A^lLCtCZdv033jL{f&eI>9ISF2x$~~6;tnOzYI*(I*?>+6ozHgn+iutW-50rn% ztIAoG0!guTBfvFW3Thg_WtLf?4+*6q61dY`qXbfO*(>@w!l|u3&BIZu84UE^j!yro z^oi)PjvWObd1M?(HjP?Hjc1s_HH?DvC)%cciIXHNQnqKY1Mg3}aOh6*=l4mzd4Txc zLVTFGo>@6$+loh+i-?qdkxJD?$#HzVN62jNChy z4YB@j$_b-hu>?T$VRfJvu%s0s0Ef{(lrq7C9j(X!@J;?lNnl2+?0`t?f7)S9^Q45Z zG6zDOr=jV;rzj)?wzFyiNCrKXu>VVcSOWr1JYl$A%&@I}YQk6lTl(}a3eog}xp;BF z2-ewA(_y0P;(%cL?=XaO+#VrrP#hBP1}@E>Nc z)4|rBGPfW9Y4aX6jC&IZkPLfLMi?Xv6E-?e2or%4;{NZwMIr3ae@SO35VpC=4w(A< zPw^v(VQ;tC0lm@xG)9oQ zxqJfxZgT&HB=QJh)Z2tGvcms=GiKqxqjKmdC2Q%Df@d50Zk!pNuo|L1uQJKl2yY)r#$r^WuYHGdz7S_A9cR|BBV!D#1L$+T24p8a>Pgr3$< MViXjGx&OBR0?kH%b^rhX delta 6547 zcmYkAbx_pNyT)OqL%K`4yFnJ0Ub0fbkcY00Ec`v8pw# zP1%=K=fTZQx1pfej+Ro3pZ{H+B$tvoY7*_j#twUpZpfOnC9Xc>mcgedjEy*!&BAw+ z!Pb8qzSx)i-geP%Y&mo93hXitf4u*5hTDllPosG z#)a_-^*6(UY8N`S7#Hmosbzg7Pl<;TElEZd0hEZc|TV zsfGsW_Cs|WF=Fk4&PWdE3~w?1)ajZRB`0|;a45l@mC9V@1@RVN@ykVBK8wj$z=wr@aDeA*lqRvbqEYcJ++2G(*rVbDu7M7;lVb@s zUpiabP+>}OT-jh)W+<}$*eWiZ!a{(GunZh*`?>0O^2Pop%YFQ-&u%m(0r8~z!-&?N zYn(_=J{6xvr3iEFhzT?{vM~CW%j8)1I6t@AfImYf>vJhH!Xrw5h_lkT}!v{y-23=jSt)Sxt`>B z(!Au<2-0p1MQWh`&bz(aR;aC0Ywui+>UmdxbpB&%mezJJ*n&xThv`}u!B~E(N6-K3 z3_8U>zN>1nxd(h1iZ4Rq7~R3ap1mtva6>is57nm3v~T=d4VC6NTP-$W3|T+EOHnOs z6tTAIq*mP>cz`uFr^&$b^x`)MujcOSgT=Yceij*Y2cU~z8-M<+1mERc*)H-}DR&(h zw?8L`cL$at6C$(3&N&zm$_4RI;qh@^|D<^Q1j)=%Hg<)&3a~S>T?6fn(Y2$jXta6S zO*-lYV;1+QIO#)S7L)%6kv;6q8ytk%rpw(R;ZohTbgfkyhu`}w@D}dQrJTkg$+${qm4m?HteM^(ho{20(c64>NjM2%I9G12_vO{<(vZQd zeYr)er=*_dY|4^hg-E$#nyQ03GpQ4-Q>6Mi+kNh?FK_xpfIl`MPV4Yy3cqmDKrpYQ zesF@i+ZSGz(@?*!1V@TSA=|@^9YkoSsgwI8i46HP#)kQLQx{t)nUusL!hR_fp_d86 zt6zUwGi1>GCU1(kw9Tn*Z*I4U?>Bm*Gn!a26D8kkO%asgWz9h?L?M`Aamwl&@P$p8 z-0z1ko0m^H#GcxW?8A@Qr~$iG<1%aA=Y(bR-G`#gEI$V!O^dX_dwmioj(5~kcZc}q z!j}a(&4VKAIw7#H5%M(h8rbr}@-_RxC5_YaHM%uX&ADKNdnWvcPF=7P{=yoTljgvk z6!VD4fE~l^=#+;87bGzasykginl9YLMr2J*O+NeCPMyo2Gra8fsqiQ`7s-BU8kRw} z=mQ^6!JW;kd*js3IK%X_n$F2?gnyPdmMz;<}hhX8vL8# zDwb%YeX5HF4~B8Zit^3_wRA8m_7pTF3j1!)mdP4XLSH2=$J-dPiqH6Dh@j@?CD;r` zR$IQ+WWpb>Xw^^DmRHcmN+#F^#-;d8?l%bvl|*4MN7OhV)mNH&72YV%wl(zBp+! zp{cou)D(g0n+xXCANKg!ER|_wPC>bx7-khT3EI#3PL)x9?_em_p`|iUe;3QW2p4Uc zv$CIRUL;gYhF`->`J<_bMn!l*UX&>W{xC7-XnRWc1|lH6m4ygrIo&mVs`>#Pb1v8>{GX-P4kK_KxSuyies;QBq1e->cP5+I;eAg9LbM^wtQ6eSW_zWF8 zI^>q<)j(@pva4?EE_PMo%gu%y`?E7d?e(WTWB>9&u`(yaalT)+pV9kcLPsL0KfV%u zc`H~JJ^Mh-J-BS0P}*69ouWEE<<9j7`A|5;d{M00Q6yV@At949h5jx_bv?(4%R{?J z_4E1c!gX?~p~<^gRf=g=E+_Vx$91C{%zJsH*EwHU74kDfi9elX)j7Vu%$osz1mq6S z+B0uR{A^U4QBOY9fAqYUmBU~EL2x~|c|3g-%f>aR(w}?1@Z7oGd`J3P^A-Ibj>6_w z{k0xhog3$NkbWcm+%+P{D8VWVW?dkh{@(R^1TWWEv_V^> zSaBI*x8WKK6-py7SIMl02$MS^6zBz{1@ z;bPeEOV*SwCmd}1zQ9Bt<1dP>ANcVrX`sqZ#Lctm56lic7SnjvsdF;>)i~)4)}6<8 zw>3kuJ6R?7lqCYM4+5leLIB{FKq@^Srr;_e9vKqp49!1e$Mo?uyV%V<^c}k0JY$e141jJkVTsm>WF? zzUm(myxyEf#<`GTnpaS5;b$-*bddR+=ipA45;OVx0Ci>}3ay2L1rZ&dWRo=voeU)U zukSaL`h57RPMmtbU6(#zA_lo?M$T~-&?rm`EIP1}2tL8<<{_<907tgqeEL3SsAI!k z2jgOUsW&{QL9N^1M$%VrXYb}SSI09g{%-q=@X+@NcaGE;Sk$ED=7Ox*;0*3Wi3^HW zfICY#b-$>~7%kFL&inoFFjq%+hvAJu*EQCjZXD-^tNyY(*JC&W!5tIGKI+i+N%gZY zSI5{_ZHY*1*6KBtgiF3f{Xo5ez5t)u!c$YO$IQpv|5==g7wqgwAyp*JJEs<+<#2Rb{s&@eV z;2pLXV}CIoejpWOF`HSeP>^@;wg--*snbwmz`h7Km33$+4sZ4=Hmpex-O zqJ1uQVCQliL8^Z2hc8r1pwrjeeG2L?3*AUK8hh7QV|M3XApI#FY-5`B0)FYsr+=TV zW?AHTHxy>#QbyO{Hb$0bq!##z*Ym!$b|RRW%<5ZHstN4rCK^^7pXU)ZD$diO;3SMm z-`5g7n|)S@A4GiKE1ec08xG$SOOPM=Ca1DfbRDca!_%7>sjyFiOWb;e>%9W&D$+?cLXYCh4ba##?-1<&69 zaH<~z9paWS)W!bcJ>&>%5zAt1xWSIIq5I>NE=@0mFzu$HKeDf>M`UydKzZyyx3FPV zeRI)5yX39+UAoH#@F)&0l$T-Q32(vjWcJ8eIYr*4HhHYu%Gzp;u^`rY^W9 z9F01NSn zDq+@Ud?UjbN4hEecEWu;zy1v)2|B(eJ@>Y7Tx@Gh>-?RsXZ|m`h$HcGdoCYKwmdKt z!(gspq5CDyr$8fzL?5HV6GmaPn2^yS@h89yg7P zv>kt>NjC;EWQ^Fk5ru=wy$FaZ-QCgW9%v=u{A~W?Tclu3=TMA6jUg>Q%z z0DZE&sp8FZymao0;o)X{%Kqin7mz{+-}O9v=eaHJm*EyfbIhlxL9)+En^Fen+s9N8 z?9Ax9wJ!8+3B12oy|Xcu{_u^c3VR%TaC=L%`u^wPqiI^v5FuzD97y?^zu;%?ANsX1Oib}xXjsN4^999+mULA4 zgAz^MtI5vp+<<&i@}JBu)`MW``uU|zgiw9nK(r^5AqHH64wH&)Qevoo`c(_9aG01@ zOK>GiZKeWSW2QnW&mnZ%&H5dtc^FZGo$L)1(otL-f>EU)oZoVaN*x-JV|xu-6Vyj&P0i{$#{T=~MwSw&I{A?F84i1gv( z)hRc=+_D2|mF=9Hi-23y=4-gvA3{SnYbVCzd5b9L(c9g?RP7|X zfs^d06B_u77gR!RA#r8+96}-`o@w!3Ua}0@QXG~eTeTy#G2yvRp$i%!$*HKZgl67s zu|>QhVci1yp>ajz$vxQsho-|ozQ!k%SwpGlrDD35d#FL5P0j9;aVK~M5V~R&*^=+L zSCzmzQciQYuf=0RCpt@)51vxm3rMU&y&##ir%NGZ&Zk(@TKmq)9z>pPm|7MW(fbxl zxZwmY; zN}{MPKvPp3B+<7pUV#b^t*{b12zyQPbh;WkjXCz}Ru>nJ#lDvm^~g+2m2&Ci#rf=W zlJ_Ne%V*;Dx(!}T2D|P6(VS$XM*iB2tVXeM6k^E?d+?5QXHqc1K{0n$%%*tB^=D>C z{Rv@&Y!C1X_)ss(h1eJ5{yqpOSSDRwxO1!itaD>RV1%dmf;F}BSF>z$+!ZNCm9>%3 zB$H}@JlE71f7KotsYWn%*}UuP-u5Lk4KCN2ahPFJs6v=g4a{r>xdoBi>Ku#l+Z>K= zwezjvKQ#3mdA(SahO=mcpI~JXIP!P>a*IrMJHz{yqYw^43@u);$e^P?Gl5N#L7VQX zb<;DDo;5P(0!j*-Ol}^`?3^Xd62%kK*S5*8(>qs@nJ8z%hMxE6519pfM|vn27qDE} zaJ>x&>A|+9=<^>R+%%8!d%3@~L?_MoFch9k8I9>)gNs0!m?%lJ@1~%hFpIc)ymh0K zd|UJS+{$Q#W+iY{stH?!&L(ymcFmPp%e!D^=o;<%1)qad$Ec-kK<%kdOG^}6NJy$G z)-+x^HXfcue(T86JkI|61%F15!*t1QUQa~Zk?9V@%;2+9n1|TEn<#9XV56}1AgZXl zEh`qo?!^}YIboKsV&BnqLav{2(1Y+83WbvGuyYYPD9q+)<7S|B zv-f*t`|zOOR4wEft=PL?k(rp6xJk;UDDyB{zVT`P3c`{8>*$4wl)kAd6io(Cm^}aF z@C!An4E3sss?9XD7k6BLFka4g)>Tcp@K(zv^>w~9bj{;Xq`%KV|84fFZ+^RDD5 z&D||R7u@IaMNW;>*F1*|X9|Zd_bnyKvu5EamB_jG`JPsUj_cXtfG9+Gjipd&=k*=@ zSAhOH1m8eW(icWXDUj9~ZfM}7GM$VC!a9aC-m z$9&}vXeQ@XN!yio)>wnSzdn=;q=i?)3mhg93pVMVBsjb;$m27x6+9D7HHXZ%-ySdS z%3-ymPnpOtY1D7si5fq6BpxnqYV$BGQ`pqmw2tS?7BLGj=p*uFAyE(xmF>T8^XMzz zw6z-2|HajrqxK4b-%h7+T@usb1> z->hmpIo^MR&k=ug(hd`I0w7tJq^B~q6snow@@qlwFrL0U_=9red9nQV!BLB*n%au_ z7SnFMfboKV`|!#-oxrN~aRU2-@%*wMv2nra9iSwbJ^W%l?!oMq_Pzy9gWK=ig7*ih zB4=|XT0P7ng?xD0PG3&1^@!%hf88|Yw;)fv9#>!EWu<)Ax(s=2e1TwHbCi+=oj+08 zYBbA9IG4oN*_Z#e$jD{DF%?^1`f9_>PM~~3ITW_pk)`WtDBgMk1&kTF^j1$1=|$tJ zjtNrAbC8($17KUyjjj)^@<#sc>1}DWs&?n>sE4Im$OpCZ^NIkktFI`#ivyY!GJ81& z3AJgh3$7e@uki@7pOuM3VcMnN-@w(jd&ay>k_L(%yKLOfHOtmDSNr6C3u$I%N$SQHW%=$FPV6i$Fz%`f zvTF|4kS7dRnJ>42(TDsLqaLY5@&Ey0u$q}4o#Y||v|WUqL1NK1mLOKneC`^BVDKV^ z+z6G7-OEnW<=4(hE4U}46Ng}{OS8|)el0=}!}g3YXD{bM1NRr-cDVaKP2}q4tH-0Q zC<%qSM}j(pfkZIce@5`Y*LfrC|DAIJGz*rXAcKFC&T0cZAY*|G#AE!=%EIu0!v#4I z0qlP)2{5=q2-q)DgFaaQLoL>H|4@+~A@1Mt>A#i#J{8zlgn^K7U~`cc7=b?pFy{#Y z&n0TqQy^hU8>HsmB*F;s{;wwP zuzw*uj2c*3KQ=Lj=5I&{G_6sCC_nz&@Ow=QG?@5LzFAj7 zy#Q*~;hNUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 46c77dc296dfab754356cd9346a01dae8d4869f4 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 10 Apr 2020 13:49:16 -0700 Subject: [PATCH 010/235] Fix crash inside RCTRedBox when trying to present same UIViewController twice Summary: Calling `-[RCTRedBox showErrorMessage]` twice causes a crash We used `-[UIViewController isBeingPresented]` to tell whether view controller is already presented. But from the documentation: > A Boolean value indicating whether the view controller is being presented. Source: https://developer.apple.com/documentation/uikit/uiviewcontroller/2097564-beingpresented?language=objc# --- So this means that if you present it, wait until presentation animation is finished and then call `-[RCTRedBox showErrorMessage]` again, following exception will be thrown. ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller .' ``` Changelog: Fix crash caused by presenting view controller twice from RCTRedBox Reviewed By: PeteTheHeat Differential Revision: D20946645 fbshipit-source-id: 763066e37db4e56efb0118b2e7867ad0724bae81 --- React/CoreModules/RCTRedBox.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/React/CoreModules/RCTRedBox.mm b/React/CoreModules/RCTRedBox.mm index 284b0ff0c87834..93ddf21a255a7d 100644 --- a/React/CoreModules/RCTRedBox.mm +++ b/React/CoreModules/RCTRedBox.mm @@ -235,10 +235,11 @@ - (void)showErrorMessage:(NSString *)message // Remove ANSI color codes from the message NSString *messageWithoutAnsi = [self stripAnsi:message]; + BOOL isRootViewControllerPresented = self.rootViewController.presentingViewController != nil; // Show if this is a new message, or if we're updating the previous message - BOOL isNew = !self.rootViewController.isBeingPresented && !isUpdate; + BOOL isNew = !isRootViewControllerPresented && !isUpdate; BOOL isUpdateForSameMessage = !isNew && - (self.rootViewController.isBeingPresented && isUpdate && + (isRootViewControllerPresented && isUpdate && ((errorCookie == -1 && [_lastErrorMessage isEqualToString:messageWithoutAnsi]) || (errorCookie == _lastErrorCookie))); if (isNew || isUpdateForSameMessage) { @@ -250,7 +251,7 @@ - (void)showErrorMessage:(NSString *)message [_stackTraceTableView reloadData]; - if (!self.rootViewController.isBeingPresented) { + if (!isRootViewControllerPresented) { [_stackTraceTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; From be7867375580ed391bb10c50b768d998087e848d Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sat, 11 Apr 2020 03:02:00 -0700 Subject: [PATCH 011/235] Animated: Early detection of division by zero in AnimatedDivision Summary: We currently see a lot of errors happens because of division by zero in `AnimatedDivision` module. We already have a check for that in the module but it happens during the animation tick where the context of execution is already lost and it's hard to find why exactly it happens. Adding an additional check to the constructor should trigger an error right inside render function which should make the error actionable. Changelog: [Internal] Early crash in AnimatedDivision in case of division by zero. Reviewed By: mdvacca Differential Revision: D20969087 fbshipit-source-id: 0d98774b79be2cc56d468a4f56d2d7c8abf58344 --- Libraries/Animated/src/nodes/AnimatedDivision.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Animated/src/nodes/AnimatedDivision.js b/Libraries/Animated/src/nodes/AnimatedDivision.js index e7b52f242b9f55..68e973fbd92d5b 100644 --- a/Libraries/Animated/src/nodes/AnimatedDivision.js +++ b/Libraries/Animated/src/nodes/AnimatedDivision.js @@ -23,6 +23,9 @@ class AnimatedDivision extends AnimatedWithChildren { constructor(a: AnimatedNode | number, b: AnimatedNode | number) { super(); + if (b === 0) { + console.error('Detected potential division by zero in AnimatedDivision'); + } this._a = typeof a === 'number' ? new AnimatedValue(a) : a; this._b = typeof b === 'number' ? new AnimatedValue(b) : b; } From d7d585f587f96b3229ef0b11462e2b773f758d80 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sat, 11 Apr 2020 12:12:58 -0700 Subject: [PATCH 012/235] Fabric: Controlling DifferentiatorMode via ReactNativeConfig Summary: Now we can control the differentiator mode via MC. Changelog: [Internal] Fabric-specific internal change. Reviewed By: fkgozali Differential Revision: D20978857 fbshipit-source-id: 13264948762f02f874d8d051c873d378062d6db4 --- React/Fabric/Mounting/RCTMountingManager.h | 2 ++ React/Fabric/Mounting/RCTMountingManager.mm | 5 ++++- React/Fabric/RCTSurfacePresenter.mm | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/React/Fabric/Mounting/RCTMountingManager.h b/React/Fabric/Mounting/RCTMountingManager.h index 0e8771b8a8b907..eb4ca669c7a9f1 100644 --- a/React/Fabric/Mounting/RCTMountingManager.h +++ b/React/Fabric/Mounting/RCTMountingManager.h @@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, weak) id delegate; @property (nonatomic, strong) RCTComponentViewRegistry *componentViewRegistry; +@property (atomic, assign) BOOL useModernDifferentiatorMode; + /** * Schedule a mounting transaction to be performed on the main thread. * Can be called from any thread. diff --git a/React/Fabric/Mounting/RCTMountingManager.mm b/React/Fabric/Mounting/RCTMountingManager.mm index 712d735b3408ac..1aa7786d8591df 100644 --- a/React/Fabric/Mounting/RCTMountingManager.mm +++ b/React/Fabric/Mounting/RCTMountingManager.mm @@ -266,7 +266,10 @@ - (void)performTransaction:(MountingCoordinator::Shared const &)mountingCoordina SystraceSection s("-[RCTMountingManager performTransaction:]"); RCTAssertMainQueue(); - auto transaction = mountingCoordinator->pullTransaction(DifferentiatorMode::Classic); + auto differentiatorMode = + self.useModernDifferentiatorMode ? DifferentiatorMode::OptimizedMoves : DifferentiatorMode::Classic; + + auto transaction = mountingCoordinator->pullTransaction(differentiatorMode); if (!transaction.has_value()) { return; } diff --git a/React/Fabric/RCTSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm index 57048acc097e93..bf110e2e8966d7 100644 --- a/React/Fabric/RCTSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -24,6 +24,7 @@ #import #import +#import #import #import #import @@ -299,6 +300,12 @@ - (RCTScheduler *)_createScheduler RCTScheduler *scheduler = [[RCTScheduler alloc] initWithToolbox:toolbox]; scheduler.delegate = self; + auto reactNativeConfig = _contextContainer->at>("ReactNativeConfig"); + if (reactNativeConfig) { + _mountingManager.useModernDifferentiatorMode = + reactNativeConfig->getBool("react_fabric:enabled_optimized_moves_differ_ios"); + } + return scheduler; } From 4305a291a9408ca65847994bbec42f1fbc97071d Mon Sep 17 00:00:00 2001 From: Will Holen Date: Mon, 13 Apr 2020 19:45:08 -0700 Subject: [PATCH 013/235] Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 --- RNTester/android/app/build.gradle | 2 +- package.json | 2 +- react.gradle | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RNTester/android/app/build.gradle b/RNTester/android/app/build.gradle index ee86770ede2e4e..0a36475ade519b 100644 --- a/RNTester/android/app/build.gradle +++ b/RNTester/android/app/build.gradle @@ -71,7 +71,7 @@ project.ext.react = [ root: "$rootDir", inputExcludes: ["android/**", "./**", ".gradle/**"], composeSourceMapsPath: "$rootDir/scripts/compose-source-maps.js", - hermesCommand: "../../../node_modules/hermes-engine/%OS-BIN%/hermes", + hermesCommand: "../../../node_modules/hermes-engine/%OS-BIN%/hermesc", enableHermesForVariant: { def v -> v.name.contains("hermes") } ] diff --git a/package.json b/package.json index abd8835dc34f2b..cd3f2d68d73b95 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "event-target-shim": "^5.0.1", "fbjs": "^1.0.0", "fbjs-scripts": "^1.1.0", - "hermes-engine": "~0.4.0", + "hermes-engine": "~0.5.0", "invariant": "^2.2.4", "jsc-android": "^245459.0.0", "metro-babel-register": "0.59.0", diff --git a/react.gradle b/react.gradle index d87182df8b58cc..e6e5afe2dc2158 100644 --- a/react.gradle +++ b/react.gradle @@ -30,7 +30,7 @@ def reactRoot = file(config.root ?: "../../") def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] def bundleConfig = config.bundleConfig ? "${reactRoot}/${config.bundleConfig}" : null ; def enableVmCleanup = config.enableVmCleanup == null ? true : config.enableVmCleanup -def hermesCommand = config.hermesCommand ?: "../../node_modules/hermes-engine/%OS-BIN%/hermes" +def hermesCommand = config.hermesCommand ?: "../../node_modules/hermes-engine/%OS-BIN%/hermesc" def reactNativeDevServerPort() { def value = project.getProperties().get("reactNativeDevServerPort") diff --git a/yarn.lock b/yarn.lock index 14c20dd0311dd2..07708118ebc80b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3837,10 +3837,10 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" -hermes-engine@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.4.0.tgz#ea3113d472871ca4791f2d75d9f68b25d82ef92c" - integrity sha512-7AO/K64GuVtcpUwUKDxyQXFN45RlqWrMIPMte6AeegMQMBh+MWuMU6ZOw8Jc7FGtsgiRqJRp+UX4+4UrFQXJ/A== +hermes-engine@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.5.0.tgz#d914acce72e9657b3c98875ad3f9094d8643f327" + integrity sha512-jSuHiOhdh2+IF3bH2gLpQ37eMkdUrEb9GK6PoG3rLRaUDK3Zn2Y9fXM+wyDfoUTA3gz9EET0/IIWk5k21qp4kw== home-or-tmp@^3.0.0: version "3.0.0" From 49c90e96fa19af0c2f1621d324244c7883a6a9ef Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Tue, 14 Apr 2020 02:04:17 -0700 Subject: [PATCH 014/235] Set width/height also to Undefined when we change the measure mode to Undefined Summary: Make sure width/height is always passed as Undefined when measure mode is changed to Undefined. Changelog: [Internal][Yoga] Set width and height as Undefined when we change measure mode to Undefined Reviewed By: alickbass Differential Revision: D20029838 fbshipit-source-id: b9931f6ddb13ffd1565889535ade5bbffbe0c304 --- ReactCommon/yoga/yoga/Yoga.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index d916a45f64814b..d6f4a114448604 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1663,8 +1663,8 @@ static void YGNodeAbsoluteLayoutChild( static void YGNodeWithMeasureFuncSetMeasuredDimensions( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + float availableWidth, + float availableHeight, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, const float ownerWidth, @@ -1677,6 +1677,13 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( node->hasMeasureFunc(), "Expected node to have custom measure function"); + if (widthMeasureMode == YGMeasureModeUndefined) { + availableWidth = YGUndefined; + } + if (heightMeasureMode == YGMeasureModeUndefined) { + availableHeight = YGUndefined; + } + const float paddingAndBorderAxisRow = YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth); const float paddingAndBorderAxisColumn = From 9c54bf419921dbaae89e49a4e2c5b5091898fd6b Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 14 Apr 2020 10:57:13 -0700 Subject: [PATCH 015/235] Remove redundant input from TextInput Summary: `const ReactNative` is assigned to but never used. Let's get rid of it. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D21016502 fbshipit-source-id: afcb0cfc501adf07e0c4d4452a831160e1cda088 --- Libraries/Components/TextInput/TextInput.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 478af12c4c4626..7fca6ef1fd6e55 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -13,7 +13,6 @@ const DeprecatedTextInputPropTypes = require('../../DeprecatedPropTypes/DeprecatedTextInputPropTypes'); const Platform = require('../../Utilities/Platform'); const React = require('react'); -const ReactNative = require('../../Renderer/shims/ReactNative'); const StyleSheet = require('../../StyleSheet/StyleSheet'); const Text = require('../../Text/Text'); const TextAncestor = require('../../Text/TextAncestor'); From e0da72ab68cf0e8477f12fce4ac8fa7b7448b613 Mon Sep 17 00:00:00 2001 From: empyrical Date: Tue, 14 Apr 2020 12:09:16 -0700 Subject: [PATCH 016/235] Update RNTester AppDelegate for changes made to SurfacePresenter API (#28580) Summary: This pull request updates RNTester's AppDelegate's Fabric mode to reflect changes made to the SurfacePresenter APIs. It now makes use of `RCTSurfacePresenterBridgeAdapter` to create its `SurfacePresenter`. ## Changelog [Internal] [Fixed] - Fixed outdated API usage in RNTester's AppDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/28580 Test Plan: `RNTester/RNTester/AppDelegate.mm` now compiles without error when `RN_FABRIC_ENABLED` is enabled. Reviewed By: hramos Differential Revision: D20966067 Pulled By: mdvacca fbshipit-source-id: 8d0168d468240cff61554f2f2df799aaf5d876c1 --- RNTester/RNTester/AppDelegate.mm | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index c8f14cad8e1efa..a6898762311470 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -30,7 +30,10 @@ #ifdef RN_FABRIC_ENABLED #import +#import #import + +#import #endif @@ -53,7 +56,9 @@ @interface AppDelegate() { #ifdef RN_FABRIC_ENABLED - RCTSurfacePresenter *_surfacePresenter; + RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; + std::shared_ptr _reactNativeConfig; + facebook::react::ContextContainer::Shared _contextContainer; #endif RCTTurboModuleManager *_turboModuleManager; @@ -77,14 +82,15 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith } #ifdef RN_FABRIC_ENABLED - _surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge - config:nil - imageLoader:RCTTurboModuleEnabled() ? - [_bridge moduleForName:@"RCTImageLoader" - lazilyLoadIfNecessary:YES] : nil - runtimeExecutor:nullptr]; - - _bridge.surfacePresenter = _surfacePresenter; + _contextContainer = std::make_shared(); + _reactNativeConfig = std::make_shared(); + + _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); + + _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:_bridge + contextContainer:_contextContainer]; + + _bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; UIView *rootView = [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps]; #else From 9bc7a07de140973f9585e90948ed4ed80e19c670 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 14 Apr 2020 14:26:01 -0700 Subject: [PATCH 017/235] Retryable ViewCommand exceptions shouldn't crash Summary: Early ViewCommand Dispatch will solve this category of crashes by going through an entirely different codepath. For users not in that experiment, it might be good to have a mitigation that prevents non-critical issues from crashing (like "blur" failing). Currently, "blur" failures cause lots of screens to crash. There's no useful signal and those crashes aren't super actionable, so seems better to swallow. If/when early viewcommand dispatch ships as the default/only mode, we can remove this try/catch entirely. The only concern I have with landing this is the perf implications of putting a try/catch inside this loop. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21023213 fbshipit-source-id: 310fe2d55a44bc424692a2365ccd5882f35f9d82 --- .../react/fabric/FabricUIManager.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index 5bc9ab4627d7b6..d63206e3f2267c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -758,7 +758,26 @@ private boolean dispatchMountItems() { FLog.d(TAG, "dispatchMountItems: Executing mountItem: " + m); } } - mountItem.execute(mMountingManager); + + // TODO: if early ViewCommand dispatch ships 100% as a feature, this can be removed. + // This try/catch catches Retryable errors that can only be thrown by ViewCommands, which + // won't be executed here in Early Dispatch mode. + try { + mountItem.execute(mMountingManager); + } catch (RetryableMountingLayerException e) { + // It's very common for commands to be executed on views that no longer exist - for + // example, a blur event on TextInput being fired because of a navigation event away + // from the current screen. If the exception is marked as Retryable, we log a soft + // exception but never crash in debug. + // It's not clear that logging this is even useful, because these events are very + // common, mundane, and there's not much we can do about them currently. + ReactSoftException.logSoftException( + TAG, + new ReactNoCrashSoftException( + "Caught exception executing retryable mounting layer instruction: " + + mountItem.toString(), + e)); + } } mBatchedExecutionTime += SystemClock.uptimeMillis() - batchedExecutionStartTime; } From b861782562080bf9c91afcac0f823d96088c2d8d Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 14 Apr 2020 15:25:04 -0700 Subject: [PATCH 018/235] Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b --- .../AndroidTextInputNativeComponent.js | 7 +----- .../RCTMultilineTextInputNativeComponent.js | 7 +----- .../RCTSingelineTextInputNativeComponent.js | 7 +----- .../TextInput/TextInputNativeCommands.js | 11 +--------- .../TextInput/RCTBaseTextInputViewManager.m | 8 ------- .../TextInput/RCTTextInputComponentView.mm | 5 ----- .../TextInput/RCTTextInputNativeCommands.h | 22 ------------------- .../textinput/ReactTextInputManager.java | 3 --- 8 files changed, 4 insertions(+), 66 deletions(-) diff --git a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js index e8598a6bfc435b..2ac53e759b825d 100644 --- a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js @@ -544,12 +544,7 @@ type NativeType = HostComponent; type NativeCommands = TextInputNativeCommands; export const Commands: NativeCommands = codegenNativeCommands({ - supportedCommands: [ - 'focus', - 'blur', - 'setMostRecentEventCount', - 'setTextAndSelection', - ], + supportedCommands: ['focus', 'blur', 'setTextAndSelection'], }); let AndroidTextInputNativeComponent; diff --git a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js index 950e5e1215c33f..a0dd8841123f6d 100644 --- a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js @@ -22,12 +22,7 @@ type NativeType = HostComponent; type NativeCommands = TextInputNativeCommands; export const Commands: NativeCommands = codegenNativeCommands({ - supportedCommands: [ - 'focus', - 'blur', - 'setMostRecentEventCount', - 'setTextAndSelection', - ], + supportedCommands: ['focus', 'blur', 'setTextAndSelection'], }); const SinglelineTextInputNativeComponent: HostComponent = requireNativeComponent( diff --git a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js index 78fcf530262f32..8a6f85756a6af6 100644 --- a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js @@ -24,12 +24,7 @@ type NativeType = HostComponent; type NativeCommands = TextInputNativeCommands; export const Commands: NativeCommands = codegenNativeCommands({ - supportedCommands: [ - 'focus', - 'blur', - 'setMostRecentEventCount', - 'setTextAndSelection', - ], + supportedCommands: ['focus', 'blur', 'setTextAndSelection'], }); let SinglelineTextInputNativeComponent; diff --git a/Libraries/Components/TextInput/TextInputNativeCommands.js b/Libraries/Components/TextInput/TextInputNativeCommands.js index d669b09f9d152b..2584b7516c804b 100644 --- a/Libraries/Components/TextInput/TextInputNativeCommands.js +++ b/Libraries/Components/TextInput/TextInputNativeCommands.js @@ -17,10 +17,6 @@ import type {Int32} from '../../Types/CodegenTypes'; export interface TextInputNativeCommands { +focus: (viewRef: React.ElementRef) => void; +blur: (viewRef: React.ElementRef) => void; - +setMostRecentEventCount: ( - viewRef: React.ElementRef, - eventCount: Int32, - ) => void; +setTextAndSelection: ( viewRef: React.ElementRef, mostRecentEventCount: Int32, @@ -30,11 +26,6 @@ export interface TextInputNativeCommands { ) => void; } -const supportedCommands = [ - 'focus', - 'blur', - 'setMostRecentEventCount', - 'setTextAndSelection', -]; +const supportedCommands = ['focus', 'blur', 'setTextAndSelection']; export default supportedCommands; diff --git a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index 695d0f6c8fe6b3..d0626ee1f4b1bd 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -117,14 +117,6 @@ - (void)setBridge:(RCTBridge *)bridge }]; } -RCT_EXPORT_METHOD(setMostRecentEventCount : (nonnull NSNumber *)viewTag eventCount:(NSInteger)eventCount) -{ - [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { - RCTBaseTextInputView *view = (RCTBaseTextInputView *)viewRegistry[viewTag]; - view.mostRecentEventCount = eventCount; - }]; -} - RCT_EXPORT_METHOD(setTextAndSelection : (nonnull NSNumber *)viewTag mostRecentEventCount : (NSInteger)mostRecentEventCount value : (NSString *)value diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 094be116826713..aa1f4a4ae6a66b 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -404,11 +404,6 @@ - (void)blur [_backedTextInputView resignFirstResponder]; } -- (void)setMostRecentEventCount:(NSInteger)eventCount -{ - _mostRecentEventCount = eventCount; -} - - (void)setTextAndSelection:(NSInteger)eventCount value:(NSString *__nullable)value start:(NSInteger)start diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h index db72f239f09435..6af78ddf7e1872 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h @@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN @protocol RCTTextInputViewProtocol - (void)focus; - (void)blur; -- (void)setMostRecentEventCount:(NSInteger)eventCount; - (void)setTextAndSelection:(NSInteger)eventCount value:(NSString *__nullable)value start:(NSInteger)start @@ -50,27 +49,6 @@ RCTTextInputHandleCommand(id componentView, NSString c return; } - if ([commandName isEqualToString:@"setMostRecentEventCount"]) { -#if RCT_DEBUG - if ([args count] != 1) { - RCTLogError( - @"%@ command %@ received %d arguments, expected %d.", @"TextInput", commandName, (int)[args count], 1); - return; - } -#endif - - NSObject *arg0 = args[0]; -#if RCT_DEBUG - if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"TextInput", commandName, @"1st")) { - return; - } -#endif - NSInteger eventCount = [(NSNumber *)arg0 intValue]; - - [componentView setMostRecentEventCount:eventCount]; - return; - } - if ([commandName isEqualToString:@"setTextAndSelection"]) { #if RCT_DEBUG if ([args count] != 4) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 74c4a2ad7db6e9..4bbbca329733de 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -230,9 +230,6 @@ public void receiveCommand( case "blurTextInput": reactEditText.clearFocusFromJS(); break; - case "setMostRecentEventCount": - // TODO: delete, this is no longer used from JS - break; case "setTextAndSelection": int mostRecentEventCount = args.getInt(0); if (mostRecentEventCount == UNSET) { From e6ed5b2bd532444960a9592a49485ddc16007f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Tue, 14 Apr 2020 15:30:56 -0700 Subject: [PATCH 019/235] label-actions: Add canned response for upgrade issues Summary: Enhance the label-actions config and support a "Type: Upgrade Issue" label. - Point to the Upgrade Support repository whenever the Type: Upgrade Issue label is applied. - Close the issue. Changelog: [Internal] label-actions: Add canned response for upgrade issues Reviewed By: cpojer Differential Revision: D20974607 fbshipit-source-id: 3cd7890aaeb1e57baf2acc5ca85a9b3ae5117c56 --- .github/label-actions.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/label-actions.yml b/.github/label-actions.yml index e0636f4c614438..8cef0647e0068c 100644 --- a/.github/label-actions.yml +++ b/.github/label-actions.yml @@ -10,6 +10,10 @@ comment: > Please report documentation issues in the [`react-native-website`](https://github.com/facebook/react-native-website/issues) repository. close: true +"Type: Upgrade Issue": + comment: > + Do you need help upgrading to a newer React Native version? Visit the [Upgrade Support repository](https://github.com/react-native-community/upgrade-support) or use the [upgrade helper](https://react-native-community.github.io/upgrade-helper/) to see the changes that need to be made to upgrade your app. + close: true "Resolution: For Stack Overflow": comment: > We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. From eaba38361f83135eb0f26479f3662727cfb334be Mon Sep 17 00:00:00 2001 From: empyrical Date: Tue, 14 Apr 2020 16:39:32 -0700 Subject: [PATCH 020/235] Yoga Podspec: Export YGNode and YGStyle headers (#997) Summary: This pull request adds `YGNode.h` and `YGStyle.h` to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native. The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the `modulemap`. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise. This pull request fences off the contents of those headers in an `#ifdef __cplusplus` block, so they will not cause errors when imported into environments where C++ isn't available. I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time. Changelog: [Internal] - Yoga Podspec: Export YGNore and YGStyle headers Pull Request resolved: https://github.com/facebook/yoga/pull/997 Reviewed By: hramos Differential Revision: D20966075 Pulled By: mdvacca fbshipit-source-id: 5f5caa6b639d11e660b968d681da9a4de6c0eb8e --- ReactCommon/yoga/yoga/YGNode.h | 5 +++++ ReactCommon/yoga/yoga/YGStyle.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ReactCommon/yoga/yoga/YGNode.h b/ReactCommon/yoga/yoga/YGNode.h index 9aef1ec6833000..63d98fe3a1a816 100644 --- a/ReactCommon/yoga/yoga/YGNode.h +++ b/ReactCommon/yoga/yoga/YGNode.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include #include #include "BitUtils.h" @@ -330,3 +333,5 @@ struct YOGA_EXPORT YGNode { bool isLayoutTreeEqualToNode(const YGNode& node) const; void reset(); }; + +#endif diff --git a/ReactCommon/yoga/yoga/YGStyle.h b/ReactCommon/yoga/yoga/YGStyle.h index 9bfbc4422c512d..aab7599ccd964b 100644 --- a/ReactCommon/yoga/yoga/YGStyle.h +++ b/ReactCommon/yoga/yoga/YGStyle.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include #include #include @@ -229,3 +232,5 @@ YOGA_EXPORT bool operator==(const YGStyle& lhs, const YGStyle& rhs); YOGA_EXPORT inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) { return !(lhs == rhs); } + +#endif From 8901d9518a5d578f528b6b94a797b4b6e4cf69c5 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 14 Apr 2020 18:24:23 -0700 Subject: [PATCH 021/235] Add logging to catch null TurboModules Summary: We're still seeing NativeModule eager-init crashes in T46487253. So, just to be extra careful, in case this diff doesn't fix the problem, I'm adding logging into `TurboModuleManager.getModule(moduleName)` to see why TurboModules are showing up as `null`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027984 fbshipit-source-id: 74ee62aeac09a4fdb29547e90ef4fa7c07de17a6 --- .../java/com/facebook/react/turbomodule/core/BUCK | 2 ++ .../react/turbomodule/core/TurboModuleManager.java | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK index ab6fd1ad0ef562..f3e34f4e46effc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK @@ -16,9 +16,11 @@ rn_android_library( react_native_dep("third-party/android/androidx:annotation"), react_native_dep("java/com/facebook/proguard/annotations:annotations"), react_native_dep("java/com/facebook/systrace:systrace"), + react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"), react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), + react_native_target("java/com/facebook/react/common:common"), react_native_target("java/com/facebook/react/turbomodule/core/jni:jni"), react_native_target("java/com/facebook/debug/holder:holder"), react_native_target("java/com/facebook/react/bridge:interfaces"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java index 52647dd0129874..1b97c5bd62db12 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java @@ -10,6 +10,7 @@ import androidx.annotation.GuardedBy; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.jni.HybridData; import com.facebook.proguard.annotations.DoNotStrip; @@ -17,6 +18,7 @@ import com.facebook.react.bridge.JSIModule; import com.facebook.react.bridge.JavaScriptContextHolder; import com.facebook.react.bridge.NativeModule; +import com.facebook.react.common.ReactConstants; import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry; @@ -114,6 +116,12 @@ private TurboModuleHolder getOrMaybeCreateTurboModuleHolder(String moduleName) { /* * Always return null after cleanup has started, so that getModule(moduleName) returns null. */ + + FLog.e( + ReactConstants.TAG, + "TurboModuleManager.getOrMaybeCreateTurboModuleHolder: Tried to require TurboModule " + + moduleName + + " after cleanup initiated"); return null; } @@ -174,6 +182,10 @@ public TurboModule getModule(String moduleName) { * Therefore, we should initialize on the TurboModule now. */ ((NativeModule) turboModule).initialize(); + } else { + FLog.e( + ReactConstants.TAG, + "TurboModuleManager.getModule: TurboModule " + moduleName + " not found in delegate"); } synchronized (moduleHolder) { From 36688d35e1325737709a446933bf5bc139fea541 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 14 Apr 2020 18:24:23 -0700 Subject: [PATCH 022/235] Remove module cache from ReactPackageTurboModuleManagerDelegate Summary: This cache is unnecessary, because: 1. TurboModuleManager caches all created TurboModules 2. TurboModuleManager calls into the TurboModuleManagerDelegate at most once per NativeModule `moduleName`. This diff also makes ReactPackageTurboModuleManager thread-safe, which should help get rid of the crashes in T46487253. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027998 fbshipit-source-id: c9b5ccc3da7b81787b749e70aa5e55883317eed7 --- ...eactPackageTurboModuleManagerDelegate.java | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/ReactPackageTurboModuleManagerDelegate.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/ReactPackageTurboModuleManagerDelegate.java index e8a45458325950..65ee5186e476bc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/ReactPackageTurboModuleManagerDelegate.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/ReactPackageTurboModuleManagerDelegate.java @@ -18,13 +18,10 @@ import com.facebook.react.module.model.ReactModuleInfo; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; public abstract class ReactPackageTurboModuleManagerDelegate extends TurboModuleManagerDelegate { private final List mPackages = new ArrayList<>(); - private final Map mModules = new HashMap<>(); private final ReactApplicationContext mReactApplicationContext; protected ReactPackageTurboModuleManagerDelegate( @@ -69,11 +66,8 @@ public CxxModuleWrapper getLegacyCxxModule(String moduleName) { return (CxxModuleWrapper) module; } + @Nullable private TurboModule resolveModule(String moduleName) { - if (mModules.containsKey(moduleName)) { - return mModules.get(moduleName); - } - NativeModule resolvedModule = null; for (final TurboReactPackage pkg : mPackages) { @@ -92,20 +86,10 @@ private TurboModule resolveModule(String moduleName) { } if (resolvedModule instanceof TurboModule) { - mModules.put(moduleName, (TurboModule) resolvedModule); - } else { - /** - * 1. The list of TurboReactPackages doesn't change. 2. TurboReactPackage.getModule is - * deterministic. Therefore, any two invocations of TurboReactPackage.getModule will return - * the same result given that they're provided the same arguments. - * - *

Hence, if module lookup fails once, we know it'll fail every time. Therefore, we can - * write null to the mModules Map and avoid doing this extra work. - */ - mModules.put(moduleName, null); + return (TurboModule) resolvedModule; } - return mModules.get(moduleName); + return null; } @Override From bc99a32e4d9a8db1d8e524fbdf1a8279a8525834 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 14 Apr 2020 18:24:23 -0700 Subject: [PATCH 023/235] Control concurrent calls into TMMDelegate from TMM Summary: In D20659799, I improved `TurboModuleManager.getModule(moduleName)` thread-safety by ensuring that if two threads race to require the same NativeModule, only one thread creates the NativeModule, while the other one waits until it's created. ## The problem: What I failed to realize was that when two threads race to require two different NativeModules, we can get concurrent calls into `TurboModuleManagerDelegate.getModule(moduleName)`, and `TurboModuleManagerDelegate.getLegacyCxxModule(moduleName)`, which don't have any thread-safe guarantees. ## The fix `TurboModuleManagerDelegate` is supposed to be an input to the TurboModule system. So, rather than expecting that all TurboModuleManagerDelegates are thread-safe, which might be a reasonable ask (see T65532092), this diff has `TurboModuleManager` acquire the delegate's lock before calling into it. This ensures that we don't get concurrent access into the delegate, which could be reading from, or writing to, some data structure in these method calls. (This was the case with `ReactPackageTurboModuleManagerDelegate`, which is what Fb4a and Workplace use under the hood). Changelog: [Android][Fixed] - Control concurrent calls into TMMDelegate from TurboModuleManager Reviewed By: mdvacca Differential Revision: D21025965 fbshipit-source-id: d22c4abfe87f9e534717a06f186dde87d3cd24df --- .../turbomodule/core/TurboModuleManager.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java index 1b97c5bd62db12..004c8e8a7407a0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java @@ -32,7 +32,7 @@ */ public class TurboModuleManager implements JSIModule, TurboModuleRegistry { private static volatile boolean sIsSoLibraryLoaded; - private final List mEagerInitModuleNames; + private final List mEagerInitModuleNames = new ArrayList<>(); private final TurboModuleProvider mJavaModuleProvider; private final TurboModuleProvider mCxxModuleProvider; @@ -64,8 +64,11 @@ public TurboModuleManager( delegate); installJSIBindings(); - mEagerInitModuleNames = - delegate == null ? new ArrayList() : delegate.getEagerInitModuleNames(); + if (delegate != null) { + synchronized (delegate) { + mEagerInitModuleNames.addAll(delegate.getEagerInitModuleNames()); + } + } mJavaModuleProvider = new TurboModuleProvider() { @@ -75,7 +78,10 @@ public TurboModule getModule(String moduleName) { return null; } - return delegate.getModule(moduleName); + /** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */ + synchronized (delegate) { + return delegate.getModule(moduleName); + } } }; @@ -87,7 +93,13 @@ public TurboModule getModule(String moduleName) { return null; } - CxxModuleWrapper nativeModule = delegate.getLegacyCxxModule(moduleName); + CxxModuleWrapper nativeModule; + + /** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */ + synchronized (delegate) { + nativeModule = delegate.getLegacyCxxModule(moduleName); + } + if (nativeModule != null) { // TurboModuleManagerDelegate must always return TurboModules Assertions.assertCondition( From 78266b8b54489f609fdca0e9c26fa52e4305f1d1 Mon Sep 17 00:00:00 2001 From: Eli White Date: Tue, 14 Apr 2020 19:18:03 -0700 Subject: [PATCH 024/235] Bump eslint-plugin-react-native-community version to 1.1.0 Summary: This release will include the new platform-colors rule. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21022163 fbshipit-source-id: 65c831b3c820e44f75631b935118b043180ab3c7 --- packages/eslint-plugin-react-native-community/README.md | 4 ++++ packages/eslint-plugin-react-native-community/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin-react-native-community/README.md b/packages/eslint-plugin-react-native-community/README.md index 702c35cd0c19d0..33aac086a30782 100644 --- a/packages/eslint-plugin-react-native-community/README.md +++ b/packages/eslint-plugin-react-native-community/README.md @@ -31,3 +31,7 @@ Enforces that error classes ( = classes with PascalCase names ending with `Error ### `no-haste-imports` Disallows Haste module names in `import` statements and `require()` calls. + +### `platform-colors` + +Enforces that calls to `PlatformColor` and `DynamicColorIOS` are statically analyzable to enable performance optimizations. diff --git a/packages/eslint-plugin-react-native-community/package.json b/packages/eslint-plugin-react-native-community/package.json index 5a6c28f26d0281..dad503b7c0e447 100644 --- a/packages/eslint-plugin-react-native-community/package.json +++ b/packages/eslint-plugin-react-native-community/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-community/eslint-plugin", - "version": "1.0.0", + "version": "1.1.0", "description": "ESLint rules for @react-native-community/eslint-config", "main": "index.js", "repository": { From 75a617827963fd53f5f36987677a992e137eaebf Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Wed, 15 Apr 2020 01:28:04 -0700 Subject: [PATCH 025/235] Update Babel to 7.8.x/7.9.x Reviewed By: motiz88 Differential Revision: D20697095 fbshipit-source-id: ef35d02da0916109ce528d3026f7ca0956911dda --- .../Pressable/__tests__/Pressable-test.js | 4 +- .../__snapshots__/Pressable-test.js.snap | 49 - .../__snapshots__/index-test.js.snap | 6 +- yarn.lock | 1717 ++++++++--------- 4 files changed, 787 insertions(+), 989 deletions(-) delete mode 100644 Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap diff --git a/Libraries/Components/Pressable/__tests__/Pressable-test.js b/Libraries/Components/Pressable/__tests__/Pressable-test.js index a8c5af535e8518..bf0f412b70e7c0 100644 --- a/Libraries/Components/Pressable/__tests__/Pressable-test.js +++ b/Libraries/Components/Pressable/__tests__/Pressable-test.js @@ -18,7 +18,9 @@ import View from '../../View/View'; import {expectRendersMatchingSnapshot} from '../../../Utilities/ReactNativeTestTools'; describe('', () => { - it('should render as expected', () => { + /* eslint-disable jest/no-disabled-tests */ + // TODO(cpojer): Reenable this test, see T64907347. + xit('should render as expected', () => { expectRendersMatchingSnapshot( 'Pressable', () => ( diff --git a/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap b/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap deleted file mode 100644 index 5c82f9ab1c7e67..00000000000000 --- a/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap +++ /dev/null @@ -1,49 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` should render as expected: should deep render when mocked (please verify output manually) 1`] = ` - - - -`; - -exports[` should render as expected: should deep render when not mocked (please verify output manually) 1`] = ` - - - -`; - -exports[` should render as expected: should shallow render as when mocked 1`] = ` - - - -`; - -exports[` should render as expected: should shallow render as when not mocked 1`] = ` - - - -`; diff --git a/packages/babel-plugin-inline-view-configs/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-inline-view-configs/__tests__/__snapshots__/index-test.js.snap index af56f2b191b12d..85c8e4580aa169 100644 --- a/packages/babel-plugin-inline-view-configs/__tests__/__snapshots__/index-test.js.snap +++ b/packages/babel-plugin-inline-view-configs/__tests__/__snapshots__/index-test.js.snap @@ -141,7 +141,7 @@ exports[`Babel plugin inline view configs fails on inline config for CommandsExp 17 | } 18 | > 19 | export const Foo = codegenNativeCommands(); - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 20 | 21 | export default (codegenNativeComponent('Module'): NativeType); 22 | " @@ -152,7 +152,7 @@ exports[`Babel plugin inline view configs fails on inline config for CommandsExp 19 | const Commands = 4; 20 | > 21 | export {Commands}; - | ^ + | ^^^^^^^^^^^^^^^^^^ 22 | 23 | export default (codegenNativeComponent('Module'): NativeType); 24 | " @@ -163,7 +163,7 @@ exports[`Babel plugin inline view configs fails on inline config for OtherComman 17 | } 18 | > 19 | export const Commands = 4; - | ^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 20 | 21 | export default (codegenNativeComponent('Module'): NativeType); 22 | " diff --git a/yarn.lock b/yarn.lock index 07708118ebc80b..ad39f7378ee86a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,218 +2,134 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/code-frame@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" - integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== dependencies: "@babel/highlight" "^7.8.3" -"@babel/core@^7.0.0": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.2.tgz#f8d2a9ceb6832887329a7b60f9d035791400ba4e" - integrity sha512-IFeSSnjXdhDaoysIlev//UzHZbdEmm7D0EIH2qtse9xK7mXEZQpYjs2P00XlP1qYsYvid79p+Zgg6tz1mp6iVw== +"@babel/compat-data@^7.8.6", "@babel/compat-data@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" + integrity sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.1.2" - "@babel/helpers" "^7.1.2" - "@babel/parser" "^7.1.2" - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.1.2" - convert-source-map "^1.1.0" - debug "^3.1.0" - json5 "^0.5.0" - lodash "^4.17.10" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" + browserslist "^4.9.1" + invariant "^2.2.4" + semver "^5.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.1.6": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" - integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.1.6", "@babel/core@^7.4.5": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" + integrity sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helpers" "^7.2.0" - "@babel/parser" "^7.2.2" - "@babel/template" "^7.2.2" - "@babel/traverse" "^7.2.2" - "@babel/types" "^7.2.2" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.10" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/core@^7.4.5": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" - integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== - dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.2" - "@babel/helpers" "^7.7.0" - "@babel/parser" "^7.7.2" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.7.2" + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.9.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helpers" "^7.9.0" + "@babel/parser" "^7.9.0" + "@babel/template" "^7.8.6" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" convert-source-map "^1.7.0" debug "^4.1.0" - json5 "^2.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" lodash "^4.17.13" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0", "@babel/generator@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" - integrity sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg== +"@babel/generator@^7.0.0", "@babel/generator@^7.5.0", "@babel/generator@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.4.tgz#12441e90c3b3c4159cdecf312075bf1a8ce2dbce" + integrity sha512-rjP8ahaDy/ouhrvCoU1E5mqaitWrxwuNGU+dy1EpaoK48jZay4MdkskKGIMHLZNewg8sAsqpGSREJwP0zH3YQA== dependencies: - "@babel/types" "^7.2.2" - jsesc "^2.5.1" - lodash "^4.17.10" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/generator@^7.1.2": - version "7.3.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.3.2.tgz#fff31a7b2f2f3dad23ef8e01be45b0d5c2fc0132" - integrity sha512-f3QCuPppXxtZOEm5GWPra/uYUjmNQlu9pbAD8D/9jze4pTY83rTtB1igTBSwvkeNlC5gR24zFFkz+2WHLFQhqQ== - dependencies: - "@babel/types" "^7.3.2" - jsesc "^2.5.1" - lodash "^4.17.10" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/generator@^7.5.0", "@babel/generator@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" - integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== - dependencies: - "@babel/types" "^7.7.2" + "@babel/types" "^7.9.0" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" -"@babel/generator@^7.8.3": +"@babel/helper-annotate-as-pure@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.3.tgz#0e22c005b0a94c1c74eafe19ef78ce53a4d45c03" - integrity sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug== + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz#60bc0bc657f63a0924ff9a4b4a0b24a13cf4deee" + integrity sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw== dependencies: "@babel/types" "^7.8.3" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" - -"@babel/helper-annotate-as-pure@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" - integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== - dependencies: - "@babel/types" "^7.0.0" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" - integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz#c84097a427a061ac56a1c30ebf54b7b22d241503" + integrity sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw== dependencies: - "@babel/helper-explode-assignable-expression" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-explode-assignable-expression" "^7.8.3" + "@babel/types" "^7.8.3" -"@babel/helper-builder-react-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0.tgz#fa154cb53eb918cf2a9a7ce928e29eb649c5acdb" - integrity sha512-ebJ2JM6NAKW0fQEqN8hOLxK84RbRz9OkUhGS/Xd5u56ejMfVbayJ4+LykERZCOUM6faa6Fp3SZNX3fcT16MKHw== +"@babel/helper-builder-react-jsx-experimental@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.9.0.tgz#066d80262ade488f9c1b1823ce5db88a4cedaa43" + integrity sha512-3xJEiyuYU4Q/Ar9BsHisgdxZsRlsShMe90URZ0e6przL26CCs8NJbDoxH94kKT17PcxlMhsCAwZd90evCo26VQ== dependencies: - "@babel/types" "^7.0.0" - esutils "^2.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-module-imports" "^7.8.3" + "@babel/types" "^7.9.0" -"@babel/helper-call-delegate@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a" - integrity sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ== +"@babel/helper-builder-react-jsx@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.9.0.tgz#16bf391990b57732700a3278d4d9a81231ea8d32" + integrity sha512-weiIo4gaoGgnhff54GQ3P5wsUQmnSwpkvU0r6ZHq6TzoSzKy4JxHEgnxNytaKbov2a9z/CVNyzliuCOUPEX3Jw== dependencies: - "@babel/helper-hoist-variables" "^7.0.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/types" "^7.9.0" -"@babel/helper-create-class-features-plugin@^7.2.3": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.2.3.tgz#f6e719abb90cb7f4a69591e35fd5eb89047c4a7c" - integrity sha512-xO/3Gn+2C7/eOUeb0VRnSP1+yvWHNxlpAot1eMhtoKDCN7POsyQP5excuT5UsV5daHxMWBeIIOeI5cmB8vMRgQ== +"@babel/helper-compilation-targets@^7.8.7": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz#dac1eea159c0e4bd46e309b5a1b04a66b53c1dde" + integrity sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.2.3" + "@babel/compat-data" "^7.8.6" + browserslist "^4.9.1" + invariant "^2.2.4" + levenary "^1.1.1" + semver "^5.5.0" "@babel/helper-create-class-features-plugin@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.3.tgz#5b94be88c255f140fd2c10dd151e7f98f4bff397" - integrity sha512-qmp4pD7zeTxsv0JNecSBsEmG1ei2MqwJq4YQcK3ZWm/0t07QstWfvuV/vm3Qt5xNMFETn2SZqpMx2MQzbtq+KA== + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz#243a5b46e2f8f0f674dc1387631eb6b28b851de0" + integrity sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg== dependencies: "@babel/helper-function-name" "^7.8.3" "@babel/helper-member-expression-to-functions" "^7.8.3" "@babel/helper-optimise-call-expression" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-replace-supers" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" "@babel/helper-split-export-declaration" "^7.8.3" -"@babel/helper-define-map@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c" - integrity sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg== +"@babel/helper-create-regexp-features-plugin@^7.8.3", "@babel/helper-create-regexp-features-plugin@^7.8.8": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz#5d84180b588f560b7864efaeea89243e58312087" + integrity sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.0.0" - lodash "^4.17.10" - -"@babel/helper-explode-assignable-expression@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" - integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== - dependencies: - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-regex" "^7.8.3" + regexpu-core "^4.7.0" -"@babel/helper-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" - integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== +"@babel/helper-define-map@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz#a0655cad5451c3760b726eba875f1cd8faa02c15" + integrity sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g== dependencies: - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-function-name" "^7.8.3" + "@babel/types" "^7.8.3" + lodash "^4.17.13" -"@babel/helper-function-name@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz#44a5ad151cfff8ed2599c91682dda2ec2c8430a3" - integrity sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q== +"@babel/helper-explode-assignable-expression@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz#a728dc5b4e89e30fc2dfc7d04fa28a930653f982" + integrity sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw== dependencies: - "@babel/helper-get-function-arity" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/traverse" "^7.8.3" + "@babel/types" "^7.8.3" "@babel/helper-function-name@^7.8.3": version "7.8.3" @@ -224,20 +140,6 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-get-function-arity@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" - integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-get-function-arity@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz#c604886bc97287a1d1398092bc666bc3d7d7aa2d" - integrity sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw== - dependencies: - "@babel/types" "^7.7.0" - "@babel/helper-get-function-arity@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" @@ -245,19 +147,12 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-hoist-variables@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz#46adc4c5e758645ae7a45deb92bab0918c23bb88" - integrity sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-member-expression-to-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" - integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== +"@babel/helper-hoist-variables@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz#1dbe9b6b55d78c9b4183fc8cdc6e30ceb83b7134" + integrity sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.8.3" "@babel/helper-member-expression-to-functions@^7.8.3": version "7.8.3" @@ -266,31 +161,25 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" - integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-transforms@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" - integrity sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw== +"@babel/helper-module-imports@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz#7fe39589b39c016331b6b8c3f441e8f0b1419498" + integrity sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg== dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - lodash "^4.17.10" + "@babel/types" "^7.8.3" -"@babel/helper-optimise-call-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" - integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== +"@babel/helper-module-transforms@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz#43b34dfe15961918707d247327431388e9fe96e5" + integrity sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA== dependencies: - "@babel/types" "^7.0.0" + "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" + "@babel/helper-simple-access" "^7.8.3" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/template" "^7.8.6" + "@babel/types" "^7.9.0" + lodash "^4.17.13" "@babel/helper-optimise-call-expression@^7.8.3": version "7.8.3" @@ -299,75 +188,46 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-plugin-utils@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" - integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== - -"@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== -"@babel/helper-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0.tgz#2c1718923b57f9bbe64705ffe5640ac64d9bdb27" - integrity sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg== - dependencies: - lodash "^4.17.10" - -"@babel/helper-remap-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" - integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-wrap-function" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.2.3": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.2.3.tgz#19970020cf22677d62b3a689561dbd9644d8c5e5" - integrity sha512-GyieIznGUfPXPWu0yLS6U55Mz67AZD9cUk0BfirOWlPrXlBcan9Gz+vHGz+cPfuoweZSnPzPIm67VtQM0OWZbA== +"@babel/helper-regex@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.8.3.tgz#139772607d51b93f23effe72105b319d2a4c6965" + integrity sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ== dependencies: - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.2.3" - "@babel/types" "^7.0.0" + lodash "^4.17.13" -"@babel/helper-replace-supers@^7.8.3": +"@babel/helper-remap-async-to-generator@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.3.tgz#91192d25f6abbcd41da8a989d4492574fb1530bc" - integrity sha512-xOUssL6ho41U81etpLoT2RTdvdus4VfHamCuAm4AHxGr+0it5fnwoVdwUJ7GFEqCsQYzJUhcbsN9wB9apcYKFA== + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz#273c600d8b9bf5006142c1e35887d555c12edd86" + integrity sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.8.3" - "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-wrap-function" "^7.8.3" + "@babel/template" "^7.8.3" "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-simple-access@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" - integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== +"@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" + integrity sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA== dependencies: - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-split-export-declaration@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" - integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== - dependencies: - "@babel/types" "^7.0.0" + "@babel/helper-member-expression-to-functions" "^7.8.3" + "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/traverse" "^7.8.6" + "@babel/types" "^7.8.6" -"@babel/helper-split-export-declaration@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz#1365e74ea6c614deeb56ebffabd71006a0eb2300" - integrity sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA== +"@babel/helper-simple-access@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz#7f8109928b4dab4654076986af575231deb639ae" + integrity sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw== dependencies: - "@babel/types" "^7.7.0" + "@babel/template" "^7.8.3" + "@babel/types" "^7.8.3" "@babel/helper-split-export-declaration@^7.8.3": version "7.8.3" @@ -376,85 +236,43 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-wrap-function@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" - integrity sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" +"@babel/helper-validator-identifier@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz#ad53562a7fc29b3b9a91bbf7d10397fd146346ed" + integrity sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw== -"@babel/helpers@^7.1.2": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.3.1.tgz#949eec9ea4b45d3210feb7dc1c22db664c9e44b9" - integrity sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA== - dependencies: - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.5" - "@babel/types" "^7.3.0" - -"@babel/helpers@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" - integrity sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A== - dependencies: - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.5" - "@babel/types" "^7.2.0" - -"@babel/helpers@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.0.tgz#359bb5ac3b4726f7c1fde0ec75f64b3f4275d60b" - integrity sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g== +"@babel/helper-wrap-function@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz#9dbdb2bb55ef14aaa01fe8c99b629bd5352d8610" + integrity sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ== dependencies: - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-function-name" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.8.3" + "@babel/types" "^7.8.3" -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== +"@babel/helpers@^7.9.0": + version "7.9.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.9.2.tgz#b42a81a811f1e7313b88cba8adc66b3d9ae6c09f" + integrity sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA== dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" "@babel/highlight@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" - integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" + integrity sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ== dependencies: + "@babel/helper-validator-identifier" "^7.9.0" chalk "^2.0.0" - esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.6", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" - integrity sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA== - -"@babel/parser@^7.1.0": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" - integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== - -"@babel/parser@^7.1.2": - version "7.3.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.2.tgz#95cdeddfc3992a6ca2a1315191c1679ca32c55cd" - integrity sha512-QzNUC2RO1gadg+fs21fi0Uu0OuGNzRKEmgCxoLNzbCdoprLwjfmZwzUrpUNfJPaVRwBpDY47A17yYEGWyRelnQ== - -"@babel/parser@^7.7.0", "@babel/parser@^7.7.2": - version "7.7.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043" - integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A== - -"@babel/parser@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081" - integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" + integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== "@babel/plugin-check-constants@^7.0.0-beta.38": version "7.0.0-beta.38" @@ -462,183 +280,191 @@ integrity sha512-MjdGn/2sMLu0fnNFbkILut0OsegzRTeCOJ/uGHH88TwTXPzxONx2cTVJ36i3cTQXHMiIOUT3hX6HqzWM99Q6vA== "@babel/plugin-external-helpers@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-external-helpers/-/plugin-external-helpers-7.0.0.tgz#61ee7ba5dba27d7cad72a13d46bec23c060b762e" - integrity sha512-tZKTMdhZvTy0KCEX5EGQQm1RHr7jUa36q/yax1baEA0yZapVYmu10yW7LTqijITgSq416gPVjrcexiA6y4pJlA== + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-external-helpers/-/plugin-external-helpers-7.8.3.tgz#5a94164d9af393b2820a3cdc407e28ebf237de4b" + integrity sha512-mx0WXDDiIl5DwzMtzWGRSPugXi9BxROS05GQrhLNbEamhBiicgn994ibwkyiBH+6png7bm/yA7AUsvHyCXi4Vw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" - integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== +"@babel/plugin-proposal-async-generator-functions@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz#bad329c670b382589721b27540c7d288601c6e6f" + integrity sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-remap-async-to-generator" "^7.8.3" + "@babel/plugin-syntax-async-generators" "^7.8.0" "@babel/plugin-proposal-class-properties@^7.0.0", "@babel/plugin-proposal-class-properties@^7.1.0": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.2.3.tgz#c9e1294363b346cff333007a92080f3203698461" - integrity sha512-FVuQngLoN2iDrpW7LmhPZ2sO4DJxf35FOcwidwB9Ru9tMvI5URthnkVHuG14IStV+TzkMTyLMoOUlSTtrdVwqw== + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e" + integrity sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.2.3" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-create-class-features-plugin" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-proposal-export-default-from@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.0.0.tgz#a057bbfd4649facfe39f33a537e18554bdd2b5da" - integrity sha512-cWhkx6SyjZ4caFOanoPmDNgQCuYYTmou4QXy886JsyLTw/vhWQbop2gLKsWyyswrJkKTB7fSNxVYbP/oEsoySA== +"@babel/plugin-proposal-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz#38c4fe555744826e97e2ae930b0fb4cc07e66054" + integrity sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-export-default-from" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-dynamic-import" "^7.8.0" -"@babel/plugin-proposal-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== +"@babel/plugin-proposal-export-default-from@^7.0.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz#4cb7c2fdeaed490b60d9bfd3dc8a20f81f9c2e7c" + integrity sha512-PYtv2S2OdCdp7GSPDg5ndGZFm9DmWFvuLoS5nBxZCgOBggluLnhTScspJxng96alHQzPyrrHxvC9/w4bFuspeA== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-export-default-from" "^7.8.3" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0.tgz#b72ec31adf612d062dc0348316246127a451e45f" - integrity sha512-QIN3UFo1ul4ruAsjIqK43PeXedo1qY74zeGrODJl1KfCGeMc6qJC4rb5Ylml/smzxibqsDeVZGH+TmWHCldRQQ== +"@babel/plugin-proposal-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz#da5216b238a98b58a1e05d6852104b10f9a70d6b" + integrity sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.0" -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.2.0.tgz#88f5fec3e7ad019014c97f7ee3c992f0adbf7fb8" - integrity sha512-1L5mWLSvR76XYUQJXkd/EEQgjq8HHRP6lQuZTTg0VA4tTGPpGemmCdAfQIz1rzEuWAm+ecP8PyyEm30jC1eQCg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0", "@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz#e4572253fdeed65cddeecfdab3f928afeb2fd5d2" + integrity sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-optional-catch-binding@^7.0.0", "@babel/plugin-proposal-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== +"@babel/plugin-proposal-numeric-separator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz#5d6769409699ec9b3b68684cd8116cedff93bad8" + integrity sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0.tgz#3d344d4152253379b8758e7d041148e8787c4a9d" - integrity sha512-7x8HLa71OzNiofbQUVakS0Kmg++6a+cXNfS7QKHbbv03SuSaumJyaWsfNgw+T7aqrJlqurYpZqrkPgXu0iZK0w== +"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.0.tgz#a28993699fc13df165995362693962ba6b061d6f" + integrity sha512-UgqBv6bjq4fDb8uku9f+wcm1J7YxJ5nT7WO/jBr0cl0PLKb7t1O6RNR1kZbjgx2LQtsDI9hwoQVmn0yhXeQyow== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-chaining" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.0" -"@babel/plugin-proposal-unicode-property-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz#abe7281fe46c95ddc143a65e5358647792039520" - integrity sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw== +"@babel/plugin-proposal-optional-catch-binding@^7.0.0", "@babel/plugin-proposal-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz#9dee96ab1650eed88646ae9734ca167ac4a9c5c9" + integrity sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.2.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-syntax-async-generators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== +"@babel/plugin-proposal-optional-chaining@^7.0.0", "@babel/plugin-proposal-optional-chaining@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz#31db16b154c39d6b8a645292472b98394c292a58" + integrity sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0.tgz#e051af5d300cbfbcec4a7476e37a803489881634" - integrity sha512-cR12g0Qzn4sgkjrbrzWy2GE7m9vMl/sFkqZ3gIpAQdrvPDnLM8180i+ANDFIXfjHo9aqp0ccJlQ0QNZcFUbf9w== +"@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.8.3": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz#ee3a95e90cdc04fe8cd92ec3279fa017d68a0d1d" + integrity sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-create-regexp-features-plugin" "^7.8.8" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-dynamic-import@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0.tgz#6dfb7d8b6c3be14ce952962f658f3b7eb54c33ee" - integrity sha512-Gt9xNyRrCHCiyX/ZxDGOcBnlJl0I3IWicpZRC4CdC0P5a/I07Ya2OAMEBU+J7GmRFVmIetqEYRko6QYRuKOESw== +"@babel/plugin-syntax-async-generators@^7.8.0": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-export-default-from@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.0.0.tgz#084b639bce3d42f3c5bf3f68ccb42220bb2d729d" - integrity sha512-HNnjg/fFFbnuLAqr/Ocp1Y3GB4AjmXcu1xxn3ql3bS2kGrB/qi+Povshb8i3hOkE5jNozzh8r/0/lq1w8oOWbQ== +"@babel/plugin-syntax-class-properties@^7.0.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz#6cb933a8872c8d359bfde69bbeaae5162fd1e8f7" + integrity sha512-UcAyQWg2bAN647Q+O811tG9MrJ38Z10jjhQdKNAL8fsyPzE3cCN/uT+f55cFVY4aGO4jqJAvmqsuY3GQDwAoXg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.0.0.tgz#70638aeaad9ee426bc532e51523cff8ff02f6f17" - integrity sha512-zGcuZWiWWDa5qTZ6iAnpG0fnX/GOu49pGR5PFvkQ9GmKNaSphXQnlNXh/LG20sqWtNrx/eB6krzfEzcwvUyeFA== +"@babel/plugin-syntax-dynamic-import@^7.0.0", "@babel/plugin-syntax-dynamic-import@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-flow@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" - integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== +"@babel/plugin-syntax-export-default-from@^7.0.0", "@babel/plugin-syntax-export-default-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.8.3.tgz#f1e55ce850091442af4ba9c2550106035b29d678" + integrity sha512-a1qnnsr73KLNIQcQlcQ4ZHxqqfBKM6iNQZW2OMTyxNbA2WC7SHWHtGVpFzWtQAuS2pspkWVzdEBXXx8Ik0Za4w== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== +"@babel/plugin-syntax-flow@^7.0.0", "@babel/plugin-syntax-flow@^7.2.0", "@babel/plugin-syntax-flow@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.8.3.tgz#f2c883bd61a6316f2c89380ae5122f923ba4527f" + integrity sha512-innAx3bUbA0KSYj2E2MNFSn9hiCeowOFLxlsuhXzw8hMQnzkDomUr9QCD7E9VF60NmnG1sNTuuv6Qf4f8INYsg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz#034d5e2b4e14ccaea2e4c137af7e4afb39375ffd" - integrity sha512-PdmL2AoPsCLWxhIr3kG2+F9v4WH06Q3z+NoGVpQgnUNGcagXHq5sB3OXxkSahKq9TLdNMN/AJzFYSOo8UKDMHg== +"@babel/plugin-syntax-json-strings@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.8.3": +"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.8.3.tgz#521b06c83c40480f1e58b4fd33b92eceb1d6ea94" integrity sha512-WxdW9xyLgBdefoo0Ynn3MRSkhe5tFVxxKNVdnZSh318WrG2e2jH+E9wd/++JsqcLJZPfz87njQJ8j2Upjm0M0A== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0.tgz#b60931d5a15da82625fff6657c39419969598743" - integrity sha512-oAJmMsAvTSIk9y0sZdU2S/nY44PEUuHN7EzNDMgbuR4e/OwyfR9lSmoBJBZ2lslFZIqhksrTt4i+av7uKfNYDw== +"@babel/plugin-syntax-nullish-coalescing-operator@^7.0.0", "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== +"@babel/plugin-syntax-numeric-separator@^7.8.0", "@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz#0e3fb63e09bea1b11e96467271c8308007e7c41f" + integrity sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-chaining@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0.tgz#1e6ecba124310b5d3a8fc1e00d50b1c4c2e05e68" - integrity sha512-QXedQsZf8yua1nNrXSePT0TsGSQH9A1iK08m9dhCMdZeJaaxYcQfXdgHWVV6Cp7WE/afPVvSKIsAHK5wP+yxDA== +"@babel/plugin-syntax-optional-catch-binding@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-typescript@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.2.0.tgz#55d240536bd314dcbbec70fd949c5cabaed1de29" - integrity sha512-WhKr6yu6yGpGcNMVgIBuI9MkredpVc7Y3YR4UzEZmDztHoL6wV56YBHLhWnjO1EvId1B32HrD3DRFc+zSoKI1g== +"@babel/plugin-syntax-optional-chaining@^7.0.0", "@babel/plugin-syntax-optional-chaining@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz#3acdece695e6b13aaf57fc291d1a800950c71391" + integrity sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-typescript@^7.8.3": version "7.8.3" @@ -647,497 +473,458 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== +"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz#82776c2ed0cd9e1a49956daeb896024c9473b8b6" + integrity sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-async-to-generator@^7.0.0", "@babel/plugin-transform-async-to-generator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.2.0.tgz#68b8a438663e88519e65b776f8938f3445b1a2ff" - integrity sha512-CEHzg4g5UraReozI9D4fblBYABs7IM6UerAVG7EJVrTLC5keh00aEuLUT+O40+mJCEzaXkYfTCUKIyeDfMOFFQ== +"@babel/plugin-transform-async-to-generator@^7.0.0", "@babel/plugin-transform-async-to-generator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz#4308fad0d9409d71eafb9b1a6ee35f9d64b64086" + integrity sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ== dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-remap-async-to-generator" "^7.8.3" -"@babel/plugin-transform-block-scoped-functions@^7.0.0", "@babel/plugin-transform-block-scoped-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== +"@babel/plugin-transform-block-scoped-functions@^7.0.0", "@babel/plugin-transform-block-scoped-functions@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz#437eec5b799b5852072084b3ae5ef66e8349e8a3" + integrity sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-block-scoping@^7.0.0", "@babel/plugin-transform-block-scoping@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.2.0.tgz#f17c49d91eedbcdf5dd50597d16f5f2f770132d4" - integrity sha512-vDTgf19ZEV6mx35yiPJe4fS02mPQUUcBNwWQSZFXSzTSbsJFQvHt7DqyS3LK8oOWALFOsJ+8bbqBgkirZteD5Q== +"@babel/plugin-transform-block-scoping@^7.0.0", "@babel/plugin-transform-block-scoping@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz#97d35dab66857a437c166358b91d09050c868f3a" + integrity sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.10" + "@babel/helper-plugin-utils" "^7.8.3" + lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.0.0", "@babel/plugin-transform-classes@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz#6c90542f210ee975aa2aa8c8b5af7fa73a126953" - integrity sha512-gEZvgTy1VtcDOaQty1l10T3jQmJKlNVxLDCs+3rCVPr6nMkODLELxViq5X9l+rfxbie3XrfrMCYYY6eX3aOcOQ== +"@babel/plugin-transform-classes@^7.0.0", "@babel/plugin-transform-classes@^7.9.0": + version "7.9.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.2.tgz#8603fc3cc449e31fdbdbc257f67717536a11af8d" + integrity sha512-TC2p3bPzsfvSsqBZo0kJnuelnoK9O3welkUpqSqBQuBF6R5MN2rysopri8kNvtlGIb2jmUO7i15IooAZJjZuMQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.1.0" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-define-map" "^7.8.3" + "@babel/helper-function-name" "^7.8.3" + "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" + "@babel/helper-split-export-declaration" "^7.8.3" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.0.0", "@babel/plugin-transform-computed-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== +"@babel/plugin-transform-computed-properties@^7.0.0", "@babel/plugin-transform-computed-properties@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz#96d0d28b7f7ce4eb5b120bb2e0e943343c86f81b" + integrity sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-destructuring@^7.0.0", "@babel/plugin-transform-destructuring@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.2.0.tgz#e75269b4b7889ec3a332cd0d0c8cff8fed0dc6f3" - integrity sha512-coVO2Ayv7g0qdDbrNiadE4bU7lvCd9H539m2gMknyVjjMdwF/iCOM7R+E8PkntoqLkltO0rk+3axhpp/0v68VQ== +"@babel/plugin-transform-destructuring@^7.0.0", "@babel/plugin-transform-destructuring@^7.8.3": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.8.tgz#fadb2bc8e90ccaf5658de6f8d4d22ff6272a2f4b" + integrity sha512-eRJu4Vs2rmttFCdhPUM3bV0Yo/xPSdPw6ML9KHs/bjB4bLA5HXlbvYXPOD5yASodGod+krjYx21xm1QmL8dCJQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-dotall-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz#f0aabb93d120a8ac61e925ea0ba440812dbe0e49" - integrity sha512-sKxnyHfizweTgKZf7XsXu/CNupKhzijptfTM+bozonIuyVrLWVUvYjE2bhuSBML8VQeMxq4Mm63Q9qvcvUcciQ== +"@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz#c3c6ec5ee6125c6993c5cbca20dc8621a9ea7a6e" + integrity sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.1.3" + "@babel/helper-create-regexp-features-plugin" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-duplicate-keys@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" - integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== +"@babel/plugin-transform-duplicate-keys@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz#8d12df309aa537f272899c565ea1768e286e21f1" + integrity sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-exponentiation-operator@^7.0.0", "@babel/plugin-transform-exponentiation-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== +"@babel/plugin-transform-exponentiation-operator@^7.0.0", "@babel/plugin-transform-exponentiation-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz#581a6d7f56970e06bf51560cd64f5e947b70d7b7" + integrity sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.0.0.tgz#c40ced34c2783985d90d9f9ac77a13e6fb396a01" - integrity sha512-WhXUNb4It5a19RsgKKbQPrjmy4yWOY1KynpEbNw7bnd1QTcrT/EIl3MJvnGgpgvrKyKbqX7nUNOJfkpLOnoDKA== +"@babel/plugin-transform-flow-strip-types@^7.0.0", "@babel/plugin-transform-flow-strip-types@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.9.0.tgz#8a3538aa40434e000b8f44a3c5c9ac7229bd2392" + integrity sha512-7Qfg0lKQhEHs93FChxVLAvhBshOPQDtJUTVHr/ZwQNRccCm4O9D79r9tVSoV8iNwjP1YgfD+e/fgHcPkN1qEQg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-flow" "^7.8.3" -"@babel/plugin-transform-for-of@^7.0.0", "@babel/plugin-transform-for-of@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz#ab7468befa80f764bb03d3cb5eef8cc998e1cad9" - integrity sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ== +"@babel/plugin-transform-for-of@^7.0.0", "@babel/plugin-transform-for-of@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz#0f260e27d3e29cd1bb3128da5e76c761aa6c108e" + integrity sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-function-name@^7.0.0", "@babel/plugin-transform-function-name@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.2.0.tgz#f7930362829ff99a3174c39f0afcc024ef59731a" - integrity sha512-kWgksow9lHdvBC2Z4mxTsvc7YdY7w/V6B2vy9cTIPtLEE9NhwoWivaxdNM/S37elu5bqlLP/qOY906LukO9lkQ== +"@babel/plugin-transform-function-name@^7.0.0", "@babel/plugin-transform-function-name@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz#279373cb27322aaad67c2683e776dfc47196ed8b" + integrity sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-function-name" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-literals@^7.0.0", "@babel/plugin-transform-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== +"@babel/plugin-transform-literals@^7.0.0", "@babel/plugin-transform-literals@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz#aef239823d91994ec7b68e55193525d76dbd5dc1" + integrity sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-member-expression-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.0.0.tgz#96a265bf61a9ed6f75c39db0c30d41ef7aabf072" - integrity sha512-kgAGWcjVdflNPSaRb9rDPdGJ9/gF80VPmxx80gdKz6NSofHvxA2LofECQ+7GrDVzzH8zBJzTn1xlV4xnmWj/nw== +"@babel/plugin-transform-member-expression-literals@^7.0.0", "@babel/plugin-transform-member-expression-literals@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz#963fed4b620ac7cbf6029c755424029fa3a40410" + integrity sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-modules-amd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" - integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== +"@babel/plugin-transform-modules-amd@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz#19755ee721912cf5bb04c07d50280af3484efef4" + integrity sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q== dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helper-plugin-utils" "^7.8.3" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz#c4f1933f5991d5145e9cfad1dfd848ea1727f404" - integrity sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ== +"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz#e3e72f4cbc9b4a260e30be0ea59bdf5a39748940" + integrity sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g== dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-simple-access" "^7.8.3" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.2.0.tgz#912bfe9e5ff982924c81d0937c92d24994bb9068" - integrity sha512-aYJwpAhoK9a+1+O625WIjvMY11wkB/ok0WClVwmeo3mCjcNRjt+/8gHWrB5i+00mUju0gWsBkQnPpdvQ7PImmQ== +"@babel/plugin-transform-modules-systemjs@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz#e9fd46a296fc91e009b64e07ddaa86d6f0edeb90" + integrity sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ== dependencies: - "@babel/helper-hoist-variables" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-hoist-variables" "^7.8.3" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helper-plugin-utils" "^7.8.3" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" - integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== +"@babel/plugin-transform-modules-umd@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz#e909acae276fec280f9b821a5f38e1f08b480697" + integrity sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ== dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-module-transforms" "^7.9.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-new-target@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz#ae8fbd89517fa7892d20e6564e641e8770c3aa4a" - integrity sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz#a2a72bffa202ac0e2d0506afd0939c5ecbc48c6c" + integrity sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-create-regexp-features-plugin" "^7.8.3" + +"@babel/plugin-transform-new-target@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz#60cc2ae66d85c95ab540eb34babb6434d4c70c43" + integrity sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-object-assign@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.0.0.tgz#fca6d7500d9675c42868b8f3882979201b9a5ad8" - integrity sha512-Dag8mxx7/03oj8F8PkNso8GEMhwGfeT0TL6KfMsa9Brjx4IpwZVl3WBvEmYks8BMhPmrvM5NQ/tjaMbwEj5ijA== + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.8.3.tgz#dc3b8dd50ef03837868a37b7df791f64f288538e" + integrity sha512-i3LuN8tPDqUCRFu3dkzF2r1Nx0jp4scxtm7JxtIqI9he9Vk20YD+/zshdzR9JLsoBMlJlNR82a62vQExNEVx/Q== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" - integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== +"@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz#ebb6a1e7a86ffa96858bd6ac0102d65944261725" + integrity sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.3" -"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.2.0.tgz#0d5ad15dc805e2ea866df4dd6682bfe76d1408c2" - integrity sha512-kB9+hhUidIgUoBQ0MsxMewhzr8i60nMa2KgeJKQWYrqQpqcBYtnpR+JgkadZVZoaEZ/eKu9mclFaVwhRpLNSzA== +"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.8.7": + version "7.9.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.3.tgz#3028d0cc20ddc733166c6e9c8534559cee09f54a" + integrity sha512-fzrQFQhp7mIhOzmOtPiKffvCYQSK10NR8t6BBz2yPbeUHb9OLW8RZGtgDRBn8z2hGcwvKDL3vC7ojPTLNxmqEg== dependencies: - "@babel/helper-call-delegate" "^7.1.0" - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-property-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.0.0.tgz#0b95a91dbd1f0be5b5a99ed86571ef5b5ae77009" - integrity sha512-7HK6/jB4MLpwQUJQ3diaX0pbCRcoL9asJscQfU3D1HpDwYdrH6yAUKleUNFHFyGNYBI9UeJrS2Jpx2JhtPKu5g== +"@babel/plugin-transform-property-literals@^7.0.0", "@babel/plugin-transform-property-literals@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz#33194300d8539c1ed28c62ad5087ba3807b98263" + integrity sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-react-display-name@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.0.0.tgz#93759e6c023782e52c2da3b75eca60d4f10533ee" - integrity sha512-BX8xKuQTO0HzINxT6j/GiCwoJB0AOMs0HmLbEnAvcte8U8rSkNa/eSCAY+l1OA4JnCVq2jw2p6U8QQryy2fTPg== + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.8.3.tgz#70ded987c91609f78353dd76d2fb2a0bb991e8e5" + integrity sha512-3Jy/PCw8Fe6uBKtEgz3M82ljt+lTg+xJaM4og+eyu83qLT87ZUSckn0wy7r31jflURWLO83TW6Ylf7lyXj3m5A== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-react-jsx-self@^7.0.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.8.3.tgz#c4f178b2aa588ecfa8d077ea80d4194ee77ed702" - integrity sha512-01OT7s5oa0XTLf2I8XGsL8+KqV9lx3EZV+jxn/L2LQ97CGKila2YMroTkCEIE0HV/FF7CMSRsIAybopdN9NTdg== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.9.0.tgz#f4f26a325820205239bb915bad8e06fcadabb49b" + integrity sha512-K2ObbWPKT7KUTAoyjCsFilOkEgMvFG+y0FqOl6Lezd0/13kMkkjHskVsZvblRPj1PHA44PrToaZANrryppzTvQ== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-jsx" "^7.8.3" "@babel/plugin-transform-react-jsx-source@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0.tgz#28e00584f9598c0dd279f6280eee213fa0121c3c" - integrity sha512-OSeEpFJEH5dw/TtxTg4nijl4nHBbhqbKL94Xo/Y17WKIf2qJWeIk/QeXACF19lG1vMezkxqruwnTjVizaW7u7w== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.9.0.tgz#89ef93025240dd5d17d3122294a093e5e0183de0" + integrity sha512-K6m3LlSnTSfRkM6FcRk8saNEeaeyG5k7AVkBU2bZK3+1zdkSED3qNdsWrUgQBeTVD2Tp3VMmerxVO2yM5iITmw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-jsx" "^7.8.3" "@babel/plugin-transform-react-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0.tgz#524379e4eca5363cd10c4446ba163f093da75f3e" - integrity sha512-0TMP21hXsSUjIQJmu/r7RiVxeFrXRcMUigbKu0BLegJK9PkYodHstaszcig7zxXfaBji2LYUdtqIkHs+hgYkJQ== + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.9.4.tgz#86f576c8540bd06d0e95e0b61ea76d55f6cbd03f" + integrity sha512-Mjqf3pZBNLt854CK0C/kRuXAnE6H/bo7xYojP+WGtX8glDGSibcwnsWwhwoSuRg0+EBnxPC1ouVnuetUIlPSAw== dependencies: - "@babel/helper-builder-react-jsx" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/helper-builder-react-jsx" "^7.9.0" + "@babel/helper-builder-react-jsx-experimental" "^7.9.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-jsx" "^7.8.3" -"@babel/plugin-transform-regenerator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1" - integrity sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw== +"@babel/plugin-transform-regenerator@^7.0.0", "@babel/plugin-transform-regenerator@^7.8.7": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz#5e46a0dca2bee1ad8285eb0527e6abc9c37672f8" + integrity sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA== + dependencies: + regenerator-transform "^0.14.2" + +"@babel/plugin-transform-reserved-words@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz#9a0635ac4e665d29b162837dd3cc50745dfdf1f5" + integrity sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A== dependencies: - regenerator-transform "^0.13.3" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-runtime@^7.0.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.1.0.tgz#9f76920d42551bb577e2dc594df229b5f7624b63" - integrity sha512-WFLMgzu5DLQEah0lKTJzYb14vd6UiES7PTnXcvrPZ1VrwFeJ+mTbvr65fFAsXYMt2bIoOoC0jk76zY1S7HZjUg== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.0.tgz#45468c0ae74cc13204e1d3b1f4ce6ee83258af0b" + integrity sha512-pUu9VSf3kI1OqbWINQ7MaugnitRss1z533436waNXp+0N3ur3zfut37sXiQMxkuCF4VUjwZucen/quskCh7NHw== dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" resolve "^1.8.1" semver "^5.5.1" -"@babel/plugin-transform-shorthand-properties@^7.0.0", "@babel/plugin-transform-shorthand-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-spread@^7.0.0", "@babel/plugin-transform-spread@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" - integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== +"@babel/plugin-transform-shorthand-properties@^7.0.0", "@babel/plugin-transform-shorthand-properties@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz#28545216e023a832d4d3a1185ed492bcfeac08c8" + integrity sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-sticky-regex@^7.0.0", "@babel/plugin-transform-sticky-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== +"@babel/plugin-transform-spread@^7.0.0", "@babel/plugin-transform-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz#9c8ffe8170fdfb88b114ecb920b82fb6e95fe5e8" + integrity sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-template-literals@^7.0.0", "@babel/plugin-transform-template-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.2.0.tgz#d87ed01b8eaac7a92473f608c97c089de2ba1e5b" - integrity sha512-FkPix00J9A/XWXv4VoKJBMeSkyY9x/TqIh76wzcdfl57RJJcf8CehQ08uwfhCDNtRQYtHQKBTwKZDEyjE13Lwg== +"@babel/plugin-transform-sticky-regex@^7.0.0", "@babel/plugin-transform-sticky-regex@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz#be7a1290f81dae767475452199e1f76d6175b100" + integrity sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw== dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-regex" "^7.8.3" -"@babel/plugin-transform-typeof-symbol@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== +"@babel/plugin-transform-template-literals@^7.0.0", "@babel/plugin-transform-template-literals@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz#7bfa4732b455ea6a43130adc0ba767ec0e402a80" + integrity sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-typescript@^7.1.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.2.0.tgz#bce7c06300434de6a860ae8acf6a442ef74a99d1" - integrity sha512-EnI7i2/gJ7ZNr2MuyvN2Hu+BHJENlxWte5XygPvfj/MbvtOkWor9zcnHpMMQL2YYaaCcqtIvJUyJ7QVfoGs7ew== +"@babel/plugin-transform-typeof-symbol@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz#ede4062315ce0aaf8a657a920858f1a2f35fc412" + integrity sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-typescript" "^7.2.0" + "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-typescript@^7.5.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.8.3.tgz#be6f01a7ef423be68e65ace1f04fc407e6d88917" - integrity sha512-Ebj230AxcrKGZPKIp4g4TdQLrqX95TobLUWKd/CwG7X1XHUH1ZpkpFvXuXqWbtGRWb7uuEWNlrl681wsOArAdQ== +"@babel/plugin-transform-typescript@^7.5.0", "@babel/plugin-transform-typescript@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.4.tgz#4bb4dde4f10bbf2d787fce9707fb09b483e33359" + integrity sha512-yeWeUkKx2auDbSxRe8MusAG+n4m9BFY/v+lPjmQDgOFX5qnySkUY5oXzkp6FwPdsYqnKay6lorXYdC0n3bZO7w== dependencies: "@babel/helper-create-class-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-typescript" "^7.8.3" -"@babel/plugin-transform-unicode-regex@^7.0.0", "@babel/plugin-transform-unicode-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz#4eb8db16f972f8abb5062c161b8b115546ade08b" - integrity sha512-m48Y0lMhrbXEJnVUaYly29jRXbQ3ksxPrS1Tg8t+MHqzXhtBYAvI51euOBaoAlZLPHsieY9XPVMf80a5x0cPcA== +"@babel/plugin-transform-unicode-regex@^7.0.0", "@babel/plugin-transform-unicode-regex@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz#0cef36e3ba73e5c57273effb182f46b91a1ecaad" + integrity sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.1.3" + "@babel/helper-create-regexp-features-plugin" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/preset-env@^7.1.6": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.2.3.tgz#948c8df4d4609c99c7e0130169f052ea6a7a8933" - integrity sha512-AuHzW7a9rbv5WXmvGaPX7wADxFkZIqKlbBh1dmZUQp4iwiPpkE/Qnrji6SC4UQCQzvWY/cpHET29eUhXS9cLPw== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.9.0.tgz#a5fc42480e950ae8f5d9f8f2bbc03f52722df3a8" + integrity sha512-712DeRXT6dyKAM/FMbQTV/FvRCms2hPCx+3weRjZ8iQVQWZejWWk1wwG6ViWMyqb/ouBbGOl5b6aCk0+j1NmsQ== dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.2.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.2.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.2.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.2.0" - "@babel/plugin-transform-classes" "^7.2.0" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.2.0" - "@babel/plugin-transform-dotall-regex" "^7.2.0" - "@babel/plugin-transform-duplicate-keys" "^7.2.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.2.0" - "@babel/plugin-transform-function-name" "^7.2.0" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.2.0" - "@babel/plugin-transform-modules-commonjs" "^7.2.0" - "@babel/plugin-transform-modules-systemjs" "^7.2.0" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-new-target" "^7.0.0" - "@babel/plugin-transform-object-super" "^7.2.0" - "@babel/plugin-transform-parameters" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.0.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.2.0" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.2.0" - browserslist "^4.3.4" + "@babel/compat-data" "^7.9.0" + "@babel/helper-compilation-targets" "^7.8.7" + "@babel/helper-module-imports" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-proposal-async-generator-functions" "^7.8.3" + "@babel/plugin-proposal-dynamic-import" "^7.8.3" + "@babel/plugin-proposal-json-strings" "^7.8.3" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-proposal-numeric-separator" "^7.8.3" + "@babel/plugin-proposal-object-rest-spread" "^7.9.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.8.3" + "@babel/plugin-proposal-optional-chaining" "^7.9.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.8.3" + "@babel/plugin-syntax-async-generators" "^7.8.0" + "@babel/plugin-syntax-dynamic-import" "^7.8.0" + "@babel/plugin-syntax-json-strings" "^7.8.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/plugin-syntax-numeric-separator" "^7.8.0" + "@babel/plugin-syntax-object-rest-spread" "^7.8.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" + "@babel/plugin-syntax-optional-chaining" "^7.8.0" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.8.3" + "@babel/plugin-transform-async-to-generator" "^7.8.3" + "@babel/plugin-transform-block-scoped-functions" "^7.8.3" + "@babel/plugin-transform-block-scoping" "^7.8.3" + "@babel/plugin-transform-classes" "^7.9.0" + "@babel/plugin-transform-computed-properties" "^7.8.3" + "@babel/plugin-transform-destructuring" "^7.8.3" + "@babel/plugin-transform-dotall-regex" "^7.8.3" + "@babel/plugin-transform-duplicate-keys" "^7.8.3" + "@babel/plugin-transform-exponentiation-operator" "^7.8.3" + "@babel/plugin-transform-for-of" "^7.9.0" + "@babel/plugin-transform-function-name" "^7.8.3" + "@babel/plugin-transform-literals" "^7.8.3" + "@babel/plugin-transform-member-expression-literals" "^7.8.3" + "@babel/plugin-transform-modules-amd" "^7.9.0" + "@babel/plugin-transform-modules-commonjs" "^7.9.0" + "@babel/plugin-transform-modules-systemjs" "^7.9.0" + "@babel/plugin-transform-modules-umd" "^7.9.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" + "@babel/plugin-transform-new-target" "^7.8.3" + "@babel/plugin-transform-object-super" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.8.7" + "@babel/plugin-transform-property-literals" "^7.8.3" + "@babel/plugin-transform-regenerator" "^7.8.7" + "@babel/plugin-transform-reserved-words" "^7.8.3" + "@babel/plugin-transform-shorthand-properties" "^7.8.3" + "@babel/plugin-transform-spread" "^7.8.3" + "@babel/plugin-transform-sticky-regex" "^7.8.3" + "@babel/plugin-transform-template-literals" "^7.8.3" + "@babel/plugin-transform-typeof-symbol" "^7.8.4" + "@babel/plugin-transform-unicode-regex" "^7.8.3" + "@babel/preset-modules" "^0.1.3" + "@babel/types" "^7.9.0" + browserslist "^4.9.1" + core-js-compat "^3.6.2" invariant "^2.2.2" - js-levenshtein "^1.1.3" - semver "^5.3.0" + levenary "^1.1.1" + semver "^5.5.0" "@babel/preset-flow@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0.tgz#afd764835d9535ec63d8c7d4caf1c06457263da2" - integrity sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.9.0.tgz#fee847c3e090b0b2d9227c1949e4da1d1379280d" + integrity sha512-88uSmlshIrlmPkNkEcx3UpSZ6b8n0UGBq0/0ZMZCF/uxAW0XIAUuDHBhIOAh0pvweafH4RxOwi/H3rWhtqOYPA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-transform-flow-strip-types" "^7.9.0" + +"@babel/preset-modules@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.3.tgz#13242b53b5ef8c883c3cf7dddd55b36ce80fbc72" + integrity sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-flow-strip-types" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/types" "^7.4.4" + esutils "^2.0.2" "@babel/preset-typescript@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.1.0.tgz#49ad6e2084ff0bfb5f1f7fb3b5e76c434d442c7f" - integrity sha512-LYveByuF9AOM8WrsNne5+N79k1YxjNB6gmpCQsnuSBAcV8QUeB+ZUxQzL7Rz7HksPbahymKkq2qBR+o36ggFZA== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz#87705a72b1f0d59df21c179f7c3d2ef4b16ce192" + integrity sha512-S4cueFnGrIbvYJgwsVFKdvOmpiL0XGw9MFW9D0vgRys5g36PBhZRL8NX8Gr2akz8XRtzq6HuDXPD/1nniagNUg== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-typescript" "^7.1.0" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-transform-typescript" "^7.9.0" "@babel/register@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" - integrity sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.9.0.tgz#02464ede57548bddbb5e9f705d263b7c3f43d48b" + integrity sha512-Tv8Zyi2J2VRR8g7pC5gTeIN8Ihultbmk0ocyNz8H2nEZbmhp1N6q0A1UGsQbDvGP/sNinQKUHf3SqXwqjtFv4Q== dependencies: - core-js "^2.5.7" - find-cache-dir "^1.0.0" - home-or-tmp "^3.0.0" - lodash "^4.17.10" - mkdirp "^0.5.1" + find-cache-dir "^2.0.0" + lodash "^4.17.13" + make-dir "^2.1.0" pirates "^4.0.0" - source-map-support "^0.5.9" + source-map-support "^0.5.16" -"@babel/runtime@^7.0.0": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.1.2.tgz#81c89935f4647706fc54541145e6b4ecfef4b8e3" - integrity sha512-Y3SCjmhSupzFB6wcv1KmmFucH6gDVnI30WjOcicV10ju0cZjak3Jcs67YLIXBrmZYw1xCrVeJPbycFwrqNyxpg== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.8.4": + version "7.9.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.2.tgz#d90df0583a3a252f09aaa619665367bae518db06" + integrity sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q== dependencies: - regenerator-runtime "^0.12.0" + regenerator-runtime "^0.13.4" -"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" - integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.2.2" - "@babel/types" "^7.2.2" - -"@babel/template@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" - integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/types" "^7.7.0" - -"@babel/template@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.3.tgz#e02ad04fe262a657809327f578056ca15fd4d1b8" - integrity sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ== +"@babel/template@^7.0.0", "@babel/template@^7.8.3", "@babel/template@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" + integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/parser" "^7.8.3" - "@babel/types" "^7.8.3" - -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2", "@babel/traverse@^7.2.3": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" - integrity sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.2.3" - "@babel/types" "^7.2.2" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.10" - -"@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" - integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== - dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.2" - "@babel/helper-function-name" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" - "@babel/parser" "^7.7.2" - "@babel/types" "^7.7.2" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.13" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" -"@babel/traverse@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.3.tgz#a826215b011c9b4f73f3a893afbc05151358bf9a" - integrity sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.0.tgz#d3882c2830e513f4fe4cec9fe76ea1cc78747892" + integrity sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.3" + "@babel/generator" "^7.9.0" "@babel/helper-function-name" "^7.8.3" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/parser" "^7.9.0" + "@babel/types" "^7.9.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" - integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== - dependencies: - esutils "^2.0.2" - lodash "^4.17.10" - to-fast-properties "^2.0.0" - -"@babel/types@^7.1.2", "@babel/types@^7.3.0", "@babel/types@^7.3.2": - version "7.3.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.3.2.tgz#424f5be4be633fff33fb83ab8d67e4a8290f5a2f" - integrity sha512-3Y6H8xlUlpbGR+XvawiH0UXehqydTmNmEpozWcXymqwcrwYAl5KMvKtQ+TF6f6E08V6Jur7v/ykdDSF+WDEIXQ== - dependencies: - esutils "^2.0.2" - lodash "^4.17.10" - to-fast-properties "^2.0.0" - -"@babel/types@^7.7.0", "@babel/types@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" - integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== - dependencies: - esutils "^2.0.2" - lodash "^4.17.13" - to-fast-properties "^2.0.0" - -"@babel/types@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" - integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.0.tgz#00b064c3df83ad32b2dbf5ff07312b15c7f1efb5" + integrity sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng== dependencies: - esutils "^2.0.2" + "@babel/helper-validator-identifier" "^7.9.0" lodash "^4.17.13" to-fast-properties "^2.0.0" @@ -2002,6 +1789,13 @@ babel-jest@^24.9.0: chalk "^2.4.2" slash "^2.0.0" +babel-plugin-dynamic-import-node@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" + integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== + dependencies: + object.assign "^4.1.0" + babel-plugin-istanbul@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30" @@ -2193,14 +1987,15 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browserslist@^4.3.4: - version "4.3.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.6.tgz#0f9d9081afc66b36f477c6bdf3813f784f42396a" - integrity sha512-kMGKs4BTzRWviZ8yru18xBpx+CyHG9eqgRbj9XbE3IMgtczf4aiA0Y1YCpVdvUieKGZ03kolSPXqTcscBCb9qw== +browserslist@^4.8.3, browserslist@^4.9.1: + version "4.11.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.11.1.tgz#92f855ee88d6e050e7e7311d987992014f1a1f1b" + integrity sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g== dependencies: - caniuse-lite "^1.0.30000921" - electron-to-chromium "^1.3.92" - node-releases "^1.1.1" + caniuse-lite "^1.0.30001038" + electron-to-chromium "^1.3.390" + node-releases "^1.1.53" + pkg-up "^2.0.0" bser@^2.0.0: version "2.0.0" @@ -2308,10 +2103,10 @@ camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000921: - version "1.0.30000923" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000923.tgz#148f9bda508024b5ce957b463ae2e8302b451bb2" - integrity sha512-j5ur7eeluOFjjPUkydtXP4KFAsmH3XaQNch5tvWSO+dLHYt5PE+VgJZLWtbVOodfWij6m6zas28T4gB/cLYq1w== +caniuse-lite@^1.0.30001038: + version "1.0.30001038" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz#44da3cbca2ab6cb6aa83d1be5d324e17f141caff" + integrity sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ== capture-exit@^1.2.0: version "1.2.0" @@ -2589,7 +2384,7 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -convert-source-map@^1.1.0, convert-source-map@^1.4.0: +convert-source-map@^1.4.0: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== @@ -2608,7 +2403,15 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js@^2.2.2, core-js@^2.4.1, core-js@^2.5.7: +core-js-compat@^3.6.2: + version "3.6.4" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.4.tgz#938476569ebb6cda80d339bcf199fae4f16fff17" + integrity sha512-zAa3IZPvsJ0slViBQ2z+vgyyTuhd3MFn1rBQjZSKVEgB0UMYhUkCj9jJUVPgGTGqWvsBVmfnruXgTcNyTlEiSA== + dependencies: + browserslist "^4.8.3" + semver "7.0.0" + +core-js@^2.2.2, core-js@^2.4.1: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== @@ -2905,10 +2708,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.92: - version "1.3.95" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.95.tgz#79fac438813ca7f3db182a525c2ab432934f6484" - integrity sha512-0JZEDKOQAE05EO/4rk3vLAE+PYFI9OLCVLAS4QAq1y+Bb2y1N6MyQJz62ynzHN/y0Ka/nO5jVJcahbCEdfiXLQ== +electron-to-chromium@^1.3.390: + version "1.3.392" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.392.tgz#280ab4f7a3ae47419cfabb15dbfc1567be7f1111" + integrity sha512-/hsgeVdReDsyTBE0aU9FRdh1wnNPrX3xlz3t61F+CJPOT+Umfi9DXHsCX85TEgWZQqlow0Rw44/4/jbU2Sqgkg== emoji-regex@^7.0.1, emoji-regex@^7.0.2: version "7.0.3" @@ -3232,7 +3035,7 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= -esutils@^2.0.0, esutils@^2.0.2: +esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= @@ -3489,14 +3292,14 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" -find-cache-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" - integrity sha1-kojj6ePMN0hxfTnq3hfPcfww7m8= +find-cache-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== dependencies: commondir "^1.0.1" - make-dir "^1.0.0" - pkg-dir "^2.0.0" + make-dir "^2.0.0" + pkg-dir "^3.0.0" find-up@^2.1.0: version "2.1.0" @@ -3655,6 +3458,11 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +gensync@^1.0.0-beta.1: + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" + integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -3842,11 +3650,6 @@ hermes-engine@~0.5.0: resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.5.0.tgz#d914acce72e9657b3c98875ad3f9094d8643f327" integrity sha512-jSuHiOhdh2+IF3bH2gLpQ37eMkdUrEb9GK6PoG3rLRaUDK3Zn2Y9fXM+wyDfoUTA3gz9EET0/IIWk5k21qp4kw== -home-or-tmp@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" - integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs= - hosted-git-info@^2.1.4: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -4742,11 +4545,6 @@ jetifier@^1.6.2: resolved "https://registry.yarnpkg.com/jetifier/-/jetifier-1.6.4.tgz#6159db8e275d97980d26162897a0648b6d4a3222" integrity sha512-+f/4OLeqY8RAmXnonI1ffeY1DR8kMNJPhv5WMFehchf7U71cjMQVKkOz1n6asz6kfVoAqKNWJz1A/18i18AcXA== -js-levenshtein@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e" - integrity sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -4886,17 +4684,12 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== +json5@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e" + integrity sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ== dependencies: - minimist "^1.2.0" + minimist "^1.2.5" jsonfile@^2.1.0: version "2.4.0" @@ -5002,6 +4795,13 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== +levenary@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/levenary/-/levenary-1.1.1.tgz#842a9ee98d2075aa7faeedbe32679e9205f46f77" + integrity sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ== + dependencies: + leven "^3.1.0" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -5099,13 +4899,21 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -make-dir@^1.0.0, make-dir@^1.3.0: +make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" +make-dir@^2.0.0, make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -5550,6 +5358,11 @@ minimist@^1.1.1, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minipass@^2.2.1, minipass@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" @@ -5727,12 +5540,10 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.2.tgz#93c17fba5eec8650ad908de5433fa8763baebe4d" - integrity sha512-j1gEV/zX821yxdWp/1vBMN0pSUjuH9oGUdLCb4PfUko6ZW7KdRs3Z+QGGwDUhYtSpQvdVVyLd2V0YvLsmdg5jQ== - dependencies: - semver "^5.3.0" +node-releases@^1.1.53: + version "1.1.53" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" + integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== node-version@^1.0.0: version "1.2.0" @@ -5838,6 +5649,11 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-keys@^1.0.11: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -5850,6 +5666,16 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + object.fromentries@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" @@ -6122,6 +5948,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -6148,13 +5979,6 @@ pirates@^4.0.1: dependencies: node-modules-regexp "^1.0.0" -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -6162,6 +5986,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" + integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + dependencies: + find-up "^2.1.0" + plist@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c" @@ -6245,7 +6076,7 @@ pretty-format@^25.1.0: ansi-styles "^4.0.0" react-is "^16.12.0" -private@^0.1.6, private@^0.1.8: +private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -6461,10 +6292,10 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -regenerate-unicode-properties@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" - integrity sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw== +regenerate-unicode-properties@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== dependencies: regenerate "^1.4.0" @@ -6473,22 +6304,23 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.12.0: - version "0.12.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" - integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== - regenerator-runtime@^0.13.2: version "0.13.2" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== -regenerator-transform@^0.13.3: - version "0.13.3" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" - integrity sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + +regenerator-transform@^0.14.2: + version "0.14.4" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.4.tgz#5266857896518d1616a78a0479337a30ea974cc7" + integrity sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw== dependencies: - private "^0.1.6" + "@babel/runtime" "^7.8.4" + private "^0.1.8" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -6510,27 +6342,27 @@ regexpp@^1.1.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== -regexpu-core@^4.1.3, regexpu-core@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" - integrity sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw== +regexpu-core@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938" + integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ== dependencies: regenerate "^1.4.0" - regenerate-unicode-properties "^7.0.0" - regjsgen "^0.4.0" - regjsparser "^0.3.0" + regenerate-unicode-properties "^8.2.0" + regjsgen "^0.5.1" + regjsparser "^0.6.4" unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.0.2" + unicode-match-property-value-ecmascript "^1.2.0" -regjsgen@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" - integrity sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA== +regjsgen@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" + integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== -regjsparser@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" - integrity sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA== +regjsparser@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.4.tgz#a769f8684308401a66e9b529d2436ff4d0666272" + integrity sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw== dependencies: jsesc "~0.5.0" @@ -6792,6 +6624,16 @@ scheduler@0.19.1, scheduler@^0.19.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +semver@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" + integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== + +semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -7005,7 +6847,15 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@^0.5.9: +source-map-support@^0.5.16: + version "0.5.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" + integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@^0.5.6: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== @@ -7421,11 +7271,6 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - truncate-utf8-bytes@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz#405923909592d56f78a5818434b0b78489ca5f2b" @@ -7493,10 +7338,10 @@ unicode-match-property-ecmascript@^1.0.4: unicode-canonical-property-names-ecmascript "^1.0.4" unicode-property-aliases-ecmascript "^1.0.4" -unicode-match-property-value-ecmascript@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" - integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== +unicode-match-property-value-ecmascript@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== unicode-property-aliases-ecmascript@^1.0.4: version "1.0.4" From 992e0ce922cee91b079f8da7ce0e03ee2780b8c8 Mon Sep 17 00:00:00 2001 From: grabbou Date: Wed, 15 Apr 2020 11:16:12 -0700 Subject: [PATCH 026/235] fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e --- react.gradle | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/react.gradle b/react.gradle index e6e5afe2dc2158..ea3fee2ee6c20e 100644 --- a/react.gradle +++ b/react.gradle @@ -21,7 +21,26 @@ def detectEntryFile(config) { return "index.js"; } -def cliPath = config.cliPath ?: "node_modules/react-native/cli.js" +/** + * Detects CLI location in a similar fashion to the React Native CLI + */ +def detectCliPath(config) { + if (config.cliPath) { + return config.cliPath + } + + def cliPath = ["node", "-e", "console.log(require('react-native/cli').bin);"].execute([], projectDir).text + + if (cliPath) { + return cliPath + } else if (new File("${projectDir}/../../node_modules/react-native/cli.js").exists()) { + return "${projectDir}/../../node_modules/react-native/cli.js" + } else { + throw new Exception("Couldn't determine CLI location. " + + "Please set `project.ext.react.cliPath` to the path of the react-native cli.js"); + } +} + def composeSourceMapsPath = config.composeSourceMapsPath ?: "node_modules/react-native/scripts/compose-source-maps.js" def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" def entryFile = detectEntryFile(config) @@ -98,21 +117,16 @@ afterEvaluate { // Additional node and packager commandline arguments def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"] - def extraPackagerArgs = config.extraPackagerArgs ?: [] + def cliPath = detectCliPath(config) def execCommand = [] - if (config.cliPath || config.nodeExecutableAndArgs) { - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - execCommand.addAll(["cmd", "/c", *nodeExecutableAndArgs, cliPath]) - } else { - execCommand.addAll([*nodeExecutableAndArgs, cliPath]) - } + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + execCommand.addAll(["cmd", "/c", *nodeExecutableAndArgs, cliPath]) } else { - throw new Exception("Missing cliPath or nodeExecutableAndArgs from build config. " + - "Please set project.ext.react.cliPath to the path of the react-native cli.js"); + execCommand.addAll([*nodeExecutableAndArgs, cliPath]) } - + def enableHermes = enableHermesForVariant(variant) def currentBundleTask = tasks.create( @@ -145,7 +159,7 @@ afterEvaluate { def devEnabled = !(config."devDisabledIn${targetName}" || targetName.toLowerCase().contains("release")) - def extraArgs = extraPackagerArgs; + def extraArgs = config.extraPackagerArgs ?: []; if (bundleConfig) { extraArgs = extraArgs.clone() From 1908d50ba4052cea0be92a0fee272ca256c38c22 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 15 Apr 2020 11:43:23 -0700 Subject: [PATCH 027/235] Fix CIRCLE_PR_NUMBER may not always be set (#28640) Summary: This fixes build failures where `CIRCLE_PR_NUMBER` is not set. This can happen if the PR did not come from a fork. ## Changelog [Internal] [Fixed] - Fix CIRCLE_PR_NUMBER may not always be set Pull Request resolved: https://github.com/facebook/react-native/pull/28640 Test Plan: Report bundle size step should pass on both this PR and https://github.com/facebook/react-native/issues/28641. Reviewed By: cpojer Differential Revision: D21045553 Pulled By: TheSavior fbshipit-source-id: fdfcb1bb88a96345b78ca69c49623df71d4cd608 --- scripts/circleci/report-bundle-size.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/circleci/report-bundle-size.sh b/scripts/circleci/report-bundle-size.sh index 4f8c49535f7e32..c8fa61079383f4 100755 --- a/scripts/circleci/report-bundle-size.sh +++ b/scripts/circleci/report-bundle-size.sh @@ -8,7 +8,7 @@ case $1 in "android" | "ios") GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook} \ GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native} \ - GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" \ + GITHUB_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" \ GITHUB_REF=${CIRCLE_BRANCH} \ GITHUB_SHA=${CIRCLE_SHA1} \ node bots/report-bundle-size.js "$1" From a9bac177e52096fbb6dff5bd8ff5d9b56628261f Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 15 Apr 2020 19:32:27 -0700 Subject: [PATCH 028/235] Add "Open Debugger" and "Open React DevTools" to iOS dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Provided so that we don't drift too far from the Android code. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20784270 fbshipit-source-id: 6bb16431d25a6c093a583e2e041b8cffa6765ddd --- React/CoreModules/RCTDevMenu.mm | 60 +++++++++++++++---- React/CoreModules/RCTDevSettings.h | 2 +- React/CoreModules/RCTDevSettings.mm | 2 +- .../DevSupport/RCTInspectorDevServerHelper.h | 1 + .../DevSupport/RCTInspectorDevServerHelper.mm | 41 ++++++++++--- 5 files changed, 84 insertions(+), 22 deletions(-) diff --git a/React/CoreModules/RCTDevMenu.mm b/React/CoreModules/RCTDevMenu.mm index 6abcd34329fa15..1d0be74094544a 100644 --- a/React/CoreModules/RCTDevMenu.mm +++ b/React/CoreModules/RCTDevMenu.mm @@ -16,11 +16,9 @@ #import #import #import - #import "CoreModulesPlugins.h" #if RCT_DEV_MENU - #if RCT_ENABLE_INSPECTOR #import #endif @@ -221,13 +219,59 @@ - (void)setDefaultJSBundle }]]; if (!devSettings.isProfilingEnabled) { - if (!devSettings.isRemoteDebuggingAvailable) { +#if RCT_ENABLE_INSPECTOR + if (devSettings.isDeviceDebuggingAvailable) { + // For on-device debugging we link out to Flipper. + // Since we're assuming Flipper is available, also include the DevTools. + // Note: For parity with the Android code. + + // Reset the old debugger setting so no one gets stuck. + // TODO: Remove in a few weeks. + if (devSettings.isDebuggingRemotely) { + devSettings.isDebuggingRemotely = false; + } + [items addObject:[RCTDevMenuItem + buttonItemWithTitleBlock:^NSString * { + return @"Open Debugger"; + } + handler:^{ + [RCTInspectorDevServerHelper + openURL:@"flipper://null/Hermesdebuggerrn?device=React%20Native" + withBundleURL:bridge.bundleURL + withErrorMessage:@"Failed to open Flipper. Please check that Metro is runnning."]; + }]]; + + [items addObject:[RCTDevMenuItem + buttonItemWithTitleBlock:^NSString * { + return @"Open React DevTools"; + } + handler:^{ + [RCTInspectorDevServerHelper + openURL:@"flipper://null/React?device=React%20Native" + withBundleURL:bridge.bundleURL + withErrorMessage:@"Failed to open Flipper. Please check that Metro is runnning."]; + }]]; + } else if (devSettings.isRemoteDebuggingAvailable) { +#else + if (devSettings.isRemoteDebuggingAvailable) { +#endif + // For remote debugging, we open up Chrome running the app in a web worker. + // Note that this requires async communication, which will not work for Turbo Modules. + [items addObject:[RCTDevMenuItem + buttonItemWithTitleBlock:^NSString * { + return devSettings.isDebuggingRemotely ? @"Stop Debugging" : @"Debug with Chrome"; + } + handler:^{ + devSettings.isDebuggingRemotely = !devSettings.isDebuggingRemotely; + }]]; + } else { + // If neither are available, we're defaulting to a message that tells you about remote debugging. [items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Debugger Unavailable" handler:^{ NSString *message = RCTTurboModuleEnabled() - ? @"Debugging is not currently supported when TurboModule is enabled." + ? @"Debugging with Chrome is not supported when TurboModules are enabled." : @"Include the RCTWebSocket library to enable JavaScript debugging."; UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Debugger Unavailable" @@ -246,14 +290,6 @@ - (void)setDefaultJSBundle animated:YES completion:NULL]; }]]; - } else { - [items addObject:[RCTDevMenuItem - buttonItemWithTitleBlock:^NSString * { - return devSettings.isDebuggingRemotely ? @"Stop Debugging" : @"Debug"; - } - handler:^{ - devSettings.isDebuggingRemotely = !devSettings.isDebuggingRemotely; - }]]; } } diff --git a/React/CoreModules/RCTDevSettings.h b/React/CoreModules/RCTDevSettings.h index d33b718b4edf4c..b1ea0e75315dfb 100644 --- a/React/CoreModules/RCTDevSettings.h +++ b/React/CoreModules/RCTDevSettings.h @@ -37,7 +37,7 @@ @property (nonatomic, readonly) BOOL isHotLoadingAvailable; @property (nonatomic, readonly) BOOL isLiveReloadAvailable; @property (nonatomic, readonly) BOOL isRemoteDebuggingAvailable; -@property (nonatomic, readonly) BOOL isNuclideDebuggingAvailable; +@property (nonatomic, readonly) BOOL isDeviceDebuggingAvailable; @property (nonatomic, readonly) BOOL isJSCSamplingProfilerAvailable; /** diff --git a/React/CoreModules/RCTDevSettings.mm b/React/CoreModules/RCTDevSettings.mm index c17c76d4014418..0ac5cc4f5ddbfd 100644 --- a/React/CoreModules/RCTDevSettings.mm +++ b/React/CoreModules/RCTDevSettings.mm @@ -222,7 +222,7 @@ - (id)settingForKey:(NSString *)key return [_dataSource settingForKey:key]; } -- (BOOL)isNuclideDebuggingAvailable +- (BOOL)isDeviceDebuggingAvailable { #if RCT_ENABLE_INSPECTOR return self.bridge.isInspectable; diff --git a/React/DevSupport/RCTInspectorDevServerHelper.h b/React/DevSupport/RCTInspectorDevServerHelper.h index c50051bb0f69dc..b69fa02bc2a2f4 100644 --- a/React/DevSupport/RCTInspectorDevServerHelper.h +++ b/React/DevSupport/RCTInspectorDevServerHelper.h @@ -17,6 +17,7 @@ + (RCTInspectorPackagerConnection *)connectWithBundleURL:(NSURL *)bundleURL; + (void)disableDebugger; ++ (void)openURL:(NSString *)url withBundleURL:(NSURL *)bundleURL withErrorMessage:(NSString *)errorMessage; @end #endif diff --git a/React/DevSupport/RCTInspectorDevServerHelper.mm b/React/DevSupport/RCTInspectorDevServerHelper.mm index 7d7212ffbcf30f..5885f214ebb9dd 100644 --- a/React/DevSupport/RCTInspectorDevServerHelper.mm +++ b/React/DevSupport/RCTInspectorDevServerHelper.mm @@ -17,8 +17,14 @@ static NSString *const kDebuggerMsgDisable = @"{ \"id\":1,\"method\":\"Debugger.disable\" }"; -static NSString *getServerHost(NSURL *bundleURL, NSNumber *port) +static NSString *getServerHost(NSURL *bundleURL) { + NSNumber *port = @8081; + NSString *portStr = [[[NSProcessInfo processInfo] environment] objectForKey:@"RCT_METRO_PORT"]; + if (portStr && [portStr length] > 0) { + port = [NSNumber numberWithInt:[portStr intValue]]; + } + NSString *host = [bundleURL host]; if (!host) { host = @"localhost"; @@ -34,21 +40,19 @@ static NSURL *getInspectorDeviceUrl(NSURL *bundleURL) { - NSNumber *inspectorProxyPort = @8081; - NSString *inspectorProxyPortStr = [[[NSProcessInfo processInfo] environment] objectForKey:@"RCT_METRO_PORT"]; - if (inspectorProxyPortStr && [inspectorProxyPortStr length] > 0) { - inspectorProxyPort = [NSNumber numberWithInt:[inspectorProxyPortStr intValue]]; - } NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@", - getServerHost(bundleURL, inspectorProxyPort), + getServerHost(bundleURL), escapedDeviceName, escapedAppName]]; } - +static NSURL *getOpenUrlEndpoint(NSURL *bundleURL) +{ + return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/open-url", getServerHost(bundleURL)]]; +} @implementation RCTInspectorDevServerHelper RCT_NOT_IMPLEMENTED(-(instancetype)init) @@ -62,6 +66,27 @@ static void sendEventToAllConnections(NSString *event) } } ++ (void)openURL:(NSString *)url withBundleURL:(NSURL *)bundleURL withErrorMessage:(NSString *)errorMessage +{ + NSURL *endpoint = getOpenUrlEndpoint(bundleURL); + + NSDictionary *jsonBodyDict = @{@"url" : url}; + NSData *jsonBodyData = [NSJSONSerialization dataWithJSONObject:jsonBodyDict options:kNilOptions error:nil]; + + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:endpoint]; + [request setHTTPMethod:@"POST"]; + [request setHTTPBody:jsonBodyData]; + + [[[NSURLSession sharedSession] + dataTaskWithRequest:request + completionHandler:^( + __unused NSData *_Nullable data, __unused NSURLResponse *_Nullable response, NSError *_Nullable error) { + if (error != nullptr) { + RCTLogWarn(@"%@", errorMessage); + } + }] resume]; +} + + (void)disableDebugger { sendEventToAllConnections(kDebuggerMsgDisable); From 33b3a1a1453ca51690e59b758eeb61a4fa8f35bc Mon Sep 17 00:00:00 2001 From: jeswinsimon Date: Wed, 15 Apr 2020 22:33:25 -0700 Subject: [PATCH 029/235] Changed iOS LaunchScreen from xib to storyboard (#28239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a --- RNTester/Podfile.lock | 2 +- RNTester/RNTester/Base.lproj/LaunchScreen.xib | 46 --------------- RNTester/RNTester/LaunchScreen.storyboard | 58 +++++++++++++++++++ .../RNTesterPods.xcodeproj/project.pbxproj | 22 ++----- .../ios/HelloWorld.xcodeproj/project.pbxproj | 20 ++----- .../HelloWorld/Base.lproj/LaunchScreen.xib | 42 -------------- .../ios/HelloWorld/LaunchScreen.storyboard | 58 +++++++++++++++++++ 7 files changed, 126 insertions(+), 122 deletions(-) delete mode 100644 RNTester/RNTester/Base.lproj/LaunchScreen.xib create mode 100644 RNTester/RNTester/LaunchScreen.storyboard delete mode 100644 template/ios/HelloWorld/Base.lproj/LaunchScreen.xib create mode 100644 template/ios/HelloWorld/LaunchScreen.storyboard diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 4701a6f519d245..6f28a766139286 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -512,4 +512,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d -COCOAPODS: 1.9.1 +COCOAPODS: 1.8.4 diff --git a/RNTester/RNTester/Base.lproj/LaunchScreen.xib b/RNTester/RNTester/Base.lproj/LaunchScreen.xib deleted file mode 100644 index f7722dde9ba78c..00000000000000 --- a/RNTester/RNTester/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RNTester/RNTester/LaunchScreen.storyboard b/RNTester/RNTester/LaunchScreen.storyboard new file mode 100644 index 00000000000000..373f89ee18c77e --- /dev/null +++ b/RNTester/RNTester/LaunchScreen.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index b79cc14cfa0810..c29e9d2ec0f6a3 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -3,11 +3,10 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; }; 27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; @@ -18,6 +17,7 @@ 5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; }; 6766440649168A1FAD1DB4A4 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */; }; 6ABAB5205C9B8E0726E12033 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */; }; + 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; }; 85C7978AB28C149170A56955 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */; }; E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; }; E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; }; @@ -73,7 +73,6 @@ 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNTester/main.m; sourceTree = ""; }; 272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = ""; }; @@ -90,6 +89,7 @@ 5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = ""; }; 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7D51F73F0DA20287418D98BD /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; + 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = ""; }; 972A459EE6CF8CC63531A088 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = ""; }; 98233960D1D6A1977D1C7EAF /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = ""; }; B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -219,7 +219,7 @@ 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */, 13B07FB71A68108700A75B9A /* main.m */, 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */, 680759612239798500290469 /* Fabric */, 272E6B3A1BEA846C001FCF37 /* NativeExampleViews */, 1323F18D1C04ABAC0091BED0 /* Supporting Files */, @@ -492,8 +492,8 @@ buildActionMask = 2147483647; files = ( 2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */, + 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */, 3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -730,18 +730,6 @@ }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - path = RNTester; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; diff --git a/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/ios/HelloWorld.xcodeproj/project.pbxproj index 7416f98214a3e6..fe51ccff2c9f52 100644 --- a/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -9,13 +9,13 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -43,12 +43,12 @@ 13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = HelloWorld/AppDelegate.m; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloWorld-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HelloWorld-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ @@ -110,7 +110,7 @@ 13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 13B07FB71A68108700A75B9A /* main.m */, ); name = HelloWorld; @@ -293,8 +293,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -434,18 +434,6 @@ }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - path = HelloWorld; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; diff --git a/template/ios/HelloWorld/Base.lproj/LaunchScreen.xib b/template/ios/HelloWorld/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 0b83e7b2ddb38b..00000000000000 --- a/template/ios/HelloWorld/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/ios/HelloWorld/LaunchScreen.storyboard b/template/ios/HelloWorld/LaunchScreen.storyboard new file mode 100644 index 00000000000000..0d0edbb9640b43 --- /dev/null +++ b/template/ios/HelloWorld/LaunchScreen.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 25ed045e36f0085f6609b69e5dedece9725c7fb2 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 15 Apr 2020 23:54:58 -0700 Subject: [PATCH 030/235] Switch over to JavaTurboModule::InitParams Summary: ## Problem Every time we want to add, remove, or change the data passed to JavaTurboModule's constructor, we have to modify the C++ TurboModule codegen. (The same is true of `ObjCTurboModule`). **Why was this necessary?** - `JavaTurboModule` is effectively an abstract class whose constructor is always invoked by code-generated C++ classes. These C++ code-generated class constructors accept an argument list, and manually foward each and every item in that list to `JavaTurboModule::JavaTurboModule`. ## The fix In this diff, I introduce a struct `JavaTurboModule::InitParams`, to represent a bag of arguments: ``` class JSI_EXPORT JavaTurboModule : public TurboModule { public: struct InitParams { std::string moduleName; jni::alias_ref instance; std::shared_ptr jsInvoker; std::shared_ptr nativeInvoker; }; ``` All `JavaTurboModules` will be created with an instance of this `InitParams` struct, instead of a list of arguments. Our code-generated C++ `jsi::HostObject` sublcasses will simply accept `InitParams` in their constructor, and forward it to `JavaTurboModule`'s constructor. This way, the codegen remains oblivious to what arguments JavaTurboModule requires. ## Okay, but why do we need this change now? In the future, I plan to modify the constructor for `JavaTurboModule` to accept a performance logger, and a `RuntimeExecutor`. Similar modifications are planned for ObjC. For this reason, to avoid these four codemods, and any potential other codemods that occur because we're making modifications to `JavaTurboModule` or `ObjCTurboModule`, I'm launching this codemod, and the codemods in this stack. ## Misc Fix - Previously, we were generating the TurboModule name from the Spec filename. This is incorrect because that name represents the spec name. Now, the name will be forwarded from TurboModuleManager in the `JavaTurboModule::InitParams` struct. ## Alternative implementations I initially considered using `ContextContainer`, but decided against it because: 1. There are no type-safety guarantees. 2. I think it's a bit overkill for this scenario. We just need an opaque bag of data, and for our purposes a simple struct does the job fine. ## Commands run Reviewed By: fkgozali Differential Revision: D21035208 fbshipit-source-id: 9542cafea192081bc34d337ab3a7a783083eb06c --- .../specs/jni/FBReactNativeSpec-generated.cpp | 232 +++++++++--------- .../fbreact/specs/jni/FBReactNativeSpec.h | 116 ++++----- .../jni/ReactCommon/TurboModuleManager.cpp | 8 +- .../ReactCommon/TurboModuleManagerDelegate.h | 10 +- .../core/platform/android/JavaTurboModule.cpp | 13 +- .../core/platform/android/JavaTurboModule.h | 14 +- 6 files changed, 197 insertions(+), 196 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp index b90658b8dfa3c0..243de2d8bd6d78 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec-generated.cpp @@ -35,8 +35,8 @@ namespace facebook { } - NativeAccessibilityInfoSpecJSI::NativeAccessibilityInfoSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AccessibilityInfo", instance, jsInvoker, nativeInvoker) { + NativeAccessibilityInfoSpecJSI::NativeAccessibilityInfoSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_isReduceMotionEnabled}; @@ -96,8 +96,8 @@ namespace facebook { } - NativeAccessibilityManagerSpecJSI::NativeAccessibilityManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AccessibilityManager", instance, jsInvoker, nativeInvoker) { + NativeAccessibilityManagerSpecJSI::NativeAccessibilityManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentBoldTextState}; @@ -144,8 +144,8 @@ namespace facebook { } - NativeActionSheetManagerSpecJSI::NativeActionSheetManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ActionSheetManager", instance, jsInvoker, nativeInvoker) { + NativeActionSheetManagerSpecJSI::NativeActionSheetManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerSpecJSI_showActionSheetWithOptions}; @@ -167,8 +167,8 @@ namespace facebook { } - NativeAlertManagerSpecJSI::NativeAlertManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AlertManager", instance, jsInvoker, nativeInvoker) { + NativeAlertManagerSpecJSI::NativeAlertManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerSpecJSI_alertWithArgs}; @@ -259,8 +259,8 @@ namespace facebook { } - NativeAnimatedModuleSpecJSI::NativeAnimatedModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AnimatedModule", instance, jsInvoker, nativeInvoker) { + NativeAnimatedModuleSpecJSI::NativeAnimatedModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_createAnimatedNode}; @@ -337,8 +337,8 @@ namespace facebook { } - NativeAnimationsDebugModuleSpecJSI::NativeAnimationsDebugModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AnimationsDebugModule", instance, jsInvoker, nativeInvoker) { + NativeAnimationsDebugModuleSpecJSI::NativeAnimationsDebugModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["startRecordingFps"] = MethodMetadata {0, __hostFunction_NativeAnimationsDebugModuleSpecJSI_startRecordingFps}; @@ -372,8 +372,8 @@ namespace facebook { } - NativeAppStateSpecJSI::NativeAppStateSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AppState", instance, jsInvoker, nativeInvoker) { + NativeAppStateSpecJSI::NativeAppStateSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateSpecJSI_getCurrentAppState}; @@ -409,8 +409,8 @@ namespace facebook { } - NativeAppearanceSpecJSI::NativeAppearanceSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("Appearance", instance, jsInvoker, nativeInvoker) { + NativeAppearanceSpecJSI::NativeAppearanceSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceSpecJSI_getColorScheme}; @@ -455,8 +455,8 @@ namespace facebook { } - NativeAsyncStorageSpecJSI::NativeAsyncStorageSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("AsyncStorage", instance, jsInvoker, nativeInvoker) { + NativeAsyncStorageSpecJSI::NativeAsyncStorageSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["multiGet"] = MethodMetadata {2, __hostFunction_NativeAsyncStorageSpecJSI_multiGet}; @@ -514,8 +514,8 @@ namespace facebook { } - NativeBlobModuleSpecJSI::NativeBlobModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("BlobModule", instance, jsInvoker, nativeInvoker) { + NativeBlobModuleSpecJSI::NativeBlobModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleSpecJSI_addNetworkingHandler}; @@ -560,8 +560,8 @@ namespace facebook { } - NativeBugReportingSpecJSI::NativeBugReportingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("BugReporting", instance, jsInvoker, nativeInvoker) { + NativeBugReportingSpecJSI::NativeBugReportingSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["startReportAProblemFlow"] = MethodMetadata {0, __hostFunction_NativeBugReportingSpecJSI_startReportAProblemFlow}; @@ -594,8 +594,8 @@ namespace facebook { } - NativeCameraRollManagerSpecJSI::NativeCameraRollManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("CameraRollManager", instance, jsInvoker, nativeInvoker) { + NativeCameraRollManagerSpecJSI::NativeCameraRollManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getPhotos"] = MethodMetadata {1, __hostFunction_NativeCameraRollManagerSpecJSI_getPhotos}; @@ -624,8 +624,8 @@ namespace facebook { } - NativeClipboardSpecJSI::NativeClipboardSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("Clipboard", instance, jsInvoker, nativeInvoker) { + NativeClipboardSpecJSI::NativeClipboardSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardSpecJSI_getString}; @@ -647,8 +647,8 @@ namespace facebook { } - NativeDatePickerAndroidSpecJSI::NativeDatePickerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DatePickerAndroid", instance, jsInvoker, nativeInvoker) { + NativeDatePickerAndroidSpecJSI::NativeDatePickerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["open"] = MethodMetadata {1, __hostFunction_NativeDatePickerAndroidSpecJSI_open}; @@ -671,8 +671,8 @@ namespace facebook { } - NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DevLoadingView", instance, jsInvoker, nativeInvoker) { + NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewSpecJSI_showMessage}; @@ -710,8 +710,8 @@ namespace facebook { } - NativeDevMenuSpecJSI::NativeDevMenuSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DevMenu", instance, jsInvoker, nativeInvoker) { + NativeDevMenuSpecJSI::NativeDevMenuSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuSpecJSI_show}; @@ -782,8 +782,8 @@ namespace facebook { } - NativeDevSettingsSpecJSI::NativeDevSettingsSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DevSettings", instance, jsInvoker, nativeInvoker) { + NativeDevSettingsSpecJSI::NativeDevSettingsSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsSpecJSI_reload}; @@ -832,8 +832,8 @@ namespace facebook { } - NativeDeviceEventManagerSpecJSI::NativeDeviceEventManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DeviceEventManager", instance, jsInvoker, nativeInvoker) { + NativeDeviceEventManagerSpecJSI::NativeDeviceEventManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerSpecJSI_invokeDefaultBackPressHandler}; @@ -852,8 +852,8 @@ namespace facebook { } - NativeDeviceInfoSpecJSI::NativeDeviceInfoSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DeviceInfo", instance, jsInvoker, nativeInvoker) { + NativeDeviceInfoSpecJSI::NativeDeviceInfoSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoSpecJSI_getConstants}; @@ -876,8 +876,8 @@ namespace facebook { } - NativeDialogManagerAndroidSpecJSI::NativeDialogManagerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("DialogManagerAndroid", instance, jsInvoker, nativeInvoker) { + NativeDialogManagerAndroidSpecJSI::NativeDialogManagerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerAndroidSpecJSI_showAlert}; @@ -915,8 +915,8 @@ namespace facebook { } - NativeExceptionsManagerSpecJSI::NativeExceptionsManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ExceptionsManager", instance, jsInvoker, nativeInvoker) { + NativeExceptionsManagerSpecJSI::NativeExceptionsManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerSpecJSI_reportFatalException}; @@ -951,8 +951,8 @@ namespace facebook { } - NativeFileReaderModuleSpecJSI::NativeFileReaderModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("FileReaderModule", instance, jsInvoker, nativeInvoker) { + NativeFileReaderModuleSpecJSI::NativeFileReaderModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleSpecJSI_readAsDataURL}; @@ -986,8 +986,8 @@ namespace facebook { } - NativeFrameRateLoggerSpecJSI::NativeFrameRateLoggerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("FrameRateLogger", instance, jsInvoker, nativeInvoker) { + NativeFrameRateLoggerSpecJSI::NativeFrameRateLoggerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerSpecJSI_setGlobalOptions}; @@ -1019,8 +1019,8 @@ namespace facebook { } - NativeHeadlessJsTaskSupportSpecJSI::NativeHeadlessJsTaskSupportSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("HeadlessJsTaskSupport", instance, jsInvoker, nativeInvoker) { + NativeHeadlessJsTaskSupportSpecJSI::NativeHeadlessJsTaskSupportSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskFinished}; @@ -1054,8 +1054,8 @@ namespace facebook { } - NativeI18nManagerSpecJSI::NativeI18nManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("I18nManager", instance, jsInvoker, nativeInvoker) { + NativeI18nManagerSpecJSI::NativeI18nManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerSpecJSI_allowRTL}; @@ -1083,8 +1083,8 @@ namespace facebook { } - NativeImageEditorSpecJSI::NativeImageEditorSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ImageEditor", instance, jsInvoker, nativeInvoker) { + NativeImageEditorSpecJSI::NativeImageEditorSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorSpecJSI_cropImage}; @@ -1119,8 +1119,8 @@ namespace facebook { } - NativeImageLoaderAndroidSpecJSI::NativeImageLoaderAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ImageLoaderAndroid", instance, jsInvoker, nativeInvoker) { + NativeImageLoaderAndroidSpecJSI::NativeImageLoaderAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidSpecJSI_abortRequest}; @@ -1163,8 +1163,8 @@ namespace facebook { } - NativeImageLoaderIOSSpecJSI::NativeImageLoaderIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ImageLoaderIOS", instance, jsInvoker, nativeInvoker) { + NativeImageLoaderIOSSpecJSI::NativeImageLoaderIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSSpecJSI_getSize}; @@ -1212,8 +1212,8 @@ namespace facebook { } - NativeImagePickerIOSSpecJSI::NativeImagePickerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ImagePickerIOS", instance, jsInvoker, nativeInvoker) { + NativeImagePickerIOSSpecJSI::NativeImagePickerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["canRecordVideos"] = MethodMetadata {1, __hostFunction_NativeImagePickerIOSSpecJSI_canRecordVideos}; @@ -1259,8 +1259,8 @@ namespace facebook { } - NativeImageStoreSpecJSI::NativeImageStoreSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ImageStore", instance, jsInvoker, nativeInvoker) { + NativeImageStoreSpecJSI::NativeImageStoreSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreSpecJSI_getBase64ForTag}; @@ -1288,8 +1288,8 @@ namespace facebook { } - NativeJSCHeapCaptureSpecJSI::NativeJSCHeapCaptureSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("JSCHeapCapture", instance, jsInvoker, nativeInvoker) { + NativeJSCHeapCaptureSpecJSI::NativeJSCHeapCaptureSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureSpecJSI_captureComplete}; @@ -1308,8 +1308,8 @@ namespace facebook { } - NativeJSCSamplingProfilerSpecJSI::NativeJSCSamplingProfilerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("JSCSamplingProfiler", instance, jsInvoker, nativeInvoker) { + NativeJSCSamplingProfilerSpecJSI::NativeJSCSamplingProfilerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["operationComplete"] = MethodMetadata {3, __hostFunction_NativeJSCSamplingProfilerSpecJSI_operationComplete}; @@ -1336,8 +1336,8 @@ namespace facebook { } - NativeJSDevSupportSpecJSI::NativeJSDevSupportSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("JSDevSupport", instance, jsInvoker, nativeInvoker) { + NativeJSDevSupportSpecJSI::NativeJSDevSupportSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["onSuccess"] = MethodMetadata {1, __hostFunction_NativeJSDevSupportSpecJSI_onSuccess}; @@ -1366,8 +1366,8 @@ namespace facebook { } - NativeKeyboardObserverSpecJSI::NativeKeyboardObserverSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("KeyboardObserver", instance, jsInvoker, nativeInvoker) { + NativeKeyboardObserverSpecJSI::NativeKeyboardObserverSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverSpecJSI_addListener}; @@ -1413,8 +1413,8 @@ namespace facebook { } - NativeLinkingSpecJSI::NativeLinkingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("Linking", instance, jsInvoker, nativeInvoker) { + NativeLinkingSpecJSI::NativeLinkingSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingSpecJSI_getInitialURL}; @@ -1455,8 +1455,8 @@ namespace facebook { } - NativeLogBoxSpecJSI::NativeLogBoxSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("LogBox", instance, jsInvoker, nativeInvoker) { + NativeLogBoxSpecJSI::NativeLogBoxSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxSpecJSI_show}; @@ -1482,8 +1482,8 @@ namespace facebook { } - NativeModalManagerSpecJSI::NativeModalManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ModalManager", instance, jsInvoker, nativeInvoker) { + NativeModalManagerSpecJSI::NativeModalManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerSpecJSI_addListener}; @@ -1521,8 +1521,8 @@ namespace facebook { } - NativeNetworkingAndroidSpecJSI::NativeNetworkingAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("NetworkingAndroid", instance, jsInvoker, nativeInvoker) { + NativeNetworkingAndroidSpecJSI::NativeNetworkingAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["sendRequest"] = MethodMetadata {9, __hostFunction_NativeNetworkingAndroidSpecJSI_sendRequest}; @@ -1569,8 +1569,8 @@ namespace facebook { } - NativeNetworkingIOSSpecJSI::NativeNetworkingIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("NetworkingIOS", instance, jsInvoker, nativeInvoker) { + NativeNetworkingIOSSpecJSI::NativeNetworkingIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSSpecJSI_sendRequest}; @@ -1613,8 +1613,8 @@ namespace facebook { } - NativePermissionsAndroidSpecJSI::NativePermissionsAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("PermissionsAndroid", instance, jsInvoker, nativeInvoker) { + NativePermissionsAndroidSpecJSI::NativePermissionsAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["checkPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidSpecJSI_checkPermission}; @@ -1646,8 +1646,8 @@ namespace facebook { } - NativePlatformConstantsAndroidSpecJSI::NativePlatformConstantsAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("PlatformConstantsAndroid", instance, jsInvoker, nativeInvoker) { + NativePlatformConstantsAndroidSpecJSI::NativePlatformConstantsAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getAndroidID"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidSpecJSI_getAndroidID}; @@ -1669,8 +1669,8 @@ namespace facebook { } - NativePlatformConstantsIOSSpecJSI::NativePlatformConstantsIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("PlatformConstantsIOS", instance, jsInvoker, nativeInvoker) { + NativePlatformConstantsIOSSpecJSI::NativePlatformConstantsIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSSpecJSI_getConstants}; @@ -1753,8 +1753,8 @@ namespace facebook { } - NativePushNotificationManagerIOSSpecJSI::NativePushNotificationManagerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("PushNotificationManagerIOS", instance, jsInvoker, nativeInvoker) { + NativePushNotificationManagerIOSSpecJSI::NativePushNotificationManagerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSSpecJSI_onFinishRemoteNotification}; @@ -1825,8 +1825,8 @@ namespace facebook { } - NativeRedBoxSpecJSI::NativeRedBoxSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("RedBox", instance, jsInvoker, nativeInvoker) { + NativeRedBoxSpecJSI::NativeRedBoxSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxSpecJSI_setExtraData}; @@ -1852,8 +1852,8 @@ namespace facebook { } - NativeSegmentFetcherSpecJSI::NativeSegmentFetcherSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("SegmentFetcher", instance, jsInvoker, nativeInvoker) { + NativeSegmentFetcherSpecJSI::NativeSegmentFetcherSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherSpecJSI_fetchSegment}; @@ -1883,8 +1883,8 @@ namespace facebook { } - NativeSettingsManagerSpecJSI::NativeSettingsManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("SettingsManager", instance, jsInvoker, nativeInvoker) { + NativeSettingsManagerSpecJSI::NativeSettingsManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerSpecJSI_setValues}; @@ -1909,8 +1909,8 @@ namespace facebook { } - NativeShareModuleSpecJSI::NativeShareModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ShareModule", instance, jsInvoker, nativeInvoker) { + NativeShareModuleSpecJSI::NativeShareModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleSpecJSI_share}; @@ -1929,8 +1929,8 @@ namespace facebook { } - NativeSoundManagerSpecJSI::NativeSoundManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("SoundManager", instance, jsInvoker, nativeInvoker) { + NativeSoundManagerSpecJSI::NativeSoundManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerSpecJSI_playTouchSound}; @@ -1949,8 +1949,8 @@ namespace facebook { } - NativeSourceCodeSpecJSI::NativeSourceCodeSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("SourceCode", instance, jsInvoker, nativeInvoker) { + NativeSourceCodeSpecJSI::NativeSourceCodeSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeSpecJSI_getConstants}; @@ -1985,8 +1985,8 @@ namespace facebook { } - NativeStatusBarManagerAndroidSpecJSI::NativeStatusBarManagerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("StatusBarManagerAndroid", instance, jsInvoker, nativeInvoker) { + NativeStatusBarManagerAndroidSpecJSI::NativeStatusBarManagerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["setColor"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerAndroidSpecJSI_setColor}; @@ -2041,8 +2041,8 @@ namespace facebook { } - NativeStatusBarManagerIOSSpecJSI::NativeStatusBarManagerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("StatusBarManagerIOS", instance, jsInvoker, nativeInvoker) { + NativeStatusBarManagerIOSSpecJSI::NativeStatusBarManagerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_getHeight}; @@ -2083,8 +2083,8 @@ namespace facebook { } - NativeTVNavigationEventEmitterSpecJSI::NativeTVNavigationEventEmitterSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("TVNavigationEventEmitter", instance, jsInvoker, nativeInvoker) { + NativeTVNavigationEventEmitterSpecJSI::NativeTVNavigationEventEmitterSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_addListener}; @@ -2106,8 +2106,8 @@ namespace facebook { } - NativeTimePickerAndroidSpecJSI::NativeTimePickerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("TimePickerAndroid", instance, jsInvoker, nativeInvoker) { + NativeTimePickerAndroidSpecJSI::NativeTimePickerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["open"] = MethodMetadata {1, __hostFunction_NativeTimePickerAndroidSpecJSI_open}; @@ -2134,8 +2134,8 @@ namespace facebook { } - NativeTimingSpecJSI::NativeTimingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("Timing", instance, jsInvoker, nativeInvoker) { + NativeTimingSpecJSI::NativeTimingSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingSpecJSI_createTimer}; @@ -2172,8 +2172,8 @@ namespace facebook { } - NativeToastAndroidSpecJSI::NativeToastAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("ToastAndroid", instance, jsInvoker, nativeInvoker) { + NativeToastAndroidSpecJSI::NativeToastAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["show"] = MethodMetadata {2, __hostFunction_NativeToastAndroidSpecJSI_show}; @@ -2305,8 +2305,8 @@ namespace facebook { } - NativeUIManagerSpecJSI::NativeUIManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("UIManager", instance, jsInvoker, nativeInvoker) { + NativeUIManagerSpecJSI::NativeUIManagerSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["getConstantsForViewManager"] = MethodMetadata {1, __hostFunction_NativeUIManagerSpecJSI_getConstantsForViewManager}; @@ -2411,8 +2411,8 @@ namespace facebook { } - NativeVibrationSpecJSI::NativeVibrationSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("Vibration", instance, jsInvoker, nativeInvoker) { + NativeVibrationSpecJSI::NativeVibrationSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationSpecJSI_vibrate}; @@ -2461,8 +2461,8 @@ namespace facebook { } - NativeWebSocketModuleSpecJSI::NativeWebSocketModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker) - : JavaTurboModule("WebSocketModule", instance, jsInvoker, nativeInvoker) { + NativeWebSocketModuleSpecJSI::NativeWebSocketModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) + : JavaTurboModule(params) { methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleSpecJSI_connect}; diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec.h b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec.h index 0567b512e61971..569634d5233399 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec.h +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/jni/FBReactNativeSpec.h @@ -25,7 +25,7 @@ namespace facebook { class JSI_EXPORT NativeAccessibilityInfoSpecJSI : public JavaTurboModule { public: - NativeAccessibilityInfoSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAccessibilityInfoSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -39,7 +39,7 @@ namespace facebook { class JSI_EXPORT NativeAccessibilityManagerSpecJSI : public JavaTurboModule { public: - NativeAccessibilityManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAccessibilityManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -53,7 +53,7 @@ namespace facebook { class JSI_EXPORT NativeActionSheetManagerSpecJSI : public JavaTurboModule { public: - NativeActionSheetManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeActionSheetManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -67,7 +67,7 @@ namespace facebook { class JSI_EXPORT NativeAlertManagerSpecJSI : public JavaTurboModule { public: - NativeAlertManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAlertManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -81,7 +81,7 @@ namespace facebook { class JSI_EXPORT NativeAnimatedModuleSpecJSI : public JavaTurboModule { public: - NativeAnimatedModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAnimatedModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -95,7 +95,7 @@ namespace facebook { class JSI_EXPORT NativeAnimationsDebugModuleSpecJSI : public JavaTurboModule { public: - NativeAnimationsDebugModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAnimationsDebugModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -109,7 +109,7 @@ namespace facebook { class JSI_EXPORT NativeAppStateSpecJSI : public JavaTurboModule { public: - NativeAppStateSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAppStateSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -123,7 +123,7 @@ namespace facebook { class JSI_EXPORT NativeAppearanceSpecJSI : public JavaTurboModule { public: - NativeAppearanceSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAppearanceSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -137,7 +137,7 @@ namespace facebook { class JSI_EXPORT NativeAsyncStorageSpecJSI : public JavaTurboModule { public: - NativeAsyncStorageSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeAsyncStorageSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -151,7 +151,7 @@ namespace facebook { class JSI_EXPORT NativeBlobModuleSpecJSI : public JavaTurboModule { public: - NativeBlobModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeBlobModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -165,7 +165,7 @@ namespace facebook { class JSI_EXPORT NativeBugReportingSpecJSI : public JavaTurboModule { public: - NativeBugReportingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeBugReportingSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -179,7 +179,7 @@ namespace facebook { class JSI_EXPORT NativeCameraRollManagerSpecJSI : public JavaTurboModule { public: - NativeCameraRollManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeCameraRollManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -193,7 +193,7 @@ namespace facebook { class JSI_EXPORT NativeClipboardSpecJSI : public JavaTurboModule { public: - NativeClipboardSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeClipboardSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -207,7 +207,7 @@ namespace facebook { class JSI_EXPORT NativeDatePickerAndroidSpecJSI : public JavaTurboModule { public: - NativeDatePickerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDatePickerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -221,7 +221,7 @@ namespace facebook { class JSI_EXPORT NativeDevLoadingViewSpecJSI : public JavaTurboModule { public: - NativeDevLoadingViewSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDevLoadingViewSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -235,7 +235,7 @@ namespace facebook { class JSI_EXPORT NativeDevMenuSpecJSI : public JavaTurboModule { public: - NativeDevMenuSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDevMenuSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -249,7 +249,7 @@ namespace facebook { class JSI_EXPORT NativeDevSettingsSpecJSI : public JavaTurboModule { public: - NativeDevSettingsSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDevSettingsSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -263,7 +263,7 @@ namespace facebook { class JSI_EXPORT NativeDeviceEventManagerSpecJSI : public JavaTurboModule { public: - NativeDeviceEventManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDeviceEventManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -277,7 +277,7 @@ namespace facebook { class JSI_EXPORT NativeDeviceInfoSpecJSI : public JavaTurboModule { public: - NativeDeviceInfoSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDeviceInfoSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -291,7 +291,7 @@ namespace facebook { class JSI_EXPORT NativeDialogManagerAndroidSpecJSI : public JavaTurboModule { public: - NativeDialogManagerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeDialogManagerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -305,7 +305,7 @@ namespace facebook { class JSI_EXPORT NativeExceptionsManagerSpecJSI : public JavaTurboModule { public: - NativeExceptionsManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeExceptionsManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -319,7 +319,7 @@ namespace facebook { class JSI_EXPORT NativeFileReaderModuleSpecJSI : public JavaTurboModule { public: - NativeFileReaderModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeFileReaderModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -333,7 +333,7 @@ namespace facebook { class JSI_EXPORT NativeFrameRateLoggerSpecJSI : public JavaTurboModule { public: - NativeFrameRateLoggerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeFrameRateLoggerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -347,7 +347,7 @@ namespace facebook { class JSI_EXPORT NativeHeadlessJsTaskSupportSpecJSI : public JavaTurboModule { public: - NativeHeadlessJsTaskSupportSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeHeadlessJsTaskSupportSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -361,7 +361,7 @@ namespace facebook { class JSI_EXPORT NativeI18nManagerSpecJSI : public JavaTurboModule { public: - NativeI18nManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeI18nManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -375,7 +375,7 @@ namespace facebook { class JSI_EXPORT NativeImageEditorSpecJSI : public JavaTurboModule { public: - NativeImageEditorSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeImageEditorSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -389,7 +389,7 @@ namespace facebook { class JSI_EXPORT NativeImageLoaderAndroidSpecJSI : public JavaTurboModule { public: - NativeImageLoaderAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeImageLoaderAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -403,7 +403,7 @@ namespace facebook { class JSI_EXPORT NativeImageLoaderIOSSpecJSI : public JavaTurboModule { public: - NativeImageLoaderIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeImageLoaderIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -417,7 +417,7 @@ namespace facebook { class JSI_EXPORT NativeImagePickerIOSSpecJSI : public JavaTurboModule { public: - NativeImagePickerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeImagePickerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -431,7 +431,7 @@ namespace facebook { class JSI_EXPORT NativeImageStoreSpecJSI : public JavaTurboModule { public: - NativeImageStoreSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeImageStoreSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -445,7 +445,7 @@ namespace facebook { class JSI_EXPORT NativeJSCHeapCaptureSpecJSI : public JavaTurboModule { public: - NativeJSCHeapCaptureSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeJSCHeapCaptureSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -459,7 +459,7 @@ namespace facebook { class JSI_EXPORT NativeJSCSamplingProfilerSpecJSI : public JavaTurboModule { public: - NativeJSCSamplingProfilerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeJSCSamplingProfilerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -473,7 +473,7 @@ namespace facebook { class JSI_EXPORT NativeJSDevSupportSpecJSI : public JavaTurboModule { public: - NativeJSDevSupportSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeJSDevSupportSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -487,7 +487,7 @@ namespace facebook { class JSI_EXPORT NativeKeyboardObserverSpecJSI : public JavaTurboModule { public: - NativeKeyboardObserverSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeKeyboardObserverSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -501,7 +501,7 @@ namespace facebook { class JSI_EXPORT NativeLinkingSpecJSI : public JavaTurboModule { public: - NativeLinkingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeLinkingSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -515,7 +515,7 @@ namespace facebook { class JSI_EXPORT NativeLogBoxSpecJSI : public JavaTurboModule { public: - NativeLogBoxSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeLogBoxSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -529,7 +529,7 @@ namespace facebook { class JSI_EXPORT NativeModalManagerSpecJSI : public JavaTurboModule { public: - NativeModalManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeModalManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -543,7 +543,7 @@ namespace facebook { class JSI_EXPORT NativeNetworkingAndroidSpecJSI : public JavaTurboModule { public: - NativeNetworkingAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeNetworkingAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -557,7 +557,7 @@ namespace facebook { class JSI_EXPORT NativeNetworkingIOSSpecJSI : public JavaTurboModule { public: - NativeNetworkingIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeNetworkingIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -571,7 +571,7 @@ namespace facebook { class JSI_EXPORT NativePermissionsAndroidSpecJSI : public JavaTurboModule { public: - NativePermissionsAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativePermissionsAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -585,7 +585,7 @@ namespace facebook { class JSI_EXPORT NativePlatformConstantsAndroidSpecJSI : public JavaTurboModule { public: - NativePlatformConstantsAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativePlatformConstantsAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -599,7 +599,7 @@ namespace facebook { class JSI_EXPORT NativePlatformConstantsIOSSpecJSI : public JavaTurboModule { public: - NativePlatformConstantsIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativePlatformConstantsIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -613,7 +613,7 @@ namespace facebook { class JSI_EXPORT NativePushNotificationManagerIOSSpecJSI : public JavaTurboModule { public: - NativePushNotificationManagerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativePushNotificationManagerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -627,7 +627,7 @@ namespace facebook { class JSI_EXPORT NativeRedBoxSpecJSI : public JavaTurboModule { public: - NativeRedBoxSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeRedBoxSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -641,7 +641,7 @@ namespace facebook { class JSI_EXPORT NativeSegmentFetcherSpecJSI : public JavaTurboModule { public: - NativeSegmentFetcherSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeSegmentFetcherSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -655,7 +655,7 @@ namespace facebook { class JSI_EXPORT NativeSettingsManagerSpecJSI : public JavaTurboModule { public: - NativeSettingsManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeSettingsManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -669,7 +669,7 @@ namespace facebook { class JSI_EXPORT NativeShareModuleSpecJSI : public JavaTurboModule { public: - NativeShareModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeShareModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -683,7 +683,7 @@ namespace facebook { class JSI_EXPORT NativeSoundManagerSpecJSI : public JavaTurboModule { public: - NativeSoundManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeSoundManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -697,7 +697,7 @@ namespace facebook { class JSI_EXPORT NativeSourceCodeSpecJSI : public JavaTurboModule { public: - NativeSourceCodeSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeSourceCodeSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -711,7 +711,7 @@ namespace facebook { class JSI_EXPORT NativeStatusBarManagerAndroidSpecJSI : public JavaTurboModule { public: - NativeStatusBarManagerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeStatusBarManagerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -725,7 +725,7 @@ namespace facebook { class JSI_EXPORT NativeStatusBarManagerIOSSpecJSI : public JavaTurboModule { public: - NativeStatusBarManagerIOSSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeStatusBarManagerIOSSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -739,7 +739,7 @@ namespace facebook { class JSI_EXPORT NativeTVNavigationEventEmitterSpecJSI : public JavaTurboModule { public: - NativeTVNavigationEventEmitterSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeTVNavigationEventEmitterSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -753,7 +753,7 @@ namespace facebook { class JSI_EXPORT NativeTimePickerAndroidSpecJSI : public JavaTurboModule { public: - NativeTimePickerAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeTimePickerAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -767,7 +767,7 @@ namespace facebook { class JSI_EXPORT NativeTimingSpecJSI : public JavaTurboModule { public: - NativeTimingSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeTimingSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -781,7 +781,7 @@ namespace facebook { class JSI_EXPORT NativeToastAndroidSpecJSI : public JavaTurboModule { public: - NativeToastAndroidSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeToastAndroidSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -795,7 +795,7 @@ namespace facebook { class JSI_EXPORT NativeUIManagerSpecJSI : public JavaTurboModule { public: - NativeUIManagerSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeUIManagerSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -809,7 +809,7 @@ namespace facebook { class JSI_EXPORT NativeVibrationSpecJSI : public JavaTurboModule { public: - NativeVibrationSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeVibrationSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react @@ -823,7 +823,7 @@ namespace facebook { class JSI_EXPORT NativeWebSocketModuleSpecJSI : public JavaTurboModule { public: - NativeWebSocketModuleSpecJSI(jni::alias_ref instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker); + NativeWebSocketModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); }; } // namespace react diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.cpp b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.cpp index 9d1cb27475bb81..ac3a74c20660c9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.cpp @@ -112,8 +112,12 @@ void TurboModuleManager::installJSIBindings() { auto moduleInstance = getJavaModule(javaPart.get(), name); if (moduleInstance) { - auto turboModule = delegate->cthis()->getTurboModule( - name, moduleInstance, jsCallInvoker, nativeCallInvoker); + JavaTurboModule::InitParams params = {.moduleName = name, + .instance = moduleInstance, + .jsInvoker = jsCallInvoker, + .nativeInvoker = nativeCallInvoker}; + + auto turboModule = delegate->cthis()->getTurboModule(name, params); turboModuleCache->insert({name, turboModule}); return turboModule; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h index 8fd63d66682667..d98cb39013023e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h @@ -23,13 +23,11 @@ class TurboModuleManagerDelegate "Lcom/facebook/react/turbomodule/core/TurboModuleManagerDelegate;"; virtual std::shared_ptr getTurboModule( - std::string name, - jni::alias_ref turboModule, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker) = 0; + const std::string name, + const JavaTurboModule::InitParams ¶ms) = 0; virtual std::shared_ptr getTurboModule( - std::string name, - std::shared_ptr jsInvoker) = 0; + const std::string name, + const std::shared_ptr jsInvoker) = 0; private: friend HybridBase; diff --git a/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.cpp b/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.cpp index 09504b879f471c..e79158ee7ccd2d 100644 --- a/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.cpp +++ b/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.cpp @@ -23,17 +23,12 @@ namespace facebook { namespace react { -JavaTurboModule::JavaTurboModule( - const std::string &name, - jni::alias_ref instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker) - : TurboModule(name, jsInvoker), - instance_(jni::make_global(instance)), - nativeInvoker_(nativeInvoker) {} +JavaTurboModule::JavaTurboModule(const InitParams ¶ms) + : TurboModule(params.moduleName, params.jsInvoker), + instance_(jni::make_global(params.instance)), + nativeInvoker_(params.nativeInvoker) {} namespace { - jni::local_ref createJavaCallbackFromJSIFunction( jsi::Function &&function, jsi::Runtime &rt, diff --git a/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.h b/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.h index 87cbc1603f448d..3a903e49558b76 100644 --- a/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.h +++ b/ReactCommon/turbomodule/core/platform/android/JavaTurboModule.h @@ -32,11 +32,15 @@ struct JTurboModule : jni::JavaClass { class JSI_EXPORT JavaTurboModule : public TurboModule { public: - JavaTurboModule( - const std::string &name, - jni::alias_ref instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker); + // TODO(T65603471): Should we unify this with a Fabric abstraction? + struct InitParams { + std::string moduleName; + jni::alias_ref instance; + std::shared_ptr jsInvoker; + std::shared_ptr nativeInvoker; + }; + + JavaTurboModule(const InitParams ¶ms); jsi::Value invokeJavaMethod( jsi::Runtime &runtime, TurboModuleMethodValueKind valueKind, From dda7f82261cc5684564e2c67071c13e379985308 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 16 Apr 2020 01:30:48 -0700 Subject: [PATCH 031/235] RN: Shrinkwrap Text Layout (Android) Summary: When text is in a constrained parent view using `maxWidth`, long text may wrap. When the text wraps, the final width is dependent on the word breaking strategy and text content. This means that the text width is not necessarily `maxWidth`. However, the current way that we compute text layout does not shrinkwrap the text width as much as possible. This leads to visual gaps to the end-side of wrapped text. This changes the text layout slightly so that we use the length of the longest line. This bug only exists on Android. After this change, Android behaves like iOS. Changelog: [Android] [Fixed] - Fixed excessive space in Text view with word-wrapping Reviewed By: JoshuaGross, mdvacca Differential Revision: D21056031 fbshipit-source-id: e9b7793f2632caafcce69bc15bac61330b0ed958 --- .../react/views/text/ReactTextShadowNode.java | 20 ++++++++++++----- .../react/views/text/TextLayoutManager.java | 22 ++++++++++++------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 2a3a5b604dd8ee..b9fc8e75a255c4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -122,12 +122,22 @@ public long measure( } } - if (mNumberOfLines != UNSET && mNumberOfLines < layout.getLineCount()) { - return YogaMeasureOutput.make( - layout.getWidth(), layout.getLineBottom(mNumberOfLines - 1)); - } else { - return YogaMeasureOutput.make(layout.getWidth(), layout.getHeight()); + final int lineCount = + mNumberOfLines == UNSET + ? layout.getLineCount() + : Math.min(mNumberOfLines, layout.getLineCount()); + + // Instead of using `layout.getWidth()` (which may yield a significantly larger width for + // text that is wrapping), compute width using the longest line. + float layoutWidth = 0; + for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { + float lineWidth = layout.getLineWidth(lineIndex); + if (lineWidth > layoutWidth) { + layoutWidth = lineWidth; + } } + + return YogaMeasureOutput.make(layoutWidth, layout.getLineBottom(lineCount - 1)); } }; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 93aaf3d4866466..d2a68fd45507d8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -294,14 +294,20 @@ public static long measureText( ? paragraphAttributes.getInt("maximumNumberOfLines") : UNSET; - int calculatedWidth = layout.getWidth(); - int calculatedHeight; - if (maximumNumberOfLines != UNSET - && maximumNumberOfLines != 0 - && maximumNumberOfLines < layout.getLineCount()) { - calculatedHeight = layout.getLineBottom(maximumNumberOfLines - 1); - } else { - calculatedHeight = layout.getHeight(); + int calculatedLineCount = + maximumNumberOfLines == UNSET || maximumNumberOfLines == 0 + ? layout.getLineCount() + : Math.min(maximumNumberOfLines, layout.getLineCount()); + + int calculatedHeight = layout.getLineBottom(calculatedLineCount - 1); + // Instead of using `layout.getWidth()` (which may yield a significantly larger width for + // text that is wrapping), compute width using the longest line. + int calculatedWidth = 0; + for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { + float lineWidth = layout.getLineWidth(lineIndex); + if (lineWidth > calculatedWidth) { + calculatedWidth = (int) Math.ceil(lineWidth); + } } // Calculate the positions of the attachments (views) that will be rendered inside the Spanned From b2d10bc60272fc2318835ff38655a9eb4a2bbed0 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Thu, 16 Apr 2020 01:44:37 -0700 Subject: [PATCH 032/235] (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## Changelog [General] [Changed] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 --- .../eslint-config-react-native-community/package.json | 4 ++-- packages/eslint-config-react-native-community/yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/eslint-config-react-native-community/package.json b/packages/eslint-config-react-native-community/package.json index 5a43302d4500ff..d5b24facb9bcd9 100644 --- a/packages/eslint-config-react-native-community/package.json +++ b/packages/eslint-config-react-native-community/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-community/eslint-config", - "version": "1.0.0", + "version": "1.1.0", "description": "ESLint config for React Native", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://github.com/facebook/react-native/tree/master/packages/eslint-config-react-native-community#readme", "dependencies": { - "@react-native-community/eslint-plugin": "^1.0.0", + "@react-native-community/eslint-plugin": "^1.1.0", "@typescript-eslint/eslint-plugin": "^2.25.0", "@typescript-eslint/parser": "^2.25.0", "babel-eslint": "10.1.0", diff --git a/packages/eslint-config-react-native-community/yarn.lock b/packages/eslint-config-react-native-community/yarn.lock index 25ac198e6604a7..f20d678ab34220 100644 --- a/packages/eslint-config-react-native-community/yarn.lock +++ b/packages/eslint-config-react-native-community/yarn.lock @@ -118,10 +118,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@react-native-community/eslint-plugin@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@react-native-community/eslint-plugin/-/eslint-plugin-1.0.0.tgz#ae9a430f2c5795debca491f15a989fce86ea75a0" - integrity sha512-GLhSN8dRt4lpixPQh+8prSCy6PYk/MT/mvji/ojAd5yshowDo6HFsimCSTD/uWAdjpUq91XK9tVdTNWfGRlKQA== +"@react-native-community/eslint-plugin@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@react-native-community/eslint-plugin/-/eslint-plugin-1.1.0.tgz#e42b1bef12d2415411519fd528e64b593b1363dc" + integrity sha512-W/J0fNYVO01tioHjvYWQ9m6RgndVtbElzYozBq1ZPrHO/iCzlqoySHl4gO/fpCl9QEFjvJfjPgtPMTMlsoq5DQ== "@types/color-name@^1.1.1": version "1.1.1" From ddc33007ad0b4a0a24966b833e797227b9c56cca Mon Sep 17 00:00:00 2001 From: grabbou Date: Thu, 16 Apr 2020 02:54:06 -0700 Subject: [PATCH 033/235] chore: update CLI to the latest version (#28623) Summary: Bumps CLI to the latest version, needed by https://github.com/facebook/react-native/pull/28572 to work. ## Changelog [INTERNAL] - Bump CLI to latest Pull Request resolved: https://github.com/facebook/react-native/pull/28623 Reviewed By: hramos Differential Revision: D21017766 Pulled By: cpojer fbshipit-source-id: 62a873923c58f8752edb0394db7e6dfceed92485 --- package.json | 6 ++-- yarn.lock | 92 ++++++++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index cd3f2d68d73b95..6236e103e4fecd 100644 --- a/package.json +++ b/package.json @@ -86,9 +86,9 @@ }, "dependencies": { "@babel/runtime": "^7.0.0", - "@react-native-community/cli": "^4.2.4", - "@react-native-community/cli-platform-android": "^4.2.3", - "@react-native-community/cli-platform-ios": "^4.2.3", + "@react-native-community/cli": "^4.7.0", + "@react-native-community/cli-platform-android": "^4.7.0", + "@react-native-community/cli-platform-ios": "^4.7.0", "abort-controller": "^3.0.0", "anser": "^1.4.9", "base64-js": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index ad39f7378ee86a..d92ad8100a17bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1174,29 +1174,29 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^25.1.0": - version "25.1.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395" - integrity sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA== +"@jest/types@^25.3.0": + version "25.3.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.3.0.tgz#88f94b277a1d028fd7117bc1f74451e0fc2131e7" + integrity sha512-UkaDNewdqXAmCDbN2GlUM6amDKS78eCqiw/UmF5nE0mmLTd6moJkiZJML/X52Ke3LH7Swhw883IRXq8o9nWjVw== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^15.0.0" chalk "^3.0.0" -"@react-native-community/cli-debugger-ui@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.2.1.tgz#da22aa1cf8d04fe1aa2759873916473e81c4450b" - integrity sha512-/lvb39Pgo7bM9rsJ2aMomM7jCGWRpnO2iLECJz1ehC49Fblbosh3qtTsg9WWEVTHoY/34GhaQ7EzQxdSfH8pwg== +"@react-native-community/cli-debugger-ui@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.7.0.tgz#4a8689f56b99378b24bbbf0ff6a89869d667f013" + integrity sha512-Z/xJ08Wz3J2fKDPrwxtQ44XSHnWsF6dnT0H2AANw63bWjnrR0E3sh8Nk8/oO+j9R7LH8S0+NHJdlniXYtL/bNg== dependencies: serve-static "^1.13.1" -"@react-native-community/cli-platform-android@^4.2.3": - version "4.2.3" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-4.2.3.tgz#4d32a856c43575b1dbbce9a4b7a580846fb37431" - integrity sha512-pVHG7+69B/PtnL0h//0MYevxXxDpBNbzyoHn2gOrMVCZVIf20FQTQk4SmLGVblwZZ9U/f5FN3C56WQUtisldRQ== +"@react-native-community/cli-platform-android@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-4.7.0.tgz#aace6b8004b8d3aae40d6affaad1c472e0310a25" + integrity sha512-Lb6D0ipmFwYLJeQy5/NI4uJpeSHw85rd84C40wwpoUfsCgZhA93WUJdFkuQEIDkfTqs5Yqgl+/szhIZdnIXPxw== dependencies: - "@react-native-community/cli-tools" "^4.2.2" + "@react-native-community/cli-tools" "^4.7.0" chalk "^3.0.0" execa "^1.0.0" fs-extra "^8.1.0" @@ -1207,12 +1207,12 @@ slash "^3.0.0" xmldoc "^1.1.2" -"@react-native-community/cli-platform-ios@^4.2.3": - version "4.2.3" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-4.2.3.tgz#f9f07930c964ffe4ca8224f3c36f6a54e39d6a49" - integrity sha512-tdtvJYkNwgCfYBiT8AXwyo/ODc5Ybx19aKGbkB4X6Xn9ORNnXyHWSwy224qW5WK6b0kkmlyVGmASdouCQqet/A== +"@react-native-community/cli-platform-ios@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-4.7.0.tgz#471dcdbd2645c5650f16c0eddcca50e47ca78398" + integrity sha512-XqnxP6H6+PG/wn4+Pwas5jaTSr5n7x6v8trkPY8iO37b8sq7tJLNYznaBMROF43i0NqO48JdhquYOqnDN8FdBA== dependencies: - "@react-native-community/cli-tools" "^4.2.2" + "@react-native-community/cli-tools" "^4.7.0" chalk "^3.0.0" glob "^7.1.3" js-yaml "^3.13.1" @@ -1220,30 +1220,30 @@ plist "^3.0.1" xcode "^2.0.0" -"@react-native-community/cli-tools@^4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-4.2.2.tgz#953354bc4d14afa76483cdd097a18407016dab34" - integrity sha512-soo2GKb7cZNLy2uWN0TUeww+N1YTBfu7rk5ujLOXzFd+XxfpJTK9/HQ3RjHLsuA+aV8nlx8SmaielgxfKFPePQ== +"@react-native-community/cli-tools@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-tools/-/cli-tools-4.7.0.tgz#83d49277e7f56fef87bdfd0ba55d2cfa20190689" + integrity sha512-llNWJEWXhGMsaHLWoieraPeWuva3kRsIEPi8oRVTybyz82JjR71mN0OFs41o1OnAR6+TR9d5cJPN+mIOESugEA== dependencies: chalk "^3.0.0" lodash "^4.17.15" mime "^2.4.1" - node-fetch "^2.5.0" + node-fetch "^2.6.0" -"@react-native-community/cli-types@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-4.2.1.tgz#112c09e2900577bac3cbcbfbc4c6d4d59eabfec8" - integrity sha512-mKDQKSu+6DlG46IZHLcTwVHYieEiZXn+25zmfRtEG0YxnvLxTAtr21COjGEUhxMFp6zRzNMmRi5zGfRmCByTTA== +"@react-native-community/cli-types@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli-types/-/cli-types-4.7.0.tgz#871905753f8ff83cf10c48e8df3fdd63cd7667a0" + integrity sha512-Pw05Rsh/ENFs/Utv1SVRFfdMAn+W9yy1AOhyIKB36JX0Xw00sIZQDyZVsVfmaLSOpRpJ/qUdKWXB/WYV4XYELw== -"@react-native-community/cli@^4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.2.4.tgz#25fcb7fbfb96f34fc4143d0ba48bb9c4e010bc5a" - integrity sha512-sgvFNM/Gzk+fPzURkmVWgwGAZ2cJSApoqgCEyatGEsF4SCNprmd5hfCif7JVuYmxxzUIMI/sN8lP8s65fx4W/g== +"@react-native-community/cli@^4.7.0": + version "4.7.0" + resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.7.0.tgz#be692631356d14fd1ffe23f25b479dca9e8e7c95" + integrity sha512-DbpxcPC7lFCJ112dPXL4DBKh5TfH0QK2OTG7uEGjfsApT4c01Lae6OMTNSssXgXTcNJApqIT5a6GXK2vSE0CEQ== dependencies: "@hapi/joi" "^15.0.3" - "@react-native-community/cli-debugger-ui" "^4.2.1" - "@react-native-community/cli-tools" "^4.2.2" - "@react-native-community/cli-types" "^4.2.1" + "@react-native-community/cli-debugger-ui" "^4.7.0" + "@react-native-community/cli-tools" "^4.7.0" + "@react-native-community/cli-types" "^4.7.0" chalk "^3.0.0" command-exists "^1.2.8" commander "^2.19.0" @@ -1267,9 +1267,10 @@ metro-react-native-babel-transformer "^0.58.0" minimist "^1.2.0" mkdirp "^0.5.1" + node-stream-zip "^1.9.1" open "^6.2.0" ora "^3.4.0" - pretty-format "^25.1.0" + pretty-format "^25.2.0" semver "^6.3.0" serve-static "^1.13.1" shell-quote "1.6.1" @@ -1279,7 +1280,7 @@ ws "^1.1.0" "@react-native-community/eslint-plugin@file:packages/eslint-plugin-react-native-community": - version "1.0.0" + version "1.1.0" "@reactions/component@^2.0.2": version "2.0.2" @@ -5498,9 +5499,9 @@ node-fetch@^2.2.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" integrity sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA== -node-fetch@^2.5.0: +node-fetch@^2.6.0: version "2.6.0" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== node-int64@^0.4.0: @@ -5545,6 +5546,11 @@ node-releases@^1.1.53: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== +node-stream-zip@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.9.1.tgz#66d210204da7c60e2d6d685eb21a11d016981fd0" + integrity sha512-7/Xs9gkuYF0WBimz5OrSc6UVKLDTxvBG2yLGtEK8PSx94d86o/6iQLvIe/140ATz35JDqHKWIxh3GcA3u5hB0w== + node-version@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.2.0.tgz#34fde3ffa8e1149bd323983479dda620e1b5060d" @@ -6066,12 +6072,12 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8" - integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ== +pretty-format@^25.2.0: + version "25.3.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.3.0.tgz#d0a4f988ff4a6cd350342fdabbb809aeb4d49ad5" + integrity sha512-wToHwF8bkQknIcFkBqNfKu4+UZqnrLn/Vr+wwKQwwvPzkBfDDKp/qIabFqdgtoi5PEnM8LFByVsOrHoa3SpTVA== dependencies: - "@jest/types" "^25.1.0" + "@jest/types" "^25.3.0" ansi-regex "^5.0.0" ansi-styles "^4.0.0" react-is "^16.12.0" From 7cedccdb8d07c87841f96fb327a01568a1a48835 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 16 Apr 2020 08:39:12 -0700 Subject: [PATCH 034/235] Add "Open Debugger" and "Open React DevTools" to Android dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20784279 fbshipit-source-id: caecdace00007224692d994a75c106842c8b2acb --- .../react/testing/ReactSettingsForTests.java | 2 +- .../react/devsupport/DevInternalSettings.java | 2 +- .../react/devsupport/DevServerHelper.java | 40 ++++++++++++ .../devsupport/DevSupportManagerBase.java | 61 +++++++++++++++---- .../debug/interfaces/DeveloperSettings.java | 2 +- .../main/res/devsupport/values/strings.xml | 5 +- 6 files changed, 96 insertions(+), 16 deletions(-) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactSettingsForTests.java b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactSettingsForTests.java index cffb8eec4c55a9..de7f8cc1b76b7e 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactSettingsForTests.java +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactSettingsForTests.java @@ -37,7 +37,7 @@ public boolean isElementInspectorEnabled() { } @Override - public boolean isNuclideJSDebugEnabled() { + public boolean isDeviceDebugEnabled() { return false; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java index 9d060babc1866f..b63b37cdc9ce58 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevInternalSettings.java @@ -105,7 +105,7 @@ public void setElementInspectorEnabled(boolean enabled) { } @Override - public boolean isNuclideJSDebugEnabled() { + public boolean isDeviceDebugEnabled() { return ReactBuildConfig.IS_INTERNAL_BUILD && ReactBuildConfig.DEBUG; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java index f80ae648404005..5c5bad9eb4a3a2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java @@ -7,10 +7,12 @@ package com.facebook.react.devsupport; +import android.content.Context; import android.os.AsyncTask; import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; +import com.facebook.react.bridge.ReactContext; import com.facebook.react.common.ReactConstants; import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener; import com.facebook.react.devsupport.interfaces.PackagerStatusCallback; @@ -23,6 +25,7 @@ import com.facebook.react.packagerconnection.RequestHandler; import com.facebook.react.packagerconnection.RequestOnlyHandler; import com.facebook.react.packagerconnection.Responder; +import com.facebook.react.util.RNLog; import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -247,6 +250,38 @@ protected Void doInBackground(Void... params) { }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } + public void openUrl(final ReactContext context, final String url, final String errorMessage) { + new AsyncTask() { + @Override + protected Boolean doInBackground(Void... ignore) { + return doSync(); + } + + public boolean doSync() { + try { + String openUrlEndpoint = getOpenUrlEndpoint(context); + String jsonString = new JSONObject().put("url", url).toString(); + RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonString); + + Request request = new Request.Builder().url(openUrlEndpoint).post(body).build(); + OkHttpClient client = new OkHttpClient(); + client.newCall(request).execute(); + return true; + } catch (JSONException | IOException e) { + FLog.e(ReactConstants.TAG, "Failed to open URL" + url, e); + return false; + } + } + + @Override + protected void onPostExecute(Boolean result) { + if (!result) { + RNLog.w(context, errorMessage); + } + } + }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } + public void symbolicateStackTrace( Iterable stackFrames, final SymbolicationListener listener) { try { @@ -345,6 +380,11 @@ public void downloadBundleFromURL( mBundleDownloader.downloadBundleFromURL(callback, outputFile, bundleURL, bundleInfo); } + private String getOpenUrlEndpoint(Context context) { + return String.format( + Locale.US, "http://%s/open-url", AndroidInfoHelpers.getServerHost(context)); + } + public void downloadBundleFromURL( DevBundleDownloadListener callback, File outputFile, diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 249a359230dcc6..8a99c522ba9fbf 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -71,6 +71,9 @@ public abstract class DevSupportManagerBase private static final int JSEXCEPTION_ERROR_COOKIE = -1; private static final String JS_BUNDLE_FILE_NAME = "ReactNativeDevBundle.js"; private static final String RELOAD_APP_ACTION_SUFFIX = ".RELOAD_APP_ACTION"; + private static final String FLIPPER_DEBUGGER_URL = + "flipper://null/Hermesdebuggerrn?device=React%20Native"; + private static final String FLIPPER_DEVTOOLS_URL = "flipper://null/React?device=React%20Native"; private boolean mIsSamplingProfilerEnabled = false; private enum ErrorType { @@ -432,17 +435,53 @@ public void onOptionSelected() { handleReloadJS(); } }); - options.put( - mDevSettings.isRemoteJSDebugEnabled() - ? mApplicationContext.getString(R.string.catalyst_debug_stop) - : mApplicationContext.getString(R.string.catalyst_debug), - new DevOptionHandler() { - @Override - public void onOptionSelected() { - mDevSettings.setRemoteJSDebugEnabled(!mDevSettings.isRemoteJSDebugEnabled()); - handleReloadJS(); - } - }); + if (mDevSettings.isDeviceDebugEnabled()) { + // For on-device debugging we link out to Flipper. + // Since we're assuming Flipper is available, also include the DevTools. + + // Reset the old debugger setting so no one gets stuck. + // TODO: Remove in a few weeks. + if (mDevSettings.isRemoteJSDebugEnabled()) { + mDevSettings.setRemoteJSDebugEnabled(false); + handleReloadJS(); + } + options.put( + mApplicationContext.getString(R.string.catalyst_debug_open), + new DevOptionHandler() { + @Override + public void onOptionSelected() { + mDevServerHelper.openUrl( + mCurrentContext, + FLIPPER_DEBUGGER_URL, + mApplicationContext.getString(R.string.catalyst_open_flipper_error)); + } + }); + options.put( + mApplicationContext.getString(R.string.catalyst_devtools_open), + new DevOptionHandler() { + @Override + public void onOptionSelected() { + mDevServerHelper.openUrl( + mCurrentContext, + FLIPPER_DEVTOOLS_URL, + mApplicationContext.getString(R.string.catalyst_open_flipper_error)); + } + }); + } else { + // For remote debugging, we open up Chrome running the app in a web worker. + // Note that this requires async communication, which will not work for Turbo Modules. + options.put( + mDevSettings.isRemoteJSDebugEnabled() + ? mApplicationContext.getString(R.string.catalyst_debug_stop) + : mApplicationContext.getString(R.string.catalyst_debug), + new DevOptionHandler() { + @Override + public void onOptionSelected() { + mDevSettings.setRemoteJSDebugEnabled(!mDevSettings.isRemoteJSDebugEnabled()); + handleReloadJS(); + } + }); + } options.put( mApplicationContext.getString(R.string.catalyst_change_bundle_location), new DevOptionHandler() { diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java index bc5e19d7c9efdd..118c8fdb276a44 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java @@ -26,7 +26,7 @@ public interface DeveloperSettings { boolean isElementInspectorEnabled(); /** @return Whether Nuclide JS debugging is enabled. */ - boolean isNuclideJSDebugEnabled(); + boolean isDeviceDebugEnabled(); /** @return Whether remote JS debugging is enabled. */ boolean isRemoteJSDebugEnabled(); diff --git a/ReactAndroid/src/main/res/devsupport/values/strings.xml b/ReactAndroid/src/main/res/devsupport/values/strings.xml index 82db0a9b7ec2a8..3571c835e31690 100644 --- a/ReactAndroid/src/main/res/devsupport/values/strings.xml +++ b/ReactAndroid/src/main/res/devsupport/values/strings.xml @@ -3,14 +3,15 @@ Reload Failed to load bundle. Try restarting the bundler or reconnecting your device. Change Bundle Location + Failed to open Flipper. Please check that Metro is running. + Open React DevTools + Open Debugger Debug Stop Debugging Connecting to debugger... Failed to connect to debugger! Debug with Chrome Stop Chrome Debugging - Debug with Nuclide - Failed to communicate with the bundler to enabling debugging with Nuclide. Enable Fast Refresh Disable Fast Refresh Disabling Fast Refresh because it requires a development bundle. From 44beb2a685b7ceb0311bde7d0d33cb70bb891d30 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 16 Apr 2020 09:31:59 -0700 Subject: [PATCH 035/235] Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## Changelog [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac --- scripts/react_native_pods.rb | 11 ----------- template/ios/Podfile | 3 --- 2 files changed, 14 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 21984326468080..5c1eb2c75034da 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -88,14 +88,3 @@ def use_flipper!(versions = {}) pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug' 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 - end -end diff --git a/template/ios/Podfile b/template/ios/Podfile index 6e1ebd6181167f..8e81ab05d7580d 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -18,9 +18,6 @@ target 'HelloWorld' do # 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 target 'HelloWorld-tvOS' do From fb04237b18e1467889c865f3feb75ec85e807dd8 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 16 Apr 2020 12:04:20 -0700 Subject: [PATCH 036/235] Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 --- scripts/react_native_pods.rb | 11 +++++++++++ template/ios/Podfile | 3 +++ 2 files changed, 14 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 5c1eb2c75034da..21984326468080 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -88,3 +88,14 @@ def use_flipper!(versions = {}) pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug' pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug' 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 + end +end diff --git a/template/ios/Podfile b/template/ios/Podfile index 8e81ab05d7580d..6e1ebd6181167f 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -18,6 +18,9 @@ target 'HelloWorld' do # 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 target 'HelloWorld-tvOS' do From 56583c6845d0191e7b430ab07056f647d5caa3cd Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 16 Apr 2020 13:40:32 -0700 Subject: [PATCH 037/235] Remove out of date TODO Summary: No longer relevant. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D21070955 fbshipit-source-id: 11b0384501b2780f5ac41899b5e8bbb4f7a4d730 --- ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index 0f1370a7eeb50c..fd77eba63e6461 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -147,8 +147,6 @@ void JSIExecutor::loadBundle( std::string sourceURL) { SystraceSection s("JSIExecutor::loadBundle"); - // TODO: check for and use precompiled HBC - bool hasLogger(ReactMarker::logTaggedMarker); std::string scriptName = simpleBasename(sourceURL); if (hasLogger) { From 1ee8c0c2c01186d1e7f85a592b558235596d51be Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 16 Apr 2020 16:14:50 -0700 Subject: [PATCH 038/235] RNTester LayoutAnimation example: add more options Summary: Add more options to the LayoutAnimation example so it's easier to test more features of LayoutAnimations. 1) Add an option to animate reordering of views 2) Make animations slower, so it's easier to see what's going on and easier to trigger race conditions 3) Add options to mutate without animation, to test interrupting existing animations Changelog: [Internal] Updated Catalyst RNTester LayoutAnimation example with additional options Reviewed By: mdvacca Differential Revision: D21050309 fbshipit-source-id: 1daba4fd487693c34a2d40eb39a68c7d03c24f93 --- .../examples/Layout/LayoutAnimationExample.js | 117 ++++++++++++++++-- 1 file changed, 105 insertions(+), 12 deletions(-) diff --git a/RNTester/js/examples/Layout/LayoutAnimationExample.js b/RNTester/js/examples/Layout/LayoutAnimationExample.js index 4a0eac9fc58725..163a8b8c8e7737 100644 --- a/RNTester/js/examples/Layout/LayoutAnimationExample.js +++ b/RNTester/js/examples/Layout/LayoutAnimationExample.js @@ -19,43 +19,124 @@ const { TouchableOpacity, } = require('react-native'); -class AddRemoveExample extends React.Component<{...}, $FlowFixMeState> { +type ExampleViewSpec = {| + key: number, +|}; + +type AddRemoveExampleState = {| + views: Array, + nextKey: number, +|}; + +function shuffleArray(array: Array) { + var currentIndex: number = array.length, + temporaryValue: ExampleViewSpec, + randomIndex: number; + + // While there remain elements to shuffle... + while (currentIndex !== 0) { + // Pick a remaining element... + randomIndex = Math.floor(Math.random() * currentIndex); + currentIndex -= 1; + + // And swap it with the current element. + temporaryValue = array[currentIndex]; + array[currentIndex] = array[randomIndex]; + array[randomIndex] = temporaryValue; + } + + return array; +} + +class AddRemoveExample extends React.Component<{...}, AddRemoveExampleState> { state = { views: [], + nextKey: 1, }; - UNSAFE_componentWillUpdate() { - LayoutAnimation.easeInEaseOut(args => - console.log('AddRemoveExample completed', args), + configureNextAnimation() { + LayoutAnimation.configureNext( + { + duration: 1000, + create: {type: 'easeInEaseOut', property: 'opacity'}, + update: {type: 'easeInEaseOut', property: 'opacity'}, + delete: {type: 'easeInEaseOut', property: 'opacity'}, + }, + args => console.log('AddRemoveExample completed', args), ); } + _onPressAddViewAnimated = () => { + this.configureNextAnimation(); + this._onPressAddView(); + }; + + _onPressRemoveViewAnimated = () => { + this.configureNextAnimation(); + this._onPressRemoveView(); + }; + + _onPressReorderViewsAnimated = () => { + this.configureNextAnimation(); + this._onPressReorderViews(); + }; + _onPressAddView = () => { - this.setState(state => ({views: [...state.views, {}]})); + this.setState(state => ({ + views: [...state.views, {key: state.nextKey}], + nextKey: state.nextKey + 1, + })); }; _onPressRemoveView = () => { this.setState(state => ({views: state.views.slice(0, -1)})); }; + _onPressReorderViews = () => { + this.setState(state => ({views: shuffleArray(state.views)})); + }; + render() { - const views = this.state.views.map((view, i) => ( - - {i} + const views = this.state.views.map(({key}) => ( + console.log('Box onLayout')}> + {key} )); return ( - + Add view - + Remove view + + + Reorder Views + + + + + Add view (no animation) + + + + + Remove view (no animation) + + + + + Reorder Views (no animation) + + {views} ); @@ -74,7 +155,11 @@ const BlueSquare = () => ( ); -class CrossFadeExample extends React.Component<{...}, $FlowFixMeState> { +type CrossFadeExampleState = {| + toggled: boolean, +|}; + +class CrossFadeExample extends React.Component<{...}, CrossFadeExampleState> { state = { toggled: false, }; @@ -102,7 +187,15 @@ class CrossFadeExample extends React.Component<{...}, $FlowFixMeState> { } } -class LayoutUpdateExample extends React.Component<{...}, $FlowFixMeState> { +type LayoutUpdateExampleState = {| + width: number, + height: number, +|}; + +class LayoutUpdateExample extends React.Component< + {...}, + LayoutUpdateExampleState, +> { state = { width: 200, height: 100, From b2ccfac62a5062d7d8bfa6eff94327ecfac2b237 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 16 Apr 2020 16:14:50 -0700 Subject: [PATCH 039/235] Add a "reparenting" LayoutAnimation example that animates flattening/unflattening Summary: Simple test to see what it looks like when view flattening/unflattening is animated with LayoutAnimations. Changelog: [Internal] adding another example to LayoutAnimations example Reviewed By: mdvacca Differential Revision: D21074805 fbshipit-source-id: 551ed740f0ab5c5adcb19f5c35e932b8983cd108 --- .../examples/Layout/LayoutAnimationExample.js | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/RNTester/js/examples/Layout/LayoutAnimationExample.js b/RNTester/js/examples/Layout/LayoutAnimationExample.js index 163a8b8c8e7737..62c883246457b8 100644 --- a/RNTester/js/examples/Layout/LayoutAnimationExample.js +++ b/RNTester/js/examples/Layout/LayoutAnimationExample.js @@ -143,6 +143,60 @@ class AddRemoveExample extends React.Component<{...}, AddRemoveExampleState> { } } +type ReparentingExampleState = {| + hasBorder: boolean, +|}; + +class ReparentingExample extends React.Component< + {...}, + ReparentingExampleState, +> { + state = { + hasBorder: false, + }; + + _onPressToggleAnimated = () => { + LayoutAnimation.configureNext( + { + duration: 300, + create: {type: 'easeInEaseOut', property: 'opacity', duration: 1000}, + update: {type: 'easeInEaseOut', property: 'opacity'}, + delete: {type: 'easeInEaseOut', property: 'opacity', duration: 1000}, + }, + args => console.log('ReparentingExample completed', args), + ); + this._onPressToggle(); + }; + + _onPressToggle = () => { + this.setState(state => ({hasBorder: !state.hasBorder})); + }; + + render() { + const parentStyle = this.state.hasBorder + ? {borderWidth: 5, borderColor: 'red'} + : {}; + + return ( + + + + Toggle + + + + + Toggle (no animation) + + + + + + + ); + } +} + const GreenSquare = () => ( Green square @@ -299,6 +353,12 @@ exports.examples = [ return ; }, }, + { + title: 'Animate Reparenting Update', + render(): React.Element { + return ; + }, + }, { title: 'Cross fade views', render(): React.Element { From f5d00e5a2922d35a0b44935592da5700518c422b Mon Sep 17 00:00:00 2001 From: Ryan Tremblay Date: Thu, 16 Apr 2020 16:29:03 -0700 Subject: [PATCH 040/235] Fix jsi cmake include dirs (#207) Summary: I'm trying to use JSI for a React Native custom module. I saw these existing examples where the JSI API is used in the context of a CMakeLists.txt: https://github.com/terrysahaidak/host-object-test/blob/master/libs/android-jsi/test-jsi/src/main/cpp/CMakeLists.txt https://github.com/ericlewis/react-native-hostobject-demo/pull/4/files#diff-834320be1b4e4016bac27c05dcd17fb9 In both cases, they manually grab the include directories and jsi.cpp from node_modules/react-native, but I also saw that node_modules/react-native/ReactCommon/jsi/jsi already has a CMakeLists.txt that appears to be intended to provide a jsi static lib, so I tried to pull this into my own CMakeLists.txt like this: ``` add_subdirectory(${RN_DIR}/ReactCommon/jsi/jsi ${CMAKE_CURRENT_BINARY_DIR}/jsi) ... target_link_libraries(MyLib jsi) ``` Unfortunately when doing this, the consuming project still doesn't see the correct include directories. The change I'm proposing here is to use `target_include_directories` and declare that `..` is a public (to consumers) include directory for the library named `jsi`. With this change, you can do what I showed above to consume the jsi lib by just pulling in the CMakeLists.txt file into your own CMakeLists.txt file. Changelog: [General][Fixed] Fix jsi cmake include dirs Pull Request resolved: https://github.com/facebook/hermes/pull/207 Reviewed By: willholen Differential Revision: D21074270 Pulled By: tmikov fbshipit-source-id: 7d9ec3255f57a16c0b2be489dffa4540727738a1 --- ReactCommon/jsi/jsi/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/jsi/jsi/CMakeLists.txt b/ReactCommon/jsi/jsi/CMakeLists.txt index 6a2db94383d9b8..f2610548ee0e8a 100644 --- a/ReactCommon/jsi/jsi/CMakeLists.txt +++ b/ReactCommon/jsi/jsi/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) add_library(jsi jsi.cpp) -include_directories(..) +target_include_directories(jsi PUBLIC ..) set(jsi_compile_flags "") From abde0154ba4247d2c9f1451b5de8b3cba1abd316 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 16 Apr 2020 16:30:15 -0700 Subject: [PATCH 041/235] Resolve `kind-of` vulnerability by bumping to 6.0.3 Summary: https://github.com/advisories/GHSA-6c8f-qphg-qjgp Changelog: [General][Changed] Updated transitive dependency kind-of to 6.0.3 to resolve vulnerability (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21077747 fbshipit-source-id: d5c19b21b665130c6423f5caeddcd6378bac7dcb --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d92ad8100a17bb..e5994d996139da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4753,9 +4753,9 @@ kind-of@^5.0.0: integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== klaw@^1.0.0: version "1.3.1" From 8c9c402baf71f7a9aef9f7ebefcc4230054cc57e Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 16 Apr 2020 17:19:19 -0700 Subject: [PATCH 042/235] Move CheckBox Android files to FB internal (#28658) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28658 This moves the Java files to FB internal and updates all the buck files. ## Changelog: [Android] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D21066998 fbshipit-source-id: 76821fcae899ff7342697ea7dd4737ef3b008213 --- .../main/java/com/facebook/react/shell/BUCK | 1 - .../react/shell/MainReactPackage.java | 2 - .../com/facebook/react/views/checkbox/BUCK | 25 ---- .../react/views/checkbox/ReactCheckBox.java | 38 ----- .../views/checkbox/ReactCheckBoxEvent.java | 53 ------- .../views/checkbox/ReactCheckBoxManager.java | 137 ------------------ 6 files changed, 256 deletions(-) delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/checkbox/BUCK delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBox.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxEvent.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxManager.java diff --git a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK index bb25d9d77605b4..4df1ab9930362d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK @@ -52,7 +52,6 @@ rn_android_library( react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_target("java/com/facebook/react/views/art:art"), - react_native_target("java/com/facebook/react/views/checkbox:checkbox"), react_native_target("java/com/facebook/react/views/drawer:drawer"), react_native_target("java/com/facebook/react/views/image:image"), react_native_target("java/com/facebook/react/views/modal:modal"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java b/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java index 1ccb0fe94ece3f..7c60cda3300a9d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +++ b/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java @@ -45,7 +45,6 @@ import com.facebook.react.uimanager.ViewManager; import com.facebook.react.views.art.ARTRenderableViewManager; import com.facebook.react.views.art.ARTSurfaceViewManager; -import com.facebook.react.views.checkbox.ReactCheckBoxManager; import com.facebook.react.views.drawer.ReactDrawerLayoutManager; import com.facebook.react.views.image.ReactImageManager; import com.facebook.react.views.modal.ReactModalHostManager; @@ -178,7 +177,6 @@ public List createViewManagers(ReactApplicationContext reactContext viewManagers.add(ARTRenderableViewManager.createARTGroupViewManager()); viewManagers.add(ARTRenderableViewManager.createARTShapeViewManager()); viewManagers.add(ARTRenderableViewManager.createARTTextViewManager()); - viewManagers.add(new ReactCheckBoxManager()); viewManagers.add(new ReactDialogPickerManager()); viewManagers.add(new ReactDrawerLayoutManager()); viewManagers.add(new ReactDropdownPickerManager()); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/BUCK deleted file mode 100644 index 3e2f34a0960d51..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_target", "rn_android_library") - -rn_android_library( - name = "checkbox", - srcs = glob(["*.java"]), - is_androidx = True, - provided_deps = [ - react_native_dep("third-party/android/androidx:annotation"), - react_native_dep("third-party/android/androidx:appcompat"), - react_native_dep("third-party/android/androidx:core"), - react_native_dep("third-party/android/androidx:fragment"), - react_native_dep("third-party/android/androidx:legacy-support-core-ui"), - react_native_dep("third-party/android/androidx:legacy-support-core-utils"), - ], - visibility = [ - "PUBLIC", - ], - deps = [ - react_native_dep("third-party/java/jsr-305:jsr-305"), - react_native_target("java/com/facebook/react/bridge:bridge"), - react_native_target("java/com/facebook/react/common:common"), - react_native_target("java/com/facebook/react/uimanager:uimanager"), - react_native_target("java/com/facebook/react/uimanager/annotations:annotations"), - ], -) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBox.java b/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBox.java deleted file mode 100644 index 7165a781208228..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBox.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.checkbox; - -import android.content.Context; -import androidx.appcompat.widget.AppCompatCheckBox; - -/** CheckBox that has its value controlled by JS. */ -/*package*/ class ReactCheckBox extends AppCompatCheckBox { - - private boolean mAllowChange; - - public ReactCheckBox(Context context) { - super(context); - mAllowChange = true; - } - - @Override - public void setChecked(boolean checked) { - if (mAllowChange) { - mAllowChange = false; - super.setChecked(checked); - } - } - - /*package*/ void setOn(boolean on) { - // If the checkbox has a different value than the value sent by JS, we must change it. - if (isChecked() != on) { - super.setChecked(on); - } - mAllowChange = true; - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxEvent.java deleted file mode 100644 index 3e0aaa628ebd21..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.checkbox; - -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.uimanager.events.Event; -import com.facebook.react.uimanager.events.RCTEventEmitter; - -/** Event emitted by a ReactCheckBoxManager once a checkbox is manipulated. */ -/*package*/ class ReactCheckBoxEvent extends Event { - - public static final String EVENT_NAME = "topChange"; - - private final boolean mIsChecked; - - public ReactCheckBoxEvent(int viewId, boolean isChecked) { - super(viewId); - mIsChecked = isChecked; - } - - public boolean getIsChecked() { - return mIsChecked; - } - - @Override - public String getEventName() { - return EVENT_NAME; - } - - @Override - public short getCoalescingKey() { - // All checkbox events for a given view can be coalesced. - return 0; - } - - @Override - public void dispatch(RCTEventEmitter rctEventEmitter) { - rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData()); - } - - private WritableMap serializeEventData() { - WritableMap eventData = Arguments.createMap(); - eventData.putInt("target", getViewTag()); - eventData.putBoolean("value", getIsChecked()); - return eventData; - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxManager.java deleted file mode 100644 index 6f0bd7eeaf23db..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/checkbox/ReactCheckBoxManager.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.checkbox; - -import android.content.Context; -import android.content.res.ColorStateList; -import android.util.TypedValue; -import android.widget.CompoundButton; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.widget.TintContextWrapper; -import androidx.core.widget.CompoundButtonCompat; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.uimanager.SimpleViewManager; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.UIManagerModule; -import com.facebook.react.uimanager.ViewProps; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** View manager for {@link ReactCheckBox} components. */ -public class ReactCheckBoxManager extends SimpleViewManager { - - public static final String REACT_CLASS = "AndroidCheckBox"; - - private static final CompoundButton.OnCheckedChangeListener ON_CHECKED_CHANGE_LISTENER = - new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - ReactContext reactContext = getReactContext(buttonView); - reactContext - .getNativeModule(UIManagerModule.class) - .getEventDispatcher() - .dispatchEvent(new ReactCheckBoxEvent(buttonView.getId(), isChecked)); - } - - private ReactContext getReactContext(CompoundButton buttonView) { - ReactContext reactContext; - Context ctx = buttonView.getContext(); - if (ctx instanceof TintContextWrapper) { - reactContext = (ReactContext) ((TintContextWrapper) ctx).getBaseContext(); - } else { - reactContext = (ReactContext) buttonView.getContext(); - } - return reactContext; - } - }; - - @Override - public String getName() { - return REACT_CLASS; - } - - @Override - protected void addEventEmitters(final ThemedReactContext reactContext, final ReactCheckBox view) { - view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER); - } - - @Override - protected ReactCheckBox createViewInstance(ThemedReactContext context) { - ReactCheckBox view = new ReactCheckBox(context); - return view; - } - - @ReactProp(name = ViewProps.ENABLED, defaultBoolean = true) - public void setEnabled(ReactCheckBox view, boolean enabled) { - view.setEnabled(enabled); - } - - @ReactProp(name = ViewProps.ON) - public void setOn(ReactCheckBox view, boolean on) { - // we set the checked change listener to null and then restore it so that we don't fire an - // onChange event to JS when JS itself is updating the value of the checkbox - view.setOnCheckedChangeListener(null); - view.setOn(on); - view.setOnCheckedChangeListener(ON_CHECKED_CHANGE_LISTENER); - } - - @Override - public void receiveCommand( - @NonNull ReactCheckBox root, String commandId, @Nullable ReadableArray args) { - switch (commandId) { - case "setNativeValue": - if (args != null) { - setOn(root, args.getBoolean(0)); - break; - } - } - } - - private static int getThemeColor(final Context context, String colorId) { - final TypedValue value = new TypedValue(); - context.getTheme().resolveAttribute(getIdentifier(context, colorId), value, true); - return value.data; - } - - /** - * The appcompat-v7 BUCK dep is listed as a provided_dep, which complains that - * com.facebook.react.R doesn't exist. Since the attributes are provided from a parent, we can - * access those attributes dynamically. - */ - private static int getIdentifier(Context context, String name) { - return context.getResources().getIdentifier(name, "attr", context.getPackageName()); - } - - @ReactProp(name = "tintColors") - public void setTintColors(ReactCheckBox view, @Nullable ReadableMap colorsMap) { - String defaultColorIdOfCheckedState = "colorAccent"; - int trueColor = - colorsMap == null || !colorsMap.hasKey("true") - ? getThemeColor(view.getContext(), defaultColorIdOfCheckedState) - : colorsMap.getInt("true"); - - String defaultColorIdOfUncheckedState = "colorPrimaryDark"; - int falseColor = - colorsMap == null || !colorsMap.hasKey("false") - ? getThemeColor(view.getContext(), defaultColorIdOfUncheckedState) - : colorsMap.getInt("false"); - - ColorStateList csl = - new ColorStateList( - new int[][] { - new int[] {android.R.attr.state_checked}, new int[] {-android.R.attr.state_checked} - }, - new int[] { - trueColor, falseColor, - }); - - CompoundButtonCompat.setButtonTintList(view, csl); - } -} From 251ff1bb0a3fb0169acc5a7425af1692340651b3 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 16 Apr 2020 17:23:39 -0700 Subject: [PATCH 043/235] Part 1: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - `ObjCTurboModule::ObjCTurboModule` changed to accept a bag of arguments `const ObjCTurboModule::InitParams` instead of an argument list. - TurboModule iOS codegen scripts updated to generated `ObjCTurboModule` subclasses that accept a `const ObjCTurboModule::InitParams` object in their constructor, and forward it to `ObjCTurboModule::ObjCTurboModule`. - All manually checked in code-generated ObjC++ classes (i.e: RCTNativeSampleTurboModule, RCTTestModule, FBReactNativeSpec) are updated. ## Rationale This way, the code-gen can remain constant while we add, remove, or modify the arguments passed to ObjCTurboModule. ## Commands run ``` function update-codegen() { pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd; } > update-codegen ``` Changelog: [iOS][Changed] Update ObjCTurboModule to use ObjCTurboModule::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036266 fbshipit-source-id: 6584b0838dca082a69e8c14c7ca50c3568b95086 --- .../FBReactNativeSpec-generated.mm | 232 +++++++++--------- .../FBReactNativeSpec/FBReactNativeSpec.h | 116 ++++----- RNTester/RCTTest/RCTTestModule.mm | 6 +- .../core/platform/ios/RCTTurboModule.h | 22 +- .../core/platform/ios/RCTTurboModule.mm | 12 +- .../platform/ios/RCTTurboModuleManager.mm | 14 +- .../ios/RCTNativeSampleTurboModuleSpec.h | 6 +- .../ios/RCTNativeSampleTurboModuleSpec.mm | 8 +- .../modules/GenerateModuleHObjCpp.js | 2 +- .../generators/modules/GenerateModuleMm.js | 4 +- .../GenerateModuleHObjCpp-test.js.snap | 14 +- .../GenerateModuleMm-test.js.snap | 28 +-- 12 files changed, 231 insertions(+), 233 deletions(-) diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm index 1856699aa3f140..fec8d3b70b9ba9 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm @@ -36,8 +36,8 @@ } - NativeAccessibilityInfoSpecJSI::NativeAccessibilityInfoSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AccessibilityInfo", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAccessibilityInfoSpecJSI::NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["isReduceMotionEnabled"] = MethodMetadata {1, __hostFunction_NativeAccessibilityInfoSpecJSI_isReduceMotionEnabled}; @@ -103,8 +103,8 @@ + (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecSetAccessibilityContent } - NativeAccessibilityManagerSpecJSI::NativeAccessibilityManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AccessibilityManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAccessibilityManagerSpecJSI::NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getCurrentBoldTextState"] = MethodMetadata {2, __hostFunction_NativeAccessibilityManagerSpecJSI_getCurrentBoldTextState}; @@ -170,8 +170,8 @@ + (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowShareActionSheetWithO } - NativeActionSheetManagerSpecJSI::NativeActionSheetManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ActionSheetManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeActionSheetManagerSpecJSI::NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["showActionSheetWithOptions"] = MethodMetadata {2, __hostFunction_NativeActionSheetManagerSpecJSI_showActionSheetWithOptions}; @@ -201,8 +201,8 @@ + (RCTManagedPointer *)JS_NativeAlertManager_Args:(id)json } - NativeAlertManagerSpecJSI::NativeAlertManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AlertManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAlertManagerSpecJSI::NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["alertWithArgs"] = MethodMetadata {2, __hostFunction_NativeAlertManagerSpecJSI_alertWithArgs}; @@ -306,8 +306,8 @@ + (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json } - NativeAnimatedModuleSpecJSI::NativeAnimatedModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AnimatedModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAnimatedModuleSpecJSI::NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["createAnimatedNode"] = MethodMetadata {2, __hostFunction_NativeAnimatedModuleSpecJSI_createAnimatedNode}; @@ -385,8 +385,8 @@ + (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json } - NativeAnimationsDebugModuleSpecJSI::NativeAnimationsDebugModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AnimationsDebugModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAnimationsDebugModuleSpecJSI::NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["startRecordingFps"] = MethodMetadata {0, __hostFunction_NativeAnimationsDebugModuleSpecJSI_startRecordingFps}; @@ -426,8 +426,8 @@ + (RCTManagedPointer *)JS_NativeAppState_SpecGetCurrentAppStateSuccessAppState:( } - NativeAppStateSpecJSI::NativeAppStateSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AppState", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAppStateSpecJSI::NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getCurrentAppState"] = MethodMetadata {2, __hostFunction_NativeAppStateSpecJSI_getCurrentAppState}; @@ -463,8 +463,8 @@ + (RCTManagedPointer *)JS_NativeAppState_SpecGetCurrentAppStateSuccessAppState:( } - NativeAppearanceSpecJSI::NativeAppearanceSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("Appearance", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAppearanceSpecJSI::NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getColorScheme"] = MethodMetadata {0, __hostFunction_NativeAppearanceSpecJSI_getColorScheme}; @@ -574,8 +574,8 @@ + (RCTManagedPointer *)JS_NativeAsyncStorage_SpecGetAllKeysCallbackError:(id)jso } - NativeAsyncStorageSpecJSI::NativeAsyncStorageSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("AsyncStorage", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeAsyncStorageSpecJSI::NativeAsyncStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["multiGet"] = MethodMetadata {2, __hostFunction_NativeAsyncStorageSpecJSI_multiGet}; @@ -633,8 +633,8 @@ + (RCTManagedPointer *)JS_NativeAsyncStorage_SpecGetAllKeysCallbackError:(id)jso } - NativeBlobModuleSpecJSI::NativeBlobModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("BlobModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeBlobModuleSpecJSI::NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["addNetworkingHandler"] = MethodMetadata {0, __hostFunction_NativeBlobModuleSpecJSI_addNetworkingHandler}; @@ -679,8 +679,8 @@ + (RCTManagedPointer *)JS_NativeAsyncStorage_SpecGetAllKeysCallbackError:(id)jso } - NativeBugReportingSpecJSI::NativeBugReportingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("BugReporting", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeBugReportingSpecJSI::NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["startReportAProblemFlow"] = MethodMetadata {0, __hostFunction_NativeBugReportingSpecJSI_startReportAProblemFlow}; @@ -719,8 +719,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_GetPhotosParams:(id)json } - NativeCameraRollManagerSpecJSI::NativeCameraRollManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("CameraRollManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeCameraRollManagerSpecJSI::NativeCameraRollManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getPhotos"] = MethodMetadata {1, __hostFunction_NativeCameraRollManagerSpecJSI_getPhotos}; @@ -786,8 +786,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeClipboardSpecJSI::NativeClipboardSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("Clipboard", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeClipboardSpecJSI::NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getString"] = MethodMetadata {0, __hostFunction_NativeClipboardSpecJSI_getString}; @@ -809,8 +809,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDatePickerAndroidSpecJSI::NativeDatePickerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DatePickerAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDatePickerAndroidSpecJSI::NativeDatePickerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["open"] = MethodMetadata {1, __hostFunction_NativeDatePickerAndroidSpecJSI_open}; @@ -833,8 +833,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DevLoadingView", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["showMessage"] = MethodMetadata {3, __hostFunction_NativeDevLoadingViewSpecJSI_showMessage}; @@ -872,8 +872,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDevMenuSpecJSI::NativeDevMenuSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DevMenu", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDevMenuSpecJSI::NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeDevMenuSpecJSI_show}; @@ -944,8 +944,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDevSettingsSpecJSI::NativeDevSettingsSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DevSettings", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDevSettingsSpecJSI::NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["reload"] = MethodMetadata {0, __hostFunction_NativeDevSettingsSpecJSI_reload}; @@ -994,8 +994,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDeviceEventManagerSpecJSI::NativeDeviceEventManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DeviceEventManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDeviceEventManagerSpecJSI::NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["invokeDefaultBackPressHandler"] = MethodMetadata {0, __hostFunction_NativeDeviceEventManagerSpecJSI_invokeDefaultBackPressHandler}; @@ -1014,8 +1014,8 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifiersPage:(id)json } - NativeDeviceInfoSpecJSI::NativeDeviceInfoSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DeviceInfo", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDeviceInfoSpecJSI::NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeDeviceInfoSpecJSI_getConstants}; @@ -1044,8 +1044,8 @@ + (RCTManagedPointer *)JS_NativeDialogManagerAndroid_DialogOptions:(id)json } - NativeDialogManagerAndroidSpecJSI::NativeDialogManagerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("DialogManagerAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeDialogManagerAndroidSpecJSI::NativeDialogManagerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["showAlert"] = MethodMetadata {3, __hostFunction_NativeDialogManagerAndroidSpecJSI_showAlert}; @@ -1096,8 +1096,8 @@ + (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json } - NativeExceptionsManagerSpecJSI::NativeExceptionsManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ExceptionsManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeExceptionsManagerSpecJSI::NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["reportFatalException"] = MethodMetadata {3, __hostFunction_NativeExceptionsManagerSpecJSI_reportFatalException}; @@ -1133,8 +1133,8 @@ + (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json } - NativeFileReaderModuleSpecJSI::NativeFileReaderModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("FileReaderModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeFileReaderModuleSpecJSI::NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["readAsDataURL"] = MethodMetadata {1, __hostFunction_NativeFileReaderModuleSpecJSI_readAsDataURL}; @@ -1174,8 +1174,8 @@ + (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id) } - NativeFrameRateLoggerSpecJSI::NativeFrameRateLoggerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("FrameRateLogger", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeFrameRateLoggerSpecJSI::NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["setGlobalOptions"] = MethodMetadata {1, __hostFunction_NativeFrameRateLoggerSpecJSI_setGlobalOptions}; @@ -1208,8 +1208,8 @@ + (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id) } - NativeHeadlessJsTaskSupportSpecJSI::NativeHeadlessJsTaskSupportSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("HeadlessJsTaskSupport", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeHeadlessJsTaskSupportSpecJSI::NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["notifyTaskFinished"] = MethodMetadata {1, __hostFunction_NativeHeadlessJsTaskSupportSpecJSI_notifyTaskFinished}; @@ -1243,8 +1243,8 @@ + (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id) } - NativeI18nManagerSpecJSI::NativeI18nManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("I18nManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeI18nManagerSpecJSI::NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["allowRTL"] = MethodMetadata {1, __hostFunction_NativeI18nManagerSpecJSI_allowRTL}; @@ -1296,8 +1296,8 @@ + (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json } - NativeImageEditorSpecJSI::NativeImageEditorSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ImageEditor", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeImageEditorSpecJSI::NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["cropImage"] = MethodMetadata {4, __hostFunction_NativeImageEditorSpecJSI_cropImage}; @@ -1333,8 +1333,8 @@ + (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json } - NativeImageLoaderAndroidSpecJSI::NativeImageLoaderAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ImageLoaderAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeImageLoaderAndroidSpecJSI::NativeImageLoaderAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["abortRequest"] = MethodMetadata {1, __hostFunction_NativeImageLoaderAndroidSpecJSI_abortRequest}; @@ -1377,8 +1377,8 @@ + (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json } - NativeImageLoaderIOSSpecJSI::NativeImageLoaderIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ImageLoaderIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeImageLoaderIOSSpecJSI::NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getSize"] = MethodMetadata {1, __hostFunction_NativeImageLoaderIOSSpecJSI_getSize}; @@ -1438,8 +1438,8 @@ + (RCTManagedPointer *)JS_NativeImagePickerIOS_SpecOpenSelectDialogConfig:(id)js } - NativeImagePickerIOSSpecJSI::NativeImagePickerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ImagePickerIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeImagePickerIOSSpecJSI::NativeImagePickerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["canRecordVideos"] = MethodMetadata {1, __hostFunction_NativeImagePickerIOSSpecJSI_canRecordVideos}; @@ -1493,8 +1493,8 @@ + (RCTManagedPointer *)JS_NativeImageStore_SpecAddImageFromBase64ErrorCallbackEr } - NativeImageStoreSpecJSI::NativeImageStoreSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ImageStore", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeImageStoreSpecJSI::NativeImageStoreSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getBase64ForTag"] = MethodMetadata {3, __hostFunction_NativeImageStoreSpecJSI_getBase64ForTag}; @@ -1522,8 +1522,8 @@ + (RCTManagedPointer *)JS_NativeImageStore_SpecAddImageFromBase64ErrorCallbackEr } - NativeJSCHeapCaptureSpecJSI::NativeJSCHeapCaptureSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("JSCHeapCapture", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeJSCHeapCaptureSpecJSI::NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["captureComplete"] = MethodMetadata {2, __hostFunction_NativeJSCHeapCaptureSpecJSI_captureComplete}; @@ -1542,8 +1542,8 @@ + (RCTManagedPointer *)JS_NativeImageStore_SpecAddImageFromBase64ErrorCallbackEr } - NativeJSCSamplingProfilerSpecJSI::NativeJSCSamplingProfilerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("JSCSamplingProfiler", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeJSCSamplingProfilerSpecJSI::NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["operationComplete"] = MethodMetadata {3, __hostFunction_NativeJSCSamplingProfilerSpecJSI_operationComplete}; @@ -1570,8 +1570,8 @@ + (RCTManagedPointer *)JS_NativeImageStore_SpecAddImageFromBase64ErrorCallbackEr } - NativeJSDevSupportSpecJSI::NativeJSDevSupportSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("JSDevSupport", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeJSDevSupportSpecJSI::NativeJSDevSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["onSuccess"] = MethodMetadata {1, __hostFunction_NativeJSDevSupportSpecJSI_onSuccess}; @@ -1600,8 +1600,8 @@ + (RCTManagedPointer *)JS_NativeImageStore_SpecAddImageFromBase64ErrorCallbackEr } - NativeKeyboardObserverSpecJSI::NativeKeyboardObserverSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("KeyboardObserver", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeKeyboardObserverSpecJSI::NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeKeyboardObserverSpecJSI_addListener}; @@ -1653,8 +1653,8 @@ + (RCTManagedPointer *)JS_NativeLinking_SpecSendIntentExtrasElement:(id)json } - NativeLinkingSpecJSI::NativeLinkingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("Linking", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeLinkingSpecJSI::NativeLinkingSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getInitialURL"] = MethodMetadata {0, __hostFunction_NativeLinkingSpecJSI_getInitialURL}; @@ -1695,8 +1695,8 @@ + (RCTManagedPointer *)JS_NativeLinking_SpecSendIntentExtrasElement:(id)json } - NativeLogBoxSpecJSI::NativeLogBoxSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("LogBox", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeLogBoxSpecJSI::NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["show"] = MethodMetadata {0, __hostFunction_NativeLogBoxSpecJSI_show}; @@ -1722,8 +1722,8 @@ + (RCTManagedPointer *)JS_NativeLinking_SpecSendIntentExtrasElement:(id)json } - NativeModalManagerSpecJSI::NativeModalManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ModalManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeModalManagerSpecJSI::NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeModalManagerSpecJSI_addListener}; @@ -1761,8 +1761,8 @@ + (RCTManagedPointer *)JS_NativeLinking_SpecSendIntentExtrasElement:(id)json } - NativeNetworkingAndroidSpecJSI::NativeNetworkingAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("NetworkingAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeNetworkingAndroidSpecJSI::NativeNetworkingAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["sendRequest"] = MethodMetadata {9, __hostFunction_NativeNetworkingAndroidSpecJSI_sendRequest}; @@ -1815,8 +1815,8 @@ + (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json } - NativeNetworkingIOSSpecJSI::NativeNetworkingIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("NetworkingIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeNetworkingIOSSpecJSI::NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["sendRequest"] = MethodMetadata {2, __hostFunction_NativeNetworkingIOSSpecJSI_sendRequest}; @@ -1860,8 +1860,8 @@ + (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json } - NativePermissionsAndroidSpecJSI::NativePermissionsAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("PermissionsAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativePermissionsAndroidSpecJSI::NativePermissionsAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["checkPermission"] = MethodMetadata {1, __hostFunction_NativePermissionsAndroidSpecJSI_checkPermission}; @@ -1893,8 +1893,8 @@ + (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json } - NativePlatformConstantsAndroidSpecJSI::NativePlatformConstantsAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("PlatformConstantsAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativePlatformConstantsAndroidSpecJSI::NativePlatformConstantsAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getAndroidID"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsAndroidSpecJSI_getAndroidID}; @@ -1916,8 +1916,8 @@ + (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json } - NativePlatformConstantsIOSSpecJSI::NativePlatformConstantsIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("PlatformConstantsIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativePlatformConstantsIOSSpecJSI::NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativePlatformConstantsIOSSpecJSI_getConstants}; @@ -2018,8 +2018,8 @@ + (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json } - NativePushNotificationManagerIOSSpecJSI::NativePushNotificationManagerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("PushNotificationManagerIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativePushNotificationManagerIOSSpecJSI::NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["onFinishRemoteNotification"] = MethodMetadata {2, __hostFunction_NativePushNotificationManagerIOSSpecJSI_onFinishRemoteNotification}; @@ -2093,8 +2093,8 @@ + (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json } - NativeRedBoxSpecJSI::NativeRedBoxSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("RedBox", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeRedBoxSpecJSI::NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["setExtraData"] = MethodMetadata {2, __hostFunction_NativeRedBoxSpecJSI_setExtraData}; @@ -2120,8 +2120,8 @@ + (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json } - NativeSegmentFetcherSpecJSI::NativeSegmentFetcherSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("SegmentFetcher", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeSegmentFetcherSpecJSI::NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["fetchSegment"] = MethodMetadata {3, __hostFunction_NativeSegmentFetcherSpecJSI_fetchSegment}; @@ -2151,8 +2151,8 @@ + (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json } - NativeSettingsManagerSpecJSI::NativeSettingsManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("SettingsManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeSettingsManagerSpecJSI::NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["setValues"] = MethodMetadata {1, __hostFunction_NativeSettingsManagerSpecJSI_setValues}; @@ -2183,8 +2183,8 @@ + (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json } - NativeShareModuleSpecJSI::NativeShareModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ShareModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeShareModuleSpecJSI::NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["share"] = MethodMetadata {2, __hostFunction_NativeShareModuleSpecJSI_share}; @@ -2204,8 +2204,8 @@ + (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json } - NativeSoundManagerSpecJSI::NativeSoundManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("SoundManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeSoundManagerSpecJSI::NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["playTouchSound"] = MethodMetadata {0, __hostFunction_NativeSoundManagerSpecJSI_playTouchSound}; @@ -2224,8 +2224,8 @@ + (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json } - NativeSourceCodeSpecJSI::NativeSourceCodeSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("SourceCode", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeSourceCodeSpecJSI::NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSourceCodeSpecJSI_getConstants}; @@ -2260,8 +2260,8 @@ + (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json } - NativeStatusBarManagerAndroidSpecJSI::NativeStatusBarManagerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("StatusBarManagerAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeStatusBarManagerAndroidSpecJSI::NativeStatusBarManagerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["setColor"] = MethodMetadata {2, __hostFunction_NativeStatusBarManagerAndroidSpecJSI_setColor}; @@ -2322,8 +2322,8 @@ + (RCTManagedPointer *)JS_NativeStatusBarManagerIOS_SpecGetHeightCallbackResult: } - NativeStatusBarManagerIOSSpecJSI::NativeStatusBarManagerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("StatusBarManagerIOS", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeStatusBarManagerIOSSpecJSI::NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getHeight"] = MethodMetadata {1, __hostFunction_NativeStatusBarManagerIOSSpecJSI_getHeight}; @@ -2364,8 +2364,8 @@ + (RCTManagedPointer *)JS_NativeStatusBarManagerIOS_SpecGetHeightCallbackResult: } - NativeTVNavigationEventEmitterSpecJSI::NativeTVNavigationEventEmitterSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("TVNavigationEventEmitter", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeTVNavigationEventEmitterSpecJSI::NativeTVNavigationEventEmitterSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeTVNavigationEventEmitterSpecJSI_addListener}; @@ -2393,8 +2393,8 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerOptions:(id)json } - NativeTimePickerAndroidSpecJSI::NativeTimePickerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("TimePickerAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeTimePickerAndroidSpecJSI::NativeTimePickerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["open"] = MethodMetadata {1, __hostFunction_NativeTimePickerAndroidSpecJSI_open}; @@ -2428,8 +2428,8 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json } - NativeTimingSpecJSI::NativeTimingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("Timing", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeTimingSpecJSI::NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["createTimer"] = MethodMetadata {4, __hostFunction_NativeTimingSpecJSI_createTimer}; @@ -2466,8 +2466,8 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json } - NativeToastAndroidSpecJSI::NativeToastAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("ToastAndroid", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeToastAndroidSpecJSI::NativeToastAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["show"] = MethodMetadata {2, __hostFunction_NativeToastAndroidSpecJSI_show}; @@ -2599,8 +2599,8 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json } - NativeUIManagerSpecJSI::NativeUIManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("UIManager", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeUIManagerSpecJSI::NativeUIManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["getConstantsForViewManager"] = MethodMetadata {1, __hostFunction_NativeUIManagerSpecJSI_getConstantsForViewManager}; @@ -2705,8 +2705,8 @@ + (RCTManagedPointer *)JS_NativeTimePickerAndroid_TimePickerResult:(id)json } - NativeVibrationSpecJSI::NativeVibrationSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("Vibration", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeVibrationSpecJSI::NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["vibrate"] = MethodMetadata {1, __hostFunction_NativeVibrationSpecJSI_vibrate}; @@ -2761,8 +2761,8 @@ + (RCTManagedPointer *)JS_NativeWebSocketModule_SpecConnectOptions:(id)json } - NativeWebSocketModuleSpecJSI::NativeWebSocketModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("WebSocketModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeWebSocketModuleSpecJSI::NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["connect"] = MethodMetadata {4, __hostFunction_NativeWebSocketModuleSpecJSI_connect}; diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h index 2da6323051c629..4323cd25040c21 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h @@ -42,7 +42,7 @@ namespace facebook { class JSI_EXPORT NativeAccessibilityInfoSpecJSI : public ObjCTurboModule { public: - NativeAccessibilityInfoSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -101,7 +101,7 @@ namespace facebook { class JSI_EXPORT NativeAccessibilityManagerSpecJSI : public ObjCTurboModule { public: - NativeAccessibilityManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -187,7 +187,7 @@ namespace facebook { class JSI_EXPORT NativeActionSheetManagerSpecJSI : public ObjCTurboModule { public: - NativeActionSheetManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -229,7 +229,7 @@ namespace facebook { class JSI_EXPORT NativeAlertManagerSpecJSI : public ObjCTurboModule { public: - NativeAlertManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -312,7 +312,7 @@ namespace facebook { class JSI_EXPORT NativeAnimatedModuleSpecJSI : public ObjCTurboModule { public: - NativeAnimatedModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -331,7 +331,7 @@ namespace facebook { class JSI_EXPORT NativeAnimationsDebugModuleSpecJSI : public ObjCTurboModule { public: - NativeAnimationsDebugModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -398,7 +398,7 @@ namespace facebook { class JSI_EXPORT NativeAppStateSpecJSI : public ObjCTurboModule { public: - NativeAppStateSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -418,7 +418,7 @@ namespace facebook { class JSI_EXPORT NativeAppearanceSpecJSI : public ObjCTurboModule { public: - NativeAppearanceSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -564,7 +564,7 @@ namespace facebook { class JSI_EXPORT NativeAsyncStorageSpecJSI : public ObjCTurboModule { public: - NativeAsyncStorageSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeAsyncStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -620,7 +620,7 @@ namespace facebook { class JSI_EXPORT NativeBlobModuleSpecJSI : public ObjCTurboModule { public: - NativeBlobModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -641,7 +641,7 @@ namespace facebook { class JSI_EXPORT NativeBugReportingSpecJSI : public ObjCTurboModule { public: - NativeBugReportingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -690,7 +690,7 @@ namespace facebook { class JSI_EXPORT NativeCameraRollManagerSpecJSI : public ObjCTurboModule { public: - NativeCameraRollManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeCameraRollManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -822,7 +822,7 @@ namespace facebook { class JSI_EXPORT NativeClipboardSpecJSI : public ObjCTurboModule { public: - NativeClipboardSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -842,7 +842,7 @@ namespace facebook { class JSI_EXPORT NativeDatePickerAndroidSpecJSI : public ObjCTurboModule { public: - NativeDatePickerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDatePickerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -863,7 +863,7 @@ namespace facebook { class JSI_EXPORT NativeDevLoadingViewSpecJSI : public ObjCTurboModule { public: - NativeDevLoadingViewSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -885,7 +885,7 @@ namespace facebook { class JSI_EXPORT NativeDevMenuSpecJSI : public ObjCTurboModule { public: - NativeDevMenuSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -913,7 +913,7 @@ namespace facebook { class JSI_EXPORT NativeDevSettingsSpecJSI : public ObjCTurboModule { public: - NativeDevSettingsSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -931,7 +931,7 @@ namespace facebook { class JSI_EXPORT NativeDeviceEventManagerSpecJSI : public ObjCTurboModule { public: - NativeDeviceEventManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1073,7 +1073,7 @@ namespace facebook { class JSI_EXPORT NativeDeviceInfoSpecJSI : public ObjCTurboModule { public: - NativeDeviceInfoSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1149,7 +1149,7 @@ namespace facebook { class JSI_EXPORT NativeDialogManagerAndroidSpecJSI : public ObjCTurboModule { public: - NativeDialogManagerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeDialogManagerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1220,7 +1220,7 @@ namespace facebook { class JSI_EXPORT NativeExceptionsManagerSpecJSI : public ObjCTurboModule { public: - NativeExceptionsManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1244,7 +1244,7 @@ namespace facebook { class JSI_EXPORT NativeFileReaderModuleSpecJSI : public ObjCTurboModule { public: - NativeFileReaderModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1282,7 +1282,7 @@ namespace facebook { class JSI_EXPORT NativeFrameRateLoggerSpecJSI : public ObjCTurboModule { public: - NativeFrameRateLoggerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1303,7 +1303,7 @@ namespace facebook { class JSI_EXPORT NativeHeadlessJsTaskSupportSpecJSI : public ObjCTurboModule { public: - NativeHeadlessJsTaskSupportSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1354,7 +1354,7 @@ namespace facebook { class JSI_EXPORT NativeI18nManagerSpecJSI : public ObjCTurboModule { public: - NativeI18nManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1446,7 +1446,7 @@ namespace facebook { class JSI_EXPORT NativeImageEditorSpecJSI : public ObjCTurboModule { public: - NativeImageEditorSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1478,7 +1478,7 @@ namespace facebook { class JSI_EXPORT NativeImageLoaderAndroidSpecJSI : public ObjCTurboModule { public: - NativeImageLoaderAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeImageLoaderAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1508,7 +1508,7 @@ namespace facebook { class JSI_EXPORT NativeImageLoaderIOSSpecJSI : public ObjCTurboModule { public: - NativeImageLoaderIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1569,7 +1569,7 @@ namespace facebook { class JSI_EXPORT NativeImagePickerIOSSpecJSI : public ObjCTurboModule { public: - NativeImagePickerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeImagePickerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1611,7 +1611,7 @@ namespace facebook { class JSI_EXPORT NativeImageStoreSpecJSI : public ObjCTurboModule { public: - NativeImageStoreSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeImageStoreSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1630,7 +1630,7 @@ namespace facebook { class JSI_EXPORT NativeJSCHeapCaptureSpecJSI : public ObjCTurboModule { public: - NativeJSCHeapCaptureSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1650,7 +1650,7 @@ namespace facebook { class JSI_EXPORT NativeJSCSamplingProfilerSpecJSI : public ObjCTurboModule { public: - NativeJSCSamplingProfilerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1701,7 +1701,7 @@ namespace facebook { class JSI_EXPORT NativeJSDevSupportSpecJSI : public ObjCTurboModule { public: - NativeJSDevSupportSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeJSDevSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1720,7 +1720,7 @@ namespace facebook { class JSI_EXPORT NativeKeyboardObserverSpecJSI : public ObjCTurboModule { public: - NativeKeyboardObserverSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1770,7 +1770,7 @@ namespace facebook { class JSI_EXPORT NativeLinkingSpecJSI : public ObjCTurboModule { public: - NativeLinkingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeLinkingSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1789,7 +1789,7 @@ namespace facebook { class JSI_EXPORT NativeLogBoxSpecJSI : public ObjCTurboModule { public: - NativeLogBoxSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1808,7 +1808,7 @@ namespace facebook { class JSI_EXPORT NativeModalManagerSpecJSI : public ObjCTurboModule { public: - NativeModalManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1838,7 +1838,7 @@ namespace facebook { class JSI_EXPORT NativeNetworkingAndroidSpecJSI : public ObjCTurboModule { public: - NativeNetworkingAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeNetworkingAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1884,7 +1884,7 @@ namespace facebook { class JSI_EXPORT NativeNetworkingIOSSpecJSI : public ObjCTurboModule { public: - NativeNetworkingIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -1913,7 +1913,7 @@ namespace facebook { class JSI_EXPORT NativePermissionsAndroidSpecJSI : public ObjCTurboModule { public: - NativePermissionsAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativePermissionsAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2000,7 +2000,7 @@ namespace facebook { class JSI_EXPORT NativePlatformConstantsAndroidSpecJSI : public ObjCTurboModule { public: - NativePlatformConstantsAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativePlatformConstantsAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2083,7 +2083,7 @@ namespace facebook { class JSI_EXPORT NativePlatformConstantsIOSSpecJSI : public ObjCTurboModule { public: - NativePlatformConstantsIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2181,7 +2181,7 @@ namespace facebook { class JSI_EXPORT NativePushNotificationManagerIOSSpecJSI : public ObjCTurboModule { public: - NativePushNotificationManagerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2201,7 +2201,7 @@ namespace facebook { class JSI_EXPORT NativeRedBoxSpecJSI : public ObjCTurboModule { public: - NativeRedBoxSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2224,7 +2224,7 @@ namespace facebook { class JSI_EXPORT NativeSegmentFetcherSpecJSI : public ObjCTurboModule { public: - NativeSegmentFetcherSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2273,7 +2273,7 @@ namespace facebook { class JSI_EXPORT NativeSettingsManagerSpecJSI : public ObjCTurboModule { public: - NativeSettingsManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2311,7 +2311,7 @@ namespace facebook { class JSI_EXPORT NativeShareModuleSpecJSI : public ObjCTurboModule { public: - NativeShareModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2329,7 +2329,7 @@ namespace facebook { class JSI_EXPORT NativeSoundManagerSpecJSI : public ObjCTurboModule { public: - NativeSoundManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2376,7 +2376,7 @@ namespace facebook { class JSI_EXPORT NativeSourceCodeSpecJSI : public ObjCTurboModule { public: - NativeSourceCodeSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2429,7 +2429,7 @@ namespace facebook { class JSI_EXPORT NativeStatusBarManagerAndroidSpecJSI : public ObjCTurboModule { public: - NativeStatusBarManagerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeStatusBarManagerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2501,7 +2501,7 @@ namespace facebook { class JSI_EXPORT NativeStatusBarManagerIOSSpecJSI : public ObjCTurboModule { public: - NativeStatusBarManagerIOSSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2520,7 +2520,7 @@ namespace facebook { class JSI_EXPORT NativeTVNavigationEventEmitterSpecJSI : public ObjCTurboModule { public: - NativeTVNavigationEventEmitterSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeTVNavigationEventEmitterSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2559,7 +2559,7 @@ namespace facebook { class JSI_EXPORT NativeTimePickerAndroidSpecJSI : public ObjCTurboModule { public: - NativeTimePickerAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeTimePickerAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2600,7 +2600,7 @@ namespace facebook { class JSI_EXPORT NativeTimingSpecJSI : public ObjCTurboModule { public: - NativeTimingSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2661,7 +2661,7 @@ namespace facebook { class JSI_EXPORT NativeToastAndroidSpecJSI : public ObjCTurboModule { public: - NativeToastAndroidSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeToastAndroidSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2765,7 +2765,7 @@ namespace facebook { class JSI_EXPORT NativeUIManagerSpecJSI : public ObjCTurboModule { public: - NativeUIManagerSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeUIManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2786,7 +2786,7 @@ namespace facebook { class JSI_EXPORT NativeVibrationSpecJSI : public ObjCTurboModule { public: - NativeVibrationSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -2833,7 +2833,7 @@ namespace facebook { class JSI_EXPORT NativeWebSocketModuleSpecJSI : public ObjCTurboModule { public: - NativeWebSocketModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react diff --git a/RNTester/RCTTest/RCTTestModule.mm b/RNTester/RCTTest/RCTTestModule.mm index 9c1d3d37eb8fab..7de14867e36908 100644 --- a/RNTester/RCTTest/RCTTestModule.mm +++ b/RNTester/RCTTest/RCTTestModule.mm @@ -33,7 +33,7 @@ - (void)verifySnapshot:(RCTResponseSenderBlock)callback; class JSI_EXPORT NativeTestModuleSpecJSI : public ObjCTurboModule { public: - NativeTestModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeTestModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -56,8 +56,8 @@ - (void)verifySnapshot:(RCTResponseSenderBlock)callback; } - NativeTestModuleSpecJSI::NativeTestModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("TestModule", instance, jsInvoker, nativeInvoker, perfLogger) { + NativeTestModuleSpecJSI::NativeTestModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["markTestCompleted"] = MethodMetadata {0, __hostFunction_NativeTestModuleSpecJSI_markTestCompleted}; diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h index 1277561b71c5b4..89aa23832b8225 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h @@ -127,12 +127,16 @@ class Instance; */ class JSI_EXPORT ObjCTurboModule : public TurboModule { public: - ObjCTurboModule( - const std::string &name, - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger); + // TODO(T65603471): Should we unify this with a Fabric abstraction? + struct InitParams { + std::string moduleName; + id instance; + std::shared_ptr jsInvoker; + std::shared_ptr nativeInvoker; + id perfLogger; + }; + + ObjCTurboModule(const InitParams ¶ms); jsi::Value invokeObjCMethod( jsi::Runtime &runtime, @@ -208,10 +212,8 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule { @optional // This should be required, after migration is done. -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger; +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params; @end diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm index 20caa031d987e9..221bff76829cb0 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm @@ -605,13 +605,11 @@ static RCTResponseSenderBlock convertJSIFunctionToCallback( return inv; } -ObjCTurboModule::ObjCTurboModule( - const std::string &name, - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger) - : TurboModule(name, jsInvoker), instance_(instance), nativeInvoker_(nativeInvoker), performanceLogger_(perfLogger) +ObjCTurboModule::ObjCTurboModule(const InitParams ¶ms) + : TurboModule(params.moduleName, params.jsInvoker), + instance_(params.instance), + nativeInvoker_(params.nativeInvoker), + performanceLogger_(params.perfLogger) { } diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index a2061d1ea86333..108c148885fa4e 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -215,13 +215,19 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name nativeInvoker = [_bridge decorateNativeCallInvoker:nativeInvoker]; } + facebook::react::ObjCTurboModule::InitParams params = { + .moduleName = moduleName, + .instance = module, + .jsInvoker = _jsInvoker, + .nativeInvoker = nativeInvoker, + .perfLogger = _performanceLogger, + }; + // If RCTTurboModule supports creating its own C++ TurboModule object, // allow it to do so. - if ([module respondsToSelector:@selector(getTurboModuleWithJsInvoker:nativeInvoker:perfLogger:)]) { + if ([module respondsToSelector:@selector(getTurboModule:)]) { [_performanceLogger getTurboModuleFromRCTTurboModuleStart:moduleName]; - auto turboModule = [module getTurboModuleWithJsInvoker:_jsInvoker - nativeInvoker:nativeInvoker - perfLogger:_performanceLogger]; + auto turboModule = [module getTurboModule:params]; [_performanceLogger getTurboModuleFromRCTTurboModuleEnd:moduleName]; assert(turboModule != nullptr); _turboModuleCache.insert({moduleName, turboModule}); diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h index 174783fdda2e2a..93092b148fd0df 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h @@ -42,11 +42,7 @@ namespace react { */ class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI( - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm index 0a576cfeb1a6c0..42a0c2c1bd24e1 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm @@ -111,12 +111,8 @@ .invokeObjCMethod(rt, ObjectKind, "getConstants", @selector(getConstants), args, count); } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI( - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger) - : ObjCTurboModule("SampleTurboModule", instance, jsInvoker, nativeInvoker, perfLogger) +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_["voidFunc"] = MethodMetadata{0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; methodMap_["getBool"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getBool}; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js index 1018323e960c77..7a4fcce954de83 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js @@ -27,7 +27,7 @@ type FilesOutput = Map; const moduleTemplate = ` class JSI_EXPORT Native::_MODULE_NAME_::SpecJSI : public ObjCTurboModule { public: - Native::_MODULE_NAME_::SpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms); };`; const protocolTemplate = ` diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js index ab142588de96aa..0edec3036e63c4 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js @@ -34,8 +34,8 @@ const proprertyDefTemplate = const moduleTemplate = ` ::_TURBOMODULE_METHOD_INVOKERS_:: -Native::_MODULE_NAME_::SpecJSI::Native::_MODULE_NAME_::SpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule("::_MODULE_NAME_::", instance, jsInvoker, nativeInvoker, perfLogger) { +Native::_MODULE_NAME_::SpecJSI::Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { ::_PROPERTIES_MAP_::::_CONVERSION_SELECTORS_:: }`.trim(); diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index 9fecc865e8aea3..f7fe456df26a5a 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -158,7 +158,7 @@ namespace react { class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -207,7 +207,7 @@ namespace react { class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -313,7 +313,7 @@ namespace react { class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -372,12 +372,12 @@ namespace react { class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSample2TurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react @@ -435,12 +435,12 @@ namespace react { class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { public: - NativeSample2TurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger); + NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); }; } // namespace react diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap index 126bc5aa37330e..8093291ccbb3e9 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap @@ -37,8 +37,8 @@ static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_diffic .invokeObjCMethod(rt, ObjectKind, \\"difficult\\", @selector(difficult:), args, count); } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"SampleTurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"difficult\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_difficult}; setMethodArgConversionSelector(@\\"difficult\\", 0, @\\"JS_NativeSampleTurboModule_SpecDifficultA:\\"); } @@ -67,8 +67,8 @@ namespace react { -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"SampleTurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { } @@ -135,8 +135,8 @@ static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getVal .invokeObjCMethod(rt, PromiseKind, \\"getValueWithPromise\\", @selector(getValueWithPromise:resolve:reject:), args, count); } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"SampleTurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_getConstants}; methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; methodMap_[\\"getBool\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getBool}; @@ -177,8 +177,8 @@ static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFu .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"SampleTurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; } @@ -187,8 +187,8 @@ static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidF .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); } -NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"Sample2TurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; } @@ -221,8 +221,8 @@ static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFu .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"SampleTurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; } static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { @@ -230,8 +230,8 @@ static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidF .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); } -NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(id instance, std::shared_ptr jsInvoker, std::shared_ptr nativeInvoker, id perfLogger) - : ObjCTurboModule(\\"Sample2TurboModule\\", instance, jsInvoker, nativeInvoker, perfLogger) { +NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; } From 03bd7d799ef569b5c3a0fedfd229a1c6b0f0377f Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 16 Apr 2020 17:23:39 -0700 Subject: [PATCH 044/235] Part 2: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035209. ## Changes - Codemod all ObjC NativeModule `getTurboModuleWithJsInvoker:nativeInvoker:perfLogger` methods to `getTurboModule:(const ObjCTurboModule::Args)` ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?(facebook::react::|react::|::|))CallInvoker', '>', '\)', '(?[A-Za-z0-9]+)', 'nativeInvoker', ':', '\(', 'std::shared_ptr', '<', '(facebook::react::|react::|::|)CallInvoker', '>', '\)', '(?[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k', ',', '\k', ',', '\k', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$>) getTurboModule:(const $ObjCTurboModule::InitParams &)params { return std::make_shared<$>(params); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` ## Re-generating diff ``` > hg revert -r .^ --all > node index.js # run script ``` Changelog: [iOS][Changed] - Make all ObjC NativeModules create TurboModules using ObjCTurboModule::Args Reviewed By: PeteTheHeat Differential Revision: D21036265 fbshipit-source-id: 404bcc548d1775ef23d793527606d02fe384a0a2 --- Libraries/Blob/RCTBlobManager.mm | 7 ++----- Libraries/Blob/RCTFileReaderModule.mm | 7 ++----- Libraries/CameraRoll/RCTCameraRollManager.mm | 7 ++----- Libraries/CameraRoll/RCTImagePickerManager.mm | 7 ++----- Libraries/Image/RCTImageEditingManager.mm | 7 ++----- Libraries/Image/RCTImageLoader.mm | 7 ++----- Libraries/Image/RCTImageStoreManager.mm | 7 ++----- Libraries/LinkingIOS/RCTLinkingManager.mm | 7 ++----- .../NativeAnimation/RCTNativeAnimatedModule.mm | 7 ++----- Libraries/Network/RCTNetworking.mm | 7 ++----- .../RCTPushNotificationManager.mm | 7 ++----- Libraries/Settings/RCTSettingsManager.mm | 7 ++----- Libraries/Vibration/RCTVibration.mm | 7 ++----- RNTester/RCTTest/RCTTestModule.mm | 7 ++----- React/CoreModules/RCTAccessibilityManager.mm | 9 +++------ React/CoreModules/RCTActionSheetManager.mm | 6 ++---- React/CoreModules/RCTAlertManager.mm | 8 +++----- React/CoreModules/RCTAppState.mm | 8 +++----- React/CoreModules/RCTAppearance.mm | 6 ++---- React/CoreModules/RCTAsyncLocalStorage.mm | 8 +++----- React/CoreModules/RCTClipboard.mm | 6 ++---- React/CoreModules/RCTDevLoadingView.mm | 12 ++++-------- React/CoreModules/RCTDevMenu.mm | 16 ++++++---------- React/CoreModules/RCTDevSettings.mm | 16 ++++++---------- React/CoreModules/RCTDeviceInfo.mm | 6 ++---- React/CoreModules/RCTExceptionsManager.mm | 8 +++----- React/CoreModules/RCTI18nManager.mm | 6 ++---- React/CoreModules/RCTKeyboardObserver.mm | 8 +++----- React/CoreModules/RCTLogBox.mm | 16 ++++++---------- React/CoreModules/RCTPlatform.mm | 6 ++---- React/CoreModules/RCTRedBox.mm | 16 ++++++---------- React/CoreModules/RCTSourceCode.mm | 6 ++---- React/CoreModules/RCTStatusBarManager.mm | 9 +++------ React/CoreModules/RCTTVNavigationEventEmitter.mm | 9 +++------ React/CoreModules/RCTWebSocketModule.mm | 8 +++----- .../samples/platform/ios/RCTSampleTurboModule.mm | 8 +++----- 36 files changed, 100 insertions(+), 199 deletions(-) diff --git a/Libraries/Blob/RCTBlobManager.mm b/Libraries/Blob/RCTBlobManager.mm index 1f68ec27aa5345..380f3ae22885a6 100755 --- a/Libraries/Blob/RCTBlobManager.mm +++ b/Libraries/Blob/RCTBlobManager.mm @@ -310,12 +310,9 @@ - (id)processWebsocketMessage:(id)message }; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Blob/RCTFileReaderModule.mm b/Libraries/Blob/RCTFileReaderModule.mm index 7d6eda4d5c4f3b..62e817dc487aed 100644 --- a/Libraries/Blob/RCTFileReaderModule.mm +++ b/Libraries/Blob/RCTFileReaderModule.mm @@ -71,12 +71,9 @@ @implementation RCTFileReaderModule } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/CameraRoll/RCTCameraRollManager.mm b/Libraries/CameraRoll/RCTCameraRollManager.mm index 70184a97d73ec5..2077beb78ad622 100644 --- a/Libraries/CameraRoll/RCTCameraRollManager.mm +++ b/Libraries/CameraRoll/RCTCameraRollManager.mm @@ -348,12 +348,9 @@ static void checkPhotoLibraryConfig() #endif } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/CameraRoll/RCTImagePickerManager.mm b/Libraries/CameraRoll/RCTImagePickerManager.mm index 5319a856c9ceaf..5a4df99e43b68d 100644 --- a/Libraries/CameraRoll/RCTImagePickerManager.mm +++ b/Libraries/CameraRoll/RCTImagePickerManager.mm @@ -249,12 +249,9 @@ - (void)cameraChanged:(NSNotification *)notification } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Image/RCTImageEditingManager.mm b/Libraries/Image/RCTImageEditingManager.mm index 9c870fa4bd298b..650362d81d412d 100644 --- a/Libraries/Image/RCTImageEditingManager.mm +++ b/Libraries/Image/RCTImageEditingManager.mm @@ -92,12 +92,9 @@ @implementation RCTImageEditingManager }]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Image/RCTImageLoader.mm b/Libraries/Image/RCTImageLoader.mm index 3571647cf8d3ea..5e123bc7ecb17f 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/Libraries/Image/RCTImageLoader.mm @@ -1077,12 +1077,9 @@ - (void)cancelRequest:(id)requestToken } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } RCT_EXPORT_METHOD(getSize:(NSString *)uri resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) diff --git a/Libraries/Image/RCTImageStoreManager.mm b/Libraries/Image/RCTImageStoreManager.mm index a3e0debf032020..907ecbbb6b0871 100644 --- a/Libraries/Image/RCTImageStoreManager.mm +++ b/Libraries/Image/RCTImageStoreManager.mm @@ -234,12 +234,9 @@ - (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(UIImage *image)) }); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/LinkingIOS/RCTLinkingManager.mm b/Libraries/LinkingIOS/RCTLinkingManager.mm index 0f14b40d1b70d3..b1171f6ecae8ce 100644 --- a/Libraries/LinkingIOS/RCTLinkingManager.mm +++ b/Libraries/LinkingIOS/RCTLinkingManager.mm @@ -186,12 +186,9 @@ - (void)handleOpenURLNotification:(NSNotification *)notification RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd)); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm b/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm index a5a53684f9d4e2..5d78c044c740ad 100644 --- a/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +++ b/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm @@ -335,12 +335,9 @@ - (void)eventDispatcherWillDispatchEvent:(id)event }); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Network/RCTNetworking.mm b/Libraries/Network/RCTNetworking.mm index 2989276aca93b2..b857c43a9086e4 100644 --- a/Libraries/Network/RCTNetworking.mm +++ b/Libraries/Network/RCTNetworking.mm @@ -714,12 +714,9 @@ - (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request completionBlo responseSender(@[@YES]); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index 0efb32cd88fbaa..95eec384e9a9a6 100644 --- a/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -559,12 +559,9 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification #endif //TARGET_OS_TV / TARGET_OS_UIKITFORMAC -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Settings/RCTSettingsManager.mm b/Libraries/Settings/RCTSettingsManager.mm index b52c55622543be..2f6645f24d6dd0 100644 --- a/Libraries/Settings/RCTSettingsManager.mm +++ b/Libraries/Settings/RCTSettingsManager.mm @@ -112,12 +112,9 @@ - (void)userDefaultsDidChange:(NSNotification *)note _ignoringUpdates = NO; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/Libraries/Vibration/RCTVibration.mm b/Libraries/Vibration/RCTVibration.mm index 2bbf168acd0d9e..3244818c1f742a 100644 --- a/Libraries/Vibration/RCTVibration.mm +++ b/Libraries/Vibration/RCTVibration.mm @@ -30,12 +30,9 @@ - (void)vibrate [self vibrate]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } RCT_EXPORT_METHOD(vibrateByPattern:(NSArray *)pattern diff --git a/RNTester/RCTTest/RCTTestModule.mm b/RNTester/RCTTest/RCTTestModule.mm index 7de14867e36908..a0bfe8e1390f33 100644 --- a/RNTester/RCTTest/RCTTestModule.mm +++ b/RNTester/RCTTest/RCTTestModule.mm @@ -146,12 +146,9 @@ - (dispatch_queue_t)methodQueue }]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTAccessibilityManager.mm b/React/CoreModules/RCTAccessibilityManager.mm index c192312735276f..3f6098e66aba7e 100644 --- a/React/CoreModules/RCTAccessibilityManager.mm +++ b/React/CoreModules/RCTAccessibilityManager.mm @@ -337,13 +337,10 @@ static void setMultipliers( onSuccess(@[ @(_isVoiceOverEnabled) ]); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared( - self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTActionSheetManager.mm b/React/CoreModules/RCTActionSheetManager.mm index 04a150cd46482d..754e461157349d 100644 --- a/React/CoreModules/RCTActionSheetManager.mm +++ b/React/CoreModules/RCTActionSheetManager.mm @@ -232,11 +232,9 @@ - (void)presentViewController:(UIViewController *)alertController [self presentViewController:shareController onParentViewController:controller anchorViewTag:anchorViewTag]; } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTAlertManager.mm b/React/CoreModules/RCTAlertManager.mm index e467816e5f2cbd..8a956fa71ab148 100644 --- a/React/CoreModules/RCTAlertManager.mm +++ b/React/CoreModules/RCTAlertManager.mm @@ -206,12 +206,10 @@ - (void)invalidate }); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTAppState.mm b/React/CoreModules/RCTAppState.mm index 781c0fba190980..4211d760d103e8 100644 --- a/React/CoreModules/RCTAppState.mm +++ b/React/CoreModules/RCTAppState.mm @@ -138,12 +138,10 @@ - (void)handleAppStateDidChange:(NSNotification *)notification callback(@[ @{@"app_state" : RCTCurrentAppState()} ]); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTAppearance.mm b/React/CoreModules/RCTAppearance.mm index c5616766e9078d..7e1fdbd91d15ae 100644 --- a/React/CoreModules/RCTAppearance.mm +++ b/React/CoreModules/RCTAppearance.mm @@ -82,11 +82,9 @@ - (dispatch_queue_t)methodQueue return dispatch_get_main_queue(); } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getColorScheme) diff --git a/React/CoreModules/RCTAsyncLocalStorage.mm b/React/CoreModules/RCTAsyncLocalStorage.mm index be54bb936d065c..00b66634f03edd 100644 --- a/React/CoreModules/RCTAsyncLocalStorage.mm +++ b/React/CoreModules/RCTAsyncLocalStorage.mm @@ -460,12 +460,10 @@ - (NSDictionary *)_writeEntry:(NSArray *)entry changedManifest:(BOOL } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTClipboard.mm b/React/CoreModules/RCTClipboard.mm index 8b9e47b887d0fd..ffa1d8d1fdd775 100644 --- a/React/CoreModules/RCTClipboard.mm +++ b/React/CoreModules/RCTClipboard.mm @@ -38,11 +38,9 @@ - (dispatch_queue_t)methodQueue resolve((clipboard.string ?: @"")); } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index 0e73d1007f72ae..d150607ab233aa 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -177,11 +177,9 @@ - (void)updateProgress:(RCTLoadingProgress *)progress }); } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end @@ -212,11 +210,9 @@ - (void)updateProgress:(RCTLoadingProgress *)progress - (void)hide { } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTDevMenu.mm b/React/CoreModules/RCTDevMenu.mm index 1d0be74094544a..3e9e78e85a5897 100644 --- a/React/CoreModules/RCTDevMenu.mm +++ b/React/CoreModules/RCTDevMenu.mm @@ -511,12 +511,10 @@ - (BOOL)hotLoadingEnabled return _bridge.devSettings.isHotLoadingEnabled; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end @@ -554,12 +552,10 @@ + (NSString *)moduleName return @"DevMenu"; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTDevSettings.mm b/React/CoreModules/RCTDevSettings.mm index 0ac5cc4f5ddbfd..172573be3d6972 100644 --- a/React/CoreModules/RCTDevSettings.mm +++ b/React/CoreModules/RCTDevSettings.mm @@ -453,12 +453,10 @@ - (void)jsLoaded:(NSNotification *)notification }); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end @@ -521,12 +519,10 @@ - (void)setIsShakeToShowDevMenuEnabled:(BOOL)enabled { } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTDeviceInfo.mm b/React/CoreModules/RCTDeviceInfo.mm index 9927900bd2cd8a..7a168b510ce600 100644 --- a/React/CoreModules/RCTDeviceInfo.mm +++ b/React/CoreModules/RCTDeviceInfo.mm @@ -196,11 +196,9 @@ - (void)_interfaceFrameDidChange #endif // TARGET_OS_TV -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTExceptionsManager.mm b/React/CoreModules/RCTExceptionsManager.mm index 95275b6c11138e..4899d7af7cd78f 100644 --- a/React/CoreModules/RCTExceptionsManager.mm +++ b/React/CoreModules/RCTExceptionsManager.mm @@ -148,12 +148,10 @@ - (void)reportFatal:(NSString *)message } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTI18nManager.mm b/React/CoreModules/RCTI18nManager.mm index 795e6c4ff84c0d..e9acaac29074dc 100644 --- a/React/CoreModules/RCTI18nManager.mm +++ b/React/CoreModules/RCTI18nManager.mm @@ -54,11 +54,9 @@ - (NSDictionary *)getConstants }; } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTKeyboardObserver.mm b/React/CoreModules/RCTKeyboardObserver.mm index 19140efc8b345e..c60b1030c0bf61 100644 --- a/React/CoreModules/RCTKeyboardObserver.mm +++ b/React/CoreModules/RCTKeyboardObserver.mm @@ -77,12 +77,10 @@ -(void)EVENT : (NSNotification *)notification IMPLEMENT_KEYBOARD_HANDLER(keyboardWillChangeFrame) IMPLEMENT_KEYBOARD_HANDLER(keyboardDidChangeFrame) -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTLogBox.mm b/React/CoreModules/RCTLogBox.mm index 2ef88f18e00087..d7c046caf0d9ea 100644 --- a/React/CoreModules/RCTLogBox.mm +++ b/React/CoreModules/RCTLogBox.mm @@ -119,12 +119,10 @@ + (BOOL)requiresMainQueueSetup } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end @@ -151,12 +149,10 @@ - (void)hide // noop } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTPlatform.mm b/React/CoreModules/RCTPlatform.mm index 1f444061be3a22..3f637d48e66055 100644 --- a/React/CoreModules/RCTPlatform.mm +++ b/React/CoreModules/RCTPlatform.mm @@ -76,11 +76,9 @@ - (dispatch_queue_t)methodQueue }); } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTRedBox.mm b/React/CoreModules/RCTRedBox.mm index 93ddf21a255a7d..4325dc139eca47 100644 --- a/React/CoreModules/RCTRedBox.mm +++ b/React/CoreModules/RCTRedBox.mm @@ -689,12 +689,10 @@ - (void)addCustomButton:(NSString *)title onPressHandler:(RCTRedBoxButtonPressHa [_customButtonHandlers addObject:handler]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end @@ -776,12 +774,10 @@ - (void)dismiss - (void)addCustomButton:(NSString *)title onPressHandler:(RCTRedBoxButtonPressHandler)handler { } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTSourceCode.mm b/React/CoreModules/RCTSourceCode.mm index 9b57b804563567..92cb27ef4e6929 100644 --- a/React/CoreModules/RCTSourceCode.mm +++ b/React/CoreModules/RCTSourceCode.mm @@ -41,11 +41,9 @@ + (BOOL)requiresMainQueueSetup }; } -- (std::shared_ptr)getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule:(const ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTStatusBarManager.mm b/React/CoreModules/RCTStatusBarManager.mm index 36ca452ac802f2..3dd462a8b78dde 100644 --- a/React/CoreModules/RCTStatusBarManager.mm +++ b/React/CoreModules/RCTStatusBarManager.mm @@ -196,13 +196,10 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification return (facebook::react::ModuleConstants)[self getConstants]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared( - self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } #endif // TARGET_OS_TV diff --git a/React/CoreModules/RCTTVNavigationEventEmitter.mm b/React/CoreModules/RCTTVNavigationEventEmitter.mm index 6052428f608520..58fc1ead297cfb 100644 --- a/React/CoreModules/RCTTVNavigationEventEmitter.mm +++ b/React/CoreModules/RCTTVNavigationEventEmitter.mm @@ -49,13 +49,10 @@ - (void)handleTVNavigationEventNotification:(NSNotification *)notif } } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared( - self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/React/CoreModules/RCTWebSocketModule.mm b/React/CoreModules/RCTWebSocketModule.mm index 9648b18e4fed45..e26423d245438b 100644 --- a/React/CoreModules/RCTWebSocketModule.mm +++ b/React/CoreModules/RCTWebSocketModule.mm @@ -186,12 +186,10 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket }]; } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } @end diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm b/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm index dcc81e6446a7f9..11432450bfaaa7 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm @@ -30,12 +30,10 @@ - (dispatch_queue_t)methodQueue return dispatch_get_main_queue(); } -- (std::shared_ptr) - getTurboModuleWithJsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params { - return std::make_shared(self, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } // Backward compatible invalidation From d75401af9651193d83a2b89518e13ee5f73ee783 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 16 Apr 2020 17:23:39 -0700 Subject: [PATCH 045/235] Part 3: Update RCTTurboModuleManagerDelegate to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - Update `RCTTurboModuleManagerDelegate getTurboModule:instance:jsInvoker:nativeInvoker:perfLogger` to use `RCTTurboModuleManagerDelegate getTurboModule:(const ObjCTurboModule::InitParams)` - Update all implementations of `RCTTurboModuleManagerDelegate` in accordance with this API change Changelog: [iOS][Changed] - Make RCTTurboModuleManagerDelegate create TurboModules via ObjCTurboModuleManager::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036272 fbshipit-source-id: c16002c47db26e2ba143fc1080afe9e2fe1e7816 --- RNTester/RNTester/AppDelegate.mm | 7 ++----- RNTester/RNTester/RNTesterTurboModuleProvider.h | 5 +---- RNTester/RNTester/RNTesterTurboModuleProvider.mm | 7 ++----- .../turbomodule/core/platform/ios/RCTTurboModuleManager.h | 7 ++----- .../turbomodule/core/platform/ios/RCTTurboModuleManager.mm | 6 +----- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index a6898762311470..fe0954c3444bd2 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -179,12 +179,9 @@ - (Class)getModuleClassFromName:(const char *)name } - (std::shared_ptr)getTurboModule:(const std::string &)name - instance:(id)instance - jsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker:(std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger + initParams:(const facebook::react::ObjCTurboModule::InitParams &)params { - return facebook::react::RNTesterTurboModuleProvider(name, instance, jsInvoker, nativeInvoker, perfLogger); + return facebook::react::RNTesterTurboModuleProvider(name, params); } - (id)getModuleInstanceFromClass:(Class)moduleClass diff --git a/RNTester/RNTester/RNTesterTurboModuleProvider.h b/RNTester/RNTester/RNTesterTurboModuleProvider.h index 4c61336a6df343..7c80b27b39a534 100644 --- a/RNTester/RNTester/RNTesterTurboModuleProvider.h +++ b/RNTester/RNTester/RNTesterTurboModuleProvider.h @@ -24,10 +24,7 @@ std::shared_ptr RNTesterTurboModuleProvider(const std::string &name * Provide an instance of a ObjCTurboModule, given the ObjC instance, specific to this app. */ std::shared_ptr RNTesterTurboModuleProvider(const std::string &name, - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger); + const ObjCTurboModule::InitParams ¶ms); } // namespace react } // namespace facebook diff --git a/RNTester/RNTester/RNTesterTurboModuleProvider.mm b/RNTester/RNTester/RNTesterTurboModuleProvider.mm index 9c2707654fd76a..97e5a16ced6eff 100644 --- a/RNTester/RNTester/RNTesterTurboModuleProvider.mm +++ b/RNTester/RNTester/RNTesterTurboModuleProvider.mm @@ -29,12 +29,9 @@ Class RNTesterTurboModuleClassProvider(const char *name) { } std::shared_ptr RNTesterTurboModuleProvider(const std::string &name, - id instance, - std::shared_ptr jsInvoker, - std::shared_ptr nativeInvoker, - id perfLogger) { + const ObjCTurboModule::InitParams ¶ms) { if (name == "SampleTurboModule") { - return std::make_shared(instance, jsInvoker, nativeInvoker, perfLogger); + return std::make_shared(params); } return nullptr; diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.h b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.h index 0ee31c0922c235..870d1a7d8a2ec8 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.h +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.h @@ -11,11 +11,8 @@ // TODO: Move to xplat codegen. - (std::shared_ptr)getTurboModule:(const std::string &)name - instance:(id)instance - jsInvoker:(std::shared_ptr)jsInvoker - nativeInvoker: - (std::shared_ptr)nativeInvoker - perfLogger:(id)perfLogger; + initParams: + (const facebook::react::ObjCTurboModule::InitParams &)params; @optional diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index 108c148885fa4e..d82ef6a5bb25e7 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -252,11 +252,7 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name * Step 2e: Return an exact sub-class of ObjC TurboModule */ [_performanceLogger getTurboModuleFromTMMDelegateStart:moduleName]; - auto turboModule = [_delegate getTurboModule:moduleName - instance:module - jsInvoker:_jsInvoker - nativeInvoker:nativeInvoker - perfLogger:_performanceLogger]; + auto turboModule = [_delegate getTurboModule:moduleName initParams:params]; [_performanceLogger getTurboModuleFromTMMDelegateEnd:moduleName]; if (turboModule != nullptr) { _turboModuleCache.insert({moduleName, turboModule}); From 90f60a83e3671655360806b48e1604cdebebeb6b Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 16 Apr 2020 17:44:49 -0700 Subject: [PATCH 046/235] chore: update `./scripts/test-manual-e2e.sh` (#28653) Summary: Recent changes broke the script - wrong path to open `RNTesterPods.xcworkspace` and other scripts - we change dir with `cd`. Another change is incorrect use of `RNTesterProject.xcodeproj` instead of a `xcworkspace`. This PR is a simple and short fix to make it run. ## Changelog [INTERNAL] - chore: update `./scripts/test-manual-e2e.sh` Pull Request resolved: https://github.com/facebook/react-native/pull/28653 Test Plan: Run `./scripts/test-manual-e2e.sh`. Things work. Differential Revision: D21079792 Pulled By: hramos fbshipit-source-id: 6bdb8be016f044852ed216ec53f80db40c84b5fd --- scripts/test-manual-e2e.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test-manual-e2e.sh b/scripts/test-manual-e2e.sh index 3f874d455eeaec..289c3ee377df7d 100755 --- a/scripts/test-manual-e2e.sh +++ b/scripts/test-manual-e2e.sh @@ -58,11 +58,14 @@ info "" read -n 1 adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity +success "Installing CocoaPods dependencies" +rm -rf RNTester/Pods +(cd RNTester && pod install) + info "Press any key to open the workspace in Xcode, then build and test manually." info "" read -n 1 -success "Installing CocoaPods dependencies" -rm -rf RNTester/Pods && cd RNTester && pod install + open "RNTester/RNTesterPods.xcworkspace" info "When done testing RNTester app on iOS and Android press any key to continue." @@ -113,7 +116,7 @@ info "" info "Press any key to open the project in Xcode" info "" read -n 1 -open "/tmp/${project_name}/ios/${project_name}.xcodeproj" +open "/tmp/${project_name}/ios/${project_name}.xcworkspace" cd "$repo_root" From 49e16bdc2f827a6545ad4ad526048237e0d36a8a Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Fri, 17 Apr 2020 05:25:22 -0700 Subject: [PATCH 047/235] use default value of enums YGDirection and YGMeasureMode instead of -1 Summary: Changelog: [Internal][Yoga] YGDirection variable was initialized incorrectly by casting -1 to YGDirection. Changing it to default value of direction Same for YGMeasureMode. Reviewed By: pasqualeanatriello Differential Revision: D20869042 fbshipit-source-id: 7bfe490193321baae875ef6fb49a938851950c9f --- ReactCommon/yoga/yoga/YGLayout.h | 2 +- ReactCommon/yoga/yoga/Yoga-internal.h | 8 ++++---- ReactCommon/yoga/yoga/Yoga.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ReactCommon/yoga/yoga/YGLayout.h b/ReactCommon/yoga/yoga/YGLayout.h index 30b8dd765c2c3a..b7604d8e2dbe45 100644 --- a/ReactCommon/yoga/yoga/YGLayout.h +++ b/ReactCommon/yoga/yoga/YGLayout.h @@ -36,7 +36,7 @@ struct YGLayout { // Instead of recomputing the entire layout every single time, we cache some // information to break early when nothing changed uint32_t generationCount = 0; - YGDirection lastOwnerDirection = (YGDirection) -1; + YGDirection lastOwnerDirection = YGDirectionInherit; uint32_t nextCachedMeasurementsIndex = 0; std::array diff --git a/ReactCommon/yoga/yoga/Yoga-internal.h b/ReactCommon/yoga/yoga/Yoga-internal.h index 0b3368a0d72e99..1a22f24c9c147b 100644 --- a/ReactCommon/yoga/yoga/Yoga-internal.h +++ b/ReactCommon/yoga/yoga/Yoga-internal.h @@ -54,10 +54,10 @@ struct YGCachedMeasurement { float computedHeight; YGCachedMeasurement() - : availableWidth(0), - availableHeight(0), - widthMeasureMode((YGMeasureMode) -1), - heightMeasureMode((YGMeasureMode) -1), + : availableWidth(-1), + availableHeight(-1), + widthMeasureMode(YGMeasureModeUndefined), + heightMeasureMode(YGMeasureModeUndefined), computedWidth(-1), computedHeight(-1) {} diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index d6f4a114448604..bb7da7bfd91d88 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -3821,8 +3821,10 @@ bool YGLayoutNodeInternal( if (needToVisitNode) { // Invalidate the cached results. layout->nextCachedMeasurementsIndex = 0; - layout->cachedLayout.widthMeasureMode = (YGMeasureMode) -1; - layout->cachedLayout.heightMeasureMode = (YGMeasureMode) -1; + layout->cachedLayout.availableWidth = -1; + layout->cachedLayout.availableHeight = -1; + layout->cachedLayout.widthMeasureMode = YGMeasureModeUndefined; + layout->cachedLayout.heightMeasureMode = YGMeasureModeUndefined; layout->cachedLayout.computedWidth = -1; layout->cachedLayout.computedHeight = -1; } From 04de69ab72cc2b961d269245d35953ca8e797b5b Mon Sep 17 00:00:00 2001 From: acton393 Date: Fri, 17 Apr 2020 05:43:28 -0700 Subject: [PATCH 048/235] fix typo as there is no file called YGJNI.cpp (#990) Summary: fix typo in `YogaJNIBase.java` as there is no such file called `YGJNI.cpp` Pull Request resolved: https://github.com/facebook/yoga/pull/990 Reviewed By: pasqualeanatriello Differential Revision: D20735102 Pulled By: SidharthGuglani fbshipit-source-id: 3f9f4d78ba390feae3451330f997a221ab4ec70e --- .../src/main/java/com/facebook/yoga/YogaNodeJNIBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java index e20a53892ba79d..406e75e5dc3f5e 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java @@ -15,7 +15,7 @@ @DoNotStrip public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable { - /* Those flags needs be in sync with YGJNI.cpp */ + /* Those flags needs be in sync with YGJNI.h */ private static final byte MARGIN = 1; private static final byte PADDING = 2; private static final byte BORDER = 4; From 894f6b3e744679769ba0f6b83bae89354f0f1914 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Fri, 17 Apr 2020 09:21:09 -0700 Subject: [PATCH 049/235] Remove unused packages from xplat/js/package.json Summary: We have a large amount of small packages that are completely unused, or only have one call site. This diff cleans up a lot of them and reduces node_modules by 12 MiB (down to 187). Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D21088213 fbshipit-source-id: 5fa7d3da5cbe744b0d9d3e3450d6135c1488ee79 --- scripts/android-e2e-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/android-e2e-test.js b/scripts/android-e2e-test.js index 692d19ae33f223..ccc4f32e646bb1 100644 --- a/scripts/android-e2e-test.js +++ b/scripts/android-e2e-test.js @@ -36,7 +36,7 @@ const wd = require('wd'); const path = require('path'); const fs = require('fs'); const pd = require('pretty-data2').pd; -require('colors'); + // value in ms to print out screen contents, set this value in CI to debug if tests are failing const appiumDebugInterval = process.env.APPIUM_DEBUG_INTERVAL; From 0a6713312467d3f5b5dc993e91db9e7b1aa4fc8c Mon Sep 17 00:00:00 2001 From: Zack Argyle Date: Fri, 17 Apr 2020 13:01:17 -0700 Subject: [PATCH 050/235] Make ColorValue public in StyleSheet.js Summary: This diff makes the ColorValue export "official" by exporting it from StyleSheet in order to encourage its use in product code. Changelog: Moved ColorValue export from StyleSheetTypes to StyleSheet Reviewed By: TheSavior Differential Revision: D21076969 fbshipit-source-id: 972ef5a1b13bd9f6b7691a279a73168e7ce9d9ab --- Libraries/ActionSheetIOS/ActionSheetIOS.js | 2 +- .../ActivityIndicator/ActivityIndicator.js | 2 +- .../ActivityIndicatorViewNativeComponent.js | 2 +- Libraries/Components/Button.js | 2 +- .../AndroidDrawerLayoutNativeComponent.js | 2 +- .../DrawerLayoutAndroid.android.js | 3 +- .../AndroidDialogPickerNativeComponent.js | 2 +- .../AndroidDropdownPickerNativeComponent.js | 2 +- Libraries/Components/Picker/Picker.js | 2 +- .../Picker/PickerAndroid.android.js | 3 +- Libraries/Components/Picker/PickerIOS.ios.js | 2 +- .../Pressable/useAndroidRippleForView.js | 2 +- .../ProgressBarAndroid.android.js | 2 +- .../ProgressBarAndroidNativeComponent.js | 2 +- .../ProgressViewIOS/ProgressViewIOS.ios.js | 2 +- .../RCTProgressViewNativeComponent.js | 2 +- ...ndroidSwipeRefreshLayoutNativeComponent.js | 2 +- .../PullToRefreshViewNativeComponent.js | 2 +- .../RefreshControl/RefreshControl.js | 2 +- Libraries/Components/ScrollView/ScrollView.js | 2 +- .../ScrollViewNativeComponentType.js | 2 +- .../RCTSegmentedControlNativeComponent.js | 2 +- Libraries/Components/Slider/Slider.js | 2 +- .../Slider/SliderNativeComponent.js | 2 +- Libraries/Components/StatusBar/StatusBar.js | 2 +- .../Switch/AndroidSwitchNativeComponent.js | 2 +- Libraries/Components/Switch/Switch.js | 2 +- .../Switch/SwitchNativeComponent.js | 2 +- .../AndroidTextInputNativeComponent.js | 2 +- .../TextInput/InputAccessoryView.js | 2 +- .../RCTInputAccessoryViewNativeComponent.js | 2 +- Libraries/Components/TextInput/TextInput.js | 2 +- .../Touchable/TouchableHighlight.js | 2 +- Libraries/Image/ImageViewNativeComponent.js | 2 +- Libraries/Pressability/PressabilityDebug.js | 2 +- .../PlatformColorValueTypes.android.js | 2 +- .../StyleSheet/PlatformColorValueTypes.ios.js | 2 +- .../PlatformColorValueTypesIOS.ios.js | 2 +- .../StyleSheet/PlatformColorValueTypesIOS.js | 2 +- Libraries/StyleSheet/StyleSheet.js | 10 ++++++ Libraries/StyleSheet/StyleSheetTypes.js | 32 +++++++++---------- Libraries/StyleSheet/normalizeColor.js | 2 +- Libraries/StyleSheet/processColor.js | 2 +- Libraries/StyleSheet/processColorArray.js | 2 +- RNTester/js/components/RNTesterTheme.js | 2 +- .../components/ArrayPropsNativeComponent.js | 2 +- .../components/ColorPropNativeComponent.js | 2 +- .../MultiNativePropNativeComponent.js | 6 ++-- .../components/ObjectPropsNativeComponent.js | 6 ++-- 49 files changed, 75 insertions(+), 71 deletions(-) diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index e330253df81b08..076ab004a56eb3 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -14,7 +14,7 @@ import RCTActionSheetManager from './NativeActionSheetManager'; const invariant = require('invariant'); const processColor = require('../StyleSheet/processColor'); -import type {ColorValue} from '../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../StyleSheet/StyleSheet'; import type {ProcessedColorValue} from '../StyleSheet/processColor'; /** diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 62bc6664305a04..0b57a52c0b8263 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -16,7 +16,7 @@ const StyleSheet = require('../../StyleSheet/StyleSheet'); const View = require('../View/View'); import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ViewProps} from '../View/ViewPropTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; const PlatformActivityIndicator = Platform.OS === 'android' diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js index 37898d2607ae04..a7a95da5943c1d 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js @@ -12,7 +12,7 @@ import type {WithDefault} from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index 82ea7a1b0adc33..d98766470b512d 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -21,7 +21,7 @@ const View = require('./View/View'); const invariant = require('invariant'); import type {PressEvent} from '../Types/CoreEventTypes'; -import type {ColorValue} from '../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../StyleSheet/StyleSheet'; type ButtonProps = $ReadOnly<{| /** diff --git a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js index 9f4a958595671b..aff340c6f748ab 100644 --- a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +++ b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js @@ -11,7 +11,7 @@ 'use strict'; import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes'; -import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet'; import type { WithDefault, DirectEventHandler, diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index 3758c669fd1de6..47c7b0d664e09b 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -25,8 +25,7 @@ import AndroidDrawerLayoutNativeComponent, { const DRAWER_STATES = ['Idle', 'Dragging', 'Settling']; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue, ViewStyleProp} from '../../StyleSheet/StyleSheet'; import type {DirectEventHandler} from '../../Types/CodegenTypes'; import type { MeasureOnSuccessCallback, diff --git a/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js b/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js index 156b78afe824ba..bac74826a1fb11 100644 --- a/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js +++ b/Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js @@ -22,7 +22,7 @@ import type { } from '../../Types/CodegenTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ProcessedColorValue} from '../../StyleSheet/processColor'; import type {ViewProps} from '../../Components/View/ViewPropTypes'; diff --git a/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js b/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js index bf0b9e9ead63ec..f6ddb741888247 100644 --- a/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js +++ b/Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js @@ -22,7 +22,7 @@ import type { } from '../../Types/CodegenTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ProcessedColorValue} from '../../StyleSheet/processColor'; import type {ViewProps} from '../../Components/View/ViewPropTypes'; diff --git a/Libraries/Components/Picker/Picker.js b/Libraries/Components/Picker/Picker.js index c02b18d20360df..76fa6d36f1b257 100644 --- a/Libraries/Components/Picker/Picker.js +++ b/Libraries/Components/Picker/Picker.js @@ -17,7 +17,7 @@ const React = require('react'); const UnimplementedView = require('../UnimplementedViews/UnimplementedView'); import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; const MODE_DIALOG = 'dialog'; const MODE_DROPDOWN = 'dropdown'; diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index 3b2156c204a369..573618f6c0de3e 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -21,9 +21,8 @@ import StyleSheet from '../../StyleSheet/StyleSheet'; import invariant from 'invariant'; import processColor from '../../StyleSheet/processColor'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; +import type {ColorValue, TextStyleProp} from '../../StyleSheet/StyleSheet'; type PickerItemSelectSyntheticEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index c2a5f2946fd07b..39417c3c23b4d2 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -23,7 +23,7 @@ import RCTPickerNativeComponent, { Commands as PickerCommands, } from './RCTPickerNativeComponent'; import type {TextStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ProcessedColorValue} from '../../StyleSheet/processColor'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; diff --git a/Libraries/Components/Pressable/useAndroidRippleForView.js b/Libraries/Components/Pressable/useAndroidRippleForView.js index 6aafbedf2c1cde..1e33f2a144c762 100644 --- a/Libraries/Components/Pressable/useAndroidRippleForView.js +++ b/Libraries/Components/Pressable/useAndroidRippleForView.js @@ -12,7 +12,7 @@ import invariant from 'invariant'; import {Commands} from '../View/ViewNativeComponent'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {PressEvent} from '../../Types/CoreEventTypes'; import {Platform, View, processColor} from 'react-native'; import * as React from 'react'; diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index 7b10a0521522f1..61663d6ad50b30 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -15,7 +15,7 @@ const React = require('react'); import ProgressBarAndroidNativeComponent from './ProgressBarAndroidNativeComponent'; import type {ViewProps} from '../View/ViewPropTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; export type ProgressBarAndroidProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js index 409c9ac7031483..c3efe138a71653 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import type {Double, WithDefault} from '../../Types/CodegenTypes'; diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index fd34b055585820..189f7be3872ee0 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -15,7 +15,7 @@ const StyleSheet = require('../../StyleSheet/StyleSheet'); import RCTProgressViewNativeComponent from './RCTProgressViewNativeComponent'; import type {ImageSource} from '../../Image/ImageSource'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; type Props = $ReadOnly<{| diff --git a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js index 8dd3feb50290e0..ccdd15e5100489 100644 --- a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +++ b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js @@ -12,7 +12,7 @@ import type {Float, WithDefault} from '../../Types/CodegenTypes'; import type {ImageSource} from '../../Image/ImageSource'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; diff --git a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js index 8e6dba7cede396..9bd3600eb31571 100644 --- a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +++ b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js @@ -22,7 +22,7 @@ import type { Int32, WithDefault, } from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; type NativeProps = $ReadOnly<{| diff --git a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js index 8134b8a486fd7e..adf8ba966db1bf 100644 --- a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +++ b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js @@ -11,7 +11,7 @@ 'use strict'; import type {DirectEventHandler, WithDefault} from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import * as React from 'react'; diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index f3ffa4980d4fe3..a85c820791d1e1 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -13,7 +13,7 @@ const Platform = require('../../Utilities/Platform'); const React = require('react'); -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import AndroidSwipeRefreshLayoutNativeComponent, { Commands as AndroidSwipeRefreshLayoutCommands, diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index c344ac4dfd86d9..9064bb15e1a346 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -31,7 +31,7 @@ const setAndForwardRef = require('../../Utilities/setAndForwardRef'); import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {PointProp} from '../../StyleSheet/PointPropType'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { PressEvent, ScrollEvent, diff --git a/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js b/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js index 4ea33db416b087..4004a6bfb9dc9e 100644 --- a/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +++ b/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js @@ -16,7 +16,7 @@ import type { ViewStyleProp, DangerouslyImpreciseStyle, } from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {ScrollEvent} from '../../Types/CoreEventTypes'; import type {PointProp} from '../../StyleSheet/PointPropType'; diff --git a/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js b/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js index 8923582c394f74..c860c04ea9dcbb 100644 --- a/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +++ b/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js @@ -18,7 +18,7 @@ import type { WithDefault, Int32, } from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; export type OnChangeEvent = $ReadOnly<{| value: Int32, diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 1a5d23f049b884..3add030f08af4e 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -17,7 +17,7 @@ const StyleSheet = require('../../StyleSheet/StyleSheet'); import type {ImageSource} from '../../Image/ImageSource'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; diff --git a/Libraries/Components/Slider/SliderNativeComponent.js b/Libraries/Components/Slider/SliderNativeComponent.js index 91bb01b590fe90..c79d0fb730630f 100644 --- a/Libraries/Components/Slider/SliderNativeComponent.js +++ b/Libraries/Components/Slider/SliderNativeComponent.js @@ -20,7 +20,7 @@ import type { import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ImageSource} from '../../Image/ImageSource'; import type {ViewProps} from '../View/ViewPropTypes'; diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 482149fb7be6b0..9352594540a38d 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -15,7 +15,7 @@ const React = require('react'); const invariant = require('invariant'); const processColor = require('../../StyleSheet/processColor'); -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid'; import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS'; diff --git a/Libraries/Components/Switch/AndroidSwitchNativeComponent.js b/Libraries/Components/Switch/AndroidSwitchNativeComponent.js index 41644ff8109a58..61629b32cc6335 100644 --- a/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +++ b/Libraries/Components/Switch/AndroidSwitchNativeComponent.js @@ -21,7 +21,7 @@ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNativeTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; type SwitchChangeEvent = $ReadOnly<{| diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index caf191c74a917e..3b0937d893e040 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -22,7 +22,7 @@ import SwitchNativeComponent, { Commands as SwitchCommands, } from './SwitchNativeComponent'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; diff --git a/Libraries/Components/Switch/SwitchNativeComponent.js b/Libraries/Components/Switch/SwitchNativeComponent.js index 87c7299f9df148..c9bbe253bf3066 100644 --- a/Libraries/Components/Switch/SwitchNativeComponent.js +++ b/Libraries/Components/Switch/SwitchNativeComponent.js @@ -11,7 +11,7 @@ 'use strict'; import type {BubblingEventHandler, WithDefault} from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import * as React from 'react'; diff --git a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js index 2ac53e759b825d..61e37c54bea434 100644 --- a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js @@ -21,7 +21,7 @@ import type { } from '../../Types/CodegenTypes'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {TextStyleProp, ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import requireNativeComponent from '../../ReactNative/requireNativeComponent'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; diff --git a/Libraries/Components/TextInput/InputAccessoryView.js b/Libraries/Components/TextInput/InputAccessoryView.js index b35920d5bcb23d..71c225bc4de3e2 100644 --- a/Libraries/Components/TextInput/InputAccessoryView.js +++ b/Libraries/Components/TextInput/InputAccessoryView.js @@ -17,7 +17,7 @@ const StyleSheet = require('../../StyleSheet/StyleSheet'); import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; /** * Note: iOS only diff --git a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js index c0f0de232784ac..7fc7ed4861cb59 100644 --- a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +++ b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 7fca6ef1fd6e55..decaeae0057f21 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -24,7 +24,7 @@ const nullthrows = require('nullthrows'); const setAndForwardRef = require('../../Utilities/setAndForwardRef'); import type {TextStyleProp, ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import type {SyntheticEvent, ScrollEvent} from '../../Types/CoreEventTypes'; import type {PressEvent} from '../../Types/CoreEventTypes'; diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index c7db381c792eba..a29159e9f585f2 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -15,7 +15,7 @@ import Pressability, { } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import TVTouchable from './TVTouchable'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import Platform from '../../Utilities/Platform'; diff --git a/Libraries/Image/ImageViewNativeComponent.js b/Libraries/Image/ImageViewNativeComponent.js index b5dea64e6f19f7..8a6c0b25aab2e4 100644 --- a/Libraries/Image/ImageViewNativeComponent.js +++ b/Libraries/Image/ImageViewNativeComponent.js @@ -18,7 +18,7 @@ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; import type {ImageProps} from './ImageProps'; import type {ViewProps} from '../Components/View/ViewPropTypes'; import type {ImageStyleProp} from '../StyleSheet/StyleSheet'; -import type {ColorValue} from '../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../StyleSheet/StyleSheet'; import ImageViewViewConfig from './ImageViewViewConfig'; const ReactNativeViewConfigRegistry = require('../Renderer/shims/ReactNativeViewConfigRegistry'); diff --git a/Libraries/Pressability/PressabilityDebug.js b/Libraries/Pressability/PressabilityDebug.js index 168a8c1d110163..dd8ecdd2d172e0 100644 --- a/Libraries/Pressability/PressabilityDebug.js +++ b/Libraries/Pressability/PressabilityDebug.js @@ -11,7 +11,7 @@ 'use strict'; import normalizeColor from '../StyleSheet/normalizeColor'; -import type {ColorValue} from '../StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../StyleSheet/StyleSheet'; import Touchable from '../Components/Touchable/Touchable'; import View from '../Components/View/View'; diff --git a/Libraries/StyleSheet/PlatformColorValueTypes.android.js b/Libraries/StyleSheet/PlatformColorValueTypes.android.js index 16772d2d6832ba..82e7e55ec12889 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypes.android.js +++ b/Libraries/StyleSheet/PlatformColorValueTypes.android.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import type {ProcessedColorValue} from './processColor'; export opaque type NativeColorValue = { diff --git a/Libraries/StyleSheet/PlatformColorValueTypes.ios.js b/Libraries/StyleSheet/PlatformColorValueTypes.ios.js index d329db9316f2d1..d2707ed5dfb648 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +++ b/Libraries/StyleSheet/PlatformColorValueTypes.ios.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import type {ProcessedColorValue} from './processColor'; export opaque type NativeColorValue = { diff --git a/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js b/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js index 2b21c61f3df19e..ebdbc7a078ac7b 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +++ b/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import {DynamicColorIOSPrivate} from './PlatformColorValueTypes'; export type DynamicColorIOSTuple = { diff --git a/Libraries/StyleSheet/PlatformColorValueTypesIOS.js b/Libraries/StyleSheet/PlatformColorValueTypesIOS.js index cc9aa69e80f96b..a7f27e53e50103 100644 --- a/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +++ b/Libraries/StyleSheet/PlatformColorValueTypesIOS.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; export type DynamicColorIOSTuple = { light: ColorValue, diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index 54094d8bd4929e..c4de35ce721987 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -17,6 +17,7 @@ const StyleSheetValidation = require('./StyleSheetValidation'); const flatten = require('./flattenStyle'); import type { + ____ColorValue_Internal, ____Styles_Internal, ____DangerouslyImpreciseStyle_Internal, ____DangerouslyImpreciseStyleProp_Internal, @@ -28,6 +29,15 @@ import type { ____ImageStyleProp_Internal, } from './StyleSheetTypes'; +/** + * This type should be used as the type for anything that is a color. It is + * most useful when using DynamicColorIOS which can be a string or a dynamic + * color object. + * + * type props = {backgroundColor: ColorValue}; + */ +export type ColorValue = ____ColorValue_Internal; + /** * This type should be used as the type for a prop that is passed through * to a 's `style` prop. This ensures call sites of the component diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 97fe6fe355df56..b2d596a14df668 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -14,9 +14,9 @@ const AnimatedNode = require('../Animated/src/nodes/AnimatedNode'); import type {NativeColorValue} from './PlatformColorValueTypes'; -export type ColorValue = null | string | NativeColorValue; +export type ____ColorValue_Internal = null | string | NativeColorValue; -export type ColorArrayValue = null | $ReadOnlyArray; +export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>; export type PointValue = {| x: number, y: number, @@ -530,7 +530,7 @@ export type ____ShadowStyle_Internal = $ReadOnly<{| * Sets the drop shadow color * @platform ios */ - shadowColor?: ColorValue, + shadowColor?: ____ColorValue_Internal, /** * Sets the drop shadow offset * @platform ios @@ -556,14 +556,14 @@ export type ____ViewStyle_Internal = $ReadOnly<{| ...$Exact<____ShadowStyle_Internal>, ...$Exact<____TransformStyle_Internal>, backfaceVisibility?: 'visible' | 'hidden', - backgroundColor?: ColorValue, - borderColor?: ColorValue, - borderBottomColor?: ColorValue, - borderEndColor?: ColorValue, - borderLeftColor?: ColorValue, - borderRightColor?: ColorValue, - borderStartColor?: ColorValue, - borderTopColor?: ColorValue, + backgroundColor?: ____ColorValue_Internal, + borderColor?: ____ColorValue_Internal, + borderBottomColor?: ____ColorValue_Internal, + borderEndColor?: ____ColorValue_Internal, + borderLeftColor?: ____ColorValue_Internal, + borderRightColor?: ____ColorValue_Internal, + borderStartColor?: ____ColorValue_Internal, + borderTopColor?: ____ColorValue_Internal, borderRadius?: number | AnimatedNode, borderBottomEndRadius?: number | AnimatedNode, borderBottomLeftRadius?: number | AnimatedNode, @@ -600,7 +600,7 @@ export type ____FontWeight_Internal = export type ____TextStyle_Internal = $ReadOnly<{| ...$Exact<____ViewStyle_Internal>, - color?: ColorValue, + color?: ____ColorValue_Internal, fontFamily?: string, fontSize?: number, fontStyle?: 'normal' | 'italic', @@ -617,7 +617,7 @@ export type ____TextStyle_Internal = $ReadOnly<{| height: number, |}>, textShadowRadius?: number, - textShadowColor?: ColorValue, + textShadowColor?: ____ColorValue_Internal, letterSpacing?: number, lineHeight?: number, textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify', @@ -629,7 +629,7 @@ export type ____TextStyle_Internal = $ReadOnly<{| | 'line-through' | 'underline line-through', textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed', - textDecorationColor?: ColorValue, + textDecorationColor?: ____ColorValue_Internal, textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase', writingDirection?: 'auto' | 'ltr' | 'rtl', |}>; @@ -637,14 +637,14 @@ export type ____TextStyle_Internal = $ReadOnly<{| export type ____ImageStyle_Internal = $ReadOnly<{| ...$Exact<____ViewStyle_Internal>, resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat', - tintColor?: ColorValue, + tintColor?: ____ColorValue_Internal, overlayColor?: string, |}>; export type ____DangerouslyImpreciseStyle_Internal = { ...$Exact<____TextStyle_Internal>, +resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat', - +tintColor?: ColorValue, + +tintColor?: ____ColorValue_Internal, +overlayColor?: string, ... }; diff --git a/Libraries/StyleSheet/normalizeColor.js b/Libraries/StyleSheet/normalizeColor.js index eaee5813b177e1..bd7737c5d568b7 100755 --- a/Libraries/StyleSheet/normalizeColor.js +++ b/Libraries/StyleSheet/normalizeColor.js @@ -12,7 +12,7 @@ 'use strict'; -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import type {ProcessedColorValue} from './processColor'; function normalizeColor( diff --git a/Libraries/StyleSheet/processColor.js b/Libraries/StyleSheet/processColor.js index 3bfa9679e00a79..93a5c383540ff6 100644 --- a/Libraries/StyleSheet/processColor.js +++ b/Libraries/StyleSheet/processColor.js @@ -14,7 +14,7 @@ const Platform = require('../Utilities/Platform'); const normalizeColor = require('./normalizeColor'); -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import type {NativeColorValue} from './PlatformColorValueTypes'; export type ProcessedColorValue = number | NativeColorValue; diff --git a/Libraries/StyleSheet/processColorArray.js b/Libraries/StyleSheet/processColorArray.js index 9bdb026b5bc0c3..0cbbdcd745b6b4 100644 --- a/Libraries/StyleSheet/processColorArray.js +++ b/Libraries/StyleSheet/processColorArray.js @@ -12,7 +12,7 @@ const processColor = require('./processColor'); -import type {ColorValue} from './StyleSheetTypes'; +import type {ColorValue} from './StyleSheet'; import type {ProcessedColorValue} from './processColor'; function processColorArray( diff --git a/RNTester/js/components/RNTesterTheme.js b/RNTester/js/components/RNTesterTheme.js index 7bc14ea3ebd99d..5a1244ef36280c 100644 --- a/RNTester/js/components/RNTesterTheme.js +++ b/RNTester/js/components/RNTesterTheme.js @@ -12,7 +12,7 @@ import * as React from 'react'; import {Appearance} from 'react-native'; -import type {ColorValue} from '../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet'; export type RNTesterTheme = { LabelColor: ColorValue, diff --git a/packages/react-native-codegen/e2e/__test_fixtures__/components/ArrayPropsNativeComponent.js b/packages/react-native-codegen/e2e/__test_fixtures__/components/ArrayPropsNativeComponent.js index 98c2b3ac5490bd..63b0bbeefb74d9 100644 --- a/packages/react-native-codegen/e2e/__test_fixtures__/components/ArrayPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/__test_fixtures__/components/ArrayPropsNativeComponent.js @@ -12,9 +12,9 @@ import type { PointValue, - ColorValue, EdgeInsetsValue, } from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet'; import type {ImageSource} from '../../../../../Libraries/Image/ImageSource'; import type { Int32, diff --git a/packages/react-native-codegen/e2e/__test_fixtures__/components/ColorPropNativeComponent.js b/packages/react-native-codegen/e2e/__test_fixtures__/components/ColorPropNativeComponent.js index 10afa18f80e275..c00a934f6a814b 100644 --- a/packages/react-native-codegen/e2e/__test_fixtures__/components/ColorPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/__test_fixtures__/components/ColorPropNativeComponent.js @@ -10,7 +10,7 @@ 'use strict'; -import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet'; import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes'; import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent'; import type {HostComponent} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes'; diff --git a/packages/react-native-codegen/e2e/__test_fixtures__/components/MultiNativePropNativeComponent.js b/packages/react-native-codegen/e2e/__test_fixtures__/components/MultiNativePropNativeComponent.js index a4e3b545ff61bb..6965813f5ddf5e 100644 --- a/packages/react-native-codegen/e2e/__test_fixtures__/components/MultiNativePropNativeComponent.js +++ b/packages/react-native-codegen/e2e/__test_fixtures__/components/MultiNativePropNativeComponent.js @@ -10,10 +10,8 @@ 'use strict'; -import type { - PointValue, - ColorValue, -} from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {PointValue} from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet'; import type {ImageSource} from '../../../../../Libraries/Image/ImageSource'; import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes'; import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent'; diff --git a/packages/react-native-codegen/e2e/__test_fixtures__/components/ObjectPropsNativeComponent.js b/packages/react-native-codegen/e2e/__test_fixtures__/components/ObjectPropsNativeComponent.js index a967576c405340..cfaf7d8b4bf0ef 100644 --- a/packages/react-native-codegen/e2e/__test_fixtures__/components/ObjectPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/__test_fixtures__/components/ObjectPropsNativeComponent.js @@ -12,10 +12,8 @@ import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes'; import type {ImageSource} from '../../../../../Libraries/Image/ImageSource'; -import type { - PointValue, - ColorValue, -} from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {PointValue} from '../../../../../Libraries/StyleSheet/StyleSheetTypes'; +import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet'; import type { Int32, Float, From 4c538fc8d024f8bd9900442b06ff523b10bc2d37 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 17 Apr 2020 21:17:31 -0700 Subject: [PATCH 051/235] Fabric: `LayoutableShadowNode:getLayoutMetrics` is not a virtual method anymore Summary: We don't use it as vitrual anymore (setLayoutMetrics is a non-virtual method already), so it does not need to be marker virtual. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028572 fbshipit-source-id: 99f86fdd4cf2f5972034d9058d7b82bdc8680187 --- ReactCommon/fabric/core/layout/LayoutableShadowNode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h index 5351328522335e..78601fa5e221c0 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h @@ -89,7 +89,7 @@ class LayoutableShadowNode : public ShadowNode { /* * Returns layout metrics computed during previous layout pass. */ - virtual LayoutMetrics getLayoutMetrics() const; + LayoutMetrics getLayoutMetrics() const; /* * Returns a transform object that represents transformations that will/should From 62544c0830d11844d60e3c0d641ade74e1ca56c6 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 17 Apr 2020 21:17:31 -0700 Subject: [PATCH 052/235] Fabric: Proper traits for `ImageShadowNode` and `ViewShadowNode` Summary: * must be a leaf node; having a proper trait will fail earlier in case of misuse (mounting something inside). * must have a `View` trait because it's for what that trait is. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21028573 fbshipit-source-id: 457716d4661333eb2357f34316f3e495ab4fda24 --- ReactCommon/fabric/components/image/ImageShadowNode.h | 6 ++++++ ReactCommon/fabric/components/view/ViewShadowNode.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.h b/ReactCommon/fabric/components/image/ImageShadowNode.h index 592a67b505a50f..d4cf8d5cb5a1c3 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.h +++ b/ReactCommon/fabric/components/image/ImageShadowNode.h @@ -30,6 +30,12 @@ class ImageShadowNode final : public ConcreteViewShadowNode< public: using ConcreteViewShadowNode::ConcreteViewShadowNode; + static ShadowNodeTraits BaseTraits() { + auto traits = ConcreteViewShadowNode::BaseTraits(); + traits.set(ShadowNodeTraits::Trait::LeafYogaNode); + return traits; + } + /* * Associates a shared `ImageManager` with the node. */ diff --git a/ReactCommon/fabric/components/view/ViewShadowNode.h b/ReactCommon/fabric/components/view/ViewShadowNode.h index 969c6267b2c240..8d27e37143ff2a 100644 --- a/ReactCommon/fabric/components/view/ViewShadowNode.h +++ b/ReactCommon/fabric/components/view/ViewShadowNode.h @@ -23,6 +23,12 @@ class ViewShadowNode final : public ConcreteViewShadowNode< ViewProps, ViewEventEmitter> { public: + static ShadowNodeTraits BaseTraits() { + auto traits = BaseShadowNode::BaseTraits(); + traits.set(ShadowNodeTraits::Trait::View); + return traits; + } + ViewShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, From cc07baa87e5a55221915c02f170ccdc3ade0b117 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 17 Apr 2020 21:17:31 -0700 Subject: [PATCH 053/235] Fabric: "Attempt to mutate a sealed object." is now an assert (not exception) Summary: This is a debug-only feature that simply should be an assert. When it triggers in debugger and bubbles to some random exception catch block which makes it impossible to understand was exactly it happens. Making it an assert will stop debugger exactly where it happens. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028571 fbshipit-source-id: 3df4ec0da922026bb9df61081cb71113577e06e9 --- ReactCommon/fabric/core/primitives/Sealable.cpp | 6 ++---- ReactCommon/fabric/core/tests/PrimitivesTest.cpp | 11 ++++++++--- ReactCommon/fabric/core/tests/ShadowNodeTest.cpp | 4 +++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ReactCommon/fabric/core/primitives/Sealable.cpp b/ReactCommon/fabric/core/primitives/Sealable.cpp index 501f8d60edeb11..5bc35e6908b68b 100644 --- a/ReactCommon/fabric/core/primitives/Sealable.cpp +++ b/ReactCommon/fabric/core/primitives/Sealable.cpp @@ -7,7 +7,7 @@ #include "Sealable.h" -#include +#include namespace facebook { namespace react { @@ -56,9 +56,7 @@ bool Sealable::getSealed() const { } void Sealable::ensureUnsealed() const { - if (sealed_) { - throw std::runtime_error("Attempt to mutate a sealed object."); - } + assert(!sealed_ && "Attempt to mutate a sealed object."); } #endif diff --git a/ReactCommon/fabric/core/tests/PrimitivesTest.cpp b/ReactCommon/fabric/core/tests/PrimitivesTest.cpp index f156ed77b420c0..49c4f4bd93384e 100644 --- a/ReactCommon/fabric/core/tests/PrimitivesTest.cpp +++ b/ReactCommon/fabric/core/tests/PrimitivesTest.cpp @@ -23,17 +23,22 @@ TEST(SealableTest, sealObjectCorrectly) { TEST(SealableTest, handleAssignmentsCorrectly) { Sealable obj; Sealable other; - EXPECT_NO_THROW(obj = other); + + // Should work fine. + obj = other; // Assignment after getting sealed is not allowed. obj.seal(); Sealable other2; - EXPECT_THROW(obj = other2, std::runtime_error); + + EXPECT_DEATH_IF_SUPPORTED( + { obj = other2; }, "Attempt to mutate a sealed object."); // It doesn't matter if the other object is also sealed, it's still not // allowed. other2.seal(); - EXPECT_THROW(obj = other2, std::runtime_error); + EXPECT_DEATH_IF_SUPPORTED( + { obj = other2; }, "Attempt to mutate a sealed object."); // Fresh creation off other Sealable is still unsealed. Sealable other3(obj); diff --git a/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp b/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp index 08e331a56fcd4f..3f0c74ebc280f2 100644 --- a/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp +++ b/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp @@ -288,5 +288,7 @@ TEST_F(ShadowNodeTest, handleState) { // State cannot be changed for sealed shadow node. secondNode->sealRecursive(); - EXPECT_ANY_THROW(secondNode->setStateData(TestState{42})); + EXPECT_DEATH_IF_SUPPORTED( + { secondNode->setStateData(TestState{42}); }, + "Attempt to mutate a sealed object."); } From e1eef24321cbffdae10dad2993374b9679ff005a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 17 Apr 2020 21:17:31 -0700 Subject: [PATCH 054/235] Fabric: Implementation of `getDebugDescription` for `std::array` Summary: Yoga uses `std::array` a lot (and `std::array` is not a `std::vector`), so it's useful for printing Yoga values. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028570 fbshipit-source-id: c6bf114d5362f085ea201ecdc5b7d59646b33ebd --- .../fabric/debug/DebugStringConvertible.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ReactCommon/fabric/debug/DebugStringConvertible.h b/ReactCommon/fabric/debug/DebugStringConvertible.h index efab8ffaa4f9e4..f50d9be071ebbe 100644 --- a/ReactCommon/fabric/debug/DebugStringConvertible.h +++ b/ReactCommon/fabric/debug/DebugStringConvertible.h @@ -302,6 +302,23 @@ std::vector getDebugChildren( return vector; } +// `std::array` +template +std::string getDebugName(std::array const &array) { + return "List"; +} + +template +std::vector getDebugChildren( + std::array const &array, + DebugStringConvertibleOptions options) { + auto vector = std::vector{}; + for (auto const &value : array) { + vector.push_back(value); + } + return vector; +} + // `std::unordered_set` template std::string getDebugName(std::unordered_set const &set) { From e56950dc658f7c51c0368cd4665514f048c0c967 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sat, 18 Apr 2020 14:51:46 -0700 Subject: [PATCH 055/235] Fabric: `componentregistry` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885163 fbshipit-source-id: 08eb1ba1d408fc0948e8d0da62380786a40973af --- .../ART/RCTARTSurfaceViewComponentView.mm | 2 +- .../Fabric/Mounting/RCTComponentViewFactory.h | 2 +- .../Mounting/RCTComponentViewFactory.mm | 2 +- .../Mounting/RCTComponentViewProtocol.h | 2 +- React/Fabric/RCTScheduler.h | 2 +- React/Fabric/RCTScheduler.mm | 2 +- React/Fabric/RCTSurfacePresenter.mm | 2 +- .../java/com/facebook/react/fabric/jni/BUCK | 1 + .../com/facebook/react/fabric/jni/Binding.cpp | 2 +- .../fabric/jni/ComponentFactoryDelegate.cpp | 2 +- .../fabric/jni/ComponentFactoryDelegate.h | 2 +- ReactCommon/fabric/componentregistry/BUCK | 62 +++++++++++++++++++ .../ComponentDescriptorFactory.h | 0 .../ComponentDescriptorProvider.h | 0 .../ComponentDescriptorProviderRegistry.cpp | 0 .../ComponentDescriptorProviderRegistry.h | 4 +- .../ComponentDescriptorRegistry.cpp | 3 +- .../ComponentDescriptorRegistry.h | 2 +- ReactCommon/fabric/components/modal/BUCK | 1 + ReactCommon/fabric/components/picker/BUCK | 1 + ReactCommon/fabric/components/slider/BUCK | 1 + ReactCommon/fabric/components/switch/BUCK | 1 + ReactCommon/fabric/components/text/BUCK | 1 + ReactCommon/fabric/components/textinput/BUCK | 1 + .../components/textinput/iostextinput/BUCK | 1 + .../fabric/components/view/tests/ViewTest.cpp | 2 +- .../core/tests/ShadowNodeFamilyTest.cpp | 2 +- ReactCommon/fabric/element/BUCK | 1 + ReactCommon/fabric/element/ComponentBuilder.h | 2 +- ReactCommon/fabric/element/testUtils.h | 2 +- .../fabric/element/tests/ElementTest.cpp | 2 +- ReactCommon/fabric/textlayoutmanager/BUCK | 1 + ReactCommon/fabric/uimanager/BUCK | 1 + ReactCommon/fabric/uimanager/Scheduler.cpp | 2 +- ReactCommon/fabric/uimanager/Scheduler.h | 4 +- .../fabric/uimanager/SchedulerToolbox.h | 2 +- ReactCommon/fabric/uimanager/UIManager.h | 2 +- .../fabric/uimanager/UITemplateProcessor.h | 2 +- .../tests/UITemplateProcessorTest.cpp | 8 +-- 39 files changed, 102 insertions(+), 30 deletions(-) create mode 100644 ReactCommon/fabric/componentregistry/BUCK rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorFactory.h (100%) rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorProvider.h (100%) rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorProviderRegistry.cpp (100%) rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorProviderRegistry.h (94%) rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorRegistry.cpp (98%) rename ReactCommon/fabric/{uimanager => componentregistry}/ComponentDescriptorRegistry.h (97%) diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm index 0a5e9a531d83cc..f8a26d871f6bf8 100644 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm @@ -6,7 +6,7 @@ */ #import "RCTARTSurfaceViewComponentView.h" -#import +#import #import "RCTARTSurfaceViewComponentDescriptor.h" #import "FBRCTFabricComponentsPlugins.h" diff --git a/React/Fabric/Mounting/RCTComponentViewFactory.h b/React/Fabric/Mounting/RCTComponentViewFactory.h index ee347d9cf75c43..638fd4e5bdedc5 100644 --- a/React/Fabric/Mounting/RCTComponentViewFactory.h +++ b/React/Fabric/Mounting/RCTComponentViewFactory.h @@ -10,7 +10,7 @@ #import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/Mounting/RCTComponentViewFactory.mm b/React/Fabric/Mounting/RCTComponentViewFactory.mm index 773eba1ccc2958..e1566df29bf32b 100644 --- a/React/Fabric/Mounting/RCTComponentViewFactory.mm +++ b/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -13,8 +13,8 @@ #import #import +#import #import -#import #ifdef RN_DISABLE_OSS_PLUGIN_HEADER #import diff --git a/React/Fabric/Mounting/RCTComponentViewProtocol.h b/React/Fabric/Mounting/RCTComponentViewProtocol.h index 334b1bd89176c1..3fd2c3fccf5034 100644 --- a/React/Fabric/Mounting/RCTComponentViewProtocol.h +++ b/React/Fabric/Mounting/RCTComponentViewProtocol.h @@ -8,11 +8,11 @@ #import #import +#import #import #import #import #import -#import NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTScheduler.h b/React/Fabric/RCTScheduler.h index d0f9cda86c34d1..8268c6f4a7e557 100644 --- a/React/Fabric/RCTScheduler.h +++ b/React/Fabric/RCTScheduler.h @@ -9,11 +9,11 @@ #import #import +#import #import #import #import #import -#import #import #import diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index e6257df16cca57..c4979f27dcb2d4 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -7,8 +7,8 @@ #import "RCTScheduler.h" +#import #import -#import #import #import diff --git a/React/Fabric/RCTSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm index bf110e2e8966d7..255d7eb5a83d2d 100644 --- a/React/Fabric/RCTSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -23,11 +23,11 @@ #import #import +#import #import #import #import #import -#import #import #import #import diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK index 65ffaea91c4cbd..197318dfedf80d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK @@ -29,6 +29,7 @@ rn_xplat_cxx_library( react_native_xplat_target("better:better"), react_native_xplat_target("config:config"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/components/scrollview:scrollview"), react_native_xplat_target("utils:utils"), react_native_target("jni/react/jni:jni"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 908b0e73eab9f8..0ed720b2af195a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.cpp index 4a722a75b9d649..0f4d4c08fb64c0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include using namespace facebook::jsi; diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h index aea2b356b1c7a1..61ca26c85c3502 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/ReactCommon/fabric/componentregistry/BUCK b/ReactCommon/fabric/componentregistry/BUCK new file mode 100644 index 00000000000000..b5be24c533470c --- /dev/null +++ b/ReactCommon/fabric/componentregistry/BUCK @@ -0,0 +1,62 @@ +load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode") +load( + "//tools/build_defs/oss:rn_defs.bzl", + "ANDROID", + "APPLE", + "CXX", + "get_apple_compiler_flags", + "get_apple_inspector_flags", + "react_native_xplat_target", + "rn_xplat_cxx_library", + "subdir_glob", +) + +APPLE_COMPILER_FLAGS = get_apple_compiler_flags() + +rn_xplat_cxx_library( + name = "componentregistry", + srcs = glob( + ["**/*.cpp"], + exclude = glob(["tests/**/*.cpp"]), + ), + headers = glob( + ["**/*.h"], + exclude = glob(["tests/**/*.h"]), + ), + header_namespace = "", + exported_headers = subdir_glob( + [ + ("", "*.h"), + ], + prefix = "react/componentregistry", + ), + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++14", + "-Wall", + ], + fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], + fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), + force_static = True, + macosx_tests_override = [], + platforms = (ANDROID, APPLE, CXX), + preprocessor_flags = [ + "-DLOG_TAG=\"ReactNative\"", + "-DWITH_FBSYSTRACE=1", + ], + visibility = ["PUBLIC"], + deps = [ + "//xplat/fbsystrace:fbsystrace", + "//xplat/folly:headers_only", + "//xplat/folly:memory", + "//xplat/folly:molly", + "//xplat/jsi:JSIDynamic", + "//xplat/jsi:jsi", + "//xplat/third-party/glog:glog", + react_native_xplat_target("fabric/core:core"), + react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("utils:utils"), + ], +) diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorFactory.h b/ReactCommon/fabric/componentregistry/ComponentDescriptorFactory.h similarity index 100% rename from ReactCommon/fabric/uimanager/ComponentDescriptorFactory.h rename to ReactCommon/fabric/componentregistry/ComponentDescriptorFactory.h diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorProvider.h b/ReactCommon/fabric/componentregistry/ComponentDescriptorProvider.h similarity index 100% rename from ReactCommon/fabric/uimanager/ComponentDescriptorProvider.h rename to ReactCommon/fabric/componentregistry/ComponentDescriptorProvider.h diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorProviderRegistry.cpp b/ReactCommon/fabric/componentregistry/ComponentDescriptorProviderRegistry.cpp similarity index 100% rename from ReactCommon/fabric/uimanager/ComponentDescriptorProviderRegistry.cpp rename to ReactCommon/fabric/componentregistry/ComponentDescriptorProviderRegistry.cpp diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorProviderRegistry.h b/ReactCommon/fabric/componentregistry/ComponentDescriptorProviderRegistry.h similarity index 94% rename from ReactCommon/fabric/uimanager/ComponentDescriptorProviderRegistry.h rename to ReactCommon/fabric/componentregistry/ComponentDescriptorProviderRegistry.h index fb8e5ee4512ee1..40be7eb6ad0a4f 100644 --- a/ReactCommon/fabric/uimanager/ComponentDescriptorProviderRegistry.h +++ b/ReactCommon/fabric/componentregistry/ComponentDescriptorProviderRegistry.h @@ -9,9 +9,9 @@ #include +#include +#include #include -#include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp b/ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.cpp similarity index 98% rename from ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp rename to ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.cpp index 778f32fbde30eb..b85cf63661a532 100644 --- a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.cpp +++ b/ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.cpp @@ -7,9 +7,8 @@ #include "ComponentDescriptorRegistry.h" +#include #include -#include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.h b/ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.h similarity index 97% rename from ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.h rename to ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.h index 26ff94ea1709f4..3f25839bf5c06d 100644 --- a/ReactCommon/fabric/uimanager/ComponentDescriptorRegistry.h +++ b/ReactCommon/fabric/componentregistry/ComponentDescriptorRegistry.h @@ -12,8 +12,8 @@ #include #include +#include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/components/modal/BUCK b/ReactCommon/fabric/components/modal/BUCK index 7beb9ec18d8018..070a02cb8494fa 100644 --- a/ReactCommon/fabric/components/modal/BUCK +++ b/ReactCommon/fabric/components/modal/BUCK @@ -84,6 +84,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/graphics:graphics"), react_native_xplat_target("fabric/imagemanager:imagemanager"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), "//xplat/js/react-native-github:generated_components-rncore", ], ) diff --git a/ReactCommon/fabric/components/picker/BUCK b/ReactCommon/fabric/components/picker/BUCK index 82604cfca44f1d..829f5adec8fd0c 100644 --- a/ReactCommon/fabric/components/picker/BUCK +++ b/ReactCommon/fabric/components/picker/BUCK @@ -65,6 +65,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/graphics:graphics"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), "//xplat/js/react-native-github:generated_components-rncore", ], ) diff --git a/ReactCommon/fabric/components/slider/BUCK b/ReactCommon/fabric/components/slider/BUCK index a661fdbb4f40c2..52f567d985a99e 100644 --- a/ReactCommon/fabric/components/slider/BUCK +++ b/ReactCommon/fabric/components/slider/BUCK @@ -93,6 +93,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/graphics:graphics"), react_native_xplat_target("fabric/imagemanager:imagemanager"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), "//xplat/js/react-native-github:generated_components-rncore", ], ) diff --git a/ReactCommon/fabric/components/switch/BUCK b/ReactCommon/fabric/components/switch/BUCK index 7aece1971a7bec..f5b4493c5de37b 100644 --- a/ReactCommon/fabric/components/switch/BUCK +++ b/ReactCommon/fabric/components/switch/BUCK @@ -66,6 +66,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/graphics:graphics"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), "//xplat/js/react-native-github:generated_components-rncore", ], ) diff --git a/ReactCommon/fabric/components/text/BUCK b/ReactCommon/fabric/components/text/BUCK index 6ea5e080c86c91..c32ad04dfc4509 100644 --- a/ReactCommon/fabric/components/text/BUCK +++ b/ReactCommon/fabric/components/text/BUCK @@ -69,6 +69,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/textlayoutmanager:textlayoutmanager"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), ], ) diff --git a/ReactCommon/fabric/components/textinput/BUCK b/ReactCommon/fabric/components/textinput/BUCK index 448cbe3e532f29..aa630a15ac7383 100644 --- a/ReactCommon/fabric/components/textinput/BUCK +++ b/ReactCommon/fabric/components/textinput/BUCK @@ -68,6 +68,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/components/image:image"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/imagemanager:imagemanager"), ], ) diff --git a/ReactCommon/fabric/components/textinput/iostextinput/BUCK b/ReactCommon/fabric/components/textinput/iostextinput/BUCK index 94b321c61a6238..d6baec266ab94e 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/BUCK +++ b/ReactCommon/fabric/components/textinput/iostextinput/BUCK @@ -68,6 +68,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/components/image:image"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/imagemanager:imagemanager"), ], ) diff --git a/ReactCommon/fabric/components/view/tests/ViewTest.cpp b/ReactCommon/fabric/components/view/tests/ViewTest.cpp index 32aff6679052df..2224bc6829498c 100644 --- a/ReactCommon/fabric/components/view/tests/ViewTest.cpp +++ b/ReactCommon/fabric/components/view/tests/ViewTest.cpp @@ -10,13 +10,13 @@ #include +#include #include #include #include #include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/core/tests/ShadowNodeFamilyTest.cpp b/ReactCommon/fabric/core/tests/ShadowNodeFamilyTest.cpp index b5737b4b24130c..26f5c861fa2f4b 100644 --- a/ReactCommon/fabric/core/tests/ShadowNodeFamilyTest.cpp +++ b/ReactCommon/fabric/core/tests/ShadowNodeFamilyTest.cpp @@ -9,10 +9,10 @@ #include +#include #include #include #include -#include using namespace facebook::react; diff --git a/ReactCommon/fabric/element/BUCK b/ReactCommon/fabric/element/BUCK index 85428f8bd7dad1..f7fce793547bdd 100644 --- a/ReactCommon/fabric/element/BUCK +++ b/ReactCommon/fabric/element/BUCK @@ -57,6 +57,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/components/scrollview:scrollview"), react_native_xplat_target("fabric/components/text:text"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("utils:utils"), diff --git a/ReactCommon/fabric/element/ComponentBuilder.h b/ReactCommon/fabric/element/ComponentBuilder.h index 9e015665ec18cf..cafbaaa019cf23 100644 --- a/ReactCommon/fabric/element/ComponentBuilder.h +++ b/ReactCommon/fabric/element/ComponentBuilder.h @@ -9,11 +9,11 @@ #include +#include #include #include #include #include -#include #include #include diff --git a/ReactCommon/fabric/element/testUtils.h b/ReactCommon/fabric/element/testUtils.h index 008786913c1b77..2c32cbd60e8144 100644 --- a/ReactCommon/fabric/element/testUtils.h +++ b/ReactCommon/fabric/element/testUtils.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/element/tests/ElementTest.cpp b/ReactCommon/fabric/element/tests/ElementTest.cpp index 0a0a09b015e4a8..3ed6c7f8fcc2b3 100644 --- a/ReactCommon/fabric/element/tests/ElementTest.cpp +++ b/ReactCommon/fabric/element/tests/ElementTest.cpp @@ -9,12 +9,12 @@ #include +#include #include #include #include #include #include -#include using namespace facebook::react; diff --git a/ReactCommon/fabric/textlayoutmanager/BUCK b/ReactCommon/fabric/textlayoutmanager/BUCK index ff90396790bc20..ba629ee394966b 100644 --- a/ReactCommon/fabric/textlayoutmanager/BUCK +++ b/ReactCommon/fabric/textlayoutmanager/BUCK @@ -129,6 +129,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/graphics:graphics"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), ], ) diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index b9bae06f580423..e2bdd3b4c26864 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -61,6 +61,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/mounting:mounting"), react_native_xplat_target("fabric/core:core"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("utils:utils"), ], diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index 6b9c47f7a93db4..6a8133f20a384b 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -10,9 +10,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/ReactCommon/fabric/uimanager/Scheduler.h b/ReactCommon/fabric/uimanager/Scheduler.h index 31f40b474b5569..0cf62b7622bc13 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.h +++ b/ReactCommon/fabric/uimanager/Scheduler.h @@ -10,12 +10,12 @@ #include #include +#include +#include #include #include #include #include -#include -#include #include #include #include diff --git a/ReactCommon/fabric/uimanager/SchedulerToolbox.h b/ReactCommon/fabric/uimanager/SchedulerToolbox.h index 0ffa322acab807..1862f1889fd0de 100644 --- a/ReactCommon/fabric/uimanager/SchedulerToolbox.h +++ b/ReactCommon/fabric/uimanager/SchedulerToolbox.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index db882e3aec2a4c..7d282d43836205 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -11,12 +11,12 @@ #include #include +#include #include #include #include #include #include -#include #include namespace facebook { diff --git a/ReactCommon/fabric/uimanager/UITemplateProcessor.h b/ReactCommon/fabric/uimanager/UITemplateProcessor.h index dff902334b749d..4f9a892acf9397 100644 --- a/ReactCommon/fabric/uimanager/UITemplateProcessor.h +++ b/ReactCommon/fabric/uimanager/UITemplateProcessor.h @@ -11,9 +11,9 @@ #include +#include #include #include -#include #include namespace facebook { diff --git a/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp b/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp index 3339afa17e29cb..b1d2d97e85ff5b 100644 --- a/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp +++ b/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp @@ -9,18 +9,18 @@ #include #include -#include +#include #include using namespace facebook::react; +#include +#include +#include #include #include #include #include -#include -#include -#include #include namespace facebook { From 599f1edd9a86f0ba8fe88c0882f7dbee05e58896 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sat, 18 Apr 2020 14:51:46 -0700 Subject: [PATCH 056/235] Fabric: `scheduler` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885645 fbshipit-source-id: 8148bd934879802b076261ed86fa78acf0a07ed3 --- React/Fabric/RCTScheduler.h | 2 +- React/Fabric/RCTScheduler.mm | 4 +- React/Fabric/RCTSurfacePresenter.mm | 2 +- .../java/com/facebook/react/fabric/jni/BUCK | 1 + .../com/facebook/react/fabric/jni/Binding.cpp | 6 +- .../com/facebook/react/fabric/jni/Binding.h | 4 +- .../fabric/jni/ComponentFactoryDelegate.h | 2 +- ReactCommon/fabric/scheduler/BUCK | 67 +++++++++++++++++++ .../{uimanager => scheduler}/Scheduler.cpp | 0 .../{uimanager => scheduler}/Scheduler.h | 4 +- .../SchedulerDelegate.h | 0 .../SchedulerToolbox.cpp | 0 .../SchedulerToolbox.h | 0 13 files changed, 80 insertions(+), 12 deletions(-) create mode 100644 ReactCommon/fabric/scheduler/BUCK rename ReactCommon/fabric/{uimanager => scheduler}/Scheduler.cpp (100%) rename ReactCommon/fabric/{uimanager => scheduler}/Scheduler.h (97%) rename ReactCommon/fabric/{uimanager => scheduler}/SchedulerDelegate.h (100%) rename ReactCommon/fabric/{uimanager => scheduler}/SchedulerToolbox.cpp (100%) rename ReactCommon/fabric/{uimanager => scheduler}/SchedulerToolbox.h (100%) diff --git a/React/Fabric/RCTScheduler.h b/React/Fabric/RCTScheduler.h index 8268c6f4a7e557..d38465591fe2c4 100644 --- a/React/Fabric/RCTScheduler.h +++ b/React/Fabric/RCTScheduler.h @@ -14,7 +14,7 @@ #import #import #import -#import +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index c4979f27dcb2d4..25821a72e6d913 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -9,8 +9,8 @@ #import #import -#import -#import +#import +#import #import diff --git a/React/Fabric/RCTSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm index 255d7eb5a83d2d..ae1005d3676d52 100644 --- a/React/Fabric/RCTSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -28,7 +28,7 @@ #import #import #import -#import +#import #import #import diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK index 197318dfedf80d..fc4d7c9c768531 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK @@ -29,6 +29,7 @@ rn_xplat_cxx_library( react_native_xplat_target("better:better"), react_native_xplat_target("config:config"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/scheduler:scheduler"), react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/components/scrollview:scrollview"), react_native_xplat_target("utils:utils"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 0ed720b2af195a..e188e9d336e688 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -21,9 +21,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h index 1145d7ea8f0e3f..2d7128d23875d1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "ComponentFactoryDelegate.h" diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h index 61ca26c85c3502..aae5a8e5220b28 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactoryDelegate.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ReactCommon/fabric/scheduler/BUCK b/ReactCommon/fabric/scheduler/BUCK new file mode 100644 index 00000000000000..bea55d62d27428 --- /dev/null +++ b/ReactCommon/fabric/scheduler/BUCK @@ -0,0 +1,67 @@ +load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode") +load( + "//tools/build_defs/oss:rn_defs.bzl", + "ANDROID", + "APPLE", + "CXX", + "get_apple_compiler_flags", + "get_apple_inspector_flags", + "react_native_xplat_target", + "rn_xplat_cxx_library", + "subdir_glob", +) + +APPLE_COMPILER_FLAGS = get_apple_compiler_flags() + +rn_xplat_cxx_library( + name = "scheduler", + srcs = glob( + ["**/*.cpp"], + exclude = glob(["tests/**/*.cpp"]), + ), + headers = glob( + ["**/*.h"], + exclude = glob(["tests/**/*.h"]), + ), + header_namespace = "", + exported_headers = subdir_glob( + [ + ("", "*.h"), + ], + prefix = "react/scheduler", + ), + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++14", + "-Wall", + ], + fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], + fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), + force_static = True, + macosx_tests_override = [], + platforms = (ANDROID, APPLE, CXX), + preprocessor_flags = [ + "-DLOG_TAG=\"ReactNative\"", + "-DWITH_FBSYSTRACE=1", + ], + visibility = ["PUBLIC"], + deps = [ + "//xplat/fbsystrace:fbsystrace", + "//xplat/folly:headers_only", + "//xplat/folly:memory", + "//xplat/folly:molly", + "//xplat/jsi:JSIDynamic", + "//xplat/jsi:jsi", + "//xplat/third-party/glog:glog", + react_native_xplat_target("fabric/core:core"), + react_native_xplat_target("fabric/mounting:mounting"), + react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("config:config"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), + react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("fabric/components/root:root"), + react_native_xplat_target("utils:utils"), + ], +) diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/scheduler/Scheduler.cpp similarity index 100% rename from ReactCommon/fabric/uimanager/Scheduler.cpp rename to ReactCommon/fabric/scheduler/Scheduler.cpp diff --git a/ReactCommon/fabric/uimanager/Scheduler.h b/ReactCommon/fabric/scheduler/Scheduler.h similarity index 97% rename from ReactCommon/fabric/uimanager/Scheduler.h rename to ReactCommon/fabric/scheduler/Scheduler.h index 0cf62b7622bc13..59e91c5dfa711a 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.h +++ b/ReactCommon/fabric/scheduler/Scheduler.h @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/ReactCommon/fabric/uimanager/SchedulerDelegate.h b/ReactCommon/fabric/scheduler/SchedulerDelegate.h similarity index 100% rename from ReactCommon/fabric/uimanager/SchedulerDelegate.h rename to ReactCommon/fabric/scheduler/SchedulerDelegate.h diff --git a/ReactCommon/fabric/uimanager/SchedulerToolbox.cpp b/ReactCommon/fabric/scheduler/SchedulerToolbox.cpp similarity index 100% rename from ReactCommon/fabric/uimanager/SchedulerToolbox.cpp rename to ReactCommon/fabric/scheduler/SchedulerToolbox.cpp diff --git a/ReactCommon/fabric/uimanager/SchedulerToolbox.h b/ReactCommon/fabric/scheduler/SchedulerToolbox.h similarity index 100% rename from ReactCommon/fabric/uimanager/SchedulerToolbox.h rename to ReactCommon/fabric/scheduler/SchedulerToolbox.h From 7a2c685ac14cae1f5baf51beabea6af0f26bc645 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sat, 18 Apr 2020 14:51:46 -0700 Subject: [PATCH 057/235] Fabric: `templateprocessor` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885646 fbshipit-source-id: b8e3199c0eacc57a5be1481595cf97c84f972293 --- ReactCommon/fabric/scheduler/BUCK | 1 + ReactCommon/fabric/scheduler/Scheduler.cpp | 2 +- ReactCommon/fabric/templateprocessor/BUCK | 93 +++++++++++++++++++ .../UITemplateProcessor.cpp | 0 .../UITemplateProcessor.h | 0 .../tests/UITemplateProcessorTest.cpp | 2 +- 6 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 ReactCommon/fabric/templateprocessor/BUCK rename ReactCommon/fabric/{uimanager => templateprocessor}/UITemplateProcessor.cpp (100%) rename ReactCommon/fabric/{uimanager => templateprocessor}/UITemplateProcessor.h (100%) rename ReactCommon/fabric/{uimanager => templateprocessor}/tests/UITemplateProcessorTest.cpp (98%) diff --git a/ReactCommon/fabric/scheduler/BUCK b/ReactCommon/fabric/scheduler/BUCK index bea55d62d27428..527e6756d5f96d 100644 --- a/ReactCommon/fabric/scheduler/BUCK +++ b/ReactCommon/fabric/scheduler/BUCK @@ -58,6 +58,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/mounting:mounting"), react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/templateprocessor:templateprocessor"), react_native_xplat_target("config:config"), react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/debug:debug"), diff --git a/ReactCommon/fabric/scheduler/Scheduler.cpp b/ReactCommon/fabric/scheduler/Scheduler.cpp index 6a8133f20a384b..671713b4b69a8a 100644 --- a/ReactCommon/fabric/scheduler/Scheduler.cpp +++ b/ReactCommon/fabric/scheduler/Scheduler.cpp @@ -13,9 +13,9 @@ #include #include #include +#include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/templateprocessor/BUCK b/ReactCommon/fabric/templateprocessor/BUCK new file mode 100644 index 00000000000000..4a35935675458a --- /dev/null +++ b/ReactCommon/fabric/templateprocessor/BUCK @@ -0,0 +1,93 @@ +load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode") +load( + "//tools/build_defs/oss:rn_defs.bzl", + "ANDROID", + "APPLE", + "CXX", + "fb_xplat_cxx_test", + "get_apple_compiler_flags", + "get_apple_inspector_flags", + "react_native_xplat_target", + "rn_xplat_cxx_library", + "subdir_glob", +) + +APPLE_COMPILER_FLAGS = get_apple_compiler_flags() + +rn_xplat_cxx_library( + name = "templateprocessor", + srcs = glob( + ["**/*.cpp"], + exclude = glob(["tests/**/*.cpp"]), + ), + headers = glob( + ["**/*.h"], + exclude = glob(["tests/**/*.h"]), + ), + header_namespace = "", + exported_headers = subdir_glob( + [ + ("", "*.h"), + ], + prefix = "react/templateprocessor", + ), + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++14", + "-Wall", + ], + fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], + fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), + force_static = True, + macosx_tests_override = [], + platforms = (ANDROID, APPLE, CXX), + preprocessor_flags = [ + "-DLOG_TAG=\"ReactNative\"", + "-DWITH_FBSYSTRACE=1", + ], + tests = [":tests"], + visibility = ["PUBLIC"], + deps = [ + "//xplat/fbsystrace:fbsystrace", + "//xplat/folly:headers_only", + "//xplat/folly:memory", + "//xplat/folly:molly", + "//xplat/jsi:JSIDynamic", + "//xplat/jsi:jsi", + "//xplat/third-party/glog:glog", + react_native_xplat_target("fabric/core:core"), + react_native_xplat_target("fabric/uimanager:uimanager"), + react_native_xplat_target("fabric/componentregistry:componentregistry"), + react_native_xplat_target("fabric/debug:debug"), + react_native_xplat_target("config:config"), + react_native_xplat_target("utils:utils"), + ], +) + +fb_xplat_cxx_test( + name = "tests", + srcs = glob(["tests/**/*.cpp"]), + headers = glob(["tests/**/*.h"]), + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++14", + "-Wall", + ], + contacts = ["oncall+react_native@xmail.facebook.com"], + platforms = (ANDROID, APPLE, CXX), + deps = [ + ":templateprocessor", + "//xplat/folly:molly", + "//xplat/third-party/gmock:gtest", + react_native_xplat_target("config:config"), + react_native_xplat_target("fabric/components/activityindicator:activityindicator"), + react_native_xplat_target("fabric/components/image:image"), + react_native_xplat_target("fabric/components/root:root"), + react_native_xplat_target("fabric/components/scrollview:scrollview"), + react_native_xplat_target("fabric/components/view:view"), + "//xplat/js/react-native-github:generated_components-rncore", + ], +) diff --git a/ReactCommon/fabric/uimanager/UITemplateProcessor.cpp b/ReactCommon/fabric/templateprocessor/UITemplateProcessor.cpp similarity index 100% rename from ReactCommon/fabric/uimanager/UITemplateProcessor.cpp rename to ReactCommon/fabric/templateprocessor/UITemplateProcessor.cpp diff --git a/ReactCommon/fabric/uimanager/UITemplateProcessor.h b/ReactCommon/fabric/templateprocessor/UITemplateProcessor.h similarity index 100% rename from ReactCommon/fabric/uimanager/UITemplateProcessor.h rename to ReactCommon/fabric/templateprocessor/UITemplateProcessor.h diff --git a/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp b/ReactCommon/fabric/templateprocessor/tests/UITemplateProcessorTest.cpp similarity index 98% rename from ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp rename to ReactCommon/fabric/templateprocessor/tests/UITemplateProcessorTest.cpp index b1d2d97e85ff5b..743b203a6b097b 100644 --- a/ReactCommon/fabric/uimanager/tests/UITemplateProcessorTest.cpp +++ b/ReactCommon/fabric/templateprocessor/tests/UITemplateProcessorTest.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include using namespace facebook::react; From 335f3aabe28ec8f9b96fd695edabf0d5ab0b402a Mon Sep 17 00:00:00 2001 From: Jason Safaiyeh Date: Sat, 18 Apr 2020 17:48:26 -0700 Subject: [PATCH 058/235] Migrate deprecated frameInterval to preferredFramesPerSecond (#28675) Summary: [frameInterval](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1621231-frameinterval) was deprecated in favor of [preferredFramesPerSecond](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1648421-preferredframespersecond). This migrates the deprecated call over. ## Changelog [iOS] [Fixed] - Migrate frameInterval to preferredFramesPerSecond Pull Request resolved: https://github.com/facebook/react-native/pull/28675 Test Plan: Xcode should no longer throw warnings about the deprecated call. Differential Revision: D21109710 Pulled By: shergin fbshipit-source-id: 772b9f625d3e22cd4d8cd60bddad57ff8611af54 --- Libraries/Image/RCTUIImageViewAnimated.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Image/RCTUIImageViewAnimated.m b/Libraries/Image/RCTUIImageViewAnimated.m index 21f1a065b316fb..979b9aff3a4336 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.m +++ b/Libraries/Image/RCTUIImageViewAnimated.m @@ -183,7 +183,7 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink // TODO: `displayLink.frameInterval` is not available on UIKitForMac NSTimeInterval duration = displayLink.duration; #else - NSTimeInterval duration = displayLink.duration * displayLink.frameInterval; + NSTimeInterval duration = displayLink.duration * displayLink.preferredFramesPerSecond; #endif NSUInteger totalFrameCount = self.totalFrameCount; NSUInteger currentFrameIndex = self.currentFrameIndex; From de188a2c97d4e2ba23cb12476e1a9f39a737f0bd Mon Sep 17 00:00:00 2001 From: empyrical Date: Sun, 19 Apr 2020 12:04:39 -0700 Subject: [PATCH 059/235] Fabric: Fix case of Glog include in MountingTest.cpp (#28616) Summary: This pull request changes the include of Glog from `` to `` in `MountingTest.cpp`. This fixes building on a case-sensitive filesystem. ## Changelog [Internal] [Fixed] - Fabric: Fix case of Glog include in MountingTest.cpp Pull Request resolved: https://github.com/facebook/react-native/pull/28616 Test Plan: The `include` of Glog no longer causes issues with building `MountingTest.cpp` on a case-sensitive filesystem. Differential Revision: D21118085 Pulled By: shergin fbshipit-source-id: c958c54bf88333fd5001127779c855ce8c2666c3 --- ReactCommon/fabric/mounting/tests/MountingTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/mounting/tests/MountingTest.cpp b/ReactCommon/fabric/mounting/tests/MountingTest.cpp index 1241987432e928..87cc2e19155844 100644 --- a/ReactCommon/fabric/mounting/tests/MountingTest.cpp +++ b/ReactCommon/fabric/mounting/tests/MountingTest.cpp @@ -14,7 +14,7 @@ #include "shadowTreeGeneration.h" -#include +#include #include namespace facebook { From b0006648e2f58de77f261c5660cb74e2beccbbe9 Mon Sep 17 00:00:00 2001 From: empyrical Date: Sun, 19 Apr 2020 12:57:32 -0700 Subject: [PATCH 060/235] Fabric: Add Unicode prefix to AttachmentCharacter (#28617) Summary: This pull request adds a Unicode `u8` prefix to the string literal returned in `AttributedString.cpp`'s `Fragment::AttachmentCharacter()`. This fixes the following error when building on MSVC: ``` react\attributedstring\AttributedString.cpp(21): error C4566: character represented by universal-character-name '\uFFFC' cannot be represented in the current code page (1252) ``` ## Changelog [Internal] [Fixed] - Fabric: Add Unicode prefix to AttachmentCharacter Pull Request resolved: https://github.com/facebook/react-native/pull/28617 Test Plan: The Fabric test suite has been ran on a Clang-based build of Fabric on macOS, and no regressions in it have been noted. Differential Revision: D21118078 Pulled By: shergin fbshipit-source-id: c105de5e4edb67fed97ce44153a75d9d380bf588 --- ReactCommon/fabric/attributedstring/AttributedString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/attributedstring/AttributedString.cpp b/ReactCommon/fabric/attributedstring/AttributedString.cpp index 7d872e65e9c0e7..57120d063c4e86 100644 --- a/ReactCommon/fabric/attributedstring/AttributedString.cpp +++ b/ReactCommon/fabric/attributedstring/AttributedString.cpp @@ -18,7 +18,7 @@ using Fragments = AttributedString::Fragments; #pragma mark - Fragment std::string Fragment::AttachmentCharacter() { - return "\uFFFC"; // Unicode `OBJECT REPLACEMENT CHARACTER` + return u8"\uFFFC"; // Unicode `OBJECT REPLACEMENT CHARACTER` } bool Fragment::isAttachment() const { From 6694ce00bb6a78cc344cd6eac200d2ed8c5e46b9 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 19 Apr 2020 22:30:40 -0700 Subject: [PATCH 061/235] Fabric: Fixed incorrect early-return in `UIView+ComponentViewProtocol::updateLayoutMetrics` Summary: Before the change, an incorrect (NaN or Inf) values in LayoutMetrics might force an early return in the `updateLayoutMetrics:oldMetrics:` method implementation. This was not correct because the rest of the method also didn't run in this case, so it might force some value to stale. E.g., imagine we have an instruction that contains NaN size and `display: none`. Previously, the function might just return right before applying sizes and progress the stored "already applied" value of LayoutMetrics which will cause the view being visible even if it should not. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110644 fbshipit-source-id: 501319d7b1dcd5c18f27e0ceca3c8d207485c49b --- React/Fabric/Mounting/UIView+ComponentViewProtocol.mm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm index c9dc5f98d7ac90..0eda1bda5ea8e8 100644 --- a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +++ b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm @@ -79,13 +79,12 @@ - (void)updateLayoutMetrics:(LayoutMetrics const &)layoutMetrics @"-[UIView(ComponentViewProtocol) updateLayoutMetrics:oldLayoutMetrics:]: Received invalid layout metrics (%@) for a view (%@).", NSStringFromCGRect(frame), self); - return; + } else { + // Note: Changing `frame` when `layer.transform` is not the `identity transform` is undefined behavior. + // Therefore, we must use `center` and `bounds`. + self.center = CGPoint{CGRectGetMidX(frame), CGRectGetMidY(frame)}; + self.bounds = CGRect{CGPointZero, frame.size}; } - - // Note: Changing `frame` when `layer.transform` is not the `identity transform` is undefined behavior. - // Therefore, we must use `center` and `bounds`. - self.center = CGPoint{CGRectGetMidX(frame), CGRectGetMidY(frame)}; - self.bounds = CGRect{CGPointZero, frame.size}; } if (forceUpdate || (layoutMetrics.layoutDirection != oldLayoutMetrics.layoutDirection)) { From 7757ad05762284c059807d7d75fd03559e86f2b2 Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Sun, 19 Apr 2020 22:48:48 -0700 Subject: [PATCH 062/235] Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 --- .../facebook/react/views/view/ReactViewBackgroundDrawable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index 9a8f45c9f10ca9..9fe66d2fad46df 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -998,10 +998,11 @@ private static int fastBorderCompatibleColorOrZero( } private void drawRectangularBackgroundWithBorders(Canvas canvas) { + mPaint.setStyle(Paint.Style.FILL); + int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha); if (Color.alpha(useColor) != 0) { // color is not transparent mPaint.setColor(useColor); - mPaint.setStyle(Paint.Style.FILL); canvas.drawRect(getBounds(), mPaint); } From 5dc6eded1b160fa6e923b6bb11633acff484ea74 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 19 Apr 2020 22:50:34 -0700 Subject: [PATCH 063/235] Fabric: Using proper clock in MountingTelemetryTest Summary: Apparently, `std::this_thread::sleep_for` uses a different clock to measure time which causes ofter misalignment with the clock which Telemery uses which makes the test flaky. Using the same clock should fix it. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21116058 fbshipit-source-id: 52dde2e325776d365431a2a957dcc12dfe53f890 --- .../mounting/tests/MountingTelemetryTest.cpp | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp b/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp index afeaf6f2f31c79..8d1426675b85bb 100644 --- a/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp +++ b/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp @@ -18,11 +18,19 @@ using namespace facebook::react; #define EXPECT_EQ_WITH_THRESHOLD(a, b, threshold) \ EXPECT_TRUE((a >= b - threshold) && (a <= b + threshold)) +template +void sleep(double durationInSeconds) { + auto timepoint = ClockT::now() + + std::chrono::milliseconds((long long)(durationInSeconds * 1000)); + while (ClockT::now() < timepoint) { + } +} + TEST(MountingTelemetryTest, timepoints) { - auto threshold = int64_t{100}; + auto threshold = int64_t{10}; auto timepointA = telemetryTimePointNow(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + sleep(0.1); auto timepointB = telemetryTimePointNow(); auto duration = telemetryDurationToMilliseconds(timepointB - timepointA); @@ -31,21 +39,21 @@ TEST(MountingTelemetryTest, timepoints) { } TEST(MountingTelemetryTest, normalUseCase) { - auto threshold = int64_t{100}; + auto threshold = int64_t{10}; auto telemetry = MountingTelemetry{}; telemetry.willCommit(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + sleep(0.1); telemetry.willLayout(); - std::this_thread::sleep_for(std::chrono::milliseconds(200)); + sleep(0.2); telemetry.didLayout(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + sleep(0.1); telemetry.didCommit(); - std::this_thread::sleep_for(std::chrono::milliseconds(300)); + sleep(0.3); telemetry.willMount(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + sleep(0.1); telemetry.didMount(); auto commitDuration = telemetryDurationToMilliseconds( @@ -55,7 +63,7 @@ TEST(MountingTelemetryTest, normalUseCase) { auto mountDuration = telemetryDurationToMilliseconds( telemetry.getMountEndTime() - telemetry.getMountStartTime()); - EXPECT_EQ_WITH_THRESHOLD(commitDuration, 400, threshold * 2); + EXPECT_EQ_WITH_THRESHOLD(commitDuration, 400, threshold); EXPECT_EQ_WITH_THRESHOLD(layoutDuration, 200, threshold); EXPECT_EQ_WITH_THRESHOLD(mountDuration, 100, threshold); } From 28dce3665d8a63e902c165c060400486fe6234f4 Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Sun, 19 Apr 2020 23:42:16 -0700 Subject: [PATCH 064/235] Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 --- RNTester/js/examples/View/ViewExample.js | 49 +++++++++++++++++-- .../view/ReactViewBackgroundDrawable.java | 34 ++++++++----- 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/RNTester/js/examples/View/ViewExample.js b/RNTester/js/examples/View/ViewExample.js index 06b27412120e4e..7f89797ed51570 100644 --- a/RNTester/js/examples/View/ViewExample.js +++ b/RNTester/js/examples/View/ViewExample.js @@ -148,12 +148,53 @@ exports.examples = [ }, }, { - title: 'Circle with Border Radius', + title: 'Rounded Borders', render(): React.Node { return ( - + + + + + + ); }, }, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index 9fe66d2fad46df..b9863d87203bd8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -526,11 +526,6 @@ private void updatePath() { mTempRectForBorderRadiusOutline.set(getBounds()); mTempRectForCenterDrawPath.set(getBounds()); - float fullBorderWidth = getFullBorderWidth(); - if (fullBorderWidth > 0) { - mTempRectForCenterDrawPath.inset(fullBorderWidth * 0.5f, fullBorderWidth * 0.5f); - } - final RectF borderWidth = getDirectionAwareBorderInsets(); mInnerClipTempRectForBorderRadius.top += borderWidth.top; @@ -538,6 +533,11 @@ private void updatePath() { mInnerClipTempRectForBorderRadius.left += borderWidth.left; mInnerClipTempRectForBorderRadius.right -= borderWidth.right; + mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f; + mTempRectForCenterDrawPath.bottom -= borderWidth.bottom * 0.5f; + mTempRectForCenterDrawPath.left += borderWidth.left * 0.5f; + mTempRectForCenterDrawPath.right -= borderWidth.right * 0.5f; + final float borderRadius = getFullBorderRadius(); float topLeftRadius = getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.TOP_LEFT); float topRightRadius = getBorderRadiusOrDefaultTo(borderRadius, BorderRadiusLocation.TOP_RIGHT); @@ -663,14 +663,22 @@ private void updatePath() { mCenterDrawPath.addRoundRect( mTempRectForCenterDrawPath, new float[] { - innerTopLeftRadiusX + (topLeftRadius > 0 ? extraRadiusForOutline : 0), - innerTopLeftRadiusY + (topLeftRadius > 0 ? extraRadiusForOutline : 0), - innerTopRightRadiusX + (topRightRadius > 0 ? extraRadiusForOutline : 0), - innerTopRightRadiusY + (topRightRadius > 0 ? extraRadiusForOutline : 0), - innerBottomRightRadiusX + (bottomRightRadius > 0 ? extraRadiusForOutline : 0), - innerBottomRightRadiusY + (bottomRightRadius > 0 ? extraRadiusForOutline : 0), - innerBottomLeftRadiusX + (bottomLeftRadius > 0 ? extraRadiusForOutline : 0), - innerBottomLeftRadiusY + (bottomLeftRadius > 0 ? extraRadiusForOutline : 0) + Math.max(topLeftRadius - borderWidth.left * 0.5f, + (borderWidth.left > 0.0f) ? (topLeftRadius / borderWidth.left) : 0.0f), + Math.max(topLeftRadius - borderWidth.top * 0.5f, + (borderWidth.top > 0.0f) ? (topLeftRadius / borderWidth.top) : 0.0f), + Math.max(topRightRadius - borderWidth.right * 0.5f, + (borderWidth.right > 0.0f) ? (topRightRadius / borderWidth.right) : 0.0f), + Math.max(topRightRadius - borderWidth.top * 0.5f, + (borderWidth.top > 0.0f) ? (topRightRadius / borderWidth.top) : 0.0f), + Math.max(bottomRightRadius - borderWidth.right * 0.5f, + (borderWidth.right > 0.0f) ? (bottomRightRadius / borderWidth.right) : 0.0f), + Math.max(bottomRightRadius - borderWidth.bottom * 0.5f, + (borderWidth.bottom > 0.0f) ? (bottomRightRadius / borderWidth.bottom) : 0.0f), + Math.max(bottomLeftRadius - borderWidth.left * 0.5f, + (borderWidth.left > 0.0f) ? (bottomLeftRadius / borderWidth.left) : 0.0f), + Math.max(bottomLeftRadius - borderWidth.bottom * 0.5f, + (borderWidth.bottom > 0.0f) ? (bottomLeftRadius / borderWidth.bottom) : 0.0f) }, Path.Direction.CW); From 7cc791b978e0f7836f8cc90f5a1166ef28f474cc Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 20 Apr 2020 00:17:58 -0700 Subject: [PATCH 065/235] Fabric: `ComponentDescriptor::cloneProps()` now never returns the base props objects Summary: The diff changes how the `empty raw props` optimization works in `ComponentDescriptor::cloneProps()`. Now it only fires only when the base `props` object is null, which is practically all production cases we have (and care about). (I tried, in a normal run there were no cases where the empty raw props were passed with non-null props.) From the other side, the old behavior that may return the same props objects previously several times created bugs and practically unexpected results and practically disallowed to clone props objects easily. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110608 fbshipit-source-id: 884807cd8e9c5c3e6cc1c9e4c1f0227259cc21fb --- .../core/componentdescriptor/ComponentDescriptor.h | 1 + .../componentdescriptor/ConcreteComponentDescriptor.h | 9 +++++++-- .../fabric/core/tests/ComponentDescriptorTest.cpp | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/core/componentdescriptor/ComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ComponentDescriptor.h index ea2952ce291968..c9d2feb75af004 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ComponentDescriptor.h @@ -98,6 +98,7 @@ class ComponentDescriptor { * `props` and `rawProps` applied on top of this. * If `props` is `nullptr`, a default `Props` object (with default values) * will be used. + * Must return an object which is NOT pointer equal to `props`. */ virtual SharedProps cloneProps( const SharedProps &props, diff --git a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h index 142e0dd2aadfa0..7b7550447e637f 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h @@ -108,8 +108,13 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { dynamic_cast(props.get()) && "Provided `props` has an incompatible type."); - if (rawProps.isEmpty()) { - return props ? props : ShadowNodeT::defaultSharedProps(); + // Optimization: + // Quite often nodes are constructed with default/empty props: the base + // `props` object is `null` (there no base because it's not cloning) and the + // `rawProps` is empty. In this case, we can return the default props object + // of a concrete type entirely bypassing parsing. + if (!props && rawProps.isEmpty()) { + return ShadowNodeT::defaultSharedProps(); } rawProps.parse(rawPropsParser_); diff --git a/ReactCommon/fabric/core/tests/ComponentDescriptorTest.cpp b/ReactCommon/fabric/core/tests/ComponentDescriptorTest.cpp index 1dfc1878eff37d..58baadffb321ab 100644 --- a/ReactCommon/fabric/core/tests/ComponentDescriptorTest.cpp +++ b/ReactCommon/fabric/core/tests/ComponentDescriptorTest.cpp @@ -72,6 +72,9 @@ TEST(ComponentDescriptorTest, cloneShadowNode) { EXPECT_EQ(cloned->getTag(), 9); EXPECT_EQ(cloned->getSurfaceId(), 1); EXPECT_STREQ(cloned->getProps()->nativeId.c_str(), "abc"); + + auto clonedButSameProps = descriptor->cloneProps(props, RawProps()); + EXPECT_NE(clonedButSameProps, props); } TEST(ComponentDescriptorTest, appendChild) { From f248ba1c8b15a12a0c590ce8211855cde31defe8 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Mon, 20 Apr 2020 01:23:59 -0700 Subject: [PATCH 066/235] Upgrade to Jest 25 Summary: This diff upgrades Jest to the latest version which fixes a bunch of issues with snapshots (therefore allowing me to enable the Pressable-test again). Note that this also affects Metro and various other tooling as they all depend on packages like `jest-worker`, `jest-haste-map` etc. Breaking changes: https://github.com/facebook/jest/blob/master/CHANGELOG.md This diff increases node_modules by 3 MiB, primarily because it causes more duplicates of `source-map` (0.8 MiB for each copy) and packages like `chalk` 3.x (vs 2.x). The base install was 15 MiB bigger and I reduced it to this size by playing around with various manual yarn.lock optimizations. However, D21085929 reduces node_modules by 11 MiB and the Babel upgrade reduced node_modules by 13 MiB. I will subsequently work on reducing the size through other packages as well and I'm working with the Jest folks to get rid of superfluous TypeScript stuff for Jest 26. Other changes in this diff: * Fixed Pressable-test * Blackhole node-notifier: It's large and we don't need it, and also the license may be problematic, see: https://github.com/facebook/jest/pull/8918 * Updated jest-junit (not a Jest package) but blackholed it internally because it is only used for open source CI. * Updated some API calls we use from Jest to account for breaking changes * Made two absolutely egrigious changes to existing product code tests to make them still pass as our match of async/await, fake timers and then/promise using `setImmediate` is tripping up `regenerator` with `Generator is already run` errors in Jest 25. These tests should probably be rewritten. * Locked everything to the same `resolve` version that we were already using, otherwise it was somehow pulling in 1.16 even though nothing internally uses it. Changelog: [General] Update Jest Reviewed By: rickhanlonii Differential Revision: D21064825 fbshipit-source-id: d0011a51355089456718edd84ea0af21fd923a58 --- .../ActivityIndicator-test.js.snap | 4 +- .../Pressable/__tests__/Pressable-test.js | 4 +- .../__snapshots__/Pressable-test.js.snap | 49 + .../__snapshots__/ScrollView-test.js.snap | 8 +- .../__snapshots__/Image-test.js.snap | 2 +- package.json | 6 +- yarn.lock | 2122 ++++++++++------- 7 files changed, 1363 insertions(+), 832 deletions(-) create mode 100644 Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap diff --git a/Libraries/Components/ActivityIndicator/__tests__/__snapshots__/ActivityIndicator-test.js.snap b/Libraries/Components/ActivityIndicator/__tests__/__snapshots__/ActivityIndicator-test.js.snap index 1d6d1e70b30ea6..d8316e939d13d1 100644 --- a/Libraries/Components/ActivityIndicator/__tests__/__snapshots__/ActivityIndicator-test.js.snap +++ b/Libraries/Components/ActivityIndicator/__tests__/__snapshots__/ActivityIndicator-test.js.snap @@ -34,7 +34,7 @@ exports[` should render as expected: should deep render whe `; exports[` should render as expected: should shallow render as when mocked 1`] = ` - should render as expected: should shallow render `; exports[` should render as expected: should shallow render as when not mocked 1`] = ` -', () => { - /* eslint-disable jest/no-disabled-tests */ - // TODO(cpojer): Reenable this test, see T64907347. - xit('should render as expected', () => { + it('should render as expected', () => { expectRendersMatchingSnapshot( 'Pressable', () => ( diff --git a/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap b/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap new file mode 100644 index 00000000000000..5c82f9ab1c7e67 --- /dev/null +++ b/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render as expected: should deep render when mocked (please verify output manually) 1`] = ` + + + +`; + +exports[` should render as expected: should deep render when not mocked (please verify output manually) 1`] = ` + + + +`; + +exports[` should render as expected: should shallow render as when mocked 1`] = ` + + + +`; + +exports[` should render as expected: should shallow render as when not mocked 1`] = ` + + + +`; diff --git a/Libraries/Components/ScrollView/__tests__/__snapshots__/ScrollView-test.js.snap b/Libraries/Components/ScrollView/__tests__/__snapshots__/ScrollView-test.js.snap index 4828ae59bb4528..084148d5792d17 100644 --- a/Libraries/Components/ScrollView/__tests__/__snapshots__/ScrollView-test.js.snap +++ b/Libraries/Components/ScrollView/__tests__/__snapshots__/ScrollView-test.js.snap @@ -71,21 +71,21 @@ exports[` should render as expected: should deep render when not m `; exports[` should render as expected: should shallow render as when mocked 1`] = ` - + Hello World! - + `; exports[` should render as expected: should shallow render as when not mocked 1`] = ` - + Hello World! - + `; diff --git a/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap b/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap index 2d857eafdb1d0f..1bcd31396ff7d4 100644 --- a/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap +++ b/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap @@ -31,7 +31,7 @@ exports[` should render as when not mocked 1`] = ` `; exports[` should shallow render as when not mocked 1`] = ` -= 0.3.2 < 0.4.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" - integrity sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog== +cross-spawn@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.2.tgz#d0d7dcfa74e89115c7619f4f721a94e1fdb716d6" + integrity sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" -cssstyle@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" - integrity sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog== +cssom@^0.4.1: + version "0.4.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" + integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== + +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992" + integrity sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA== dependencies: - cssom "0.3.x" + cssom "~0.3.6" damerau-levenshtein@^1.0.4: version "1.0.4" @@ -2505,13 +2690,13 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.1.tgz#d416ac3896918f29ca84d81085bc3705834da579" - integrity sha512-0HdcMZzK6ubMUnsMmQmG0AcLQPvbvb47R0+7CCZQCYgcd8OUWG91CG7sM6GoXgjz+WLl4ArFzHtBMy/QqSF4eg== +data-urls@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== dependencies: abab "^2.0.0" - whatwg-mimetype "^2.1.0" + whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" dayjs@^1.8.15: @@ -2572,6 +2757,11 @@ deepmerge@^3.2.0: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -2638,10 +2828,10 @@ detect-libc@^1.0.2: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -detect-newline@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== detox@15.4.4: version "15.4.4" @@ -2670,10 +2860,10 @@ detox@15.4.4: yargs "^13.0.0" yargs-parser "^13.0.0" -diff-sequences@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" - integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== +diff-sequences@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" + integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== doctrine@^2.1.0: version "2.1.0" @@ -2719,6 +2909,11 @@ emoji-regex@^7.0.1, emoji-regex@^7.0.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + encodeurl@~1.0.1, encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -2770,7 +2965,7 @@ es-abstract@^1.10.0, es-abstract@^1.11.0: is-regex "^1.0.4" object-keys "^1.0.12" -es-abstract@^1.5.1, es-abstract@^1.7.0: +es-abstract@^1.7.0: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== @@ -2800,12 +2995,12 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.9.1: - version "1.11.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" - integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== +escodegen@^1.11.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" + integrity sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ== dependencies: - esprima "^3.1.3" + esprima "^4.0.1" estraverse "^4.2.0" esutils "^2.0.2" optionator "^0.8.1" @@ -3007,12 +3202,7 @@ espree@^4.0.0: acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - -esprima@^4.0.0, esprima@~4.0.0: +esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -3094,6 +3284,22 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^3.2.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" + integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + p-finally "^2.0.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -3112,17 +3318,17 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" - integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q== +expect@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-25.4.0.tgz#0b16c17401906d1679d173e59f0d4580b22f8dc8" + integrity sha512-7BDIX99BTi12/sNGJXA9KMRcby4iAmu1xccBOhyKCyEhjcVKS3hPmHdA/4nSI9QGIOkUropKqr3vv7WMDM5lvQ== dependencies: - "@jest/types" "^24.9.0" - ansi-styles "^3.2.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-regex-util "^24.9.0" + "@jest/types" "^25.4.0" + ansi-styles "^4.0.0" + jest-get-type "^25.2.6" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" + jest-regex-util "^25.2.6" extend-shallow@^1.1.2: version "1.1.4" @@ -3198,6 +3404,11 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-deep-equal@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + fast-diff@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" @@ -3280,6 +3491,13 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + finalhandler@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" @@ -3316,7 +3534,7 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3430,6 +3648,11 @@ fsevents@^1.2.7: nan "^2.9.2" node-pre-gyp "^0.10.0" +fsevents@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805" + integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -3498,6 +3721,13 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" +get-stream@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -3533,6 +3763,18 @@ glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.4: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals@^11.1.0, globals@^11.7.0: version "11.8.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" @@ -3548,7 +3790,7 @@ graceful-fs@^4.1.15: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== -graceful-fs@^4.2.0: +graceful-fs@^4.2.0, graceful-fs@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -3581,6 +3823,14 @@ har-validator@~5.1.0: ajv "^5.3.0" har-schema "^2.0.0" +har-validator@~5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -3652,9 +3902,9 @@ hermes-engine@~0.5.0: integrity sha512-jSuHiOhdh2+IF3bH2gLpQ37eMkdUrEb9GK6PoG3rLRaUDK3Zn2Y9fXM+wyDfoUTA3gz9EET0/IIWk5k21qp4kw== hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + version "2.8.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== html-encoding-sniffer@^1.0.2: version "1.0.2" @@ -3687,6 +3937,11 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -3724,13 +3979,13 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" -import-local@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" - integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== +import-local@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" + integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== dependencies: - pkg-dir "^3.0.0" - resolve-cwd "^2.0.0" + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" imurmurhash@^0.1.4: version "0.1.4" @@ -3811,6 +4066,11 @@ invert-kv@^2.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -3835,13 +4095,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= - dependencies: - builtin-modules "^1.0.0" - is-callable@^1.1.3, is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -3920,6 +4173,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-generator-fn@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" @@ -3932,6 +4190,11 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -3961,6 +4224,11 @@ is-stream@^1.0.1, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -3968,7 +4236,7 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" -is-typedarray@~1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -3983,6 +4251,11 @@ is-wsl@^1.1.0: resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= +is-wsl@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d" + integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog== + isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -4018,162 +4291,158 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" - integrity sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw== +istanbul-lib-coverage@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" + integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== -istanbul-lib-instrument@^3.0.0, istanbul-lib-instrument@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" - integrity sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA== - dependencies: - "@babel/generator" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/template" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - istanbul-lib-coverage "^2.0.3" - semver "^5.5.0" +istanbul-lib-instrument@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz#61f13ac2c96cfefb076fe7131156cc05907874e6" + integrity sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg== + dependencies: + "@babel/core" "^7.7.5" + "@babel/parser" "^7.7.5" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" -istanbul-lib-report@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz#bfd324ee0c04f59119cb4f07dab157d09f24d7e4" - integrity sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA== +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== dependencies: - istanbul-lib-coverage "^2.0.3" - make-dir "^1.3.0" - supports-color "^6.0.0" + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" -istanbul-lib-source-maps@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz#f1e817229a9146e8424a28e5d69ba220fda34156" - integrity sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ== +istanbul-lib-source-maps@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" + integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== dependencies: debug "^4.1.1" - istanbul-lib-coverage "^2.0.3" - make-dir "^1.3.0" - rimraf "^2.6.2" + istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^2.2.6: - version "2.2.7" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.7.tgz#5d939f6237d7b48393cc0959eab40cd4fd056931" - integrity sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg== +istanbul-reports@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" + integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== dependencies: html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" -jest-changed-files@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" - integrity sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg== +jest-changed-files@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.4.0.tgz#e573db32c2fd47d2b90357ea2eda0622c5c5cbd6" + integrity sha512-VR/rfJsEs4BVMkwOTuStRyS630fidFVekdw/lBaBQjx9KK3VZFOZ2c0fsom2fRp8pMCrCTP6LGna00o/DXGlqA== dependencies: - "@jest/types" "^24.9.0" - execa "^1.0.0" - throat "^4.0.0" + "@jest/types" "^25.4.0" + execa "^3.2.0" + throat "^5.0.0" -jest-cli@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.9.0.tgz#ad2de62d07472d419c6abc301fc432b98b10d2af" - integrity sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg== +jest-cli@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.4.0.tgz#5dac8be0fece6ce39f0d671395a61d1357322bab" + integrity sha512-usyrj1lzCJZMRN1r3QEdnn8e6E6yCx/QN7+B1sLoA68V7f3WlsxSSQfy0+BAwRiF4Hz2eHauf11GZG3PIfWTXQ== dependencies: - "@jest/core" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" + "@jest/core" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" + chalk "^3.0.0" exit "^0.1.2" - import-local "^2.0.0" + import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" + jest-config "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" prompts "^2.0.1" - realpath-native "^1.1.0" - yargs "^13.3.0" + realpath-native "^2.0.0" + yargs "^15.3.1" -jest-config@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.9.0.tgz#fb1bbc60c73a46af03590719efa4825e6e4dd1b5" - integrity sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ== +jest-config@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.4.0.tgz#56e5df3679a96ff132114b44fb147389c8c0a774" + integrity sha512-egT9aKYxMyMSQV1aqTgam0SkI5/I2P9qrKexN5r2uuM2+68ypnc+zPGmfUxK7p1UhE7dYH9SLBS7yb+TtmT1AA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.9.0" - "@jest/types" "^24.9.0" - babel-jest "^24.9.0" - chalk "^2.0.1" + "@jest/test-sequencer" "^25.4.0" + "@jest/types" "^25.4.0" + babel-jest "^25.4.0" + chalk "^3.0.0" + deepmerge "^4.2.2" glob "^7.1.1" - jest-environment-jsdom "^24.9.0" - jest-environment-node "^24.9.0" - jest-get-type "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - micromatch "^3.1.10" - pretty-format "^24.9.0" - realpath-native "^1.1.0" - -jest-diff@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" - integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== + jest-environment-jsdom "^25.4.0" + jest-environment-node "^25.4.0" + jest-get-type "^25.2.6" + jest-jasmine2 "^25.4.0" + jest-regex-util "^25.2.6" + jest-resolve "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" + micromatch "^4.0.2" + pretty-format "^25.4.0" + realpath-native "^2.0.0" + +jest-diff@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634" + integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug== dependencies: - chalk "^2.0.1" - diff-sequences "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" + chalk "^3.0.0" + diff-sequences "^25.2.6" + jest-get-type "^25.2.6" + pretty-format "^25.4.0" jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== -jest-docblock@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" - integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== +jest-docblock@^25.3.0: + version "25.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.3.0.tgz#8b777a27e3477cd77a168c05290c471a575623ef" + integrity sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg== dependencies: - detect-newline "^2.1.0" + detect-newline "^3.0.0" -jest-each@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.9.0.tgz#eb2da602e2a610898dbc5f1f6df3ba86b55f8b05" - integrity sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog== +jest-each@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.4.0.tgz#ad4e46164764e8e77058f169a0076a7f86f6b7d4" + integrity sha512-lwRIJ8/vQU/6vq3nnSSUw1Y3nz5tkYSFIywGCZpUBd6WcRgpn8NmJoQICojbpZmsJOJNHm0BKdyuJ6Xdx+eDQQ== dependencies: - "@jest/types" "^24.9.0" - chalk "^2.0.1" - jest-get-type "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - -jest-environment-jsdom@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b" - integrity sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - jsdom "^11.5.1" - -jest-environment-node@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.9.0.tgz#333d2d2796f9687f2aeebf0742b519f33c1cbfd3" - integrity sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - -jest-get-type@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0.tgz#36e72930b78e33da59a4f63d44d332188278940b" - integrity sha512-z6/Eyf6s9ZDGz7eOvl+fzpuJmN9i0KyTt1no37/dHu8galssxz5ZEgnc1KaV8R31q1khxyhB4ui/X5ZjjPk77w== + "@jest/types" "^25.4.0" + chalk "^3.0.0" + jest-get-type "^25.2.6" + jest-util "^25.4.0" + pretty-format "^25.4.0" + +jest-environment-jsdom@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.4.0.tgz#bbfc7f85bb6ade99089062a830c79cb454565cf0" + integrity sha512-KTitVGMDrn2+pt7aZ8/yUTuS333w3pWt1Mf88vMntw7ZSBNDkRS6/4XLbFpWXYfWfp1FjcjQTOKzbK20oIehWQ== + dependencies: + "@jest/environment" "^25.4.0" + "@jest/fake-timers" "^25.4.0" + "@jest/types" "^25.4.0" + jest-mock "^25.4.0" + jest-util "^25.4.0" + jsdom "^15.2.1" + +jest-environment-node@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.4.0.tgz#188aef01ae6418e001c03fdd1c299961e1439082" + integrity sha512-wryZ18vsxEAKFH7Z74zi/y/SyI1j6UkVZ6QsllBuT/bWlahNfQjLNwFsgh/5u7O957dYFoXj4yfma4n4X6kU9A== + dependencies: + "@jest/environment" "^25.4.0" + "@jest/fake-timers" "^25.4.0" + "@jest/types" "^25.4.0" + jest-mock "^25.4.0" + jest-util "^25.4.0" + semver "^6.3.0" jest-get-type@^24.3.0: version "24.3.0" @@ -4185,6 +4454,11 @@ jest-get-type@^24.9.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== +jest-get-type@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" + integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== + jest-haste-map@^24.7.1: version "24.8.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" @@ -4204,74 +4478,76 @@ jest-haste-map@^24.7.1: optionalDependencies: fsevents "^1.2.7" -jest-haste-map@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" - integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== +jest-haste-map@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.4.0.tgz#da7c309dd7071e0a80c953ba10a0ec397efb1ae2" + integrity sha512-5EoCe1gXfGC7jmXbKzqxESrgRcaO3SzWXGCnvp9BcT0CFMyrB1Q6LIsjl9RmvmJGQgW297TCfrdgiy574Rl9HQ== dependencies: - "@jest/types" "^24.9.0" - anymatch "^2.0.0" + "@jest/types" "^25.4.0" + anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.9.0" - micromatch "^3.1.10" + graceful-fs "^4.2.3" + jest-serializer "^25.2.6" + jest-util "^25.4.0" + jest-worker "^25.4.0" + micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" + which "^2.0.2" optionalDependencies: - fsevents "^1.2.7" + fsevents "^2.1.2" -jest-jasmine2@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz#1f7b1bd3242c1774e62acabb3646d96afc3be6a0" - integrity sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw== +jest-jasmine2@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.4.0.tgz#3d3d19514022e2326e836c2b66d68b4cb63c5861" + integrity sha512-QccxnozujVKYNEhMQ1vREiz859fPN/XklOzfQjm2j9IGytAkUbSwjFRBtQbHaNZ88cItMpw02JnHGsIdfdpwxQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" + "@jest/environment" "^25.4.0" + "@jest/source-map" "^25.2.6" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" + chalk "^3.0.0" co "^4.6.0" - expect "^24.9.0" + expect "^25.4.0" is-generator-fn "^2.0.0" - jest-each "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-runtime "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - throat "^4.0.0" - -jest-junit@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-6.3.0.tgz#99e64ebc54eddcb21238f0cc49f5820c89a8c785" - integrity sha512-3PH9UkpaomX6CUzqjlnk0m4yBCW/eroxV6v61OM6LkCQFO848P3YUhfIzu8ypZSBKB3vvCbB4WaLTKT0BrIf8A== + jest-each "^25.4.0" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" + jest-runtime "^25.4.0" + jest-snapshot "^25.4.0" + jest-util "^25.4.0" + pretty-format "^25.4.0" + throat "^5.0.0" + +jest-junit@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-10.0.0.tgz#c94b91c24920a327c9d2a075e897b2dba4af494b" + integrity sha512-dbOVRyxHprdSpwSAR9/YshLwmnwf+RSl5hf0kCGlhAcEeZY9aRqo4oNmaT0tLC16Zy9D0zekDjWkjHGjXlglaQ== dependencies: - jest-validate "^24.0.0" + jest-validate "^24.9.0" mkdirp "^0.5.1" - strip-ansi "^4.0.0" + strip-ansi "^5.2.0" + uuid "^3.3.3" xml "^1.0.1" -jest-leak-detector@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" - integrity sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA== +jest-leak-detector@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.4.0.tgz#cf94a160c78e53d810e7b2f40b5fd7ee263375b3" + integrity sha512-7Y6Bqfv2xWsB+7w44dvZuLs5SQ//fzhETgOGG7Gq3TTGFdYvAgXGwV8z159RFZ6fXiCPm/szQ90CyfVos9JIFQ== dependencies: - jest-get-type "^24.9.0" - pretty-format "^24.9.0" + jest-get-type "^25.2.6" + pretty-format "^25.4.0" -jest-matcher-utils@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073" - integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA== +jest-matcher-utils@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.4.0.tgz#dc3e7aec402a1e567ed80b572b9ad285878895e6" + integrity sha512-yPMdtj7YDgXhnGbc66bowk8AkQ0YwClbbwk3Kzhn5GVDrciiCr27U4NJRbrqXbTdtxjImONITg2LiRIw650k5A== dependencies: - chalk "^2.0.1" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" + chalk "^3.0.0" + jest-diff "^25.4.0" + jest-get-type "^25.2.6" + pretty-format "^25.4.0" jest-message-util@^24.8.0: version "24.8.0" @@ -4287,18 +4563,17 @@ jest-message-util@^24.8.0: slash "^2.0.0" stack-utils "^1.0.1" -jest-message-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" - integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== +jest-message-util@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.4.0.tgz#2899e8bc43f5317acf8dfdfe89ea237d354fcdab" + integrity sha512-LYY9hRcVGgMeMwmdfh9tTjeux1OjZHMusq/E5f3tJN+dAoVVkJtq5ZUEPIcB7bpxDUt2zjUsrwg0EGgPQ+OhXQ== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" + "@jest/types" "^25.4.0" "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" + chalk "^3.0.0" + micromatch "^4.0.2" + slash "^3.0.0" stack-utils "^1.0.1" jest-mock@^24.8.0: @@ -4308,130 +4583,131 @@ jest-mock@^24.8.0: dependencies: "@jest/types" "^24.8.0" -jest-mock@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" - integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== +jest-mock@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.4.0.tgz#ded7d64b5328d81d78d2138c825d3a45e30ec8ca" + integrity sha512-MdazSfcYAUjJjuVTTnusLPzE0pE4VXpOUzWdj8sbM+q6abUjm3bATVPXFqTXrxSieR8ocpvQ9v/QaQCftioQFg== dependencies: - "@jest/types" "^24.9.0" + "@jest/types" "^25.4.0" jest-pnp-resolver@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" - integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== - -jest-regex-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" - integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== +jest-regex-util@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" + integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== -jest-resolve-dependencies@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz#ad055198959c4cfba8a4f066c673a3f0786507ab" - integrity sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g== +jest-resolve-dependencies@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.4.0.tgz#783937544cfc40afcc7c569aa54748c4b3f83f5a" + integrity sha512-A0eoZXx6kLiuG1Ui7wITQPl04HwjLErKIJTt8GR3c7UoDAtzW84JtCrgrJ6Tkw6c6MwHEyAaLk7dEPml5pf48A== dependencies: - "@jest/types" "^24.9.0" - jest-regex-util "^24.3.0" - jest-snapshot "^24.9.0" + "@jest/types" "^25.4.0" + jest-regex-util "^25.2.6" + jest-snapshot "^25.4.0" -jest-resolve@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.9.0.tgz#dff04c7687af34c4dd7e524892d9cf77e5d17321" - integrity sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ== +jest-resolve@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.4.0.tgz#6f4540ce0d419c4c720e791e871da32ba4da7a60" + integrity sha512-wOsKqVDFWUiv8BtLMCC6uAJ/pHZkfFgoBTgPtmYlsprAjkxrr2U++ZnB3l5ykBMd2O24lXvf30SMAjJIW6k2aA== dependencies: - "@jest/types" "^24.9.0" + "@jest/types" "^25.4.0" browser-resolve "^1.11.3" - chalk "^2.0.1" + chalk "^3.0.0" jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" + read-pkg-up "^7.0.1" + realpath-native "^2.0.0" + resolve "^1.15.1" + slash "^3.0.0" -jest-runner@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.9.0.tgz#574fafdbd54455c2b34b4bdf4365a23857fcdf42" - integrity sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg== +jest-runner@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.4.0.tgz#6ca4a3d52e692bbc081228fa68f750012f1f29e5" + integrity sha512-wWQSbVgj2e/1chFdMRKZdvlmA6p1IPujhpLT7TKNtCSl1B0PGBGvJjCaiBal/twaU2yfk8VKezHWexM8IliBfA== dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.4.2" + "@jest/console" "^25.4.0" + "@jest/environment" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" + chalk "^3.0.0" exit "^0.1.2" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-docblock "^24.3.0" - jest-haste-map "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-leak-detector "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - jest-runtime "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.6.0" + graceful-fs "^4.2.3" + jest-config "^25.4.0" + jest-docblock "^25.3.0" + jest-haste-map "^25.4.0" + jest-jasmine2 "^25.4.0" + jest-leak-detector "^25.4.0" + jest-message-util "^25.4.0" + jest-resolve "^25.4.0" + jest-runtime "^25.4.0" + jest-util "^25.4.0" + jest-worker "^25.4.0" source-map-support "^0.5.6" - throat "^4.0.0" - -jest-runtime@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.9.0.tgz#9f14583af6a4f7314a6a9d9f0226e1a781c8e4ac" - integrity sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - chalk "^2.0.1" + throat "^5.0.0" + +jest-runtime@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.4.0.tgz#1e5227a9e2159d26ae27dcd426ca6bc041983439" + integrity sha512-lgNJlCDULtXu9FumnwCyWlOub8iytijwsPNa30BKrSNtgoT6NUMXOPrZvsH06U6v0wgD/Igwz13nKA2wEKU2VA== + dependencies: + "@jest/console" "^25.4.0" + "@jest/environment" "^25.4.0" + "@jest/source-map" "^25.2.6" + "@jest/test-result" "^25.4.0" + "@jest/transform" "^25.4.0" + "@jest/types" "^25.4.0" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-haste-map "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - realpath-native "^1.1.0" - slash "^2.0.0" - strip-bom "^3.0.0" - yargs "^13.3.0" + graceful-fs "^4.2.3" + jest-config "^25.4.0" + jest-haste-map "^25.4.0" + jest-message-util "^25.4.0" + jest-mock "^25.4.0" + jest-regex-util "^25.2.6" + jest-resolve "^25.4.0" + jest-snapshot "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" + realpath-native "^2.0.0" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^15.3.1" jest-serializer@^24.4.0: version "24.4.0" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== -jest-serializer@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" - integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== +jest-serializer@^25.2.6: + version "25.2.6" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.2.6.tgz#3bb4cc14fe0d8358489dbbefbb8a4e708ce039b7" + integrity sha512-RMVCfZsezQS2Ww4kB5HJTMaMJ0asmC0BHlnobQC6yEtxiFKIxohFA4QSXSabKwSggaNkqxn6Z2VwdFCjhUWuiQ== -jest-snapshot@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.9.0.tgz#ec8e9ca4f2ec0c5c87ae8f925cf97497b0e951ba" - integrity sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew== +jest-snapshot@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.4.0.tgz#e0b26375e2101413fd2ccb4278a5711b1922545c" + integrity sha512-J4CJ0X2SaGheYRZdLz9CRHn9jUknVmlks4UBeu270hPAvdsauFXOhx9SQP2JtRzhnR3cvro/9N9KP83/uvFfRg== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - expect "^24.9.0" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - mkdirp "^0.5.1" + "@jest/types" "^25.4.0" + "@types/prettier" "^1.19.0" + chalk "^3.0.0" + expect "^25.4.0" + jest-diff "^25.4.0" + jest-get-type "^25.2.6" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" + jest-resolve "^25.4.0" + make-dir "^3.0.0" natural-compare "^1.4.0" - pretty-format "^24.9.0" - semver "^6.2.0" + pretty-format "^25.4.0" + semver "^6.3.0" jest-util@^24.8.0: version "24.8.0" @@ -4451,34 +4727,15 @@ jest-util@^24.8.0: slash "^2.0.0" source-map "^0.6.0" -jest-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" - integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== +jest-util@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.4.0.tgz#6a093d09d86d2b41ef583e5fe7dd3976346e1acd" + integrity sha512-WSZD59sBtAUjLv1hMeKbNZXmMcrLRWcYqpO8Dz8b4CeCTZpfNQw2q9uwrYAD+BbJoLJlu4ezVPwtAmM/9/SlZA== dependencies: - "@jest/console" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/source-map" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" + "@jest/types" "^25.4.0" + chalk "^3.0.0" is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" - -jest-validate@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0.tgz#aa8571a46983a6538328fef20406b4a496b6c020" - integrity sha512-vMrKrTOP4BBFIeOWsjpsDgVXATxCspC9S1gqvbJ3Tnn/b9ACsJmteYeVx9830UMV28Cob1RX55x96Qq3Tfad4g== - dependencies: - camelcase "^5.0.0" - chalk "^2.0.1" - jest-get-type "^24.0.0" - leven "^2.1.0" - pretty-format "^24.0.0" + make-dir "^3.0.0" jest-validate@^24.7.0: version "24.7.0" @@ -4504,18 +4761,29 @@ jest-validate@^24.9.0: leven "^3.1.0" pretty-format "^24.9.0" -jest-watcher@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.9.0.tgz#4b56e5d1ceff005f5b88e528dc9afc8dd4ed2b3b" - integrity sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw== +jest-validate@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.4.0.tgz#2e177a93b716a137110eaf2768f3d9095abd3f38" + integrity sha512-hvjmes/EFVJSoeP1yOl8qR8mAtMR3ToBkZeXrD/ZS9VxRyWDqQ/E1C5ucMTeSmEOGLipvdlyipiGbHJ+R1MQ0g== dependencies: - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - jest-util "^24.9.0" - string-length "^2.0.0" + "@jest/types" "^25.4.0" + camelcase "^5.3.1" + chalk "^3.0.0" + jest-get-type "^25.2.6" + leven "^3.1.0" + pretty-format "^25.4.0" + +jest-watcher@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.4.0.tgz#63ec0cd5c83bb9c9d1ac95be7558dd61c995ff05" + integrity sha512-36IUfOSRELsKLB7k25j/wutx0aVuHFN6wO94gPNjQtQqFPa2rkOymmx9rM5EzbF3XBZZ2oqD9xbRVoYa2w86gw== + dependencies: + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" + ansi-escapes "^4.2.1" + chalk "^3.0.0" + jest-util "^25.4.0" + string-length "^3.1.0" jest-worker@^24.6.0: version "24.6.0" @@ -4525,21 +4793,22 @@ jest-worker@^24.6.0: merge-stream "^1.0.1" supports-color "^6.1.0" -jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== +jest-worker@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.4.0.tgz#ee0e2ceee5a36ecddf5172d6d7e0ab00df157384" + integrity sha512-ghAs/1FtfYpMmYQ0AHqxV62XPvKdUDIBBApMZfly+E9JEmYh2K45G0R5dWxx986RN12pRCxsViwQVtGl+N4whw== dependencies: merge-stream "^2.0.0" - supports-color "^6.1.0" + supports-color "^7.0.0" -jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" - integrity sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw== +jest@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-25.4.0.tgz#fb96892c5c4e4a6b9bcb12068849cddf4c5f8cc7" + integrity sha512-XWipOheGB4wai5JfCYXd6vwsWNwM/dirjRoZgAa7H2wd8ODWbli2AiKjqG8AYhyx+8+5FBEdpO92VhGlBydzbw== dependencies: - import-local "^2.0.0" - jest-cli "^24.9.0" + "@jest/core" "^25.4.0" + import-local "^3.0.2" + jest-cli "^25.4.0" jetifier@^1.6.2: version "1.6.4" @@ -4606,36 +4875,36 @@ jscodeshift@^0.7.0: temp "^0.8.1" write-file-atomic "^2.3.0" -jsdom@^11.5.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" - integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== +jsdom@^15.2.1: + version "15.2.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" + integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== dependencies: abab "^2.0.0" - acorn "^5.5.3" - acorn-globals "^4.1.0" + acorn "^7.1.0" + acorn-globals "^4.3.2" array-equal "^1.0.0" - cssom ">= 0.3.2 < 0.4.0" - cssstyle "^1.0.0" - data-urls "^1.0.0" + cssom "^0.4.1" + cssstyle "^2.0.0" + data-urls "^1.1.0" domexception "^1.0.1" - escodegen "^1.9.1" + escodegen "^1.11.1" html-encoding-sniffer "^1.0.2" - left-pad "^1.3.0" - nwsapi "^2.0.7" - parse5 "4.0.0" + nwsapi "^2.2.0" + parse5 "5.1.0" pn "^1.1.0" - request "^2.87.0" - request-promise-native "^1.0.5" - sax "^1.2.4" + request "^2.88.0" + request-promise-native "^1.0.7" + saxes "^3.1.9" symbol-tree "^3.2.2" - tough-cookie "^2.3.4" + tough-cookie "^3.0.1" w3c-hr-time "^1.0.1" + w3c-xmlserializer "^1.1.2" webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.3" - whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.1" - ws "^5.2.0" + whatwg-encoding "^1.0.5" + whatwg-mimetype "^2.3.0" + whatwg-url "^7.0.0" + ws "^7.0.0" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -4781,11 +5050,6 @@ lcov-parse@^0.0.10: resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= -left-pad@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" - integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== - leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -4811,15 +5075,10 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= locate-path@^2.0.0: version "2.0.0" @@ -4854,7 +5113,7 @@ lodash.throttle@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= -lodash@4.x.x, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: +lodash@4.x.x, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -4885,6 +5144,13 @@ logkitty@^0.6.0: dayjs "^1.8.15" yargs "^12.0.5" +lolex@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" + integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== + dependencies: + "@sinonjs/commons" "^1.7.0" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -4900,13 +5166,6 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -make-dir@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - dependencies: - pify "^3.0.0" - make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -4915,6 +5174,13 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +make-dir@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" + integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w== + dependencies: + semver "^6.0.0" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -5303,6 +5569,14 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + "mime-db@>= 1.36.0 < 2", mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" @@ -5342,6 +5616,11 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + "minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -5514,16 +5793,16 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^5.4.2: - version "5.4.3" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.3.tgz#cb72daf94c93904098e28b9c590fd866e464bd50" - integrity sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q== +node-notifier@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" + integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== dependencies: growly "^1.3.0" - is-wsl "^1.1.0" - semver "^5.5.0" + is-wsl "^2.1.1" + semver "^6.3.0" shellwords "^0.1.1" - which "^1.3.0" + which "^1.3.1" node-pre-gyp@^0.10.0: version "0.10.3" @@ -5564,13 +5843,13 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== +normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" + resolve "^1.10.0" semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" @@ -5581,6 +5860,11 @@ normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" @@ -5601,6 +5885,13 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -5621,10 +5912,10 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nwsapi@^2.0.7: - version "2.0.9" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" - integrity sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ== +nwsapi@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" + integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== oauth-sign@~0.9.0: version "0.9.0" @@ -5692,14 +5983,6 @@ object.fromentries@^2.0.0: function-bind "^1.1.1" has "^1.0.1" -object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -5733,6 +6016,13 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + open@^6.2.0: version "6.4.0" resolved "https://registry.npmjs.org/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" @@ -5810,18 +6100,21 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= -p-each-series@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" - integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= - dependencies: - p-reduce "^1.0.0" +p-each-series@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" + integrity sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-finally@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" + integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== + p-is-promise@^1.1.0: version "1.1.0" resolved "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" @@ -5869,11 +6162,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-reduce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" - integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= - p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -5892,10 +6180,20 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse5@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" + +parse5@5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" + integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== parseurl@~1.3.2: version "1.3.2" @@ -5932,27 +6230,25 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5, path-parse@^1.0.6: +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +picomatch@^2.0.4, picomatch@^2.0.5: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== pify@^4.0.1: version "4.0.1" @@ -5992,6 +6288,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" @@ -6044,14 +6347,6 @@ prettier@1.19.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -pretty-format@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0.tgz#cb6599fd73ac088e37ed682f61291e4678f48591" - integrity sha512-LszZaKG665djUcqg5ZQq+XzezHLKrxsA86ZABTozp+oNhkdqa+tG2dX4qa6ERl5c/sRDrAa3lHmwnvKoP+OG/g== - dependencies: - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - pretty-format@^24.7.0: version "24.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.7.0.tgz#d23106bc2edcd776079c2daa5da02bcb12ed0c10" @@ -6082,6 +6377,16 @@ pretty-format@^25.2.0: ansi-styles "^4.0.0" react-is "^16.12.0" +pretty-format@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830" + integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ== + dependencies: + "@jest/types" "^25.4.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -6159,6 +6464,11 @@ psl@^1.1.24: resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" @@ -6172,7 +6482,7 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -6244,22 +6554,24 @@ react@16.13.1: object-assign "^4.1.1" prop-types "^15.6.2" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@~2.3.6: version "2.3.6" @@ -6274,12 +6586,10 @@ readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" -realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== - dependencies: - util.promisify "^1.0.0" +realpath-native@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" + integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== recast@^0.18.1: version "0.18.7" @@ -6387,23 +6697,23 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request-promise-core@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" - integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= +request-promise-core@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" + integrity sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ== dependencies: - lodash "^4.13.1" + lodash "^4.17.15" -request-promise-native@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" - integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= +request-promise-native@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" + integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== dependencies: - request-promise-core "1.1.1" - stealthy-require "^1.1.0" - tough-cookie ">=2.3.3" + request-promise-core "1.1.3" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" -request@^2.85.0, request@^2.87.0: +request@^2.85.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -6429,6 +6739,32 @@ request@^2.85.0, request@^2.87.0: tunnel-agent "^0.6.0" uuid "^3.3.2" +request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -6452,12 +6788,12 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" -resolve-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: - resolve-from "^3.0.0" + resolve-from "^5.0.0" resolve-from@^1.0.0: version "1.0.1" @@ -6469,6 +6805,11 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -6479,17 +6820,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.6, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - -resolve@^1.9.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" - integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.15.1, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: + version "1.15.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== dependencies: path-parse "^1.0.6" @@ -6518,10 +6852,10 @@ rimraf@^2.5.4, rimraf@^2.6.1: dependencies: glob "^7.0.5" -rimraf@^2.6.2, rimraf@~2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" @@ -6537,6 +6871,13 @@ rimraf@~2.4.0: dependencies: glob "^6.0.1" +rimraf@~2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + rsvp@^3.3.3: version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" @@ -6617,6 +6958,13 @@ sax@^1.2.1, sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +saxes@^3.1.9: + version "3.1.11" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" + integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== + dependencies: + xmlchars "^2.1.1" + scheduler@0.19.1, scheduler@^0.19.1: version "0.19.1" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" @@ -6625,22 +6973,22 @@ scheduler@0.19.1, scheduler@^0.19.1: loose-envify "^1.1.0" object-assign "^4.1.1" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +"semver@2 || 3 || 4 || 5", semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== semver@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -6721,11 +7069,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@1.6.1, shell-quote@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" @@ -6884,10 +7244,15 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + spdx-correct@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" - integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -6906,9 +7271,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" - integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -6970,7 +7335,7 @@ statuses@~1.4.0: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== -stealthy-require@^1.1.0: +stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= @@ -6980,13 +7345,13 @@ stream-buffers@~2.2.0: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ= -string-length@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" - integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= +string-length@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" + integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== dependencies: astral-regex "^1.0.0" - strip-ansi "^4.0.0" + strip-ansi "^5.2.0" string-width@^1.0.1: version "1.0.2" @@ -7014,6 +7379,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string.prototype.matchall@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz#2af8fe3d2d6dc53ca2a59bd376b089c3c152b3c8" @@ -7060,16 +7434,28 @@ strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -7092,20 +7478,28 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.0.0, supports-color@^6.1.0: +supports-color@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== dependencies: has-flag "^3.0.0" -supports-color@^7.1.0: +supports-color@^7.0.0, supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== dependencies: has-flag "^4.0.0" +supports-hyperlinks@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47" + integrity sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA== + dependencies: + has-flag "^4.0.0" + supports-color "^7.0.0" + symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" @@ -7174,26 +7568,38 @@ tempfile@^2.0.0: temp-dir "^1.0.0" uuid "^3.0.1" -test-exclude@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" - integrity sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA== +terminal-link@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" + integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== + dependencies: + ansi-escapes "^4.2.1" + supports-hyperlinks "^2.0.0" + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== dependencies: - arrify "^1.0.1" + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^1.0.1" text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^4.0.0, throat@^4.1.0: +throat@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= +throat@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" + integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== + through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -7252,6 +7658,13 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" @@ -7262,7 +7675,24 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@>=2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" + integrity sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg== + dependencies: + ip-regex "^2.1.0" + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== @@ -7303,6 +7733,33 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -7414,14 +7871,6 @@ util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -util.promisify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -7432,6 +7881,20 @@ uuid@^3.0.1, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== +uuid@^3.3.3: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +v8-to-istanbul@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz#22fe35709a64955f49a08a7c7c959f6520ad6f20" + integrity sha512-sAjOC+Kki6aJVbUOXJbcR0MnbfjvBzwKZazEJymA2IX49uoOdEdk+4fBq5cXgYgiyKtAyrrJNtBZdOeDIF+Fng== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + source-map "^0.7.3" + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -7471,6 +7934,15 @@ w3c-hr-time@^1.0.1: dependencies: browser-process-hrtime "^0.1.2" +w3c-xmlserializer@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" + integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== + dependencies: + domexception "^1.0.1" + webidl-conversions "^4.0.2" + xml-name-validator "^3.0.0" + walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" @@ -7490,7 +7962,7 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== @@ -7502,19 +7974,10 @@ whatwg-fetch@>=0.10.0, whatwg-fetch@^3.0.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== -whatwg-mimetype@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.2.0.tgz#a3d58ef10b76009b042d03e25591ece89b88d171" - integrity sha512-5YSO1nMd5D1hY3WzAQV3PzZL83W3YeyR1yW9PcH26Weh1t+Vzh9B6XkDh7aXm83HBZ4nSMvkjvN2H2ySWIvBgw== - -whatwg-url@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" +whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== whatwg-url@^7.0.0: version "7.0.0" @@ -7530,13 +7993,20 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" +which@^2.0.1, which@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -7566,20 +8036,20 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - write-file-atomic@^1.2.0: version "1.3.4" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" @@ -7598,6 +8068,16 @@ write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -7622,13 +8102,6 @@ ws@^3.3.1: safe-buffer "~5.1.0" ultron "~1.1.0" -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - ws@^6.1.4: version "6.1.4" resolved "https://registry.yarnpkg.com/ws/-/ws-6.1.4.tgz#5b5c8800afab925e94ccb29d153c8d02c1776ef9" @@ -7643,6 +8116,11 @@ ws@^7: dependencies: async-limiter "^1.0.0" +ws@^7.0.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== + xcode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xcode/-/xcode-2.0.0.tgz#134f1f94c26fbfe8a9aaa9724bfb2772419da1a2" @@ -7666,6 +8144,11 @@ xmlbuilder@^9.0.7: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= +xmlchars@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + xmldoc@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/xmldoc/-/xmldoc-1.1.2.tgz#6666e029fe25470d599cd30e23ff0d1ed50466d7" @@ -7724,14 +8207,6 @@ yargs-parser@^13.0.0: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^15.0.0: version "15.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.0.tgz#cdd7a97490ec836195f59f3f4dbe5ea9e8f75f08" @@ -7740,6 +8215,14 @@ yargs-parser@^15.0.0: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^18.1.1: + version "18.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" + integrity sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs@^12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -7775,12 +8258,13 @@ yargs@^13.0.0: y18n "^4.0.0" yargs-parser "^13.0.0" -yargs@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" - integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== +yargs@^14.2.0: + version "14.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.0.tgz#f116a9242c4ed8668790b40759b4906c276e76c3" + integrity sha512-/is78VKbKs70bVZH7w4YaZea6xcJWOAwkhbR0CFuZBmYtfTYF0xjGJF43AYd8g2Uii1yJwmS5GR2vBmrc32sbg== dependencies: cliui "^5.0.0" + decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^2.0.1" require-directory "^2.1.1" @@ -7789,21 +8273,21 @@ yargs@^13.3.0: string-width "^3.0.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^13.1.1" + yargs-parser "^15.0.0" -yargs@^14.2.0: - version "14.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.0.tgz#f116a9242c4ed8668790b40759b4906c276e76c3" - integrity sha512-/is78VKbKs70bVZH7w4YaZea6xcJWOAwkhbR0CFuZBmYtfTYF0xjGJF43AYd8g2Uii1yJwmS5GR2vBmrc32sbg== +yargs@^15.3.1: + version "15.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" + integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== dependencies: - cliui "^5.0.0" + cliui "^6.0.0" decamelize "^1.2.0" - find-up "^3.0.0" + find-up "^4.1.0" get-caller-file "^2.0.1" require-directory "^2.1.1" require-main-filename "^2.0.0" set-blocking "^2.0.0" - string-width "^3.0.0" + string-width "^4.2.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^15.0.0" + yargs-parser "^18.1.1" From 57099962b75c20912a1edd6b2b9d7ba5e6e42aae Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 20 Apr 2020 10:10:53 -0700 Subject: [PATCH 067/235] Apply placeholderColor to TextInput component Summary: Changelog: [Internal] TextInput's `placeholderTextColor` prop was being ignored. This diff fixes that. Reviewed By: JoshuaGross Differential Revision: D21064118 fbshipit-source-id: 33f148c355cee846db010153e0c65ea43155c3c9 --- .../ComponentViews/TextInput/RCTTextInputComponentView.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index aa1f4a4ae6a66b..1879ac90e7efc3 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -157,6 +157,10 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & _backedTextInputView.placeholder = RCTNSStringFromString(newTextInputProps.placeholder); } + if (newTextInputProps.placeholderTextColor != oldTextInputProps.placeholderTextColor) { + _backedTextInputView.placeholderColor = RCTUIColorFromSharedColor(newTextInputProps.placeholderTextColor); + } + if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) { _backedTextInputView.defaultTextAttributes = RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes()); From e7ef35c133ee8f6a1363598e2ccbb9415921a0a6 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 20 Apr 2020 11:41:56 -0700 Subject: [PATCH 068/235] Fix mistake in swapping left/right layout properties Summary: Changelog: [Internal] We were assigned `undefined` value to incorrect edge, instead of `YGEdgeLeft` it should have been `YGEdgeRight`. If node has `YGEdgeRight` value, it needs to be reassigned to `YGEdgeEnd` and its original value set to undefined. Reviewed By: mdvacca Differential Revision: D21095234 fbshipit-source-id: fbecd9b7e6670742ad4a4bb097760aa10eec8685 --- .../fabric/components/view/yoga/YogaLayoutableShadowNode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 3f4c0bdbe909fd..b1a23d06eb232b 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -18,7 +18,6 @@ #include #include #include -#include namespace facebook { namespace react { @@ -450,7 +449,7 @@ void YogaLayoutableShadowNode::swapLeftAndRightInYogaStyleProps( if (yogaStyle.margin()[YGEdgeRight] != YGValueUndefined) { yogaStyle.margin()[YGEdgeEnd] = margin[YGEdgeRight]; - yogaStyle.margin()[YGEdgeLeft] = YGValueUndefined; + yogaStyle.margin()[YGEdgeRight] = YGValueUndefined; } shadowNode.yogaNode_.setStyle(yogaStyle); From 80575503d234ac007f04fe412d71023b576899fd Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 20 Apr 2020 12:01:56 -0700 Subject: [PATCH 069/235] Fixed incorrect owner assignment in YGNode move constructor Summary: Assigning self as an owner makes a cycle which is obviously a bug. Changelog: [Internal] Small change in Yoga (should not affect RN). Reviewed By: SidharthGuglani Differential Revision: D21111423 fbshipit-source-id: 1835561c055ac827f5ce98a044f25aed0d1845a5 --- ReactCommon/yoga/yoga/YGNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/yoga/yoga/YGNode.cpp b/ReactCommon/yoga/yoga/YGNode.cpp index c15af8de76e7fc..23d5c40bc93806 100644 --- a/ReactCommon/yoga/yoga/YGNode.cpp +++ b/ReactCommon/yoga/yoga/YGNode.cpp @@ -29,7 +29,7 @@ YGNode::YGNode(YGNode&& node) { config_ = node.config_; resolvedDimensions_ = node.resolvedDimensions_; for (auto c : children_) { - c->setOwner(c); + c->setOwner(this); } } From 854f63701d2653ff46d5908cf814b1e95e8b279b Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 20 Apr 2020 13:16:03 -0700 Subject: [PATCH 070/235] Easy diff to add a TODO Summary: Easy diff to add a TODO to refactor `sendAccessibilityEvent` to use ViewCommands This was orginally added D17142507 changelog: [Internal] Internal change Reviewed By: JoshuaGross Differential Revision: D21137348 fbshipit-source-id: aff38ccad8dfbb222f83161e2bd5da82f543e5db --- .../main/java/com/facebook/react/uimanager/UIManagerModule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 2000e6f7212d9a..9d7879d425d2ae 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -815,6 +815,7 @@ public EventDispatcher getEventDispatcher() { public void sendAccessibilityEvent(int tag, int eventType) { int uiManagerType = ViewUtil.getUIManagerType(tag); if (uiManagerType == FABRIC) { + // TODO: T65793557 Refactor sendAccessibilityEvent to use ViewCommands UIManager fabricUIManager = UIManagerHelper.getUIManager(getReactApplicationContext(), uiManagerType); if (fabricUIManager != null) { From 04bc315eba373c861c348b09545fc0ded46bfb33 Mon Sep 17 00:00:00 2001 From: Will Holen Date: Mon, 20 Apr 2020 14:03:25 -0700 Subject: [PATCH 071/235] Add support for generating custom messages Summary: Until now we've generated scaffolding entirely based on the official devtools protocol spec. This diff adds support for defining custom domains in `custom.json` which will be merged with the upstream protocol JSON definition. ChangeLog: [Internal] Add support for Hermes-specific CDP messages Reviewed By: bestander Differential Revision: D20754605 fbshipit-source-id: a8075f81816a40114d1a3332192c7aa076b17848 --- .../hermes/inspector/tools/msggen/src/custom.json | 3 +++ .../hermes/inspector/tools/msggen/src/index.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ReactCommon/hermes/inspector/tools/msggen/src/custom.json diff --git a/ReactCommon/hermes/inspector/tools/msggen/src/custom.json b/ReactCommon/hermes/inspector/tools/msggen/src/custom.json new file mode 100644 index 00000000000000..cf7aab3e6220bc --- /dev/null +++ b/ReactCommon/hermes/inspector/tools/msggen/src/custom.json @@ -0,0 +1,3 @@ +{ + "domains": [] +} diff --git a/ReactCommon/hermes/inspector/tools/msggen/src/index.js b/ReactCommon/hermes/inspector/tools/msggen/src/index.js index 5124485a86d853..973e5c894831da 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/src/index.js +++ b/ReactCommon/hermes/inspector/tools/msggen/src/index.js @@ -24,7 +24,10 @@ import {HeaderWriter} from './HeaderWriter'; import {ImplementationWriter} from './ImplementationWriter'; // $FlowFixMe: this isn't a module, just a JSON file. -const proto = require('devtools-protocol/json/js_protocol.json'); +const standard = require('devtools-protocol/json/js_protocol.json'); + +// $FlowFixMe: this isn't a module, also just a JSON file. +const custom = require('../src/custom.json'); type Descriptor = {| types: Array, @@ -32,6 +35,12 @@ type Descriptor = {| events: Array, |}; +function mergeDomains(original, extra) { + return {...original, domains: original.domains.concat(extra.domains)}; +} + +const proto = mergeDomains(standard, custom); + function parseDomains( domainObjs: Array, ignoreExperimental: boolean, From 33ccc0a0bc281f202d03eb2d7d136f783696b798 Mon Sep 17 00:00:00 2001 From: Will Holen Date: Mon, 20 Apr 2020 14:03:25 -0700 Subject: [PATCH 072/235] Implement Hermes.setPauseOnLoad Summary: This Hermes-specific mode is similar to Debugger.setPauseOnExceptions and lets the VM know that it should enter a Pause state whenever a new script is loaded/executed. The debugger can then take its time to parse the source map and update any breakpoints, before automatically continuing. Changelog: [Internal] Implement a Hermes.setPauseOnLoad CDP call Reviewed By: bestander Differential Revision: D20754604 fbshipit-source-id: 7f9d0638706c99e9dcb534699b633f658e364909 --- ReactCommon/hermes/inspector/Inspector.cpp | 28 +++++++++++++++++ ReactCommon/hermes/inspector/Inspector.h | 18 +++++++++++ .../hermes/inspector/InspectorState.cpp | 4 +++ .../hermes/inspector/chrome/Connection.cpp | 19 ++++++++++++ .../hermes/inspector/chrome/MessageTypes.cpp | 30 ++++++++++++++++++- .../hermes/inspector/chrome/MessageTypes.h | 18 ++++++++++- .../hermes/inspector/tools/message_types.txt | 1 + .../inspector/tools/msggen/src/custom.json | 25 +++++++++++++++- 8 files changed, 140 insertions(+), 3 deletions(-) diff --git a/ReactCommon/hermes/inspector/Inspector.cpp b/ReactCommon/hermes/inspector/Inspector.cpp index 8ab8e8643aa03d..7376b578aa1e1c 100644 --- a/ReactCommon/hermes/inspector/Inspector.cpp +++ b/ReactCommon/hermes/inspector/Inspector.cpp @@ -382,6 +382,34 @@ folly::Future Inspector::setPauseOnExceptions( return promise->getFuture(); }; +folly::Future Inspector::setPauseOnLoads( + const PauseOnLoadMode mode) { + std::unique_lock lock(mutex_); + auto promise = std::make_shared>(); + pauseOnLoadMode_ = mode; + promise->setValue(); + return promise->getFuture(); +}; + +bool Inspector::shouldPauseOnThisScriptLoad() { + switch (pauseOnLoadMode_) { + case None: + return false; + case All: + return true; + case Smart: + // If we don't have active breakpoints, there's nothing to set or update. + if (debugger_.getBreakpoints().size() == 0) { + return false; + } + // If there's no source map URL, it's probably not a file we care about. + if (getScriptInfoFromTopCallFrame().sourceMappingUrl.size() == 0) { + return false; + } + return true; + } +}; + debugger::Command Inspector::didPause(debugger::Debugger &debugger) { std::unique_lock lock(mutex_); diff --git a/ReactCommon/hermes/inspector/Inspector.h b/ReactCommon/hermes/inspector/Inspector.h index 0cc0b8f4dd4a11..bf4fc553c1da1f 100644 --- a/ReactCommon/hermes/inspector/Inspector.h +++ b/ReactCommon/hermes/inspector/Inspector.h @@ -53,6 +53,8 @@ struct ConsoleMessageInfo { args(std::move(args)) {} }; +enum PauseOnLoadMode { None, Smart, All }; + /** * InspectorObserver notifies the observer of events that occur in the VM. */ @@ -200,6 +202,19 @@ class Inspector : public facebook::hermes::debugger::EventObserver, folly::Future setPauseOnExceptions( const facebook::hermes::debugger::PauseOnThrowMode &mode); + /** + * Set whether to pause on loads. This does not require runtime modifications, + * but returns a future for consistency. + */ + folly::Future setPauseOnLoads(const PauseOnLoadMode mode); + + /** + * If called during a script load event, return true if we should pause. + * Assumed to be called from a script load event where we already hold + * `mutex_`. + */ + bool shouldPauseOnThisScriptLoad(); + /** * didPause implements the pause callback from Hermes. This callback arrives * on the JS thread. @@ -297,6 +312,9 @@ class Inspector : public facebook::hermes::debugger::EventObserver, // this state is here rather than in the Running class. AsyncPauseState pendingPauseState_ = AsyncPauseState::None; + // Whether we should enter a paused state when a script loads. + PauseOnLoadMode pauseOnLoadMode_ = PauseOnLoadMode::None; + // All scripts loaded in to the VM, along with whether we've notified the // client about the script yet. struct LoadedScriptInfo { diff --git a/ReactCommon/hermes/inspector/InspectorState.cpp b/ReactCommon/hermes/inspector/InspectorState.cpp index 7b7552f3e1e75a..7d6c35e05bbaee 100644 --- a/ReactCommon/hermes/inspector/InspectorState.cpp +++ b/ReactCommon/hermes/inspector/InspectorState.cpp @@ -236,6 +236,10 @@ std::pair InspectorState::Running::didPause( } else if (reason == debugger::PauseReason::ScriptLoaded) { inspector_.addCurrentScriptToLoadedScripts(); inspector_.notifyScriptsLoaded(); + if (inspector_.shouldPauseOnThisScriptLoad()) { + return std::make_pair( + InspectorState::Paused::make(inspector_), nullptr); + } } else if (reason == debugger::PauseReason::EvalComplete) { assert(pendingEvalPromise_); diff --git a/ReactCommon/hermes/inspector/chrome/Connection.cpp b/ReactCommon/hermes/inspector/chrome/Connection.cpp index ca3f4191c4da5a..354eede529c9eb 100644 --- a/ReactCommon/hermes/inspector/chrome/Connection.cpp +++ b/ReactCommon/hermes/inspector/chrome/Connection.cpp @@ -88,6 +88,7 @@ class Connection::Impl : public inspector::InspectorObserver, const m::heapProfiler::StopTrackingHeapObjectsRequest &req) override; void handle(const m::runtime::EvaluateRequest &req) override; void handle(const m::runtime::GetPropertiesRequest &req) override; + void handle(const m::hermes::SetPauseOnLoadRequest &req) override; private: std::vector makePropsFromScope( @@ -290,6 +291,9 @@ void Connection::Impl::onPause( case debugger::PauseReason::Exception: note.reason = "exception"; break; + case debugger::PauseReason::ScriptLoaded: + note.reason = "load"; + break; default: note.reason = "other"; break; @@ -757,6 +761,21 @@ void Connection::Impl::handle(const m::runtime::GetPropertiesRequest &req) { .thenError(sendErrorToClient(req.id)); } +void Connection::Impl::handle(const m::hermes::SetPauseOnLoadRequest &req) { + PauseOnLoadMode mode; + if (req.state == "none") { + mode = PauseOnLoadMode::None; + } else if (req.state == "all") { + mode = PauseOnLoadMode::All; + } else if (req.state == "smart") { + mode = PauseOnLoadMode::Smart; + } else { + sendErrorToClientViaExecutor(req.id, "Unrecognized pause on load mode"); + return; + } + sendResponseToClientViaExecutor(inspector_->setPauseOnLoads(mode), req.id); +} + /* * Send-to-client methods */ diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp index ae0f77851a1e14..18ce5ac65a6a60 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<4ab81efd6f767bd583d00c806b7d1d9b>> +// @generated SignedSource<<0d7691362d081e7bc44d2b7a0ed24371>> #include "MessageTypes.h" @@ -46,6 +46,7 @@ std::unique_ptr Request::fromJsonThrowOnError(const std::string &str) { makeUnique}, {"HeapProfiler.takeHeapSnapshot", makeUnique}, + {"Hermes.setPauseOnLoad", makeUnique}, {"Runtime.evaluate", makeUnique}, {"Runtime.getProperties", makeUnique}, }; @@ -682,6 +683,33 @@ void heapProfiler::TakeHeapSnapshotRequest::accept( handler.handle(*this); } +hermes::SetPauseOnLoadRequest::SetPauseOnLoadRequest() + : Request("Hermes.setPauseOnLoad") {} + +hermes::SetPauseOnLoadRequest::SetPauseOnLoadRequest(const dynamic &obj) + : Request("Hermes.setPauseOnLoad") { + assign(id, obj, "id"); + assign(method, obj, "method"); + + dynamic params = obj.at("params"); + assign(state, params, "state"); +} + +dynamic hermes::SetPauseOnLoadRequest::toDynamic() const { + dynamic params = dynamic::object; + put(params, "state", state); + + dynamic obj = dynamic::object; + put(obj, "id", id); + put(obj, "method", method); + put(obj, "params", std::move(params)); + return obj; +} + +void hermes::SetPauseOnLoadRequest::accept(RequestHandler &handler) const { + handler.handle(*this); +} + runtime::EvaluateRequest::EvaluateRequest() : Request("Runtime.evaluate") {} runtime::EvaluateRequest::EvaluateRequest(const dynamic &obj) diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.h b/ReactCommon/hermes/inspector/chrome/MessageTypes.h index 503b486743c3a8..3d7222fd6ac65a 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.h +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.h @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<0a1a011902fd18d4eebd2fe12fafb8b1>> +// @generated SignedSource<<08b66e22784e225b926d36131b9a7693>> #pragma once @@ -73,6 +73,10 @@ struct StopTrackingHeapObjectsRequest; struct TakeHeapSnapshotRequest; } // namespace heapProfiler +namespace hermes { +struct SetPauseOnLoadRequest; +} // namespace hermes + /// RequestHandler handles requests via the visitor pattern. struct RequestHandler { virtual ~RequestHandler() = default; @@ -95,6 +99,7 @@ struct RequestHandler { virtual void handle( const heapProfiler::StopTrackingHeapObjectsRequest &req) = 0; virtual void handle(const heapProfiler::TakeHeapSnapshotRequest &req) = 0; + virtual void handle(const hermes::SetPauseOnLoadRequest &req) = 0; virtual void handle(const runtime::EvaluateRequest &req) = 0; virtual void handle(const runtime::GetPropertiesRequest &req) = 0; }; @@ -119,6 +124,7 @@ struct NoopRequestHandler : public RequestHandler { void handle( const heapProfiler::StopTrackingHeapObjectsRequest &req) override {} void handle(const heapProfiler::TakeHeapSnapshotRequest &req) override {} + void handle(const hermes::SetPauseOnLoadRequest &req) override {} void handle(const runtime::EvaluateRequest &req) override {} void handle(const runtime::GetPropertiesRequest &req) override {} }; @@ -411,6 +417,16 @@ struct heapProfiler::TakeHeapSnapshotRequest : public Request { folly::Optional treatGlobalObjectsAsRoots; }; +struct hermes::SetPauseOnLoadRequest : public Request { + SetPauseOnLoadRequest(); + explicit SetPauseOnLoadRequest(const folly::dynamic &obj); + + folly::dynamic toDynamic() const override; + void accept(RequestHandler &handler) const override; + + std::string state; +}; + struct runtime::EvaluateRequest : public Request { EvaluateRequest(); explicit EvaluateRequest(const folly::dynamic &obj); diff --git a/ReactCommon/hermes/inspector/tools/message_types.txt b/ReactCommon/hermes/inspector/tools/message_types.txt index 420fdad15d6d08..6d02ed4e754d6e 100644 --- a/ReactCommon/hermes/inspector/tools/message_types.txt +++ b/ReactCommon/hermes/inspector/tools/message_types.txt @@ -23,3 +23,4 @@ Runtime.consoleAPICalled Runtime.evaluate Runtime.executionContextCreated Runtime.getProperties +Hermes.setPauseOnLoad diff --git a/ReactCommon/hermes/inspector/tools/msggen/src/custom.json b/ReactCommon/hermes/inspector/tools/msggen/src/custom.json index cf7aab3e6220bc..c9650a9c293a77 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/src/custom.json +++ b/ReactCommon/hermes/inspector/tools/msggen/src/custom.json @@ -1,3 +1,26 @@ { - "domains": [] + "domains": [ + { + "domain": "Hermes", + "description": "Hermes specific messages", + "commands": [ + { + "name": "setPauseOnLoad", + "description": "Pause VM when new scripts are loaded (reason='load')", + "parameters": [ + { + "name": "state", + "description": "Pause on script load mode", + "type": "string", + "enum": [ + "none", + "smart", + "all" + ] + } + ] + } + ] + } + ] } From 77012753e5db549a730581a6518f05b4f811b77a Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Mon, 20 Apr 2020 15:43:50 -0700 Subject: [PATCH 073/235] Switch isPackagerRunning to a class method. Summary: This diff exports `isPackagerRunning` as a class method to be used without and instance. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21094414 fbshipit-source-id: 44becb59e3c08d66e4992c4c1b32d6efcd4fe257 --- React/Base/RCTBundleURLProvider.h | 4 ++-- React/Base/RCTBundleURLProvider.m | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/React/Base/RCTBundleURLProvider.h b/React/Base/RCTBundleURLProvider.h index 1e03949470bdb5..24e3aec1cc694d 100644 --- a/React/Base/RCTBundleURLProvider.h +++ b/React/Base/RCTBundleURLProvider.h @@ -37,8 +37,8 @@ extern const NSUInteger kRCTBundleURLProviderDefaultPort; */ - (NSString *)packagerServerHost; -#if RCT_DEV -- (BOOL)isPackagerRunning:(NSString *)host; +#if RCT_DEV_MENU ++ (BOOL)isPackagerRunning:(NSString *)host; #endif /** diff --git a/React/Base/RCTBundleURLProvider.m b/React/Base/RCTBundleURLProvider.m index 96083efa2dcdde..3f30f1c5b05edd 100644 --- a/React/Base/RCTBundleURLProvider.m +++ b/React/Base/RCTBundleURLProvider.m @@ -70,8 +70,8 @@ - (void)resetToDefaults stringWithFormat:@"http://%@:%lu/", hostPort, (unsigned long)kRCTBundleURLProviderDefaultPort]]; } -#if RCT_DEV -- (BOOL)isPackagerRunning:(NSString *)host +#if RCT_DEV_MENU ++ (BOOL)isPackagerRunning:(NSString *)host { NSURL *url = [serverRootWithHostPort(host) URLByAppendingPathComponent:@"status"]; @@ -105,7 +105,7 @@ - (NSString *)guessPackagerHost }); NSString *host = ipGuess ?: @"localhost"; - if ([self isPackagerRunning:host]) { + if ([RCTBundleURLProvider isPackagerRunning:host]) { return host; } return nil; From 4afb8362ec7f65fa315e44343ca878203ecfcfe1 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 20 Apr 2020 19:19:09 -0700 Subject: [PATCH 074/235] Fabric: Fixed `getDirtied` vs `isDirty` in `YogaLayoutableShadowNode` Summary: This is quite a fateful mistake. `getDirtied()` returns the pointer to a function which is obviously a mistake here; we should use `isDirty()` instead. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028569 fbshipit-source-id: 95212b31f4e32d51c594d5209f295397af3f1252 --- .../fabric/components/view/yoga/YogaLayoutableShadowNode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index b1a23d06eb232b..25baf6871f3530 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -174,8 +174,8 @@ void YogaLayoutableShadowNode::updateYogaChildren() { // Optimization: // If the new list of child nodes consists of clean nodes, and if their styles // are identical to styles of old children, we don't dirty the node. - bool isClean = !yogaNode_.getDirtied() && - children.size() == yogaNode_.getChildren().size(); + bool isClean = + !yogaNode_.isDirty() && children.size() == yogaNode_.getChildren().size(); auto oldChildren = isClean ? yogaNode_.getChildren() : YGVector{}; yogaNode_.setChildren({}); From d639063499f98dd0f2608584b3f1efe9ce610dde Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 20 Apr 2020 19:19:09 -0700 Subject: [PATCH 075/235] Fabric: More strict policies to dirty Yoga nodes in YogaLayoutableShadowNode Summary: Yoga uses a dirty flag to re-layout nodes. In normal, single-threaded approach the policy for dirtying is simple: if a node was changed, we need to dirty it. In the Concurrent Yoga approach, those rules are not so simple, and it seems we haven't formalized those rules yet. Investigating some layout issues that we have in Fabric, I tend to believe that we don't dirty as much we should. Hense this change adds mode dirtying. Reviewed By: JoshuaGross Differential Revision: D21092815 fbshipit-source-id: 4603c97ccb79efcdf5e6a4cc450ebe61b63effb3 --- .../view/yoga/YogaLayoutableShadowNode.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 25baf6871f3530..5cd3b412e2c627 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -54,6 +54,10 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode( yogaNode_(&initializeYogaConfig(yogaConfig_)) { yogaNode_.setContext(this); + // Newly created node must be `dirty` just becasue it is new. + // This is not a default for `YGNode`. + yogaNode_.setDirty(true); + updateYogaProps(); updateYogaChildren(); } @@ -140,8 +144,6 @@ void YogaLayoutableShadowNode::appendChildYogaNode( return; } - yogaNode_.setDirty(true); - auto yogaNodeRawPtr = &yogaNode_; auto childYogaNodeRawPtr = &child.yogaNode_; auto childNodePtr = const_cast(&child); @@ -180,6 +182,10 @@ void YogaLayoutableShadowNode::updateYogaChildren() { yogaNode_.setChildren({}); + // We might undo this later at the end of the method if we can infer that + // dirting is not necessary here. + yogaNode_.setDirty(true); + auto i = int{0}; for (auto const &child : children) { auto yogaLayoutableChild = @@ -321,8 +327,9 @@ YogaLayoutableShadowNode &YogaLayoutableShadowNode::cloneAndReplaceChild( int suggestedIndex) { auto clonedChildShadowNode = child.clone({}); replaceChild(child, clonedChildShadowNode, suggestedIndex); - - return static_cast(*clonedChildShadowNode); + auto &node = static_cast(*clonedChildShadowNode); + node.yogaNode_.setDirty(true); + return node; } #pragma mark - Yoga Connectors From 25793eab56217a9961620761ea65ec2fcb97dcb0 Mon Sep 17 00:00:00 2001 From: Tom Underhill Date: Mon, 20 Apr 2020 20:20:02 -0700 Subject: [PATCH 076/235] Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. PlatformColor Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 --- .../PlatformColor/PlatformColorExample.js | 100 +++++++++--------- React/Base/RCTConvert.m | 21 +++- 2 files changed, 69 insertions(+), 52 deletions(-) diff --git a/RNTester/js/examples/PlatformColor/PlatformColorExample.js b/RNTester/js/examples/PlatformColor/PlatformColorExample.js index d0b04e21930087..5cb831c0627d06 100644 --- a/RNTester/js/examples/PlatformColor/PlatformColorExample.js +++ b/RNTester/js/examples/PlatformColor/PlatformColorExample.js @@ -22,94 +22,94 @@ function PlatformColorsExample() { colors = [ // https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors // Label Colors - {label: 'labelColor', color: PlatformColor('labelColor')}, + {label: 'label', color: PlatformColor('label')}, { - label: 'secondaryLabelColor', - color: PlatformColor('secondaryLabelColor'), + label: 'secondaryLabel', + color: PlatformColor('secondaryLabel'), }, { - label: 'tertiaryLabelColor', - color: PlatformColor('tertiaryLabelColor'), + label: 'tertiaryLabel', + color: PlatformColor('tertiaryLabel'), }, { - label: 'quaternaryLabelColor', - color: PlatformColor('quaternaryLabelColor'), + label: 'quaternaryLabel', + color: PlatformColor('quaternaryLabel'), }, // Fill Colors - {label: 'systemFillColor', color: PlatformColor('systemFillColor')}, + {label: 'systemFill', color: PlatformColor('systemFill')}, { - label: 'secondarySystemFillColor', - color: PlatformColor('secondarySystemFillColor'), + label: 'secondarySystemFill', + color: PlatformColor('secondarySystemFill'), }, { - label: 'tertiarySystemFillColor', - color: PlatformColor('tertiarySystemFillColor'), + label: 'tertiarySystemFill', + color: PlatformColor('tertiarySystemFill'), }, { - label: 'quaternarySystemFillColor', - color: PlatformColor('quaternarySystemFillColor'), + label: 'quaternarySystemFill', + color: PlatformColor('quaternarySystemFill'), }, // Text Colors { - label: 'placeholderTextColor', - color: PlatformColor('placeholderTextColor'), + label: 'placeholderText', + color: PlatformColor('placeholderText'), }, // Standard Content Background Colors { - label: 'systemBackgroundColor', - color: PlatformColor('systemBackgroundColor'), + label: 'systemBackground', + color: PlatformColor('systemBackground'), }, { - label: 'secondarySystemBackgroundColor', - color: PlatformColor('secondarySystemBackgroundColor'), + label: 'secondarySystemBackground', + color: PlatformColor('secondarySystemBackground'), }, { - label: 'tertiarySystemBackgroundColor', - color: PlatformColor('tertiarySystemBackgroundColor'), + label: 'tertiarySystemBackground', + color: PlatformColor('tertiarySystemBackground'), }, // Grouped Content Background Colors { - label: 'systemGroupedBackgroundColor', - color: PlatformColor('systemGroupedBackgroundColor'), + label: 'systemGroupedBackground', + color: PlatformColor('systemGroupedBackground'), }, { - label: 'secondarySystemGroupedBackgroundColor', - color: PlatformColor('secondarySystemGroupedBackgroundColor'), + label: 'secondarySystemGroupedBackground', + color: PlatformColor('secondarySystemGroupedBackground'), }, { - label: 'tertiarySystemGroupedBackgroundColor', - color: PlatformColor('tertiarySystemGroupedBackgroundColor'), + label: 'tertiarySystemGroupedBackground', + color: PlatformColor('tertiarySystemGroupedBackground'), }, // Separator Colors - {label: 'separatorColor', color: PlatformColor('separatorColor')}, + {label: 'separator', color: PlatformColor('separator')}, { - label: 'opaqueSeparatorColor', - color: PlatformColor('opaqueSeparatorColor'), + label: 'opaqueSeparator', + color: PlatformColor('opaqueSeparator'), }, // Link Color - {label: 'linkColor', color: PlatformColor('linkColor')}, + {label: 'link', color: PlatformColor('link')}, // Nonadaptable Colors - {label: 'darkTextColor', color: PlatformColor('darkTextColor')}, - {label: 'lightTextColor', color: PlatformColor('lightTextColor')}, + {label: 'darkText', color: PlatformColor('darkText')}, + {label: 'lightText', color: PlatformColor('lightText')}, // https://developer.apple.com/documentation/uikit/uicolor/standard_colors // Adaptable Colors - {label: 'systemBlueColor', color: PlatformColor('systemBlueColor')}, - {label: 'systemBrownColor', color: PlatformColor('systemBrownColor')}, - {label: 'systemGreenColor', color: PlatformColor('systemGreenColor')}, - {label: 'systemIndigoColor', color: PlatformColor('systemIndigoColor')}, - {label: 'systemOrangeColor', color: PlatformColor('systemOrangeColor')}, - {label: 'systemPinkColor', color: PlatformColor('systemPinkColor')}, - {label: 'systemPurpleColor', color: PlatformColor('systemPurpleColor')}, - {label: 'systemRedColor', color: PlatformColor('systemRedColor')}, - {label: 'systemTealColor', color: PlatformColor('systemTealColor')}, - {label: 'systemYellowColor', color: PlatformColor('systemYellowColor')}, + {label: 'systemBlue', color: PlatformColor('systemBlue')}, + {label: 'systemBrown', color: PlatformColor('systemBrown')}, + {label: 'systemGreen', color: PlatformColor('systemGreen')}, + {label: 'systemIndigo', color: PlatformColor('systemIndigo')}, + {label: 'systemOrange', color: PlatformColor('systemOrange')}, + {label: 'systemPink', color: PlatformColor('systemPink')}, + {label: 'systemPurple', color: PlatformColor('systemPurple')}, + {label: 'systemRed', color: PlatformColor('systemRed')}, + {label: 'systemTeal', color: PlatformColor('systemTeal')}, + {label: 'systemYellow', color: PlatformColor('systemYellow')}, // Adaptable Gray Colors - {label: 'systemGrayColor', color: PlatformColor('systemGrayColor')}, - {label: 'systemGray2Color', color: PlatformColor('systemGray2Color')}, - {label: 'systemGray3Color', color: PlatformColor('systemGray3Color')}, - {label: 'systemGray4Color', color: PlatformColor('systemGray4Color')}, - {label: 'systemGray5Color', color: PlatformColor('systemGray5Color')}, - {label: 'systemGray6Color', color: PlatformColor('systemGray6Color')}, + {label: 'systemGray', color: PlatformColor('systemGray')}, + {label: 'systemGray2', color: PlatformColor('systemGray2')}, + {label: 'systemGray3', color: PlatformColor('systemGray3')}, + {label: 'systemGray4', color: PlatformColor('systemGray4')}, + {label: 'systemGray5', color: PlatformColor('systemGray5')}, + {label: 'systemGray6', color: PlatformColor('systemGray6')}, ]; } else if (Platform.OS === 'android') { colors = [ diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 0102ecf906a9a0..6de135bd1e5cb5 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -604,7 +604,7 @@ +(type)type : (id)json \ { static NSDictionary *colorMap = nil; if (colorMap == nil) { - colorMap = @{ + NSMutableDictionary *map = [@{ // https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors // Label Colors @"labelColor" : @{ @@ -729,7 +729,22 @@ +(type)type : (id)json \ // iOS 13.0 RCTFallbackARGB : @(0xFFf2f2f7) }, + } mutableCopy]; + // The color names are the Objective-C UIColor selector names, + // but Swift selector names are valid as well, so make aliases. + static NSString *const RCTColorSuffix = @"Color"; + NSMutableDictionary *aliases = [NSMutableDictionary new]; + for (NSString *objcSelector in map) { + RCTAssert([objcSelector hasSuffix:RCTColorSuffix], @"A selector in the color map did not end with the suffix Color."); + NSMutableDictionary *entry = [map[objcSelector] mutableCopy]; + RCTAssert([entry objectForKey:RCTSelector] == nil, @"Entry should not already have an RCTSelector"); + NSString *swiftSelector = [objcSelector substringToIndex:[objcSelector length] - [RCTColorSuffix length]]; + entry[RCTSelector] = objcSelector; + aliases[swiftSelector] = entry; + } + [map addEntriesFromDictionary:aliases]; #if DEBUG + [map addEntriesFromDictionary:@{ // The follow exist for Unit Tests @"unitTestFallbackColor" : @{RCTFallback : @"gridColor"}, @"unitTestFallbackColorIOS" : @{RCTFallback : @"blueColor"}, @@ -743,9 +758,11 @@ +(type)type : (id)json \ RCTIndex : @1, RCTFallback : @"controlAlternatingRowBackgroundColors" }, + }]; #endif - }; + colorMap = [map copy]; } + return colorMap; } From 1fdb9ac69c7b2a4af8eb4efdd048e703fb1a606b Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 20 Apr 2020 23:17:29 -0700 Subject: [PATCH 077/235] Update Differ test Summary: Update differ test so it passes again. Previously to D21111423 (I think) nodes were being incorrectly detected as updated even if they weren't different, so now there are fewer unnecessary Update mutations generated. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21148647 fbshipit-source-id: cab6e3ecd0a457e1ac3155b3468bcc56663dab0b --- .../fabric/mounting/tests/MountingTest.cpp | 70 ++++++++----------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/ReactCommon/fabric/mounting/tests/MountingTest.cpp b/ReactCommon/fabric/mounting/tests/MountingTest.cpp index 87cc2e19155844..4783516bf1c4a5 100644 --- a/ReactCommon/fabric/mounting/tests/MountingTest.cpp +++ b/ReactCommon/fabric/mounting/tests/MountingTest.cpp @@ -248,24 +248,18 @@ TEST(MountingTest, testMinimalInstructionGeneration) { // This test, in particular, ensures that removing a node in the middle // produces a single remove (and delete) instruction, and no remove/insert // (move) operations; and that simultaneously, we can insert a node at the - // end. NOTE: This list of mutations has some unexpected "Update" - // instructions, due to layout issues (some LayoutMetrics are 0). Not sure - // why, but the point of this test is to make sure there aren't unnecessary - // insert/deletes, so we can ignore for now. - assert(mutations3.size() == 7); - assert(mutations3[0].type == ShadowViewMutation::Update); - assert(mutations3[1].type == ShadowViewMutation::Update); - assert(mutations3[2].type == ShadowViewMutation::Update); - assert(mutations3[3].type == ShadowViewMutation::Remove); - assert(mutations3[3].oldChildShadowView.tag == 102); - assert(mutations3[3].index == 1); - assert(mutations3[4].type == ShadowViewMutation::Delete); - assert(mutations3[4].oldChildShadowView.tag == 102); - assert(mutations3[5].type == ShadowViewMutation::Create); - assert(mutations3[5].newChildShadowView.tag == 104); - assert(mutations3[6].type == ShadowViewMutation::Insert); - assert(mutations3[6].newChildShadowView.tag == 104); - assert(mutations3[6].index == 2); + // end. + assert(mutations3.size() == 4); + assert(mutations3[0].type == ShadowViewMutation::Remove); + assert(mutations3[0].oldChildShadowView.tag == 102); + assert(mutations3[0].index == 1); + assert(mutations3[1].type == ShadowViewMutation::Delete); + assert(mutations3[1].oldChildShadowView.tag == 102); + assert(mutations3[2].type == ShadowViewMutation::Create); + assert(mutations3[2].newChildShadowView.tag == 104); + assert(mutations3[3].type == ShadowViewMutation::Insert); + assert(mutations3[3].newChildShadowView.tag == 104); + assert(mutations3[3].index == 2); // Calculating mutations. auto mutations4 = calculateShadowViewMutations( @@ -276,29 +270,23 @@ TEST(MountingTest, testMinimalInstructionGeneration) { // This test, in particular, ensures that inserting a child at the middle, and // at the end, and removing a node in the middle, produces the minimal set of // instructions. All these nodes are laid out with absolute positioning, so - // moving them around does not change layout. NOTE: This list of mutations has - // some unexpected "Update" instructions, due to layout issues (some - // LayoutMetrics are 0). Not sure why, but the point of this test is to make - // sure there aren't unnecessary insert/deletes, so we can ignore for now. - assert(mutations4.size() == 9); - assert(mutations4[0].type == ShadowViewMutation::Update); - assert(mutations4[1].type == ShadowViewMutation::Update); - assert(mutations4[2].type == ShadowViewMutation::Update); - assert(mutations4[3].type == ShadowViewMutation::Remove); - assert(mutations4[3].oldChildShadowView.tag == 103); - assert(mutations4[3].index == 1); - assert(mutations4[4].type == ShadowViewMutation::Delete); - assert(mutations4[4].oldChildShadowView.tag == 103); - assert(mutations4[5].type == ShadowViewMutation::Create); - assert(mutations4[5].newChildShadowView.tag == 100); - assert(mutations4[6].type == ShadowViewMutation::Create); - assert(mutations4[6].newChildShadowView.tag == 102); - assert(mutations4[7].type == ShadowViewMutation::Insert); - assert(mutations4[7].newChildShadowView.tag == 100); - assert(mutations4[7].index == 1); - assert(mutations4[8].type == ShadowViewMutation::Insert); - assert(mutations4[8].newChildShadowView.tag == 102); - assert(mutations4[8].index == 3); + // moving them around does not change layout. + assert(mutations4.size() == 6); + assert(mutations4[0].type == ShadowViewMutation::Remove); + assert(mutations4[0].oldChildShadowView.tag == 103); + assert(mutations4[0].index == 1); + assert(mutations4[1].type == ShadowViewMutation::Delete); + assert(mutations4[1].oldChildShadowView.tag == 103); + assert(mutations4[2].type == ShadowViewMutation::Create); + assert(mutations4[2].newChildShadowView.tag == 100); + assert(mutations4[3].type == ShadowViewMutation::Create); + assert(mutations4[3].newChildShadowView.tag == 102); + assert(mutations4[4].type == ShadowViewMutation::Insert); + assert(mutations4[4].newChildShadowView.tag == 100); + assert(mutations4[4].index == 1); + assert(mutations4[5].type == ShadowViewMutation::Insert); + assert(mutations4[5].newChildShadowView.tag == 102); + assert(mutations4[5].index == 3); auto mutations5 = calculateShadowViewMutations( DifferentiatorMode::OptimizedMoves, *rootNodeV5, *rootNodeV6); From 8c4efc94e1114e454ecbeb4ad64403fa5359eab5 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 20 Apr 2020 23:28:44 -0700 Subject: [PATCH 078/235] Enable Yoga logging in Fabric Debug Summary: This diff extends Fabric to support Yoga logging changeLog: [Internal] Internal changes in Fabric to enable yoga logging Reviewed By: JoshuaGross Differential Revision: D21150195 fbshipit-source-id: a2e8308a79a7b422bf9ecc3a65f822b305f02c5d --- .../view/yoga/YogaLayoutableShadowNode.cpp | 27 +++++++++++++++---- .../fabric/debug/DebugStringConvertible.h | 6 +++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 5cd3b412e2c627..f625e1467869b3 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -6,11 +6,6 @@ */ #include "YogaLayoutableShadowNode.h" - -#include -#include -#include - #include #include #include @@ -18,6 +13,9 @@ #include #include #include +#include +#include +#include namespace facebook { namespace react { @@ -396,10 +394,29 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector( yogaFloatFromFloat(size.height)}; } +#ifdef RN_DEBUG_YOGA_LOGGER +static int YogaLog( + const YGConfigRef config, + const YGNodeRef node, + YGLogLevel level, + const char *format, + va_list args) { + int result = vsnprintf(NULL, 0, format, args); + std::vector buffer(1 + result); + vsnprintf(buffer.data(), buffer.size(), format, args); + LOG(INFO) << "RNYogaLogger " << buffer.data(); + return result; +} +#endif + YGConfig &YogaLayoutableShadowNode::initializeYogaConfig(YGConfig &config) { config.setCloneNodeCallback( YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector); config.useLegacyStretchBehaviour = true; +#ifdef RN_DEBUG_YOGA_LOGGER + config.printTree = true; + config.setLogger(&YogaLog); +#endif return config; } diff --git a/ReactCommon/fabric/debug/DebugStringConvertible.h b/ReactCommon/fabric/debug/DebugStringConvertible.h index f50d9be071ebbe..a71077193cbf95 100644 --- a/ReactCommon/fabric/debug/DebugStringConvertible.h +++ b/ReactCommon/fabric/debug/DebugStringConvertible.h @@ -20,6 +20,12 @@ namespace react { #define RN_DEBUG_STRING_CONVERTIBLE 1 #endif +// To Debug Yoga layout, uncomment the following line. +// #define RN_DEBUG_YOGA_LOGGER 1 +// +// Additional logging can be enabled editing yoga.cpp (e.g. gPrintChanges, +// gPrintSkips) + #if RN_DEBUG_STRING_CONVERTIBLE class DebugStringConvertible; From 05c76be176b41ee94706b232a3a0d8d51820fe58 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 20 Apr 2020 23:28:44 -0700 Subject: [PATCH 079/235] Easy diff to document in code how to enable logging of Shadow Tree instrospection Summary: Easy diff to document in code how to enable logging of Shadow Tree instrospection changeLog: [Internal] Internal change used on Fabric Reviewed By: JoshuaGross Differential Revision: D21150196 fbshipit-source-id: 8eb23ec3ea1d574b79b09333428ab52c851065dd --- ReactCommon/fabric/debug/DebugStringConvertible.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactCommon/fabric/debug/DebugStringConvertible.h b/ReactCommon/fabric/debug/DebugStringConvertible.h index a71077193cbf95..ccdfef0189acf5 100644 --- a/ReactCommon/fabric/debug/DebugStringConvertible.h +++ b/ReactCommon/fabric/debug/DebugStringConvertible.h @@ -26,6 +26,9 @@ namespace react { // Additional logging can be enabled editing yoga.cpp (e.g. gPrintChanges, // gPrintSkips) +// To Debug introspection of RN Shadow tree, uncomment the following line: +// #define RN_SHADOW_TREE_INTROSPECTION 1 + #if RN_DEBUG_STRING_CONVERTIBLE class DebugStringConvertible; From a136b34c35eec345e232ed4086411e8cf05ad35d Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 21 Apr 2020 05:40:07 -0700 Subject: [PATCH 080/235] Flip text alignment in case layout direction is RTL Summary: Changelog: [Internal] Flip text alignment in case layout direction is RTL. Reviewed By: JoshuaGross, mdvacca Differential Revision: D21130371 fbshipit-source-id: cf56ca052c17a48e321803b0f99f8a4baaa0e67b --- .../facebook/react/uimanager/ViewProps.java | 1 + .../views/text/ReactTextViewManager.java | 3 +-- .../react/views/text/TextAttributeProps.java | 25 ++++++++++++++++--- .../react/views/text/TextLayoutManager.java | 12 +++++++++ .../textinput/ReactTextInputManager.java | 2 +- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java index 19926020b8a7c6..fcb4d2bb4f15cc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java @@ -97,6 +97,7 @@ public class ViewProps { public static final String ON = "on"; public static final String RESIZE_MODE = "resizeMode"; public static final String RESIZE_METHOD = "resizeMethod"; + public static final String LAYOUT_DIRECTION = "layoutDirection"; public static final String TEXT_ALIGN = "textAlign"; public static final String TEXT_ALIGN_VERTICAL = "textAlignVertical"; public static final String TEXT_DECORATION_LINE = "textDecorationLine"; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java index c6d739a586f03e..599ab79e666dd8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java @@ -87,7 +87,6 @@ public Object updateState( ReadableNativeMap state = stateWrapper.getState(); ReadableMap attributedString = state.getMap("attributedString"); ReadableMap paragraphAttributes = state.getMap("paragraphAttributes"); - Spannable spanned = TextLayoutManager.getOrCreateSpannableForText( view.getContext(), attributedString, mReactTextViewManagerCallback); @@ -100,7 +99,7 @@ public Object updateState( spanned, state.hasKey("mostRecentEventCount") ? state.getInt("mostRecentEventCount") : -1, false, // TODO add this into local Data - TextAttributeProps.getTextAlignment(props), + TextAttributeProps.getTextAlignment(props, TextLayoutManager.isRTL(attributedString)), textBreakStrategy, TextAttributeProps.getJustificationMode(props)); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java index 2562f450ea578f..29e3e2969fb879 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java @@ -10,6 +10,7 @@ import android.graphics.Typeface; import android.os.Build; import android.text.Layout; +import android.util.LayoutDirection; import android.view.Gravity; import androidx.annotation.Nullable; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; @@ -57,6 +58,9 @@ public class TextAttributeProps { protected float mLetterSpacingInput = Float.NaN; protected int mTextAlign = Gravity.NO_GRAVITY; + // `UNSET` is -1 and is the same as `LayoutDirection.UNDEFINED` but the symbol isn't available. + protected int mLayoutDirection = UNSET; + protected TextTransform mTextTransform = TextTransform.UNSET; protected float mTextShadowOffsetDx = 0; @@ -129,10 +133,10 @@ public TextAttributeProps(ReactStylesDiffMap props) { setTextShadowRadius(getIntProp(PROP_SHADOW_RADIUS, 1)); setTextShadowColor(getIntProp(PROP_SHADOW_COLOR, DEFAULT_TEXT_SHADOW_COLOR)); setTextTransform(getStringProp(PROP_TEXT_TRANSFORM)); + setLayoutDirection(getStringProp(ViewProps.LAYOUT_DIRECTION)); } - // TODO T63645393 add support for RTL - public static int getTextAlignment(ReactStylesDiffMap props) { + public static int getTextAlignment(ReactStylesDiffMap props, boolean isRTL) { @Nullable String textAlignPropValue = props.hasKey(ViewProps.TEXT_ALIGN) ? props.getString(ViewProps.TEXT_ALIGN) : null; @@ -144,9 +148,9 @@ public static int getTextAlignment(ReactStylesDiffMap props) { if (textAlignPropValue == null || "auto".equals(textAlignPropValue)) { textAlignment = Gravity.NO_GRAVITY; } else if ("left".equals(textAlignPropValue)) { - textAlignment = Gravity.LEFT; + textAlignment = isRTL ? Gravity.RIGHT : Gravity.LEFT; } else if ("right".equals(textAlignPropValue)) { - textAlignment = Gravity.RIGHT; + textAlignment = isRTL ? Gravity.LEFT : Gravity.RIGHT; } else if ("center".equals(textAlignPropValue)) { textAlignment = Gravity.CENTER_HORIZONTAL; } else { @@ -369,6 +373,19 @@ public void setTextShadowOffset(ReadableMap offsetMap) { } } + public void setLayoutDirection(@Nullable String layoutDirection) { + if (layoutDirection == null || "undefined".equals(layoutDirection)) { + mLayoutDirection = UNSET; + } else if ("rtl".equals(layoutDirection)) { + mLayoutDirection = LayoutDirection.RTL; + } else if ("ltr".equals(layoutDirection)) { + mLayoutDirection = LayoutDirection.LTR; + } else { + throw new JSApplicationIllegalArgumentException( + "Invalid layoutDirection: " + layoutDirection); + } + } + public void setTextShadowRadius(float textShadowRadius) { if (textShadowRadius != mTextShadowRadius) { mTextShadowRadius = textShadowRadius; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index d2a68fd45507d8..2213ec612823e0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -18,6 +18,7 @@ import android.text.Spanned; import android.text.StaticLayout; import android.text.TextPaint; +import android.util.LayoutDirection; import android.util.LruCache; import androidx.annotation.Nullable; import com.facebook.react.bridge.ReadableArray; @@ -47,6 +48,17 @@ public class TextLayoutManager { private static final Object sSpannableCacheLock = new Object(); private static LruCache sSpannableCache = new LruCache<>(spannableCacheSize); + public static boolean isRTL(ReadableMap attributedString) { + ReadableArray fragments = attributedString.getArray("fragments"); + for (int i = 0, length = fragments.size(); i < length; i++) { + ReadableMap fragment = fragments.getMap(i); + ReactStylesDiffMap map = new ReactStylesDiffMap(fragment.getMap("textAttributes")); + TextAttributeProps textAttributes = new TextAttributeProps(map); + return textAttributes.mLayoutDirection == LayoutDirection.RTL; + } + return false; + } + private static void buildSpannableFromFragment( Context context, ReadableArray fragments, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 4bbbca329733de..2f228cd0566005 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -1285,7 +1285,7 @@ public Object updateState( spanned, state.getInt("mostRecentEventCount"), false, // TODO add this into local Data - TextAttributeProps.getTextAlignment(props), + TextAttributeProps.getTextAlignment(props, TextLayoutManager.isRTL(attributedString)), textBreakStrategy, TextAttributeProps.getJustificationMode(props), attributedString); From 19658a1a60ce0408857338bc3a6bf1c05c50abeb Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Tue, 21 Apr 2020 09:13:38 -0700 Subject: [PATCH 081/235] Daily `arc lint --take GOOGLEJAVAFORMAT` Reviewed By: zertosh Differential Revision: D21154707 fbshipit-source-id: 11956915c265f98e286638b91d66d51545e3a311 --- .../view/ReactViewBackgroundDrawable.java | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index b9863d87203bd8..e22b70046f1975 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -663,22 +663,30 @@ private void updatePath() { mCenterDrawPath.addRoundRect( mTempRectForCenterDrawPath, new float[] { - Math.max(topLeftRadius - borderWidth.left * 0.5f, - (borderWidth.left > 0.0f) ? (topLeftRadius / borderWidth.left) : 0.0f), - Math.max(topLeftRadius - borderWidth.top * 0.5f, - (borderWidth.top > 0.0f) ? (topLeftRadius / borderWidth.top) : 0.0f), - Math.max(topRightRadius - borderWidth.right * 0.5f, - (borderWidth.right > 0.0f) ? (topRightRadius / borderWidth.right) : 0.0f), - Math.max(topRightRadius - borderWidth.top * 0.5f, - (borderWidth.top > 0.0f) ? (topRightRadius / borderWidth.top) : 0.0f), - Math.max(bottomRightRadius - borderWidth.right * 0.5f, - (borderWidth.right > 0.0f) ? (bottomRightRadius / borderWidth.right) : 0.0f), - Math.max(bottomRightRadius - borderWidth.bottom * 0.5f, - (borderWidth.bottom > 0.0f) ? (bottomRightRadius / borderWidth.bottom) : 0.0f), - Math.max(bottomLeftRadius - borderWidth.left * 0.5f, - (borderWidth.left > 0.0f) ? (bottomLeftRadius / borderWidth.left) : 0.0f), - Math.max(bottomLeftRadius - borderWidth.bottom * 0.5f, - (borderWidth.bottom > 0.0f) ? (bottomLeftRadius / borderWidth.bottom) : 0.0f) + Math.max( + topLeftRadius - borderWidth.left * 0.5f, + (borderWidth.left > 0.0f) ? (topLeftRadius / borderWidth.left) : 0.0f), + Math.max( + topLeftRadius - borderWidth.top * 0.5f, + (borderWidth.top > 0.0f) ? (topLeftRadius / borderWidth.top) : 0.0f), + Math.max( + topRightRadius - borderWidth.right * 0.5f, + (borderWidth.right > 0.0f) ? (topRightRadius / borderWidth.right) : 0.0f), + Math.max( + topRightRadius - borderWidth.top * 0.5f, + (borderWidth.top > 0.0f) ? (topRightRadius / borderWidth.top) : 0.0f), + Math.max( + bottomRightRadius - borderWidth.right * 0.5f, + (borderWidth.right > 0.0f) ? (bottomRightRadius / borderWidth.right) : 0.0f), + Math.max( + bottomRightRadius - borderWidth.bottom * 0.5f, + (borderWidth.bottom > 0.0f) ? (bottomRightRadius / borderWidth.bottom) : 0.0f), + Math.max( + bottomLeftRadius - borderWidth.left * 0.5f, + (borderWidth.left > 0.0f) ? (bottomLeftRadius / borderWidth.left) : 0.0f), + Math.max( + bottomLeftRadius - borderWidth.bottom * 0.5f, + (borderWidth.bottom > 0.0f) ? (bottomLeftRadius / borderWidth.bottom) : 0.0f) }, Path.Direction.CW); @@ -1007,7 +1015,7 @@ private static int fastBorderCompatibleColorOrZero( private void drawRectangularBackgroundWithBorders(Canvas canvas) { mPaint.setStyle(Paint.Style.FILL); - + int useColor = ColorUtil.multiplyColorAlpha(mColor, mAlpha); if (Color.alpha(useColor) != 0) { // color is not transparent mPaint.setColor(useColor); From 17f025bc26da13da795845a3f7daee65563420c0 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Tue, 21 Apr 2020 17:43:59 -0700 Subject: [PATCH 082/235] Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android ## Changelog [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 --- RNTester/Podfile.lock | 88 +++++++++---------- .../RNTesterPods.xcodeproj/project.pbxproj | 14 +++ RNTester/android/app/gradle.properties | 2 +- scripts/react_native_pods.rb | 35 ++++++-- template/android/gradle.properties | 2 +- 5 files changed, 90 insertions(+), 51 deletions(-) diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 6f28a766139286..e5124ddbd7c54e 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -11,11 +11,11 @@ PODS: - React-Core (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - - Flipper (0.33.1): - - Flipper-Folly (~> 2.1) - - Flipper-RSocket (~> 1.0) + - Flipper (0.37.0): + - Flipper-Folly (~> 2.2) + - Flipper-RSocket (~> 1.1) - Flipper-DoubleConversion (1.1.7) - - Flipper-Folly (2.1.1): + - Flipper-Folly (2.2.0): - boost-for-react-native - CocoaLibEvent (~> 1.0) - Flipper-DoubleConversion @@ -23,38 +23,38 @@ PODS: - OpenSSL-Universal (= 1.0.2.19) - Flipper-Glog (0.3.6) - Flipper-PeerTalk (0.0.4) - - Flipper-RSocket (1.0.0): - - Flipper-Folly (~> 2.0) - - FlipperKit (0.33.1): - - FlipperKit/Core (= 0.33.1) - - FlipperKit/Core (0.33.1): - - Flipper (~> 0.33.1) + - Flipper-RSocket (1.1.0): + - Flipper-Folly (~> 2.2) + - FlipperKit (0.37.0): + - FlipperKit/Core (= 0.37.0) + - FlipperKit/Core (0.37.0): + - Flipper (~> 0.37.0) - FlipperKit/CppBridge - FlipperKit/FBCxxFollyDynamicConvert - FlipperKit/FBDefines - FlipperKit/FKPortForwarding - - FlipperKit/CppBridge (0.33.1): - - Flipper (~> 0.33.1) - - FlipperKit/FBCxxFollyDynamicConvert (0.33.1): - - Flipper-Folly (~> 2.1) - - FlipperKit/FBDefines (0.33.1) - - FlipperKit/FKPortForwarding (0.33.1): + - FlipperKit/CppBridge (0.37.0): + - Flipper (~> 0.37.0) + - FlipperKit/FBCxxFollyDynamicConvert (0.37.0): + - Flipper-Folly (~> 2.2) + - FlipperKit/FBDefines (0.37.0) + - FlipperKit/FKPortForwarding (0.37.0): - CocoaAsyncSocket (~> 7.6) - Flipper-PeerTalk (~> 0.0.4) - - FlipperKit/FlipperKitHighlightOverlay (0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (0.33.1): + - FlipperKit/FlipperKitHighlightOverlay (0.37.0) + - FlipperKit/FlipperKitLayoutPlugin (0.37.0): - FlipperKit/Core - FlipperKit/FlipperKitHighlightOverlay - FlipperKit/FlipperKitLayoutTextSearchable - YogaKit (~> 1.18) - - FlipperKit/FlipperKitLayoutTextSearchable (0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (0.33.1): + - FlipperKit/FlipperKitLayoutTextSearchable (0.37.0) + - FlipperKit/FlipperKitNetworkPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/FlipperKitReactPlugin (0.33.1): + - FlipperKit/FlipperKitReactPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/FlipperKitUserDefaultsPlugin (0.33.1): + - FlipperKit/FlipperKitUserDefaultsPlugin (0.37.0): - FlipperKit/Core - - FlipperKit/SKIOSNetworkPlugin (0.33.1): + - FlipperKit/SKIOSNetworkPlugin (0.37.0): - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - Folly (2020.01.13.00): @@ -343,25 +343,25 @@ DEPENDENCIES: - DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../Libraries/FBLazyVector`) - FBReactNativeSpec (from `../Libraries/FBReactNativeSpec`) - - Flipper (~> 0.33.1) + - Flipper (~> 0.37.0) - Flipper-DoubleConversion (= 1.1.7) - - Flipper-Folly (~> 2.1) + - Flipper-Folly (~> 2.2) - Flipper-Glog (= 0.3.6) - Flipper-PeerTalk (~> 0.0.4) - - Flipper-RSocket (~> 1.0) - - FlipperKit (~> 0.33.1) - - FlipperKit/Core (~> 0.33.1) - - FlipperKit/CppBridge (~> 0.33.1) - - FlipperKit/FBCxxFollyDynamicConvert (~> 0.33.1) - - FlipperKit/FBDefines (~> 0.33.1) - - FlipperKit/FKPortForwarding (~> 0.33.1) - - FlipperKit/FlipperKitHighlightOverlay (~> 0.33.1) - - FlipperKit/FlipperKitLayoutPlugin (~> 0.33.1) - - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.33.1) - - FlipperKit/FlipperKitNetworkPlugin (~> 0.33.1) - - FlipperKit/FlipperKitReactPlugin (~> 0.33.1) - - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.33.1) - - FlipperKit/SKIOSNetworkPlugin (~> 0.33.1) + - Flipper-RSocket (~> 1.1) + - FlipperKit (~> 0.37.0) + - FlipperKit/Core (~> 0.37.0) + - FlipperKit/CppBridge (~> 0.37.0) + - FlipperKit/FBCxxFollyDynamicConvert (~> 0.37.0) + - FlipperKit/FBDefines (~> 0.37.0) + - FlipperKit/FKPortForwarding (~> 0.37.0) + - FlipperKit/FlipperKitHighlightOverlay (~> 0.37.0) + - FlipperKit/FlipperKitLayoutPlugin (~> 0.37.0) + - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.37.0) + - FlipperKit/FlipperKitNetworkPlugin (~> 0.37.0) + - FlipperKit/FlipperKitReactPlugin (~> 0.37.0) + - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.37.0) + - FlipperKit/SKIOSNetworkPlugin (~> 0.37.0) - Folly (from `../third-party-podspecs/Folly.podspec`) - glog (from `../third-party-podspecs/glog.podspec`) - RCTRequired (from `../Libraries/RCTRequired`) @@ -474,13 +474,13 @@ SPEC CHECKSUMS: DoubleConversion: cde416483dac037923206447da6e1454df403714 FBLazyVector: 8ea0285646adaf7fa725c20ed737c49ee5ea680a FBReactNativeSpec: e8f07c749b9cf184c819f5a8ca44b91ab61fca12 - Flipper: 6c1f484f9a88d30ab3e272800d53688439e50f69 + Flipper: 1670db365568191bd123a0c905b834e77ba9e3d3 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 - Flipper-Folly: 2de3d03e0acc7064d5e4ed9f730e2f217486f162 + Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 - Flipper-RSocket: 1260a31c05c238eabfa9bb8a64e3983049048371 - FlipperKit: 6dc9b8f4ef60d9e5ded7f0264db299c91f18832e + Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 + FlipperKit: afd4259ef9eadeeb2d30250b37d95cb3b6b97a69 Folly: b73c3869541e86821df3c387eb0af5f65addfab4 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 @@ -512,4 +512,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.1 diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index c29e9d2ec0f6a3..8f9b9b6a6a2142 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -784,6 +784,10 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", ); "LIBRARY_SEARCH_PATHS[arch=*]" = "$(inherited)"; + OTHER_CFLAGS = ( + "$(inherited)", + "-DFB_SONARKIT_ENABLED=1", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -791,6 +795,7 @@ "-framework", "\"JavaScriptCore\"", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_NAME = RNTester; TARGETED_DEVICE_FAMILY = "1,2"; @@ -845,6 +850,10 @@ "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", ); + OTHER_CFLAGS = ( + "$(inherited)", + "-DFB_SONARKIT_ENABLED=1", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -852,6 +861,7 @@ "-framework", "\"JavaScriptCore\"", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_NAME = RNTester; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1044,6 +1054,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1079,6 +1090,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1115,6 +1127,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1148,6 +1161,7 @@ "$(inherited)", "-DFB_SONARKIT_ENABLED=1", ); + OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -DFB_SONARKIT_ENABLED"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/RNTester/android/app/gradle.properties b/RNTester/android/app/gradle.properties index 3d9a626c164f38..4ff9751aab7d8b 100644 --- a/RNTester/android/app/gradle.properties +++ b/RNTester/android/app/gradle.properties @@ -9,4 +9,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.33.1 +FLIPPER_VERSION=0.37.0 diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 21984326468080..5a2726e0d85354 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -58,19 +58,17 @@ def use_react_native! (options={}) end def use_flipper!(versions = {}) - versions['Flipper'] ||= '~> 0.33.1' + versions['Flipper'] ||= '~> 0.37.0' versions['DoubleConversion'] ||= '1.1.7' - versions['Flipper-Folly'] ||= '~> 2.1' + versions['Flipper-Folly'] ||= '~> 2.2' versions['Flipper-Glog'] ||= '0.3.6' versions['Flipper-PeerTalk'] ||= '~> 0.0.4' - versions['Flipper-RSocket'] ||= '~> 1.0' - + versions['Flipper-RSocket'] ||= '~> 1.1' 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' @@ -98,4 +96,31 @@ def flipper_post_install(installer) end end end + 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 + if (config.build_settings['OTHER_SWIFT_FLAGS']) + unless config.build_settings['OTHER_SWIFT_FLAGS'].include? '-DFB_SONARKIT_ENABLED' + puts 'Adding -DFB_SONARKIT_ENABLED ...' + swift_flags = config.build_settings['OTHER_SWIFT_FLAGS'] + if swift_flags.split.last != '-Xcc' + config.build_settings['OTHER_SWIFT_FLAGS'] << ' -Xcc' + end + config.build_settings['OTHER_SWIFT_FLAGS'] << ' -DFB_SONARKIT_ENABLED' + end + else + puts 'OTHER_SWIFT_FLAGS does not exist thus assigning it to `$(inherited) -Xcc -DFB_SONARKIT_ENABLED`' + config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -Xcc -DFB_SONARKIT_ENABLED' + end + app_project.save + end + end + installer.pods_project.save end diff --git a/template/android/gradle.properties b/template/android/gradle.properties index 1bbc8cc20f27f5..04ca0ef29e7d10 100644 --- a/template/android/gradle.properties +++ b/template/android/gradle.properties @@ -25,4 +25,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.33.1 +FLIPPER_VERSION=0.37.0 From 0b68f3cf77cb96df18535764b68f40b3fa89ed37 Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Tue, 21 Apr 2020 19:02:52 -0700 Subject: [PATCH 083/235] Upgrade babel-eslint in xplat/js Summary: `babel-eslint` is the parser you can supply to ESLint based off of Babel. `babel-eslint` 10.1.0 is the newest production version of `babel-eslint`. There are very few changes between 10.0.1 (the lowest previous version) and 10.1.0. There are only 3 non-version-bump commits: 2 bug fixes and enabling parsing of Flow enums. The only project that was on a lower version than 10.0.1 was `/xplat/js/RKJSModules/Libraries/Relay/oss/__github__` - test below Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21055850 fbshipit-source-id: bae0d8af5c6d833a4dbb0ad775c8e5e78ead1051 --- package.json | 2 +- .../package.json | 2 +- .../yarn.lock | 2 +- yarn.lock | 37 +++++++++---------- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index d033b42b138819..b1aa8943cec545 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "@react-native-community/eslint-plugin": "file:packages/eslint-plugin-react-native-community", "@reactions/component": "^2.0.2", "async": "^2.4.0", - "babel-eslint": "10.0.1", + "babel-eslint": "^10.1.0", "clang-format": "^1.2.4", "connect": "^3.6.5", "coveralls": "^3.0.2", diff --git a/packages/eslint-config-react-native-community/package.json b/packages/eslint-config-react-native-community/package.json index d5b24facb9bcd9..48c7bb25ef53db 100644 --- a/packages/eslint-config-react-native-community/package.json +++ b/packages/eslint-config-react-native-community/package.json @@ -13,7 +13,7 @@ "@react-native-community/eslint-plugin": "^1.1.0", "@typescript-eslint/eslint-plugin": "^2.25.0", "@typescript-eslint/parser": "^2.25.0", - "babel-eslint": "10.1.0", + "babel-eslint": "^10.1.0", "eslint-config-prettier": "^6.10.1", "eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-flowtype": "2.50.3", diff --git a/packages/eslint-config-react-native-community/yarn.lock b/packages/eslint-config-react-native-community/yarn.lock index f20d678ab34220..2bc0acb2eee40f 100644 --- a/packages/eslint-config-react-native-community/yarn.lock +++ b/packages/eslint-config-react-native-community/yarn.lock @@ -272,7 +272,7 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== -babel-eslint@10.1.0: +babel-eslint@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== diff --git a/yarn.lock b/yarn.lock index 6402ded848592c..c68cb87554a484 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,7 +293,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": version "7.9.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== @@ -957,7 +957,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/traverse@^7.7.4": +"@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== @@ -981,7 +981,7 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@babel/types@^7.9.5": +"@babel/types@^7.7.0", "@babel/types@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== @@ -1902,17 +1902,17 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-eslint@10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" - integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== +babel-eslint@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - eslint-scope "3.7.1" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" eslint-visitor-keys "^1.0.0" + resolve "^1.12.0" babel-jest@^25.4.0: version "25.4.0" @@ -3122,14 +3122,6 @@ eslint-rule-composer@^0.3.0: resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -6827,6 +6819,13 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.15.1, resolve@^1.3.2, resolve@^1.5.0 dependencies: path-parse "^1.0.6" +resolve@^1.12.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.16.1.tgz#49fac5d8bacf1fd53f200fa51247ae736175832c" + integrity sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" From a850d116dc1253b2055aeee57660ec4938d96aa6 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 21 Apr 2020 19:12:57 -0700 Subject: [PATCH 084/235] RN: Create `RootTag` Type Summary: Creates a `RootTag` type and refactors the `RootTagContext` module a bit. This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21127173 fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0 --- Libraries/ReactNative/AppContainer.js | 4 ++-- Libraries/ReactNative/RootTag.js | 27 +++++++++++++++++++++++++ Libraries/ReactNative/RootTagContext.js | 15 -------------- index.js | 4 ++-- 4 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 Libraries/ReactNative/RootTag.js delete mode 100644 Libraries/ReactNative/RootTagContext.js diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index 22e3bd3bef1883..93c83fba66350b 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -14,7 +14,7 @@ const EmitterSubscription = require('../vendor/emitter/EmitterSubscription'); const PropTypes = require('prop-types'); const RCTDeviceEventEmitter = require('../EventEmitter/RCTDeviceEventEmitter'); const React = require('react'); -const RootTagContext = require('./RootTagContext'); +import {RootTagContext, createRootTag} from './RootTag'; const StyleSheet = require('../StyleSheet/StyleSheet'); const View = require('../Components/View/View'); @@ -128,7 +128,7 @@ class AppContainer extends React.Component { ); } return ( - + {!this.state.hasError && innerView} {this.state.inspector} diff --git a/Libraries/ReactNative/RootTag.js b/Libraries/ReactNative/RootTag.js new file mode 100644 index 00000000000000..24b151544d43b2 --- /dev/null +++ b/Libraries/ReactNative/RootTag.js @@ -0,0 +1,27 @@ +/** + * 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. + * + * @flow strict + * @format + */ + +'use strict'; + +import * as React from 'react'; + +// TODO: Make this into an opaque type. +export type RootTag = number; + +export const RootTagContext: React$Context = React.createContext( + 0, +); + +/** + * Intended to only be used by `AppContainer`. + */ +export function createRootTag(rootTag: number): RootTag { + return rootTag; +} diff --git a/Libraries/ReactNative/RootTagContext.js b/Libraries/ReactNative/RootTagContext.js deleted file mode 100644 index ca5ed03932fd5c..00000000000000 --- a/Libraries/ReactNative/RootTagContext.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * 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. - * - * @flow strict - * @format - */ - -'use strict'; - -const React = require('react'); - -module.exports = (React.createContext(0): React$Context); diff --git a/index.js b/index.js index 1290bb728b5cdb..9d5a6dcb1458e5 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,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 RootTagContext from './Libraries/ReactNative/RootTagContext'; +import typeof {RootTagContext} from './Libraries/ReactNative/RootTag'; import typeof DeprecatedColorPropType from './Libraries/DeprecatedPropTypes/DeprecatedColorPropType'; import typeof DeprecatedEdgeInsetsPropType from './Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType'; import typeof DeprecatedPointPropType from './Libraries/DeprecatedPropTypes/DeprecatedPointPropType'; @@ -468,7 +468,7 @@ module.exports = { return require('./Libraries/ReactNative/requireNativeComponent'); }, get unstable_RootTagContext(): RootTagContext { - return require('./Libraries/ReactNative/RootTagContext'); + return require('./Libraries/ReactNative/RootTag').RootTagContext; }, get unstable_enableLogBox(): () => void { return () => From 5242ad931b05312929b58ffd78ef9d2e2dd3f4b7 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 21 Apr 2020 19:12:57 -0700 Subject: [PATCH 085/235] RN: Add `RootTag` Type to TurboModule Summary: Adds `RootTag` as a valid type for arguments and return types in TurboModules (on both Android and iOS). This will enable us to change `RootTag` into an opaque type. There are two compelling reasons to do this: - JavaScript will no longer be able to safely depend on `RootTag` being a number (which means we can change this in the future). - Call sites using `unstable_RootTagContext` will can get a `RootTag`, but call sites using the legacy `context.rootTag` will not. This means the opaque type will give us a strategy for migrating away from legacy context and eventually making `unstable_RootTagContext` the only way to access `RootTag`. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: RSNara Differential Revision: D21127170 fbshipit-source-id: baec9d7ad17b2f8c4527f1a84f604fc0d28b97eb --- Libraries/TurboModule/RCTExport.js | 2 ++ .../TurboModule/samples/NativeSampleTurboModule.js | 3 ++- .../examples/TurboModule/SampleTurboModuleExample.js | 5 +++++ .../platform/ios/RCTNativeSampleTurboModuleSpec.h | 1 + .../platform/ios/RCTNativeSampleTurboModuleSpec.mm | 11 +++++++++++ .../samples/platform/ios/RCTSampleTurboModule.mm | 5 +++++ .../platform/ios/SampleTurboCxxModuleLegacyImpl.cpp | 10 ++++++++++ .../platform/ios/SampleTurboCxxModuleLegacyImpl.h | 1 + 8 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Libraries/TurboModule/RCTExport.js b/Libraries/TurboModule/RCTExport.js index f90568d0e5bfc0..bbf236ed452d3d 100644 --- a/Libraries/TurboModule/RCTExport.js +++ b/Libraries/TurboModule/RCTExport.js @@ -34,3 +34,5 @@ export interface DEPRECATED_RCTExport { } export interface TurboModule extends DEPRECATED_RCTExport {} + +export type {RootTag} from '../ReactNative/RootTag.js'; diff --git a/Libraries/TurboModule/samples/NativeSampleTurboModule.js b/Libraries/TurboModule/samples/NativeSampleTurboModule.js index f82a8e810878e5..f9c4c6ef53e393 100644 --- a/Libraries/TurboModule/samples/NativeSampleTurboModule.js +++ b/Libraries/TurboModule/samples/NativeSampleTurboModule.js @@ -10,7 +10,7 @@ 'use strict'; -import type {TurboModule} from '../RCTExport'; +import type {RootTag, TurboModule} from '../RCTExport'; import * as TurboModuleRegistry from '../TurboModuleRegistry'; export interface Spec extends TurboModule { @@ -26,6 +26,7 @@ export interface Spec extends TurboModule { +getString: (arg: string) => string; +getArray: (arg: Array) => Array; +getObject: (arg: Object) => Object; + +getRootTag: (arg: RootTag) => RootTag; +getValue: (x: number, y: string, z: Object) => Object; +getValueWithCallback: (callback: (value: string) => void) => void; +getValueWithPromise: (error: boolean) => Promise; diff --git a/RNTester/js/examples/TurboModule/SampleTurboModuleExample.js b/RNTester/js/examples/TurboModule/SampleTurboModuleExample.js index eae564aa3a21cc..4eaa82444ad0ab 100644 --- a/RNTester/js/examples/TurboModule/SampleTurboModuleExample.js +++ b/RNTester/js/examples/TurboModule/SampleTurboModuleExample.js @@ -11,6 +11,7 @@ 'use strict'; import NativeSampleTurboModule from '../../../../Libraries/TurboModule/samples/NativeSampleTurboModule'; +import type {RootTag} from '../../../../Libraries/ReactNative/RootTag'; import { StyleSheet, Text, @@ -18,6 +19,7 @@ import { FlatList, Platform, TouchableOpacity, + unstable_RootTagContext, } from 'react-native'; import * as React from 'react'; @@ -33,6 +35,8 @@ type State = {| |}; class SampleTurboModuleExample extends React.Component<{||}, State> { + static contextType: React$Context = unstable_RootTagContext; + state: State = { testResults: {}, }; @@ -64,6 +68,7 @@ class SampleTurboModuleExample extends React.Component<{||}, State> { ]), getObject: () => NativeSampleTurboModule.getObject({a: 1, b: 'foo', c: null}), + getRootTag: () => NativeSampleTurboModule.getRootTag(this.context), getValue: () => NativeSampleTurboModule.getValue(5, 'test', {a: 1, b: 'foo'}), }; diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h index 93092b148fd0df..4738cff8d10ad5 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.h @@ -26,6 +26,7 @@ - (NSString *)getString:(NSString *)arg; - (NSArray> *)getArray:(NSArray *)arg; - (NSDictionary *)getObject:(NSDictionary *)arg; +- (NSNumber *)getRootTag:(double)arg; - (NSDictionary *)getValue:(double)x y:(NSString *)y z:(NSDictionary *)z; - (void)getValueWithCallback:(RCTResponseSenderBlock)callback; - (void)getValueWithPromise:(BOOL)error resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm index 42a0c2c1bd24e1..70f69b107babb3 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTNativeSampleTurboModuleSpec.mm @@ -70,6 +70,16 @@ .invokeObjCMethod(rt, ObjectKind, "getObject", @selector(getObject:), args, count); } +static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag( + facebook::jsi::Runtime &rt, + TurboModule &turboModule, + const facebook::jsi::Value *args, + size_t count) +{ + return static_cast(turboModule) + .invokeObjCMethod(rt, NumberKind, "getRootTag", @selector(getRootTag:), args, count); +} + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValue( facebook::jsi::Runtime &rt, TurboModule &turboModule, @@ -120,6 +130,7 @@ methodMap_["getString"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getString}; methodMap_["getArray"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getArray}; methodMap_["getObject"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getObject}; + methodMap_["getRootTag"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag}; methodMap_["getValue"] = MethodMetadata{3, __hostFunction_NativeSampleTurboModuleSpecJSI_getValue}; methodMap_["getValueWithCallback"] = MethodMetadata{1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback}; diff --git a/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm b/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm index 11432450bfaaa7..a875ff521ad998 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm +++ b/ReactCommon/turbomodule/samples/platform/ios/RCTSampleTurboModule.mm @@ -91,6 +91,11 @@ - (NSDictionary *)constantsToExport return arg; } +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getRootTag : (double)arg) +{ + return @(arg); +} + RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getValue : (double)x y : (NSString *)y z : (NSDictionary *)z) { return @{ diff --git a/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.cpp b/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.cpp index 54c975938b57a1..5eea42c3d8058a 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.cpp +++ b/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.cpp @@ -69,6 +69,12 @@ std::vector SampleTurboCxxModuleLegacyImpl::getMethods() { return getObject(xplat::jsArgAsObject(args, 0)); }, CxxModule::SyncTag), + CxxModule::Method( + "getRootTag", + [this](folly::dynamic args) { + return getNumber(xplat::jsArgAsDouble(args, 0)); + }, + CxxModule::SyncTag), CxxModule::Method( "getValue", [this](folly::dynamic args) { @@ -120,6 +126,10 @@ folly::dynamic SampleTurboCxxModuleLegacyImpl::getObject( return arg; } +double SampleTurboCxxModuleLegacyImpl::getRootTag(double arg) { + return arg; +} + folly::dynamic SampleTurboCxxModuleLegacyImpl::getValue( double x, const std::string &y, diff --git a/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.h b/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.h index 8248acad1cb354..72d0e3b4adbf49 100644 --- a/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.h +++ b/ReactCommon/turbomodule/samples/platform/ios/SampleTurboCxxModuleLegacyImpl.h @@ -31,6 +31,7 @@ class SampleTurboCxxModuleLegacyImpl std::string getString(const std::string &arg); folly::dynamic getArray(const folly::dynamic &arg); folly::dynamic getObject(const folly::dynamic &arg); + double getRootTag(double arg); folly::dynamic getValue(double x, const std::string &y, const folly::dynamic &z); void getValueWithCallback( From 6aab3f8946937c362c0820e2e7ff3b9de26fc550 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 21 Apr 2020 19:12:57 -0700 Subject: [PATCH 086/235] RN: Fix Codegen Schema Buck Dependency (#28719) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28719 The Buck dependencies for the schema rule is missing the source files for the new codegen (and specifically, the parser). Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21162993 fbshipit-source-id: 4addb6f257134e245a5d86dd427ee2536ed6d658 --- packages/react-native-codegen/BUCK | 1 + .../src/generators/components/CppHelpers.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native-codegen/BUCK b/packages/react-native-codegen/BUCK index eb1521347d7ddd..622981a8d9ec28 100644 --- a/packages/react-native-codegen/BUCK +++ b/packages/react-native-codegen/BUCK @@ -29,6 +29,7 @@ fb_native.sh_binary( resources = [ "src/cli/combine/combine-js-to-schema.js", "src/cli/combine/combine_js_to_schema.sh", + ":yarn-workspace", "//xplat/js:setup_env", ], visibility = ["PUBLIC"], diff --git a/packages/react-native-codegen/src/generators/components/CppHelpers.js b/packages/react-native-codegen/src/generators/components/CppHelpers.js index 80854623221241..0ea941489be250 100644 --- a/packages/react-native-codegen/src/generators/components/CppHelpers.js +++ b/packages/react-native-codegen/src/generators/components/CppHelpers.js @@ -163,7 +163,9 @@ function convertDefaultTypeToString( return ''; default: (typeAnnotation.name: empty); - throw new Error('Received unknown NativePrimitiveTypeAnnotation'); + throw new Error( + `Unsupported type annotation: ${typeAnnotation.name}`, + ); } case 'ArrayTypeAnnotation': { const elementType = typeAnnotation.elementType; @@ -198,7 +200,7 @@ function convertDefaultTypeToString( )}`; default: (typeAnnotation: empty); - throw new Error('Received invalid typeAnnotation'); + throw new Error(`Unsupported type annotation: ${typeAnnotation.type}`); } } From 57fee338988fc0dbb51eacc7b41ad47fb783e803 Mon Sep 17 00:00:00 2001 From: Panagiotis Vekris Date: Tue, 21 Apr 2020 22:40:47 -0700 Subject: [PATCH 087/235] Flow 0.123.0 in xplat/js Summary: Changelog: [Internal] ## Sync of generated files Ran ``` js1 upgrade www-shared -p core_windowless ``` but had to manually revert ``` RKJSModules/Libraries/www-shared/core_windowless/logging/FBLoggerType.flow.js RKJSModules/Libraries/www-shared/core_windowless/logging/FBLogger.js ``` because they introduced more errors ## Flow version bump ``` ~/fbsource/fbcode/flow/facebook/deploy_xplat.sh 0.123.0 ``` Reviewed By: gkz Differential Revision: D21159821 fbshipit-source-id: e106fcb43e4fc525b9185f8fc8a246e6c3a6b14f --- .flowconfig | 2 +- .flowconfig.android | 2 +- Libraries/ReactNative/PaperUIManager.js | 6 +++--- ReactCommon/hermes/inspector/tools/msggen/src/index.js | 1 - package.json | 2 +- template/_flowconfig | 2 +- yarn.lock | 8 ++++---- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.flowconfig b/.flowconfig index 1c776c8065b471..e991466446c86d 100644 --- a/.flowconfig +++ b/.flowconfig @@ -85,4 +85,4 @@ untyped-import untyped-type-import [version] -^0.122.0 +^0.123.0 diff --git a/.flowconfig.android b/.flowconfig.android index cb37da2887626a..fb3eff119655a2 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -85,4 +85,4 @@ untyped-import untyped-type-import [version] -^0.122.0 +^0.123.0 diff --git a/Libraries/ReactNative/PaperUIManager.js b/Libraries/ReactNative/PaperUIManager.js index 146af3d2028cd8..776fa431e8298c 100644 --- a/Libraries/ReactNative/PaperUIManager.js +++ b/Libraries/ReactNative/PaperUIManager.js @@ -32,10 +32,10 @@ function getConstants(): Object { return NativeUIManagerConstants; } +/* $FlowFixMe(>=0.123.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.123.0 was deployed. To see the error, delete this comment + * and run Flow. */ const UIManagerJS = { - /* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses an - * error found when Flow v0.111 was deployed. To see the error, delete this - * comment and run Flow. */ ...NativeUIManager, getConstants(): Object { return getConstants(); diff --git a/ReactCommon/hermes/inspector/tools/msggen/src/index.js b/ReactCommon/hermes/inspector/tools/msggen/src/index.js index 973e5c894831da..adcbdea071eda9 100644 --- a/ReactCommon/hermes/inspector/tools/msggen/src/index.js +++ b/ReactCommon/hermes/inspector/tools/msggen/src/index.js @@ -26,7 +26,6 @@ import {ImplementationWriter} from './ImplementationWriter'; // $FlowFixMe: this isn't a module, just a JSON file. const standard = require('devtools-protocol/json/js_protocol.json'); -// $FlowFixMe: this isn't a module, also just a JSON file. const custom = require('../src/custom.json'); type Descriptor = {| diff --git a/package.json b/package.json index b1aa8943cec545..786395213ae8e6 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "eslint-plugin-react-hooks": "^3.0.0", "eslint-plugin-react-native": "3.8.1", "eslint-plugin-relay": "1.7.0", - "flow-bin": "^0.122.0", + "flow-bin": "^0.123.0", "flow-remove-types": "1.2.3", "jest": "^25.4.0", "jest-junit": "^10.0.0", diff --git a/template/_flowconfig b/template/_flowconfig index b274ad1d6762f4..68af1e70c5fb83 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -70,4 +70,4 @@ untyped-import untyped-type-import [version] -^0.122.0 +^0.123.0 diff --git a/yarn.lock b/yarn.lock index c68cb87554a484..f2efeddb18115f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3544,10 +3544,10 @@ flat-cache@^1.2.1: rimraf "~2.6.2" write "^0.2.1" -flow-bin@^0.122.0: - version "0.122.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.122.0.tgz#c723a2b33b1a70bd10204704ae1dc776d5d89d79" - integrity sha512-my8N5jgl/A+UVby9E7NDppHdhLgRbWgKbmFZSx2MSYMRh3d9YGnM2MM+wexpUpl0ftY1IM6ZcUwaAhrypLyvlA== +flow-bin@^0.123.0: + version "0.123.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.123.0.tgz#7ba61a0b8775928cf4943ccf78eed2b1b05f7b3a" + integrity sha512-Ylcf8YDIM/KrqtxkPuq+f8O+6sdYA2Nuz5f+sWHlp539DatZz3YMcsO1EiXaf1C11HJgpT/3YGYe7xZ9/UZmvQ== flow-parser@0.*: version "0.89.0" From 2ad827be38f3ed4858d81a0c5daa49e1e4adf5a9 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Wed, 22 Apr 2020 04:03:14 -0700 Subject: [PATCH 088/235] Remove outdated metro type definitions Summary: RN itself does not depend on Metro any longer, which is abstracted away into the CLI. I don't think we need those type definitions any longer as we have proper Metro definitions internally. I'm removing them because they keep showing up in biggrep when I look for things. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D21089924 fbshipit-source-id: 2845277af12dae0f0baefaf85adefffb6ef9f2a5 --- flow-typed/npm/metro_vx.x.x.js | 1063 -------------------------------- 1 file changed, 1063 deletions(-) delete mode 100644 flow-typed/npm/metro_vx.x.x.js diff --git a/flow-typed/npm/metro_vx.x.x.js b/flow-typed/npm/metro_vx.x.x.js deleted file mode 100644 index ae90fe1e0a3c72..00000000000000 --- a/flow-typed/npm/metro_vx.x.x.js +++ /dev/null @@ -1,1063 +0,0 @@ -/** - * 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. - * - * @flow strict-local - * @format - */ - -// flow-typed signature: d001c1f5a12f9970243121d73d04bb1e -// flow-typed version: <>/metro_v0.47.0/flow_v0.82.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'metro' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'metro' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'metro/src/Assets' { - declare module.exports: any; -} - -declare module 'metro/src/assetTransformer' { - declare module.exports: any; -} - -declare module 'metro/src/Bundler' { - declare module.exports: any; -} - -declare module 'metro/src/Bundler/util' { - declare module.exports: any; -} - -declare module 'metro/src/cli-utils' { - declare module.exports: any; -} - -declare module 'metro/src/cli' { - declare module.exports: any; -} - -declare module 'metro/src/commands/build' { - declare module.exports: any; -} - -declare module 'metro/src/commands/serve' { - declare module.exports: any; -} - -declare module 'metro/src/defaultTransformer' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/DeltaCalculator' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/ResourceNotFoundError' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/deltaJSBundle' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/getAllFiles' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/getAssets' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/getRamBundleInfo' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/helpers/js' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/hmrJSBundle' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/plainJSBundle' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/sourceMapObject' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Serializers/sourceMapString' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Transformer' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Transformer/getTransformCacheKey' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/traverseDependencies' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/types.flow' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/Worker' { - declare module.exports: any; -} - -declare module 'metro/src/DeltaBundler/WorkerFarm' { - declare module.exports: any; -} - -declare module 'metro/src/HmrServer' { - declare module.exports: any; -} - -declare module 'metro/src/index' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/AssetRegistry' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/Bar' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/ErrorBundle' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/Foo' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-1' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-2' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-3' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-4' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-null' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-primitive-default' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/import-export/index' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/polyfill' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/TestBundle' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/basic_bundle/TestPolyfill' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/execBundle' { - declare module.exports: any; -} - -declare module 'metro/src/integration_tests/metro.config' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/constant-folding-plugin' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/import-export-plugin' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/inline-platform' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/inline-plugin' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/normalizePseudoglobals' { - declare module.exports: any; -} - -declare module 'metro/src/JSTransformer/worker/test-helpers' { - declare module.exports: any; -} - -declare module 'metro/src/legacy' { - declare module.exports: any; -} - -declare module 'metro/src/lib/addParamsToDefineCall' { - declare module.exports: any; -} - -declare module 'metro/src/lib/attachWebsocketServer' { - declare module.exports: any; -} - -declare module 'metro/src/lib/BatchProcessor' { - declare module.exports: any; -} - -declare module 'metro/src/lib/bundle-modules/asyncRequire' { - declare module.exports: any; -} - -declare module 'metro/src/lib/bundle-modules/HMRClient' { - declare module.exports: any; -} - -declare module 'metro/src/lib/bundle-modules/MetroClient' { - declare module.exports: any; -} - -declare module 'metro/src/lib/createModuleIdFactory' { - declare module.exports: any; -} - -declare module 'metro/src/lib/formatBundlingError' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getAbsolutePath' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getAppendScripts' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getEntryAbsolutePath' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getKeyFromFiles' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getMaxWorkers' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getMinifier' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getPreludeCode' { - declare module.exports: any; -} - -declare module 'metro/src/lib/getPrependedScripts' { - declare module.exports: any; -} - -declare module 'metro/src/lib/JsonReporter' { - declare module.exports: any; -} - -declare module 'metro/src/lib/parseCustomTransformOptions' { - declare module.exports: any; -} - -declare module 'metro/src/lib/polyfills/require' { - declare module.exports: any; -} - -declare module 'metro/src/lib/RamBundleParser' { - declare module.exports: any; -} - -declare module 'metro/src/lib/relativizeSourceMap' { - declare module.exports: any; -} - -declare module 'metro/src/lib/reporting' { - declare module.exports: any; -} - -declare module 'metro/src/lib/TerminalReporter' { - declare module.exports: any; -} - -declare module 'metro/src/lib/transformHelpers' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/build' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/module' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/HasteFS' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/Module' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/ModuleCache' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/node-haste.flow' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/node-haste' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/node-haste/Package' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/output/indexed-ram-bundle' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/output/multiple-files-ram-bundle' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/output/plain-bundle' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/output/util' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/silent-console' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/test-helpers' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/types.flow' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/collectDependencies' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/generate' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/generateImportNames' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/JsFileWrapping' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/optimizeDependencies' { - declare module.exports: any; -} - -declare module 'metro/src/ModuleGraph/worker/Platforms' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/AssetResolutionCache' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/DependencyGraph' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/DependencyGraph/assets/empty-module' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/DependencyGraph/DependencyGraphHelpers' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/DependencyGraph/ModuleResolution' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/DependencyGraph/ResolutionRequest' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/FilesByDirNameIndex' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/lib/AssetPaths' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/lib/MapWithDefaults' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/lib/parsePlatformFilePath' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/Module' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/ModuleCache' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/Package' { - declare module.exports: any; -} - -declare module 'metro/src/node-haste/types' { - declare module.exports: any; -} - -declare module 'metro/src/reactNativeTransformer' { - declare module.exports: any; -} - -declare module 'metro/src/rn-cli.config' { - declare module.exports: any; -} - -declare module 'metro/src/Server' { - declare module.exports: any; -} - -declare module 'metro/src/Server/MultipartResponse' { - declare module.exports: any; -} - -declare module 'metro/src/Server/symbolicate/symbolicate' { - declare module.exports: any; -} - -declare module 'metro/src/Server/symbolicate/util' { - declare module.exports: any; -} - -declare module 'metro/src/Server/symbolicate/worker' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/bundle' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/meta' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/as-assets' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/as-indexed-file' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/buildSourcemapWithMetadata' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/magic-number' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/util' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/RamBundle/write-sourcemap' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/unbundle' { - declare module.exports: any; -} - -declare module 'metro/src/shared/output/writeFile' { - declare module.exports: any; -} - -declare module 'metro/src/shared/types.flow' { - declare module.exports: any; -} - -// Filename aliases -declare module 'metro/src/Assets.js' { - declare module.exports: $Exports<'metro/src/Assets'>; -} -declare module 'metro/src/assetTransformer.js' { - declare module.exports: $Exports<'metro/src/assetTransformer'>; -} -declare module 'metro/src/Bundler.js' { - declare module.exports: $Exports<'metro/src/Bundler'>; -} -declare module 'metro/src/Bundler/util.js' { - declare module.exports: $Exports<'metro/src/Bundler/util'>; -} -declare module 'metro/src/cli-utils.js' { - declare module.exports: $Exports<'metro/src/cli-utils'>; -} -declare module 'metro/src/cli.js' { - declare module.exports: $Exports<'metro/src/cli'>; -} -declare module 'metro/src/commands/build.js' { - declare module.exports: $Exports<'metro/src/commands/build'>; -} -declare module 'metro/src/commands/serve.js' { - declare module.exports: $Exports<'metro/src/commands/serve'>; -} -declare module 'metro/src/defaultTransformer.js' { - declare module.exports: $Exports<'metro/src/defaultTransformer'>; -} -declare module 'metro/src/DeltaBundler.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler'>; -} -declare module 'metro/src/DeltaBundler/DeltaCalculator.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler/DeltaCalculator'>; -} -declare module 'metro/src/DeltaBundler/ResourceNotFoundError.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/ResourceNotFoundError', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/deltaJSBundle.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/deltaJSBundle', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/getAllFiles.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/getAllFiles', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/getAssets.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/getAssets', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/getRamBundleInfo.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/getRamBundleInfo', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/helpers/js.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/helpers/js', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/hmrJSBundle.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/hmrJSBundle', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/plainJSBundle.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/plainJSBundle', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/sourceMapObject.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/sourceMapObject', - >; -} -declare module 'metro/src/DeltaBundler/Serializers/sourceMapString.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Serializers/sourceMapString', - >; -} -declare module 'metro/src/DeltaBundler/Transformer.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler/Transformer'>; -} -declare module 'metro/src/DeltaBundler/Transformer/getTransformCacheKey.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/Transformer/getTransformCacheKey', - >; -} -declare module 'metro/src/DeltaBundler/traverseDependencies.js' { - declare module.exports: $Exports< - 'metro/src/DeltaBundler/traverseDependencies', - >; -} -declare module 'metro/src/DeltaBundler/types.flow.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler/types.flow'>; -} -declare module 'metro/src/DeltaBundler/Worker.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler/Worker'>; -} -declare module 'metro/src/DeltaBundler/WorkerFarm.js' { - declare module.exports: $Exports<'metro/src/DeltaBundler/WorkerFarm'>; -} -declare module 'metro/src/HmrServer.js' { - declare module.exports: $Exports<'metro/src/HmrServer'>; -} -declare module 'metro/src/index.js' { - declare module.exports: $Exports<'metro/src/index'>; -} -declare module 'metro/src/integration_tests/basic_bundle/AssetRegistry.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/AssetRegistry', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/Bar.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/Bar', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/ErrorBundle.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/ErrorBundle', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/Foo.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/Foo', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-1.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-1', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-2.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-2', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-3.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-3', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-4.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-4', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-null.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-null', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/export-primitive-default.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/export-primitive-default', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/import-export/index.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/import-export/index', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/polyfill.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/polyfill', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/TestBundle.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/TestBundle', - >; -} -declare module 'metro/src/integration_tests/basic_bundle/TestPolyfill.js' { - declare module.exports: $Exports< - 'metro/src/integration_tests/basic_bundle/TestPolyfill', - >; -} -declare module 'metro/src/integration_tests/execBundle.js' { - declare module.exports: $Exports<'metro/src/integration_tests/execBundle'>; -} -declare module 'metro/src/integration_tests/metro.config.js' { - declare module.exports: $Exports<'metro/src/integration_tests/metro.config'>; -} -declare module 'metro/src/JSTransformer/worker.js' { - declare module.exports: $Exports<'metro/src/JSTransformer/worker'>; -} -declare module 'metro/src/JSTransformer/worker/constant-folding-plugin.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/constant-folding-plugin', - >; -} -declare module 'metro/src/JSTransformer/worker/import-export-plugin.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/import-export-plugin', - >; -} -declare module 'metro/src/JSTransformer/worker/inline-platform.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/inline-platform', - >; -} -declare module 'metro/src/JSTransformer/worker/inline-plugin.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/inline-plugin', - >; -} -declare module 'metro/src/JSTransformer/worker/normalizePseudoglobals.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/normalizePseudoglobals', - >; -} -declare module 'metro/src/JSTransformer/worker/test-helpers.js' { - declare module.exports: $Exports< - 'metro/src/JSTransformer/worker/test-helpers', - >; -} -declare module 'metro/src/legacy.js' { - declare module.exports: $Exports<'metro/src/legacy'>; -} -declare module 'metro/src/lib/addParamsToDefineCall.js' { - declare module.exports: $Exports<'metro/src/lib/addParamsToDefineCall'>; -} -declare module 'metro/src/lib/attachWebsocketServer.js' { - declare module.exports: $Exports<'metro/src/lib/attachWebsocketServer'>; -} -declare module 'metro/src/lib/BatchProcessor.js' { - declare module.exports: $Exports<'metro/src/lib/BatchProcessor'>; -} -declare module 'metro/src/lib/bundle-modules/asyncRequire.js' { - declare module.exports: $Exports<'metro/src/lib/bundle-modules/asyncRequire'>; -} -declare module 'metro/src/lib/bundle-modules/HMRClient.js' { - declare module.exports: $Exports<'metro/src/lib/bundle-modules/HMRClient'>; -} -declare module 'metro/src/lib/bundle-modules/MetroClient.js' { - declare module.exports: $Exports<'metro/src/lib/bundle-modules/MetroClient'>; -} -declare module 'metro/src/lib/createModuleIdFactory.js' { - declare module.exports: $Exports<'metro/src/lib/createModuleIdFactory'>; -} -declare module 'metro/src/lib/formatBundlingError.js' { - declare module.exports: $Exports<'metro/src/lib/formatBundlingError'>; -} -declare module 'metro/src/lib/getAbsolutePath.js' { - declare module.exports: $Exports<'metro/src/lib/getAbsolutePath'>; -} -declare module 'metro/src/lib/getAppendScripts.js' { - declare module.exports: $Exports<'metro/src/lib/getAppendScripts'>; -} -declare module 'metro/src/lib/getEntryAbsolutePath.js' { - declare module.exports: $Exports<'metro/src/lib/getEntryAbsolutePath'>; -} -declare module 'metro/src/lib/getKeyFromFiles.js' { - declare module.exports: $Exports<'metro/src/lib/getKeyFromFiles'>; -} -declare module 'metro/src/lib/getMaxWorkers.js' { - declare module.exports: $Exports<'metro/src/lib/getMaxWorkers'>; -} -declare module 'metro/src/lib/getMinifier.js' { - declare module.exports: $Exports<'metro/src/lib/getMinifier'>; -} -declare module 'metro/src/lib/getPreludeCode.js' { - declare module.exports: $Exports<'metro/src/lib/getPreludeCode'>; -} -declare module 'metro/src/lib/getPrependedScripts.js' { - declare module.exports: $Exports<'metro/src/lib/getPrependedScripts'>; -} -declare module 'metro/src/lib/JsonReporter.js' { - declare module.exports: $Exports<'metro/src/lib/JsonReporter'>; -} -declare module 'metro/src/lib/parseCustomTransformOptions.js' { - declare module.exports: $Exports<'metro/src/lib/parseCustomTransformOptions'>; -} -declare module 'metro/src/lib/polyfills/require.js' { - declare module.exports: $Exports<'metro/src/lib/polyfills/require'>; -} -declare module 'metro/src/lib/RamBundleParser.js' { - declare module.exports: $Exports<'metro/src/lib/RamBundleParser'>; -} -declare module 'metro/src/lib/relativizeSourceMap.js' { - declare module.exports: $Exports<'metro/src/lib/relativizeSourceMap'>; -} -declare module 'metro/src/lib/reporting.js' { - declare module.exports: $Exports<'metro/src/lib/reporting'>; -} -declare module 'metro/src/lib/TerminalReporter.js' { - declare module.exports: $Exports<'metro/src/lib/TerminalReporter'>; -} -declare module 'metro/src/lib/transformHelpers.js' { - declare module.exports: $Exports<'metro/src/lib/transformHelpers'>; -} -declare module 'metro/src/ModuleGraph/build.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/build'>; -} -declare module 'metro/src/ModuleGraph/module.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/module'>; -} -declare module 'metro/src/ModuleGraph/node-haste/HasteFS.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/node-haste/HasteFS'>; -} -declare module 'metro/src/ModuleGraph/node-haste/Module.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/node-haste/Module'>; -} -declare module 'metro/src/ModuleGraph/node-haste/ModuleCache.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/node-haste/ModuleCache', - >; -} -declare module 'metro/src/ModuleGraph/node-haste/node-haste.flow.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/node-haste/node-haste.flow', - >; -} -declare module 'metro/src/ModuleGraph/node-haste/node-haste.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/node-haste/node-haste', - >; -} -declare module 'metro/src/ModuleGraph/node-haste/Package.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/node-haste/Package'>; -} -declare module 'metro/src/ModuleGraph/output/indexed-ram-bundle.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/output/indexed-ram-bundle', - >; -} -declare module 'metro/src/ModuleGraph/output/multiple-files-ram-bundle.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/output/multiple-files-ram-bundle', - >; -} -declare module 'metro/src/ModuleGraph/output/plain-bundle.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/output/plain-bundle'>; -} -declare module 'metro/src/ModuleGraph/output/util.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/output/util'>; -} -declare module 'metro/src/ModuleGraph/silent-console.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/silent-console'>; -} -declare module 'metro/src/ModuleGraph/test-helpers.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/test-helpers'>; -} -declare module 'metro/src/ModuleGraph/types.flow.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/types.flow'>; -} -declare module 'metro/src/ModuleGraph/worker/collectDependencies.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/worker/collectDependencies', - >; -} -declare module 'metro/src/ModuleGraph/worker/generate.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/worker/generate'>; -} -declare module 'metro/src/ModuleGraph/worker/generateImportNames.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/worker/generateImportNames', - >; -} -declare module 'metro/src/ModuleGraph/worker/JsFileWrapping.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/worker/JsFileWrapping', - >; -} -declare module 'metro/src/ModuleGraph/worker/optimizeDependencies.js' { - declare module.exports: $Exports< - 'metro/src/ModuleGraph/worker/optimizeDependencies', - >; -} -declare module 'metro/src/ModuleGraph/worker/Platforms.js' { - declare module.exports: $Exports<'metro/src/ModuleGraph/worker/Platforms'>; -} -declare module 'metro/src/node-haste/AssetResolutionCache.js' { - declare module.exports: $Exports<'metro/src/node-haste/AssetResolutionCache'>; -} -declare module 'metro/src/node-haste/DependencyGraph.js' { - declare module.exports: $Exports<'metro/src/node-haste/DependencyGraph'>; -} -declare module 'metro/src/node-haste/DependencyGraph/assets/empty-module.js' { - declare module.exports: $Exports< - 'metro/src/node-haste/DependencyGraph/assets/empty-module', - >; -} -declare module 'metro/src/node-haste/DependencyGraph/DependencyGraphHelpers.js' { - declare module.exports: $Exports< - 'metro/src/node-haste/DependencyGraph/DependencyGraphHelpers', - >; -} -declare module 'metro/src/node-haste/DependencyGraph/ModuleResolution.js' { - declare module.exports: $Exports< - 'metro/src/node-haste/DependencyGraph/ModuleResolution', - >; -} -declare module 'metro/src/node-haste/DependencyGraph/ResolutionRequest.js' { - declare module.exports: $Exports< - 'metro/src/node-haste/DependencyGraph/ResolutionRequest', - >; -} -declare module 'metro/src/node-haste/FilesByDirNameIndex.js' { - declare module.exports: $Exports<'metro/src/node-haste/FilesByDirNameIndex'>; -} -declare module 'metro/src/node-haste/lib/AssetPaths.js' { - declare module.exports: $Exports<'metro/src/node-haste/lib/AssetPaths'>; -} -declare module 'metro/src/node-haste/lib/MapWithDefaults.js' { - declare module.exports: $Exports<'metro/src/node-haste/lib/MapWithDefaults'>; -} -declare module 'metro/src/node-haste/lib/parsePlatformFilePath.js' { - declare module.exports: $Exports< - 'metro/src/node-haste/lib/parsePlatformFilePath', - >; -} -declare module 'metro/src/node-haste/Module.js' { - declare module.exports: $Exports<'metro/src/node-haste/Module'>; -} -declare module 'metro/src/node-haste/ModuleCache.js' { - declare module.exports: $Exports<'metro/src/node-haste/ModuleCache'>; -} -declare module 'metro/src/node-haste/Package.js' { - declare module.exports: $Exports<'metro/src/node-haste/Package'>; -} -declare module 'metro/src/node-haste/types.js' { - declare module.exports: $Exports<'metro/src/node-haste/types'>; -} -declare module 'metro/src/reactNativeTransformer.js' { - declare module.exports: $Exports<'metro/src/reactNativeTransformer'>; -} -declare module 'metro/src/rn-cli.config.js' { - declare module.exports: $Exports<'metro/src/rn-cli.config'>; -} -declare module 'metro/src/Server.js' { - declare module.exports: $Exports<'metro/src/Server'>; -} -declare module 'metro/src/Server/MultipartResponse.js' { - declare module.exports: $Exports<'metro/src/Server/MultipartResponse'>; -} -declare module 'metro/src/Server/symbolicate/symbolicate.js' { - declare module.exports: $Exports<'metro/src/Server/symbolicate/symbolicate'>; -} -declare module 'metro/src/Server/symbolicate/util.js' { - declare module.exports: $Exports<'metro/src/Server/symbolicate/util'>; -} -declare module 'metro/src/Server/symbolicate/worker.js' { - declare module.exports: $Exports<'metro/src/Server/symbolicate/worker'>; -} -declare module 'metro/src/shared/output/bundle.js' { - declare module.exports: $Exports<'metro/src/shared/output/bundle'>; -} -declare module 'metro/src/shared/output/meta.js' { - declare module.exports: $Exports<'metro/src/shared/output/meta'>; -} -declare module 'metro/src/shared/output/RamBundle.js' { - declare module.exports: $Exports<'metro/src/shared/output/RamBundle'>; -} -declare module 'metro/src/shared/output/RamBundle/as-assets.js' { - declare module.exports: $Exports< - 'metro/src/shared/output/RamBundle/as-assets', - >; -} -declare module 'metro/src/shared/output/RamBundle/as-indexed-file.js' { - declare module.exports: $Exports< - 'metro/src/shared/output/RamBundle/as-indexed-file', - >; -} -declare module 'metro/src/shared/output/RamBundle/buildSourcemapWithMetadata.js' { - declare module.exports: $Exports< - 'metro/src/shared/output/RamBundle/buildSourcemapWithMetadata', - >; -} -declare module 'metro/src/shared/output/RamBundle/magic-number.js' { - declare module.exports: $Exports< - 'metro/src/shared/output/RamBundle/magic-number', - >; -} -declare module 'metro/src/shared/output/RamBundle/util.js' { - declare module.exports: $Exports<'metro/src/shared/output/RamBundle/util'>; -} -declare module 'metro/src/shared/output/RamBundle/write-sourcemap.js' { - declare module.exports: $Exports< - 'metro/src/shared/output/RamBundle/write-sourcemap', - >; -} -declare module 'metro/src/shared/output/unbundle.js' { - declare module.exports: $Exports<'metro/src/shared/output/unbundle'>; -} -declare module 'metro/src/shared/output/writeFile.js' { - declare module.exports: $Exports<'metro/src/shared/output/writeFile'>; -} -declare module 'metro/src/shared/types.flow.js' { - declare module.exports: $Exports<'metro/src/shared/types.flow'>; -} From bf5f3c6a79fba839225576da889d3b7f835a19f6 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Wed, 22 Apr 2020 04:43:12 -0700 Subject: [PATCH 089/235] Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21175893 fbshipit-source-id: 101734c1b968ce241a15648efdcaeabbd789952d --- React/Base/RCTConvert.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 6de135bd1e5cb5..3bc072efc79eed 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -735,7 +735,8 @@ +(type)type : (id)json \ static NSString *const RCTColorSuffix = @"Color"; NSMutableDictionary *aliases = [NSMutableDictionary new]; for (NSString *objcSelector in map) { - RCTAssert([objcSelector hasSuffix:RCTColorSuffix], @"A selector in the color map did not end with the suffix Color."); + RCTAssert( + [objcSelector hasSuffix:RCTColorSuffix], @"A selector in the color map did not end with the suffix Color."); NSMutableDictionary *entry = [map[objcSelector] mutableCopy]; RCTAssert([entry objectForKey:RCTSelector] == nil, @"Entry should not already have an RCTSelector"); NSString *swiftSelector = [objcSelector substringToIndex:[objcSelector length] - [RCTColorSuffix length]]; From df03228a61881cdfa520fa6d8a9d9cfb6e77fdde Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Wed, 22 Apr 2020 12:23:09 -0700 Subject: [PATCH 090/235] remove tvOS from template (#28706) Summary: According to the [0.62 blog post](https://reactnative.dev/blog/2020/03/26/version-0.62), Apple TV support has moved to react-native-tvos. The template still contains info.plist for tvOS, so I've removed them for future releases. ## Changelog [General] [Removed] - Removed tvOS related files from the template Pull Request resolved: https://github.com/facebook/react-native/pull/28706 Test Plan: run `react-native init TestTemplate` and remove tvOS related files and verified that iOS and Android runs on emulator. Differential Revision: D21182211 Pulled By: hramos fbshipit-source-id: 41d2e19e5158d7ec103a37c01a93cf511fc1e4c9 --- template/ios/HelloWorld-tvOS/Info.plist | 53 ---- template/ios/HelloWorld-tvOSTests/Info.plist | 24 -- .../ios/HelloWorld.xcodeproj/project.pbxproj | 271 ------------------ .../xcschemes/HelloWorld-tvOS.xcscheme | 88 ------ template/ios/Podfile | 9 - 5 files changed, 445 deletions(-) delete mode 100644 template/ios/HelloWorld-tvOS/Info.plist delete mode 100644 template/ios/HelloWorld-tvOSTests/Info.plist delete mode 100644 template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme diff --git a/template/ios/HelloWorld-tvOS/Info.plist b/template/ios/HelloWorld-tvOS/Info.plist deleted file mode 100644 index ecbd496be7dfa3..00000000000000 --- a/template/ios/HelloWorld-tvOS/Info.plist +++ /dev/null @@ -1,53 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - - NSLocationWhenInUseUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/template/ios/HelloWorld-tvOSTests/Info.plist b/template/ios/HelloWorld-tvOSTests/Info.plist deleted file mode 100644 index ba72822e8728ef..00000000000000 --- a/template/ios/HelloWorld-tvOSTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/ios/HelloWorld.xcodeproj/project.pbxproj index fe51ccff2c9f52..20ac3c62655dc7 100644 --- a/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -11,10 +11,6 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ @@ -26,13 +22,6 @@ remoteGlobalIDString = 13B07F861A680F5B00A75B9A; remoteInfo = HelloWorld; }; - 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; - remoteInfo = "HelloWorld-tvOS"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -46,8 +35,6 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; }; - 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloWorld-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HelloWorld-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; @@ -68,20 +55,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -151,8 +124,6 @@ children = ( 13B07F961A680F5B00A75B9A /* HelloWorld.app */, 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */, - 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */, - 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */, ); name = Products; sourceTree = ""; @@ -197,43 +168,6 @@ productReference = 13B07F961A680F5B00A75B9A /* HelloWorld.app */; productType = "com.apple.product-type.application"; }; - 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOS" */; - buildPhases = ( - FD10A7F122414F3F0027D42C /* Start Packager */, - 2D02E4771E0B4A5D006451C7 /* Sources */, - 2D02E4781E0B4A5D006451C7 /* Frameworks */, - 2D02E4791E0B4A5D006451C7 /* Resources */, - 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "HelloWorld-tvOS"; - productName = "HelloWorld-tvOS"; - productReference = 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */; - productType = "com.apple.product-type.application"; - }; - 2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOSTests" */; - buildPhases = ( - 2D02E48C1E0B4A5D006451C7 /* Sources */, - 2D02E48D1E0B4A5D006451C7 /* Frameworks */, - 2D02E48E1E0B4A5D006451C7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, - ); - name = "HelloWorld-tvOSTests"; - productName = "HelloWorld-tvOSTests"; - productReference = 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -249,15 +183,6 @@ 13B07F861A680F5B00A75B9A = { LastSwiftMigration = 1120; }; - 2D02E47A1E0B4A5D006451C7 = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - }; - 2D02E48F1E0B4A5D006451C7 = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - TestTargetID = 2D02E47A1E0B4A5D006451C7; - }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */; @@ -275,8 +200,6 @@ targets = ( 13B07F861A680F5B00A75B9A /* HelloWorld */, 00E356ED1AD99517003FC87E /* HelloWorldTests */, - 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */, - 2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */, ); }; /* End PBXProject section */ @@ -298,21 +221,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 2D02E4791E0B4A5D006451C7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48E1E0B4A5D006451C7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -330,20 +238,6 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; - 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Bundle React Native Code And Images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; - }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -363,25 +257,6 @@ shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; showEnvVarsInLog = 0; }; - FD10A7F122414F3F0027D42C /* Start Packager */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Start Packager"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -402,23 +277,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 2D02E4771E0B4A5D006451C7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, - 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2D02E48C1E0B4A5D006451C7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -427,11 +285,6 @@ target = 13B07F861A680F5B00A75B9A /* HelloWorld */; targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; }; - 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */; - targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -522,112 +375,6 @@ }; name = Release; }; - 2D02E4971E0B4A5E006451C7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 10.0; - }; - name = Debug; - }; - 2D02E4981E0B4A5E006451C7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 10.0; - }; - name = Release; - }; - 2D02E4991E0B4A5E006451C7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS"; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Debug; - }; - 2D02E49A1E0B4A5E006451C7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - OTHER_LDFLAGS = ( - "$(inherited)", - "-ObjC", - "-lc++", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.HelloWorld-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS"; - TVOS_DEPLOYMENT_TARGET = 10.1; - }; - name = Release; - }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -762,24 +509,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2D02E4971E0B4A5E006451C7 /* Debug */, - 2D02E4981E0B4A5E006451C7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOSTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2D02E4991E0B4A5E006451C7 /* Debug */, - 2D02E49A1E0B4A5E006451C7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme b/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme deleted file mode 100644 index d4e27b270d01a1..00000000000000 --- a/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/ios/Podfile b/template/ios/Podfile index 6e1ebd6181167f..73726efe1d9d8f 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -22,12 +22,3 @@ target 'HelloWorld' do flipper_post_install(installer) end end - -target 'HelloWorld-tvOS' do - # Pods for HelloWorld-tvOS - - target 'HelloWorld-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end From 3246eaec44b64e246cd759f20291600953d9dd62 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 22 Apr 2020 15:37:49 -0700 Subject: [PATCH 091/235] Fabric: `ConcreteShadowNode::initialStateData()` now accepts a `ShadowNodeFamilyFragment` instead of just a `SurfaceId` Summary: We need it to be able pass an `EventEmitter` object to constructed concrete State objects. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21169581 fbshipit-source-id: 3eef0310de7e2f061108aa85c1a39678a43fe85e --- .../fabric/components/image/ImageShadowNode.h | 2 +- .../components/slider/SliderShadowNode.h | 2 +- .../ConcreteComponentDescriptor.h | 2 +- .../core/shadownode/ConcreteShadowNode.h | 2 +- .../fabric/core/shadownode/ShadowNodeFamily.h | 1 + .../shadownode/ShadowNodeFamilyFragment.cpp | 25 +++++++++++++++++++ .../shadownode/ShadowNodeFamilyFragment.h | 4 +++ 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.h b/ReactCommon/fabric/components/image/ImageShadowNode.h index d4cf8d5cb5a1c3..a723a000b195dc 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.h +++ b/ReactCommon/fabric/components/image/ImageShadowNode.h @@ -43,7 +43,7 @@ class ImageShadowNode final : public ConcreteViewShadowNode< static ImageState initialStateData( ShadowNodeFragment const &fragment, - SurfaceId const surfaceId, + ShadowNodeFamilyFragment const &familyFragment, ComponentDescriptor const &componentDescriptor) { auto imageSource = ImageSource{ImageSource::Type::Invalid}; return {imageSource, {imageSource, nullptr}}; diff --git a/ReactCommon/fabric/components/slider/SliderShadowNode.h b/ReactCommon/fabric/components/slider/SliderShadowNode.h index f4b9c334fad1e3..958f3b2aafb7b0 100644 --- a/ReactCommon/fabric/components/slider/SliderShadowNode.h +++ b/ReactCommon/fabric/components/slider/SliderShadowNode.h @@ -40,7 +40,7 @@ class SliderShadowNode final : public ConcreteViewShadowNode< static SliderState initialStateData( ShadowNodeFragment const &fragment, - SurfaceId const surfaceId, + ShadowNodeFamilyFragment const &familyFragment, ComponentDescriptor const &componentDescriptor) { auto imageSource = ImageSource{ImageSource::Type::Invalid}; return {imageSource, diff --git a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h index 7b7550447e637f..43fbeaf40cf3ae 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h @@ -133,7 +133,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { return std::make_shared( std::make_shared( ConcreteShadowNode::initialStateData( - fragment, family->getSurfaceId(), *this)), + fragment, ShadowNodeFamilyFragment::build(*family), *this)), family); } diff --git a/ReactCommon/fabric/core/shadownode/ConcreteShadowNode.h b/ReactCommon/fabric/core/shadownode/ConcreteShadowNode.h index fded3fe4bd1790..7edb2e567830a3 100644 --- a/ReactCommon/fabric/core/shadownode/ConcreteShadowNode.h +++ b/ReactCommon/fabric/core/shadownode/ConcreteShadowNode.h @@ -82,7 +82,7 @@ class ConcreteShadowNode : public BaseShadowNodeT { static ConcreteStateData initialStateData( ShadowNodeFragment const &fragment, - SurfaceId const surfaceId, + ShadowNodeFamilyFragment const &familyFragment, ComponentDescriptor const &componentDescriptor) { return {}; } diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h index ea9699ce35d7fe..15998067f44222 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h @@ -87,6 +87,7 @@ class ShadowNodeFamily { private: friend ShadowNode; + friend ShadowNodeFamilyFragment; EventDispatcher::Weak eventDispatcher_; mutable std::shared_ptr mostRecentState_; diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp new file mode 100644 index 00000000000000..150ef2760d3dd3 --- /dev/null +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp @@ -0,0 +1,25 @@ +/* + * 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. + */ + +#include "ShadowNodeFamilyFragment.h" + +#include + +namespace facebook { +namespace react { + +ShadowNodeFamilyFragment ShadowNodeFamilyFragment::build( + ShadowNodeFamily const &family) { + return { + family.tag_, + family.surfaceId_, + family.eventEmitter_, + }; +} + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h index 88de3a07d2bcd6..11359418c72cc9 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h @@ -13,6 +13,8 @@ namespace facebook { namespace react { +class ShadowNodeFamily; + /* * Note: All of the fields are `const &` references (essentially just raw * pointers) which means that the Fragment does not copy/store them nor @@ -20,6 +22,8 @@ namespace react { */ class ShadowNodeFamilyFragment final { public: + static ShadowNodeFamilyFragment build(ShadowNodeFamily const &family); + Tag const tag; SurfaceId const surfaceId; EventEmitter::Shared const &eventEmitter; From f64b39ea6c75c27ec61cfe224551f2c1b8c5d794 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 22 Apr 2020 15:37:49 -0700 Subject: [PATCH 092/235] Fabric: Introducting `ShadowNodeFamilyFragment::Value` Summary: `ShadowNodeFamilyFragment::Value` is a value couter-part type for `ShadowNodeFamilyFragment`. We need that to be able safely copy data stored inside a `ShadowNodeFamilyFragment` object. Changelog: [Internal] Fabric-specific internal change. Reviewed By: kacieb Differential Revision: D21169580 fbshipit-source-id: 1a485e1b2ae47bc7da9476a60466934ac9d61366 --- .../shadownode/ShadowNodeFamilyFragment.cpp | 11 +++++++++ .../shadownode/ShadowNodeFamilyFragment.h | 23 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp index 150ef2760d3dd3..47cee004354ec6 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.cpp @@ -21,5 +21,16 @@ ShadowNodeFamilyFragment ShadowNodeFamilyFragment::build( }; } +using Value = ShadowNodeFamilyFragment::Value; + +Value::Value(ShadowNodeFamilyFragment const &fragment) + : tag_(fragment.tag), + surfaceId_(fragment.surfaceId), + eventEmitter_(fragment.eventEmitter) {} + +Value::operator ShadowNodeFamilyFragment() const { + return ShadowNodeFamilyFragment{tag_, surfaceId_, eventEmitter_}; +} + } // namespace react } // namespace facebook diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h index 11359418c72cc9..9b97a6d340748d 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamilyFragment.h @@ -27,6 +27,29 @@ class ShadowNodeFamilyFragment final { Tag const tag; SurfaceId const surfaceId; EventEmitter::Shared const &eventEmitter; + + /* + * `ShadowNodeFamilyFragment` is not owning data-structure, it only stores raw + * pointers to the data. `ShadowNodeFamilyFragment::Value` is a convenient + * owning counterpart of that. + */ + class Value final { + public: + /* + * Creates an object with given `ShadowNodeFragment`. + */ + Value(ShadowNodeFamilyFragment const &fragment); + + /* + * Creates a `ShadowNodeFragment` from the object. + */ + explicit operator ShadowNodeFamilyFragment() const; + + private: + Tag const tag_; + SurfaceId const surfaceId_; + EventEmitter::Shared const eventEmitter_; + }; }; } // namespace react From 2c473e1a38c35957fe80b6c334a1983c034c2bbc Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 22 Apr 2020 16:10:14 -0700 Subject: [PATCH 093/235] Overhaul RCTTurboModule creation and initialization Summary: ## Problems: In my investigation of T65656635, I realized that the TurboModule system has a number of problems: - In TurboModules, we use 1 lock to create n TurboModules. We should change this setup to n locks for n TurboModules. This way, two threads creating two different NativeModules don't compete for the same lock. Also, this is how it's done in Android (TurboModules & NativeModules), and iOS (NativeModules). - In TurboModules, we don't calculate "requires main queue setup" faithfully. In the legacy system, if a NativeModule has a custom `init` method or a custom `constantsToExport` method, it "requires main queue setup" with a warning. - In TurboModules, we don't create the NativeModule on the main queue, if "requires main queue setup" is true. Instead, the NativeModule is always created on the thread that requires it. - In TurboModules, we don't perform any concurrency control around `id` setup. We should. ## What this diff does In this diff, I fixed all the aforementioned issues by re-implementing `provideRCTTurboModule:`. **Algorithm Notes:** - **Gist:** When `n` threads race to create NativeModule `x`, only the first thread creates and sets up `x`. All others are told to wait. Once the creator thread finishes its job, it notifies all other waiting threads, which then wake up and return the newly created NativeModule. This algorithm was initially implemented in NativeModules for Android inside (ModuleHolder.java). I modified and implemented it for TurboModules for Android, and now this diff implements it for TurboModules for iOS. - The TurboModule cache is replace with a TurboModuleHolder map. A TurboModuleHolder manages the creation lifecycle of a TurboModule, and holds a condition variable and mutex for doing concurrency control around it. When the bridge invalidates, in TurboModuleManager, we set the `invalidating` flag to true, which prevents the insertion of new entries into the TurboModuleHolder map. - I added a `std::mutex` to serialize calls into the TurboModuleManagerDelegate, so we don't get races if the delegate isn't thread-safe. Changelog: [iOS][Fixed] - Re-implement RCTTurboModuleManager provideRCTTurboModule: Reviewed By: shergin Differential Revision: D21170099 fbshipit-source-id: 8792812c2237d3bfc80c9834c818e011de85b0ea --- .../platform/ios/RCTTurboModuleManager.mm | 525 +++++++++++------- 1 file changed, 332 insertions(+), 193 deletions(-) diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index d82ef6a5bb25e7..e7ccf625bbed9b 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -9,6 +9,7 @@ #import #import +#import #import #import @@ -31,6 +32,57 @@ static char kAssociatedMethodQueueKey; namespace { +class TurboModuleHolder { + private: + id module_; + bool isTryingToCreateModule_; + bool isDoneCreatingModule_; + std::mutex mutex_; + std::condition_variable cv_; + + public: + void setModule(id module) + { + module_ = module; + } + + id getModule() const + { + return module_; + } + + void startCreatingModule() + { + isTryingToCreateModule_ = true; + } + + void endCreatingModule() + { + isTryingToCreateModule_ = false; + isDoneCreatingModule_ = true; + } + + bool isDoneCreatingModule() const + { + return isDoneCreatingModule_; + } + + bool isCreatingModule() const + { + return isTryingToCreateModule_; + } + + std::mutex &mutex() + { + return mutex_; + } + + std::condition_variable &cv() + { + return cv_; + } +}; + class MethodQueueNativeCallInvoker : public facebook::react::CallInvoker { private: dispatch_queue_t methodQueue_; @@ -82,26 +134,25 @@ @implementation RCTTurboModuleManager { id _performanceLogger; __weak id _delegate; __weak RCTBridge *_bridge; + /** * TODO(T48018690): * All modules are currently long-lived. * We need to come up with a mechanism to allow modules to specify whether * they want to be long-lived or short-lived. + * + * All instances of TurboModuleHolder are owned by the _turboModuleHolders map. + * We create TurboModuleHolder via operator[] inside getOrCreateTurboModuleHolder(). + * Henceforth, we only refer to TurboModuleHolders via pointers to entries in the _turboModuleHolders map. */ - std::unordered_map> _rctTurboModuleCache; + std::unordered_map _turboModuleHolders; std::unordered_map> _turboModuleCache; - /** - * _rctTurboModuleCache can be accessed by multiple threads at once via - * the provideRCTTurboModule method. This can lead to races. Therefore, we - * need to protect access to this unordered_map. - * - * Note: - * There's no need to protect access to _turboModuleCache because that cache - * is only accessed within provideTurboModule, which is only invoked by the - * JS thread. - */ - std::mutex _rctTurboModuleCacheLock; + // Enforce synchronous access into _delegate + std::mutex _turboModuleManagerDelegateMutex; + + // Enforce synchronous access to _invalidating and _turboModuleHolders + std::mutex _turboModuleHoldersMutex; std::atomic _invalidating; } @@ -270,22 +321,29 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name */ - (id)provideRCTTurboModule:(const char *)moduleName { - Class moduleClass; - id module = nil; + TurboModuleHolder *moduleHolder = [self _getOrCreateTurboModuleHolder:moduleName]; + + if (!moduleHolder) { + return nil; + } + + bool shouldCreateModule = false; { - std::unique_lock lock(_rctTurboModuleCacheLock); + std::lock_guard guard(moduleHolder->mutex()); - auto rctTurboModuleCacheLookup = _rctTurboModuleCache.find(moduleName); - if (rctTurboModuleCacheLookup != _rctTurboModuleCache.end()) { - [_performanceLogger createRCTTurboModuleCacheHit:moduleName]; - return rctTurboModuleCacheLookup->second; + if (moduleHolder->isDoneCreatingModule()) { + return moduleHolder->getModule(); } - if (_invalidating) { - // Don't allow creating new instances while invalidating. - return nil; + if (!moduleHolder->isCreatingModule()) { + shouldCreateModule = true; + moduleHolder->startCreatingModule(); } + } + + if (shouldCreateModule) { + Class moduleClass; /** * Step 2a: Resolve platform-specific class. @@ -293,6 +351,8 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name [_performanceLogger getRCTTurboModuleClassStart:moduleName]; if ([_delegate respondsToSelector:@selector(getModuleClassFromName:)]) { + std::lock_guard delegateGuard(_turboModuleManagerDelegateMutex); + moduleClass = [_delegate getModuleClassFromName:moduleName]; } @@ -302,195 +362,277 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name [_performanceLogger getRCTTurboModuleClassEnd:moduleName]; - if (![moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) { - return nil; - } + __block id module = nil; - /** - * Step 2b: Ask hosting application/delegate to instantiate this class - */ - [_performanceLogger getRCTTurboModuleInstanceStart:moduleName]; + if ([moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) { + dispatch_block_t work = ^{ + module = [self _createAndSetUpRCTTurboModule:moduleClass moduleName:moduleName]; + }; - if ([_delegate respondsToSelector:@selector(getModuleInstanceFromClass:)]) { - module = [_delegate getModuleInstanceFromClass:moduleClass]; - } else { - module = [moduleClass new]; + if ([self _requiresMainQueueSetup:moduleClass]) { + RCTUnsafeExecuteOnMainQueueSync(work); + } else { + work(); + } } - [_performanceLogger getRCTTurboModuleInstanceEnd:moduleName]; + { + std::lock_guard guard(moduleHolder->mutex()); - if ([module respondsToSelector:@selector(setTurboModuleLookupDelegate:)]) { - [module setTurboModuleLookupDelegate:self]; + moduleHolder->setModule(module); + moduleHolder->endCreatingModule(); } - _rctTurboModuleCache.insert({moduleName, module}); + moduleHolder->cv().notify_all(); + + return module; } - [self setUpRCTTurboModule:module moduleName:moduleName]; - return module; + std::unique_lock guard(moduleHolder->mutex()); + + while (moduleHolder->isCreatingModule()) { + /** + * TODO(T65905574): + * If the thread responsible for creating and initializing the NativeModule stalls, we'll wait here indefinitely. + * This is the behaviour in legacy NativeModuels. Changing this now could lead to more crashes/problems in + * TurboModules than in NativeModules, which'll make it more difficult to test the TurboModules infra. Therefore, + * we should consider making it post TurboModule 100% rollout. + */ + moduleHolder->cv().wait(guard); + } + + return moduleHolder->getModule(); } -- (void)setUpRCTTurboModule:(id)module moduleName:(const char *)moduleName +/** + * Given a TurboModule class, and its name, create and initialize it synchronously. + * + * This method can be called synchronously from two different contexts: + * - The thread that calls provideRCTTurboModule: + * - The main thread (if the TurboModule requires main queue init), blocking the thread that calls provideRCTTurboModule:. + */ +- (id)_createAndSetUpRCTTurboModule:(Class)moduleClass moduleName:(const char *)moduleName { - __weak id weakModule = (id)module; - __weak RCTBridge *weakBridge = _bridge; - id performanceLogger = _performanceLogger; + id module = nil; - auto setUpTurboModule = ^{ - if (!weakModule) { - return; - } + /** + * Step 2b: Ask hosting application/delegate to instantiate this class + */ + [_performanceLogger getRCTTurboModuleInstanceStart:moduleName]; - [performanceLogger setupRCTTurboModuleStart:moduleName]; + if ([_delegate respondsToSelector:@selector(getModuleInstanceFromClass:)]) { + std::lock_guard delegateGuard(_turboModuleManagerDelegateMutex); - id strongModule = weakModule; - RCTBridge *strongBridge = weakBridge; + module = [_delegate getModuleInstanceFromClass:moduleClass]; + } else { + module = [moduleClass new]; + } + + [_performanceLogger getRCTTurboModuleInstanceEnd:moduleName]; + + [_performanceLogger setupRCTTurboModuleStart:moduleName]; + + if ([module respondsToSelector:@selector(setTurboModuleLookupDelegate:)]) { + [module setTurboModuleLookupDelegate:self]; + } + + /** + * It is reasonable for NativeModules to not want/need the bridge. + * In such cases, they won't have `@synthesize bridge = _bridge` in their + * implementation, and a `- (RCTBridge *) bridge { ... }` method won't be + * generated by the ObjC runtime. The property will also not be backed + * by an ivar, which makes writing to it unsafe. Therefore, we check if + * this method exists to know if we can safely set the bridge to the + * NativeModule. + */ + if ([module respondsToSelector:@selector(bridge)] && _bridge) { + [_performanceLogger attachRCTBridgeToRCTTurboModuleStart:moduleName]; /** - * It is reasonable for NativeModules to not want/need the bridge. - * In such cases, they won't have `@synthesize bridge = _bridge` in their - * implementation, and a `- (RCTBridge *) bridge { ... }` method won't be - * generated by the ObjC runtime. The property will also not be backed - * by an ivar, which makes writing to it unsafe. Therefore, we check if - * this method exists to know if we can safely set the bridge to the - * NativeModule. + * Just because a NativeModule has the `bridge` method, it doesn't mean + * that it has synthesized the bridge in its implementation. Therefore, + * we need to surround the code that sets the bridge to the NativeModule + * inside a try/catch. This catches the cases where the NativeModule + * author specifies a `bridge` method manually. */ - if ([strongModule respondsToSelector:@selector(bridge)] && strongBridge) { - [performanceLogger attachRCTBridgeToRCTTurboModuleStart:moduleName]; + @try { + /** + * RCTBridgeModule declares the bridge property as readonly. + * Therefore, when authors of NativeModules synthesize the bridge + * via @synthesize bridge = bridge;, the ObjC runtime generates + * only a - (RCTBridge *) bridge: { ... } method. No setter is + * generated, so we have have to rely on the KVC API of ObjC to set + * the bridge property of these NativeModules. + */ + [(id)module setValue:_bridge forKey:@"bridge"]; + } @catch (NSException *exception) { + RCTLogError( + @"%@ has no setter or ivar for its bridge, which is not " + "permitted. You must either @synthesize the bridge property, " + "or provide your own setter method.", + RCTBridgeModuleNameForClass([module class])); + } + + [_performanceLogger attachRCTBridgeToRCTTurboModuleEnd:moduleName]; + } + + /** + * Some modules need their own queues, but don't provide any, so we need to create it for them. + * These modules typically have the following: + * `@synthesize methodQueue = _methodQueue` + */ + + [_performanceLogger attachMethodQueueToRCTTurboModuleStart:moduleName]; + + dispatch_queue_t methodQueue = nil; + BOOL moduleHasMethodQueueGetter = [module respondsToSelector:@selector(methodQueue)]; + if (moduleHasMethodQueueGetter) { + methodQueue = [(id)module methodQueue]; + } + + /** + * Note: RCTJSThread, which is a valid method queue, is defined as (id)kCFNull. It should rightfully not enter the + * following if condition's block. + */ + if (!methodQueue) { + NSString *methodQueueName = [NSString stringWithFormat:@"com.facebook.react.%sQueue", moduleName]; + methodQueue = dispatch_queue_create(methodQueueName.UTF8String, DISPATCH_QUEUE_SERIAL); + + if (moduleHasMethodQueueGetter) { /** - * Just because a NativeModule has the `bridge` method, it doesn't mean - * that it has synthesized the bridge in its implementation. Therefore, - * we need to surround the code that sets the bridge to the NativeModule - * inside a try/catch. This catches the cases where the NativeModule - * author specifies a `bridge` method manually. + * If the module has a method queue getter, two cases are possible: + * - We @synthesized the method queue. In this case, the getter will initially return nil. + * - We had a custom methodQueue function on the NativeModule. If we got this far, then that getter returned + * nil. + * + * Therefore, we do a try/catch and use ObjC's KVC API and try to assign the method queue to the NativeModule. + * In case 1, we'll succeed. In case 2, an exception will be thrown, which we'll ignore. */ + @try { - /** - * RCTBridgeModule declares the bridge property as readonly. - * Therefore, when authors of NativeModules synthesize the bridge - * via @synthesize bridge = bridge;, the ObjC runtime generates - * only a - (RCTBridge *) bridge: { ... } method. No setter is - * generated, so we have have to rely on the KVC API of ObjC to set - * the bridge property of these NativeModules. - */ - [(id)strongModule setValue:strongBridge forKey:@"bridge"]; + [(id)module setValue:methodQueue forKey:@"methodQueue"]; } @catch (NSException *exception) { RCTLogError( - @"%@ has no setter or ivar for its bridge, which is not " + @"%@ has no setter or ivar for its methodQueue, which is not " "permitted. You must either @synthesize the bridge property, " "or provide your own setter method.", - RCTBridgeModuleNameForClass([strongModule class])); + RCTBridgeModuleNameForClass([module class])); } - - [performanceLogger attachRCTBridgeToRCTTurboModuleEnd:moduleName]; } + } - /** - * Some modules need their own queues, but don't provide any, so we need to create it for them. - * These modules typically have the following: - * `@synthesize methodQueue = _methodQueue` - */ + /** + * Attach method queue to id object. + * This is necessary because the id object can be eagerly created/initialized before the method + * queue is required. The method queue is required for an id for JS -> Native calls. So, we need it + * before we create the id's TurboModule jsi::HostObject in provideTurboModule:. + */ + objc_setAssociatedObject(module, &kAssociatedMethodQueueKey, methodQueue, OBJC_ASSOCIATION_RETAIN); - [performanceLogger attachMethodQueueToRCTTurboModuleStart:moduleName]; + [_performanceLogger attachMethodQueueToRCTTurboModuleEnd:moduleName]; - dispatch_queue_t methodQueue = nil; - BOOL moduleHasMethodQueueGetter = [strongModule respondsToSelector:@selector(methodQueue)]; + /** + * NativeModules that implement the RCTFrameUpdateObserver protocol + * require registration with RCTDisplayLink. + * + * TODO(T55504345): Investigate whether we can improve this after TM + * rollout. + */ + if (_bridge) { + [_performanceLogger registerRCTTurboModuleForFrameUpdatesStart:moduleName]; + RCTModuleData *data = [[RCTModuleData alloc] initWithModuleInstance:(id)module bridge:_bridge]; + [_bridge registerModuleForFrameUpdates:(id)module withModuleData:data]; + [_performanceLogger registerRCTTurboModuleForFrameUpdatesEnd:moduleName]; + } - if (moduleHasMethodQueueGetter) { - methodQueue = [strongModule methodQueue]; - } + /** + * Broadcast that this TurboModule was created. + * + * TODO(T41180176): Investigate whether we can delete this after TM + * rollout. + */ + [_performanceLogger dispatchDidInitializeModuleNotificationForRCTTurboModuleStart:moduleName]; + [[NSNotificationCenter defaultCenter] + postNotificationName:RCTDidInitializeModuleNotification + object:_bridge + userInfo:@{@"module" : module, @"bridge" : RCTNullIfNil([_bridge parentBridge])}]; + [_performanceLogger dispatchDidInitializeModuleNotificationForRCTTurboModuleEnd:moduleName]; - /** - * Note: RCTJSThread, which is a valid method queue, is defined as (id)kCFNull. It should rightfully not enter the - * following if condition's block. - */ - if (!methodQueue) { - NSString *methodQueueName = [NSString stringWithFormat:@"com.facebook.react.%sQueue", moduleName]; - methodQueue = dispatch_queue_create(methodQueueName.UTF8String, DISPATCH_QUEUE_SERIAL); + [_performanceLogger setupRCTTurboModuleEnd:moduleName]; - if (moduleHasMethodQueueGetter) { - /** - * If the module has a method queue getter, two cases are possible: - * - We @synthesized the method queue. In this case, the getter will initially return nil. - * - We had a custom methodQueue function on the NativeModule. If we got this far, then that getter returned - * nil. - * - * Therefore, we do a try/catch and use ObjC's KVC API and try to assign the method queue to the NativeModule. - * In case 1, we'll succeed. In case 2, an exception will be thrown, which we'll ignore. - */ + return module; +} - @try { - [(id)strongModule setValue:methodQueue forKey:@"methodQueue"]; - } @catch (NSException *exception) { - RCTLogError( - @"%@ has no setter or ivar for its methodQueue, which is not " - "permitted. You must either @synthesize the bridge property, " - "or provide your own setter method.", - RCTBridgeModuleNameForClass([strongModule class])); - } - } - } +/** + * Return a pointer to this TurboModule's TurboModuleHolder entry, creating one if it doesn't exist. + * Return nullptr if we've started teardown of TurboModuleManager. + */ +- (TurboModuleHolder *)_getOrCreateTurboModuleHolder:(const char *)moduleName +{ + std::lock_guard guard(_turboModuleHoldersMutex); + if (_invalidating) { + return nullptr; + } - /** - * Attach method queue to id object. - * This is necessary because the id object can be eagerly created/initialized before the method - * queue is required. The method queue is required for an id for JS -> Native calls. So, we need it - * before we create the id's TurboModule jsi::HostObject in provideTurboModule:. - */ - objc_setAssociatedObject(strongModule, &kAssociatedMethodQueueKey, methodQueue, OBJC_ASSOCIATION_RETAIN); + return &_turboModuleHolders[moduleName]; +} - [performanceLogger attachMethodQueueToRCTTurboModuleEnd:moduleName]; +/** + * Should this TurboModule be created and initialized on the main queue? + * + * For TurboModule ObjC classes that implement requiresMainQueueInit, return the result of this method. + * For TurboModule ObjC classes that don't. Return true if they have a custom init or constantsToExport method. + */ +- (BOOL)_requiresMainQueueSetup:(Class)moduleClass +{ + const BOOL implementsRequireMainQueueSetup = [moduleClass respondsToSelector:@selector(requiresMainQueueSetup)]; + if (implementsRequireMainQueueSetup) { + return [moduleClass requiresMainQueueSetup]; + } - /** - * NativeModules that implement the RCTFrameUpdateObserver protocol - * require registration with RCTDisplayLink. - * - * TODO(T55504345): Investigate whether we can improve this after TM - * rollout. - */ - if (strongBridge) { - [performanceLogger registerRCTTurboModuleForFrameUpdatesStart:moduleName]; - RCTModuleData *data = [[RCTModuleData alloc] initWithModuleInstance:strongModule bridge:strongBridge]; - [strongBridge registerModuleForFrameUpdates:strongModule withModuleData:data]; - [performanceLogger registerRCTTurboModuleForFrameUpdatesEnd:moduleName]; - } + /** + * WARNING! + * This following logic exists for backwards compatibility with the legacy NativeModule system. + * + * TODO(T65864302) Remove the following logic after TM 100% rollout + */ - /** - * Broadcast that this TurboModule was created. - * - * TODO(T41180176): Investigate whether we can delete this after TM - * rollout. - */ - [performanceLogger dispatchDidInitializeModuleNotificationForRCTTurboModuleStart:moduleName]; - [[NSNotificationCenter defaultCenter] - postNotificationName:RCTDidInitializeModuleNotification - object:strongBridge - userInfo:@{@"module" : module, @"bridge" : RCTNullIfNil([strongBridge parentBridge])}]; - [performanceLogger dispatchDidInitializeModuleNotificationForRCTTurboModuleEnd:moduleName]; - - [performanceLogger setupRCTTurboModuleEnd:moduleName]; - }; + /** + * If a module overrides `constantsToExport` and doesn't implement `requiresMainQueueSetup`, then we must assume + * that it must be called on the main thread, because it may need to access UIKit. + */ + BOOL hasConstantsToExport = [moduleClass instancesRespondToSelector:@selector(constantsToExport)]; + + static IMP objectInitMethod; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + objectInitMethod = [NSObject instanceMethodForSelector:@selector(init)]; + }); /** - * TODO(T64991809): Fix TurboModule race: - * - When NativeModules that don't require main queue setup are required from different threads, they'll - * concurrently run setUpRCTTurboModule: + * If a module overrides `init` then we must assume that it expects to be initialized on the main thread, because it may + * need to access UIKit. */ - if ([[module class] respondsToSelector:@selector(requiresMainQueueSetup)] && - [[module class] requiresMainQueueSetup]) { - /** - * If the main thread synchronously calls into JS that creates a TurboModule, - * we could deadlock. This behaviour is migrated over from the legacy NativeModule - * system. - * - * TODO(T63807674): Investigate the right migration plan off of this - */ - [_performanceLogger setupRCTTurboModuleDispatch:moduleName]; - RCTUnsafeExecuteOnMainQueueSync(setUpTurboModule); - } else { - setUpTurboModule(); + const BOOL hasCustomInit = [moduleClass instanceMethodForSelector:@selector(init)] != objectInitMethod; + + BOOL requiresMainQueueSetup = hasConstantsToExport || hasCustomInit; + if (requiresMainQueueSetup) { + const char *methodName = ""; + if (hasConstantsToExport) { + methodName = "constantsToExport"; + } else if (hasCustomInit) { + methodName = "init"; + } + RCTLogWarn( + @"Module %@ requires main queue setup since it overrides `%s` but doesn't implement " + "`requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules " + "on a background thread unless explicitly opted-out of.", + moduleClass, + methodName); } + + return requiresMainQueueSetup; } - (void)installJSBindingWithRuntime:(jsi::Runtime *)runtime @@ -560,8 +702,8 @@ - (id)moduleForName:(const char *)moduleName warnOnLookupFailure:(BOOL)warnOnLoo - (BOOL)moduleIsInitialized:(const char *)moduleName { - std::unique_lock lock(_rctTurboModuleCacheLock); - return _rctTurboModuleCache.find(std::string(moduleName)) != _rctTurboModuleCache.end(); + std::unique_lock guard(_turboModuleHoldersMutex); + return _turboModuleHolders.find(moduleName) != _turboModuleHolders.end(); } #pragma mark Invalidation logic @@ -573,6 +715,9 @@ - (void)bridgeWillInvalidateModules:(NSNotification *)notification return; } + std::lock_guard guard(_turboModuleHoldersMutex); + + // This should halt all insertions into _turboModuleHolders _invalidating = true; } @@ -583,16 +728,19 @@ - (void)bridgeDidInvalidateModules:(NSNotification *)notification return; } - std::unordered_map> rctCacheCopy; - { - std::unique_lock lock(_rctTurboModuleCacheLock); - rctCacheCopy.insert(_rctTurboModuleCache.begin(), _rctTurboModuleCache.end()); - } - // Backward-compatibility: RCTInvalidating handling. dispatch_group_t moduleInvalidationGroup = dispatch_group_create(); - for (const auto &p : rctCacheCopy) { - id module = p.second; + + for (const auto &pair : _turboModuleHolders) { + std::string moduleName = pair.first; + + /** + * We could start tearing down ReactNative before a TurboModule is fully initialized. In this case, we should wait + * for init to finish before we call invalidate on the module. Therefore, we call provideRCTTurboModule (because + * it's guaranteed to return a fully initialized NativeModule). + */ + id module = [self provideRCTTurboModule:moduleName.c_str()]; + if ([module respondsToSelector:@selector(invalidate)]) { if ([module respondsToSelector:@selector(methodQueue)]) { dispatch_queue_t methodQueue = [module performSelector:@selector(methodQueue)]; @@ -615,35 +763,26 @@ - (void)bridgeDidInvalidateModules:(NSNotification *)notification RCTLogError(@"TurboModuleManager: Timed out waiting for modules to be invalidated"); } - { - std::unique_lock lock(_rctTurboModuleCacheLock); - _rctTurboModuleCache.clear(); - } - + _turboModuleHolders.clear(); _turboModuleCache.clear(); } - (void)invalidate { - std::unordered_map> rctCacheCopy; { - std::unique_lock lock(_rctTurboModuleCacheLock); - rctCacheCopy.insert(_rctTurboModuleCache.begin(), _rctTurboModuleCache.end()); + std::lock_guard guard(_turboModuleHoldersMutex); + _invalidating = true; } // Backward-compatibility: RCTInvalidating handling, but not adhering to desired methodQueue. - for (const auto &p : rctCacheCopy) { - id module = p.second; + for (const auto &p : _turboModuleHolders) { + id module = p.second.getModule(); if ([module respondsToSelector:@selector(invalidate)]) { [((id)module) invalidate]; } } - { - std::unique_lock lock(_rctTurboModuleCacheLock); - _rctTurboModuleCache.clear(); - } - + _turboModuleHolders.clear(); _turboModuleCache.clear(); } From d06ee3d18973e74983590d2888552dbd57ceb951 Mon Sep 17 00:00:00 2001 From: Will Holen Date: Wed, 22 Apr 2020 18:43:13 -0700 Subject: [PATCH 094/235] Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b --- ReactAndroid/src/main/jni/third-party/folly/Android.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/src/main/jni/third-party/folly/Android.mk b/ReactAndroid/src/main/jni/third-party/folly/Android.mk index 2688890637300e..1bd5c3e9d137af 100644 --- a/ReactAndroid/src/main/jni/third-party/folly/Android.mk +++ b/ReactAndroid/src/main/jni/third-party/folly/Android.mk @@ -36,7 +36,8 @@ FOLLY_FLAGS := \ -DFOLLY_NO_CONFIG=1 \ -DFOLLY_HAVE_CLOCK_GETTIME=1 \ -DFOLLY_HAVE_MEMRCHR=1 \ - -DFOLLY_USE_LIBCPP=1 + -DFOLLY_USE_LIBCPP=1 \ + -DFOLLY_MOBILE=1 # If APP_PLATFORM in Application.mk targets android-23 above, please comment this line. # NDK uses GNU style stderror_r() after API 23. @@ -87,9 +88,6 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -FOLLY_FLAGS += \ - -DFOLLY_MOBILE=1 - LOCAL_CFLAGS += $(FOLLY_FLAGS) LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS) From a2f8b9c36e5eba6bc354a2f53bf8d3ca11297d00 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Wed, 22 Apr 2020 23:40:59 -0700 Subject: [PATCH 095/235] Set black as default text color for on iOS (#28708) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 --- Libraries/Text/TextInput/RCTBaseTextInputView.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 114bc21478beb4..538832e0e92bcc 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -68,7 +68,13 @@ - (void)setTextAttributes:(RCTTextAttributes *)textAttributes - (void)enforceTextAttributesIfNeeded { id backedTextInputView = self.backedTextInputView; - backedTextInputView.defaultTextAttributes = [_textAttributes effectiveTextAttributes]; + + NSDictionary *textAttributes = [[_textAttributes effectiveTextAttributes] mutableCopy]; + if ([textAttributes valueForKey:NSForegroundColorAttributeName] == nil) { + [textAttributes setValue:[UIColor blackColor] forKey:NSForegroundColorAttributeName]; + } + + backedTextInputView.defaultTextAttributes = textAttributes; } - (void)setReactPaddingInsets:(UIEdgeInsets)reactPaddingInsets From ca162560af851af8b04040c279a15a58329611e2 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Thu, 23 Apr 2020 06:51:21 -0700 Subject: [PATCH 096/235] Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21202121 fbshipit-source-id: 6acb53e6ca941e465b11aeac4215533c16067eed --- .../turbomodule/core/platform/ios/RCTTurboModuleManager.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index e7ccf625bbed9b..f5a12a6dce6b26 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -409,7 +409,8 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name * * This method can be called synchronously from two different contexts: * - The thread that calls provideRCTTurboModule: - * - The main thread (if the TurboModule requires main queue init), blocking the thread that calls provideRCTTurboModule:. + * - The main thread (if the TurboModule requires main queue init), blocking the thread that calls + * provideRCTTurboModule:. */ - (id)_createAndSetUpRCTTurboModule:(Class)moduleClass moduleName:(const char *)moduleName { @@ -611,8 +612,8 @@ - (BOOL)_requiresMainQueueSetup:(Class)moduleClass }); /** - * If a module overrides `init` then we must assume that it expects to be initialized on the main thread, because it may - * need to access UIKit. + * If a module overrides `init` then we must assume that it expects to be initialized on the main thread, because it + * may need to access UIKit. */ const BOOL hasCustomInit = [moduleClass instanceMethodForSelector:@selector(init)] != objectInitMethod; From ab9b212de8aeed5844f2c7da4b2498bac7025c63 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 097/235] RN: Rename `{ => Event}ObjectPropertyType` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160790 fbshipit-source-id: eaf5e8c9f51e16134e153a6321857234be1aa338 --- packages/react-native-codegen/src/CodegenSchema.js | 6 +++--- .../src/generators/components/GenerateEventEmitterCpp.js | 4 ++-- .../src/generators/components/GenerateEventEmitterH.js | 8 ++++---- .../src/parsers/flow/components/events.js | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 7d8375512b3599..f11dbb26e569be 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -47,7 +47,7 @@ export type StringTypeAnnotation = $ReadOnly<{| type: 'StringTypeAnnotation', |}>; -export type ObjectPropertyType = +export type EventObjectPropertyType = | $ReadOnly<{| type: 'BooleanTypeAnnotation', name: string, @@ -85,7 +85,7 @@ export type ObjectPropertyType = type: 'ObjectTypeAnnotation', name: string, optional: boolean, - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, |}>; type PropTypeTypeAnnotation = @@ -274,7 +274,7 @@ export type EventTypeShape = $ReadOnly<{| type: 'EventTypeAnnotation', argument?: $ReadOnly<{| type: 'ObjectTypeAnnotation', - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, |}>, |}>, |}>; diff --git a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js index 8577df4309ebe6..052315baaf46ed 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterCpp.js @@ -14,7 +14,7 @@ const {generateEventStructName} = require('./CppHelpers.js'); import type { ComponentShape, - ObjectPropertyType, + EventObjectPropertyType, SchemaType, } from '../../CodegenSchema'; @@ -79,7 +79,7 @@ function generateEnumSetter(variableName, propertyName, propertyParts) { function generateSetters( parentPropertyName: string, - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, propertyParts: $ReadOnlyArray, ): string { const propSetters = properties diff --git a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js index a1d6956f8557cc..6c90069677f1ce 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js +++ b/packages/react-native-codegen/src/generators/components/GenerateEventEmitterH.js @@ -21,7 +21,7 @@ const { import type { ComponentShape, EventTypeShape, - ObjectPropertyType, + EventObjectPropertyType, SchemaType, } from '../../CodegenSchema'; @@ -97,7 +97,7 @@ function indent(nice: string, spaces: number) { function getNativeTypeFromAnnotation( componentName: string, - eventProperty: ObjectPropertyType, + eventProperty: EventObjectPropertyType, nameParts: $ReadOnlyArray, ): string { const type = eventProperty.type; @@ -146,7 +146,7 @@ function generateStruct( structs: StructsMap, componentName: string, nameParts: $ReadOnlyArray, - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, ): void { const structNameParts = nameParts; const structName = generateEventStructName(structNameParts); @@ -161,7 +161,7 @@ function generateStruct( }) .join('\n' + ' '); - properties.forEach((property: ObjectPropertyType) => { + properties.forEach((property: EventObjectPropertyType) => { const name = property.name; switch (property.type) { case 'BooleanTypeAnnotation': diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index bb748d48eece47..8767cf88a9a802 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -12,7 +12,7 @@ import type { EventTypeShape, - ObjectPropertyType, + EventObjectPropertyType, } from '../../../CodegenSchema.js'; function getPropertyType(name, optional, typeAnnotation) { @@ -126,7 +126,7 @@ function findEventArgumentsAndType( } } -function buildPropertiesForEvent(property): ObjectPropertyType { +function buildPropertiesForEvent(property): EventObjectPropertyType { const name = property.key.name; const optional = property.value.type === 'NullableTypeAnnotation' || property.optional; From 1b2bcb180c87a02630f0c346ac88be5acfb552ef Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 098/235] RN: Rename `{NativePrimitive => ReservedProp}TypeAnnotation` in Codegen Summary: Straightforward rename to clarify the purpose of this type. The current naming made more sense before the codegen also produced code for NativeModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160793 fbshipit-source-id: 6787ef298e32ff1b4d506afd831af96764f5af6f --- .../react-native-codegen/src/CodegenSchema.js | 4 +- .../src/generators/components/CppHelpers.js | 6 +- .../generators/components/GeneratePropsH.js | 14 +-- .../components/GeneratePropsJavaDelegate.js | 4 +- .../components/GeneratePropsJavaInterface.js | 4 +- .../generators/components/GenerateTests.js | 2 +- .../components/GenerateViewConfigJs.js | 4 +- .../src/generators/components/JavaHelpers.js | 6 +- .../components/__test_fixtures__/fixtures.js | 34 ++--- .../component-parser-test.js.snap | 118 +++++++++--------- .../src/parsers/flow/components/props.js | 18 +-- 11 files changed, 105 insertions(+), 109 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index f11dbb26e569be..6a8e7725ab2d67 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -124,7 +124,7 @@ type PropTypeTypeAnnotation = |}>, |}> | $ReadOnly<{| - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: | 'ColorPrimitive' | 'ImageSourcePrimitive' @@ -165,7 +165,7 @@ type PropTypeTypeAnnotation = properties: $ReadOnlyArray, |}> | $ReadOnly<{| - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: | 'ColorPrimitive' | 'ImageSourcePrimitive' diff --git a/packages/react-native-codegen/src/generators/components/CppHelpers.js b/packages/react-native-codegen/src/generators/components/CppHelpers.js index 0ea941489be250..75b259ab84f912 100644 --- a/packages/react-native-codegen/src/generators/components/CppHelpers.js +++ b/packages/react-native-codegen/src/generators/components/CppHelpers.js @@ -78,13 +78,13 @@ function getImports(properties: $ReadOnlyArray): Set { properties.forEach(prop => { const typeAnnotation = prop.typeAnnotation; - if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') { + if (typeAnnotation.type === 'ReservedPropTypeAnnotation') { addImportsForNativeName(typeAnnotation.name); } if ( typeAnnotation.type === 'ArrayTypeAnnotation' && - typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation' + typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation' ) { addImportsForNativeName(typeAnnotation.elementType.name); } @@ -151,7 +151,7 @@ function convertDefaultTypeToString( return parseInt(defaultFloatVal, 10) === defaultFloatVal ? defaultFloatVal.toFixed(1) : String(typeAnnotation.default); - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': switch (typeAnnotation.name) { case 'ColorPrimitive': return ''; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js index fd12096e297854..adb94d16f442f4 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js @@ -221,7 +221,7 @@ function getNativeTypeFromAnnotation( case 'DoubleTypeAnnotation': case 'FloatTypeAnnotation': return getCppTypeForAnnotation(typeAnnotation.type); - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': switch (typeAnnotation.name) { case 'ColorPrimitive': return 'SharedColor'; @@ -233,7 +233,7 @@ function getNativeTypeFromAnnotation( return 'EdgeInsets'; default: (typeAnnotation.name: empty); - throw new Error('Received unknown NativePrimitiveTypeAnnotation'); + throw new Error('Received unknown ReservedPropTypeAnnotation'); } case 'ArrayTypeAnnotation': { const arrayType = typeAnnotation.elementType.type; @@ -503,16 +503,14 @@ function getLocalImports( return; default: (name: empty); - throw new Error( - `Invalid NativePrimitiveTypeAnnotation name, got ${name}`, - ); + throw new Error(`Invalid ReservedPropTypeAnnotation name, got ${name}`); } } properties.forEach(prop => { const typeAnnotation = prop.typeAnnotation; - if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') { + if (typeAnnotation.type === 'ReservedPropTypeAnnotation') { addImportsForNativeName(typeAnnotation.name); } @@ -525,7 +523,7 @@ function getLocalImports( if ( typeAnnotation.type === 'ArrayTypeAnnotation' && - typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation' + typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation' ) { addImportsForNativeName(typeAnnotation.elementType.name); } @@ -703,7 +701,7 @@ function generateStruct( return; case 'FloatTypeAnnotation': return; - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': return; case 'ArrayTypeAnnotation': return; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index a92f7e445f1b51..afddadb910763a 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -97,7 +97,7 @@ function getJavaValueForProp( } else { return 'value == null ? Float.NaN : ((Double) value).floatValue()'; } - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': switch (typeAnnotation.name) { case 'ColorPrimitive': return 'ColorPropConverter.getColor(value, view.getContext())'; @@ -109,7 +109,7 @@ function getJavaValueForProp( return '(ReadableMap) value'; default: (typeAnnotation.name: empty); - throw new Error('Received unknown NativePrimitiveTypeAnnotation'); + throw new Error('Received unknown ReservedPropTypeAnnotation'); } case 'ArrayTypeAnnotation': { return '(ReadableArray) value'; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js index 51b008bb54dc94..ea8e4262b9d1b8 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js @@ -72,7 +72,7 @@ function getJavaValueForProp(prop: PropTypeShape, imports): string { } else { return 'float value'; } - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': switch (typeAnnotation.name) { case 'ColorPrimitive': addNullable(imports); @@ -88,7 +88,7 @@ function getJavaValueForProp(prop: PropTypeShape, imports): string { return '@Nullable ReadableMap value'; default: (typeAnnotation.name: empty); - throw new Error('Received unknown NativePrimitiveTypeAnnotation'); + throw new Error('Received unknown ReservedPropTypeAnnotation'); } case 'ArrayTypeAnnotation': { addNullable(imports); diff --git a/packages/react-native-codegen/src/generators/components/GenerateTests.js b/packages/react-native-codegen/src/generators/components/GenerateTests.js index 213ee3ba4d2c21..25c0cfa59a9b61 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateTests.js +++ b/packages/react-native-codegen/src/generators/components/GenerateTests.js @@ -83,7 +83,7 @@ function getTestCasesForProp(propName, typeAnnotation) { propName, propValue: typeAnnotation.default != null ? typeAnnotation.default : 0.1, }); - } else if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') { + } else if (typeAnnotation.type === 'ReservedPropTypeAnnotation') { if (typeAnnotation.name === 'ColorPrimitive') { cases.push({ propName, diff --git a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js index 22e76aa785baad..3b578b752d01b8 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js +++ b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js @@ -49,7 +49,7 @@ function getReactDiffProcessValue(typeAnnotation) { case 'StringEnumTypeAnnotation': case 'Int32EnumTypeAnnotation': return j.literal(true); - case 'NativePrimitiveTypeAnnotation': + case 'ReservedPropTypeAnnotation': switch (typeAnnotation.name) { case 'ColorPrimitive': return j.template.expression`{ process: require('processColor') }`; @@ -67,7 +67,7 @@ function getReactDiffProcessValue(typeAnnotation) { ); } case 'ArrayTypeAnnotation': - if (typeAnnotation.elementType.type === 'NativePrimitiveTypeAnnotation') { + if (typeAnnotation.elementType.type === 'ReservedPropTypeAnnotation') { switch (typeAnnotation.elementType.name) { case 'ColorPrimitive': return j.template diff --git a/packages/react-native-codegen/src/generators/components/JavaHelpers.js b/packages/react-native-codegen/src/generators/components/JavaHelpers.js index affb28a21406e0..e59fe7df4f8571 100644 --- a/packages/react-native-codegen/src/generators/components/JavaHelpers.js +++ b/packages/react-native-codegen/src/generators/components/JavaHelpers.js @@ -78,16 +78,14 @@ function getImports( return; default: (name: empty); - throw new Error( - `Invalid NativePrimitiveTypeAnnotation name, got ${name}`, - ); + throw new Error(`Invalid ReservedPropTypeAnnotation name, got ${name}`); } } component.props.forEach(prop => { const typeAnnotation = prop.typeAnnotation; - if (typeAnnotation.type === 'NativePrimitiveTypeAnnotation') { + if (typeAnnotation.type === 'ReservedPropTypeAnnotation') { addImportsForNativeName(typeAnnotation.name); } diff --git a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js index 07d7fae0e0ef47..9461acd92fd445 100644 --- a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js @@ -409,7 +409,7 @@ const COLOR_PROP: SchemaType = { name: 'tintColor', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -438,7 +438,7 @@ const IMAGE_PROP: SchemaType = { name: 'thumbImage', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }, }, @@ -467,7 +467,7 @@ const POINT_PROP: SchemaType = { name: 'startPoint', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }, }, @@ -496,7 +496,7 @@ const INSETS_PROP: SchemaType = { name: 'contentInset', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'EdgeInsetsPrimitive', }, }, @@ -567,7 +567,7 @@ const ARRAY_PROPS: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -578,7 +578,7 @@ const ARRAY_PROPS: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }, }, @@ -589,7 +589,7 @@ const ARRAY_PROPS: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }, }, @@ -726,7 +726,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -737,7 +737,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }, }, @@ -748,7 +748,7 @@ const ARRAY_PROPS_WITH_NESTED_OBJECT: SchemaType = { typeAnnotation: { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }, }, @@ -871,7 +871,7 @@ const OBJECT_PROPS: SchemaType = { name: 'image', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }, }, @@ -879,7 +879,7 @@ const OBJECT_PROPS: SchemaType = { name: 'color', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -887,7 +887,7 @@ const OBJECT_PROPS: SchemaType = { name: 'point', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }, }, @@ -977,7 +977,7 @@ const MULTI_NATIVE_PROP: SchemaType = { name: 'thumbImage', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }, }, @@ -985,7 +985,7 @@ const MULTI_NATIVE_PROP: SchemaType = { name: 'color', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -993,7 +993,7 @@ const MULTI_NATIVE_PROP: SchemaType = { name: 'thumbTintColor', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }, @@ -1001,7 +1001,7 @@ const MULTI_NATIVE_PROP: SchemaType = { name: 'point', optional: true, typeAnnotation: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }, }, diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap index 5fdbb373abe9a9..bd0b3629a6f71b 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap @@ -361,7 +361,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -369,7 +369,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -377,7 +377,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -385,7 +385,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -393,7 +393,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -401,7 +401,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -409,7 +409,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -418,7 +418,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -429,7 +429,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -440,7 +440,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -451,7 +451,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -461,7 +461,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -469,7 +469,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -477,7 +477,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -485,7 +485,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -493,7 +493,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -501,7 +501,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -509,7 +509,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -517,7 +517,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -525,7 +525,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -533,7 +533,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -541,7 +541,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, Object { @@ -549,7 +549,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -819,7 +819,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -830,7 +830,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -841,7 +841,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -852,7 +852,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -863,7 +863,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -874,7 +874,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -885,7 +885,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -896,7 +896,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -907,7 +907,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -918,7 +918,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -929,7 +929,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -940,7 +940,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -951,7 +951,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -962,7 +962,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -973,7 +973,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -984,7 +984,7 @@ Object { "typeAnnotation": Object { "elementType": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, "type": "ArrayTypeAnnotation", }, @@ -5386,7 +5386,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5403,7 +5403,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5420,7 +5420,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5437,7 +5437,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ImageSourcePrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5454,7 +5454,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5471,7 +5471,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5488,7 +5488,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5505,7 +5505,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5522,7 +5522,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5539,7 +5539,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5556,7 +5556,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5573,7 +5573,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "ColorPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5590,7 +5590,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5607,7 +5607,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5624,7 +5624,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5641,7 +5641,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "PointPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5658,7 +5658,7 @@ Object { "optional": false, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5675,7 +5675,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5692,7 +5692,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], @@ -5709,7 +5709,7 @@ Object { "optional": true, "typeAnnotation": Object { "name": "EdgeInsetsPrimitive", - "type": "NativePrimitiveTypeAnnotation", + "type": "ReservedPropTypeAnnotation", }, }, ], diff --git a/packages/react-native-codegen/src/parsers/flow/components/props.js b/packages/react-native-codegen/src/parsers/flow/components/props.js index 24e5889d4a3f56..9b549ac2337acd 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/props.js +++ b/packages/react-native-codegen/src/parsers/flow/components/props.js @@ -90,23 +90,23 @@ function getTypeAnnotationForArray(name, typeAnnotation, defaultValue, types) { switch (type) { case 'ImageSource': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }; case 'ColorValue': case 'ProcessedColorValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }; case 'PointValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }; case 'EdgeInsetsValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'EdgeInsetsPrimitive', }; case 'Stringish': @@ -214,31 +214,31 @@ function getTypeAnnotation( switch (type) { case 'ImageSource': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ImageSourcePrimitive', }; case 'ColorValue': case 'ProcessedColorValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }; case 'ColorArrayValue': return { type: 'ArrayTypeAnnotation', elementType: { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'ColorPrimitive', }, }; case 'PointValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'PointPrimitive', }; case 'EdgeInsetsValue': return { - type: 'NativePrimitiveTypeAnnotation', + type: 'ReservedPropTypeAnnotation', name: 'EdgeInsetsPrimitive', }; case 'Int32': From b8bfc50dd243f1a88946469441f1e020eba1a5f3 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 099/235] RN: Rename `{ => NativeModule}MethodTypeShape` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160791 fbshipit-source-id: 422d09243edda0660815eb2f0ce51f7e56134983 --- packages/react-native-codegen/src/CodegenSchema.js | 4 ++-- .../src/parsers/flow/modules/methods.js | 6 +++--- .../src/parsers/flow/modules/schema.js | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 6a8e7725ab2d67..54b6b1796cc27b 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -256,13 +256,13 @@ export type FunctionTypeAnnotation = $ReadOnly<{| optional: boolean, |}>; -export type MethodTypeShape = $ReadOnly<{| +export type NativeModuleMethodTypeShape = $ReadOnly<{| name: string, typeAnnotation: FunctionTypeAnnotation, |}>; export type NativeModuleShape = $ReadOnly<{| - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, |}>; export type EventTypeShape = $ReadOnly<{| diff --git a/packages/react-native-codegen/src/parsers/flow/modules/methods.js b/packages/react-native-codegen/src/parsers/flow/modules/methods.js index 79f0b413716e4a..e581b12a2c20e6 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/methods.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/methods.js @@ -11,7 +11,7 @@ 'use strict'; import type { - MethodTypeShape, + NativeModuleMethodTypeShape, FunctionTypeAnnotationParam, FunctionTypeAnnotationReturn, FunctionTypeAnnotationParamTypeAnnotation, @@ -401,7 +401,7 @@ function getReturnTypeAnnotation( function buildMethodSchema( property: MethodAST, types: TypeMap, -): MethodTypeShape { +): NativeModuleMethodTypeShape { const name: string = property.key.name; const value = getValueFromTypes(property.value, types); if (value.type !== 'FunctionTypeAnnotation') { @@ -432,7 +432,7 @@ function buildMethodSchema( function getMethods( typeDefinition: $ReadOnlyArray, types: TypeMap, -): $ReadOnlyArray { +): $ReadOnlyArray { return typeDefinition .filter(property => property.type === 'ObjectTypeProperty') .map(property => buildMethodSchema(property, types)) diff --git a/packages/react-native-codegen/src/parsers/flow/modules/schema.js b/packages/react-native-codegen/src/parsers/flow/modules/schema.js index c40c3c8b591693..b2da0d43dd99c9 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/schema.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/schema.js @@ -10,10 +10,13 @@ 'use strict'; -import type {SchemaType, MethodTypeShape} from '../../../CodegenSchema.js'; +import type { + SchemaType, + NativeModuleMethodTypeShape, +} from '../../../CodegenSchema.js'; export type NativeModuleSchemaBuilderConfig = $ReadOnly<{| - properties: $ReadOnlyArray, + properties: $ReadOnlyArray, |}>; function buildModuleSchema( From 064cb12fe01a828ecada55309f97c9061f38eca3 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 100/235] RN: Add `RootTag` Codegen Parser Test (and Cleanup) Summary: Adds a `RootTag` parser test for the new codegen for NativeModules/TurboModules. I'm doing this in a prerequisite commit in order to make the diff of the diff clearer when I implement proper support for `RootTag`. This also fixes some of the minor typos and mistakes that I noticed. I also wanted to land these benign snapshot changes independent of the upcoming behavior changes. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160792 fbshipit-source-id: 5f29f34035da30d7afa2369dbc19e95954553e88 --- .../modules/__test_fixtures__/fixtures.js | 41 ++- .../__snapshots__/module-parser-test.js.snap | 251 ++++++++++-------- 2 files changed, 176 insertions(+), 116 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js index 11d87b9835cc96..e15a2f823f8f0e 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/__test_fixtures__/fixtures.js @@ -132,7 +132,7 @@ export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); `; -const NATIVE_MODULE_WITH_WITH_ALIASES = ` +const NATIVE_MODULE_WITH_ALIASES = ` /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -159,14 +159,14 @@ export interface Spec extends TurboModule { // Exported methods. +getNumber: Num2; +getVoid: () => Void; - +getArray: (a : Array) => {| a: B |}; + +getArray: (a: Array) => {| a: B |}; } export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); `; -const NATIVE_MODULE_WITH_WITH_FLOAT_AND_INT32 = ` +const NATIVE_MODULE_WITH_FLOAT_AND_INT32 = ` /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -208,7 +208,31 @@ import type {TurboModule} from '../RCTExport'; import * as TurboModuleRegistry from '../TurboModuleRegistry'; export interface Spec extends TurboModule { - +getObject: (o : Object) => Object, + +getObject: (o: Object) => Object, +} + +export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); + +`; + +const NATIVE_MODULE_WITH_ROOT_TAG = ` +/** + * 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. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {RootTag, TurboModule} from '../RCTExport'; +import * as TurboModuleRegistry from '../TurboModuleRegistry'; + +export interface Spec extends TurboModule { + +getRootTag: (rootTag: RootTag) => RootTag, } export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); @@ -265,7 +289,7 @@ export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); `; -const NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEIFNED_IN_FILE_AS_PROPERTY = ` +const NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEFINED_IN_FILE_AS_PROPERTY = ` /** * Copyright (c) Facebook, Inc. and its affiliates. * @@ -431,14 +455,15 @@ export default TurboModuleRegistry.getEnforcing('SampleTurboModule'); `; module.exports = { - NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEIFNED_IN_FILE_AS_PROPERTY, + NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEFINED_IN_FILE_AS_PROPERTY, NATIVE_MODULE_WITH_ARRAY_WITH_UNION_AND_TOUPLE, - NATIVE_MODULE_WITH_WITH_FLOAT_AND_INT32, - NATIVE_MODULE_WITH_WITH_ALIASES, + NATIVE_MODULE_WITH_FLOAT_AND_INT32, + NATIVE_MODULE_WITH_ALIASES, NATIVE_MODULE_WITH_PROMISE, NATIVE_MODULE_WITH_COMPLEX_OBJECTS, NATIVE_MODULE_WITH_COMPLEX_OBJECTS_WITH_NULLABLE_KEY, NATIVE_MODULE_WITH_SIMPLE_OBJECT, + NATIVE_MODULE_WITH_ROOT_TAG, NATIVE_MODULE_WITH_NULLABLE_PARAM, NATIVE_MODULE_WITH_BASIC_ARRAY, NATIVE_MODULE_WITH_COMPLEX_ARRAY, diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap index 37673dd7c530f0..34dccd02d6339a 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap @@ -33,6 +33,85 @@ Object { } `; +exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ALIASES 1`] = ` +Object { + "modules": Object { + "NativeSampleTurboModule": Object { + "nativeModules": Object { + "SampleTurboModule": Object { + "properties": Array [ + Object { + "name": "getNumber", + "typeAnnotation": Object { + "optional": false, + "params": Array [ + Object { + "name": "arg", + "nullable": false, + "typeAnnotation": Object { + "type": "NumberTypeAnnotation", + }, + }, + ], + "returnTypeAnnotation": Object { + "nullable": false, + "type": "VoidTypeAnnotation", + }, + "type": "FunctionTypeAnnotation", + }, + }, + Object { + "name": "getVoid", + "typeAnnotation": Object { + "optional": false, + "params": Array [], + "returnTypeAnnotation": Object { + "nullable": false, + "type": "VoidTypeAnnotation", + }, + "type": "FunctionTypeAnnotation", + }, + }, + Object { + "name": "getArray", + "typeAnnotation": Object { + "optional": false, + "params": Array [ + Object { + "name": "a", + "nullable": false, + "typeAnnotation": Object { + "elementType": Object { + "type": "NumberTypeAnnotation", + }, + "type": "ArrayTypeAnnotation", + }, + }, + ], + "returnTypeAnnotation": Object { + "nullable": false, + "properties": Array [ + Object { + "name": "a", + "optional": false, + "typeAnnotation": Object { + "type": "NumberTypeAnnotation", + }, + }, + ], + "type": "ObjectTypeAnnotation", + }, + "type": "FunctionTypeAnnotation", + }, + }, + ], + }, + }, + }, + }, +} +`; + exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ARRAY_WITH_ALIAS 1`] = ` Object { "modules": Object { @@ -683,6 +762,61 @@ Object { } `; +exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_FLOAT_AND_INT32 1`] = ` +Object { + "modules": Object { + "NativeSampleTurboModule": Object { + "nativeModules": Object { + "SampleTurboModule": Object { + "properties": Array [ + Object { + "name": "getInt", + "typeAnnotation": Object { + "optional": false, + "params": Array [ + Object { + "name": "arg", + "nullable": false, + "typeAnnotation": Object { + "type": "Int32TypeAnnotation", + }, + }, + ], + "returnTypeAnnotation": Object { + "nullable": false, + "type": "Int32TypeAnnotation", + }, + "type": "FunctionTypeAnnotation", + }, + }, + Object { + "name": "getFloat", + "typeAnnotation": Object { + "optional": false, + "params": Array [ + Object { + "name": "arg", + "nullable": false, + "typeAnnotation": Object { + "type": "FloatTypeAnnotation", + }, + }, + ], + "returnTypeAnnotation": Object { + "nullable": false, + "type": "FloatTypeAnnotation", + }, + "type": "FunctionTypeAnnotation", + }, + }, + ], + }, + }, + }, + }, +} +`; + exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_NULLABLE_PARAM 1`] = ` Object { "modules": Object { @@ -718,7 +852,7 @@ Object { } `; -exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEIFNED_IN_FILE_AS_PROPERTY 1`] = ` +exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_OBJECT_WITH_OBJECT_DEFINED_IN_FILE_AS_PROPERTY 1`] = ` Object { "modules": Object { "NativeSampleTurboModule": Object { @@ -862,7 +996,7 @@ Object { } `; -exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_SIMPLE_OBJECT 1`] = ` +exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_ROOT_TAG 1`] = ` Object { "modules": Object { "NativeSampleTurboModule": Object { @@ -870,12 +1004,12 @@ Object { "SampleTurboModule": Object { "properties": Array [ Object { - "name": "getObject", + "name": "getRootTag", "typeAnnotation": Object { "optional": false, "params": Array [ Object { - "name": "o", + "name": "rootTag", "nullable": false, "typeAnnotation": Object { "type": "GenericObjectTypeAnnotation", @@ -897,86 +1031,7 @@ Object { } `; -exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_WITH_ALIASES 1`] = ` -Object { - "modules": Object { - "NativeSampleTurboModule": Object { - "nativeModules": Object { - "SampleTurboModule": Object { - "properties": Array [ - Object { - "name": "getNumber", - "typeAnnotation": Object { - "optional": false, - "params": Array [ - Object { - "name": "arg", - "nullable": false, - "typeAnnotation": Object { - "type": "NumberTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "getVoid", - "typeAnnotation": Object { - "optional": false, - "params": Array [], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "VoidTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "getArray", - "typeAnnotation": Object { - "optional": false, - "params": Array [ - Object { - "name": "a", - "nullable": false, - "typeAnnotation": Object { - "elementType": Object { - "type": "NumberTypeAnnotation", - }, - "type": "ArrayTypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "nullable": false, - "properties": Array [ - Object { - "name": "a", - "optional": false, - "typeAnnotation": Object { - "type": "NumberTypeAnnotation", - }, - }, - ], - "type": "ObjectTypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - ], - }, - }, - }, - }, -} -`; - -exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_WITH_FLOAT_AND_INT32 1`] = ` +exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_SIMPLE_OBJECT 1`] = ` Object { "modules": Object { "NativeSampleTurboModule": Object { @@ -984,41 +1039,21 @@ Object { "SampleTurboModule": Object { "properties": Array [ Object { - "name": "getInt", - "typeAnnotation": Object { - "optional": false, - "params": Array [ - Object { - "name": "arg", - "nullable": false, - "typeAnnotation": Object { - "type": "Int32TypeAnnotation", - }, - }, - ], - "returnTypeAnnotation": Object { - "nullable": false, - "type": "Int32TypeAnnotation", - }, - "type": "FunctionTypeAnnotation", - }, - }, - Object { - "name": "getFloat", + "name": "getObject", "typeAnnotation": Object { "optional": false, "params": Array [ Object { - "name": "arg", + "name": "o", "nullable": false, "typeAnnotation": Object { - "type": "FloatTypeAnnotation", + "type": "GenericObjectTypeAnnotation", }, }, ], "returnTypeAnnotation": Object { "nullable": false, - "type": "FloatTypeAnnotation", + "type": "GenericObjectTypeAnnotation", }, "type": "FunctionTypeAnnotation", }, From 310b0c3af57d67bdb018a092c523619afb6217bb Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 101/235] RN: Add `RootTag` to New NativeModule Codegen Summary: Adds support for `RootTag` in the new codegen for NativeModules/TurboModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160788 fbshipit-source-id: 952189f6e8bc8fde8b403d4c0e77b5d66b3f03e4 --- .../react-native-codegen/src/CodegenSchema.js | 15 ++++- .../generators/modules/GenerateModuleCpp.js | 26 ++++++--- .../src/generators/modules/GenerateModuleH.js | 26 ++++++--- .../modules/GenerateModuleHObjCpp.js | 55 ++++++++++++++----- .../generators/modules/GenerateModuleMm.js | 49 +++++++++-------- .../modules/ObjCppUtils/GenerateStructs.js | 18 ++++++ .../GenerateStructsForConstants.js | 16 ++++++ .../modules/__test_fixtures__/fixtures.js | 22 ++++++++ .../__test_fixtures__/structFixtures.js | 16 ++++++ .../GenerateModuleCpp-test.js.snap | 4 ++ .../GenerateModuleH-test.js.snap | 1 + .../GenerateModuleHObjCpp-test.js.snap | 1 + .../GenerateModuleMm-test.js.snap | 5 ++ .../GenerateStructs-test.js.snap | 11 ++++ .../__snapshots__/module-parser-test.js.snap | 6 +- .../src/parsers/flow/modules/methods.js | 20 +++++++ 16 files changed, 237 insertions(+), 54 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 54b6b1796cc27b..0352c48948bb73 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -200,6 +200,8 @@ export type PrimitiveTypeAnnotation = $ReadOnly<{| type: PrimitiveTypeAnnotationType, |}>; +export type ReservedFunctionValueTypeName = 'RootTag'; // Union with more custom types. + export type FunctionTypeAnnotationParamTypeAnnotation = | $ReadOnly<{| type: @@ -207,6 +209,10 @@ export type FunctionTypeAnnotationParamTypeAnnotation = | 'FunctionTypeAnnotation' | PrimitiveTypeAnnotationType, |}> + | $ReadOnly<{| + type: 'ReservedFunctionValueTypeAnnotation', + name: ReservedFunctionValueTypeName, + |}> | $ReadOnly<{| type: 'ArrayTypeAnnotation', elementType: ?FunctionTypeAnnotationParamTypeAnnotation, @@ -228,9 +234,14 @@ export type FunctionTypeAnnotationReturn = | $ReadOnly<{| nullable: boolean, type: - | PrimitiveTypeAnnotationType + | 'GenericPromiseTypeAnnotation' | 'VoidTypeAnnotation' - | 'GenericPromiseTypeAnnotation', + | PrimitiveTypeAnnotationType, + |}> + | $ReadOnly<{| + nullable: boolean, + type: 'ReservedFunctionValueTypeAnnotation', + name: ReservedFunctionValueTypeName, |}> | $ReadOnly<{| nullable: boolean, diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js index dd2eb05858f7e5..5acd433a04c64f 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleCpp.js @@ -66,8 +66,18 @@ function traverseArg(arg, index): string { function wrap(suffix) { return `args[${index}]${suffix}`; } - const type = arg.typeAnnotation.type; - switch (type) { + const {typeAnnotation} = arg; + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return wrap('.getNumber()'); + default: + (typeAnnotation.name: empty); + throw new Error( + `Unknown prop type for "${arg.name}, found: ${typeAnnotation.name}"`, + ); + } case 'StringTypeAnnotation': return wrap('.getString(rt)'); case 'BooleanTypeAnnotation': @@ -85,14 +95,16 @@ function traverseArg(arg, index): string { return wrap('.getObject(rt)'); case 'AnyTypeAnnotation': throw new Error(`Any type is not allowed in params for "${arg.name}"`); - default: - (type: empty); - throw new Error(`Unknown prop type for "${arg.name}, found: ${type}"`); + // TODO (T65847278): Figure out why this does not work. + // (typeAnnotation.type: empty); + throw new Error( + `Unknown prop type for "${arg.name}, found: ${typeAnnotation.type}"`, + ); } } -function traverseProprety(property): string { +function traverseProperty(property): string { const propertyTemplate = property.typeAnnotation.returnTypeAnnotation.type === 'VoidTypeAnnotation' ? voidPropertyTemplate @@ -127,7 +139,7 @@ module.exports = { .map(name => { const {properties} = nativeModules[name]; const traversedProperties = properties - .map(property => traverseProprety(property)) + .map(property => traverseProperty(property)) .join('\n'); return moduleTemplate .replace(/::_MODULE_PROPERTIES_::/g, traversedProperties) diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index afb1b9c2f747ad..a423127ee49f75 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -49,12 +49,20 @@ namespace react { `; function translatePrimitiveJSTypeToCpp( - type: + typeAnnotation: | FunctionTypeAnnotationParamTypeAnnotation | FunctionTypeAnnotationReturn, - error: string, + createErrorMessage: (typeName: string) => string, ) { - switch (type.type) { + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return 'double'; + default: + (typeAnnotation.name: empty); + throw new Error(createErrorMessage(typeAnnotation.name)); + } case 'VoidTypeAnnotation': return 'void'; case 'StringTypeAnnotation': @@ -75,11 +83,13 @@ function translatePrimitiveJSTypeToCpp( return 'jsi::Function'; case 'GenericPromiseTypeAnnotation': return 'jsi::Value'; - default: - throw new Error(error); + // TODO (T65847278): Figure out why this does not work. + // (typeAnnotation.type: empty); + throw new Error(createErrorMessage(typeAnnotation.type)); } } + const propertyTemplate = 'virtual ::_RETURN_VALUE_:: ::_PROPERTY_NAME_::(jsi::Runtime &rt::_ARGS_::) = 0;'; @@ -110,7 +120,8 @@ module.exports = { .map(param => { const translatedParam = translatePrimitiveJSTypeToCpp( param.typeAnnotation, - `Unspopported type for param "${param.name}" in ${prop.name}. Found: ${param.typeAnnotation.type}`, + typeName => + `Unsupported type for param "${param.name}" in ${prop.name}. Found: ${typeName}`, ); const isObject = translatedParam.startsWith('jsi::'); return ( @@ -126,7 +137,8 @@ module.exports = { '::_RETURN_VALUE_::', translatePrimitiveJSTypeToCpp( prop.typeAnnotation.returnTypeAnnotation, - `Unspopported return type for ${prop.name}. Found: ${prop.typeAnnotation.returnTypeAnnotation.type}`, + typeName => + `Unsupported return type for ${prop.name}. Found: ${typeName}`, ), ) .replace( diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js index 7a4fcce954de83..87e9367bae09dd 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js @@ -93,20 +93,30 @@ const constants = `- (facebook::react::ModuleConstants string, ) { + const {nullable, typeAnnotation} = param; + function wrapIntoNullableIfNeeded(generatedType: string) { - return param.nullable ? `${generatedType} _Nullable` : generatedType; + return nullable ? `${generatedType} _Nullable` : generatedType; } - switch (param.typeAnnotation.type) { + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return nullable ? 'NSNumber *' : 'double'; + default: + (typeAnnotation.name: empty); + throw new Error(createErrorMessage(typeAnnotation.name)); + } case 'StringTypeAnnotation': return wrapIntoNullableIfNeeded('NSString *'); case 'NumberTypeAnnotation': case 'FloatTypeAnnotation': case 'Int32TypeAnnotation': - return param.nullable ? 'NSNumber *' : 'double'; + return nullable ? 'NSNumber *' : 'double'; case 'BooleanTypeAnnotation': - return param.nullable ? 'NSNumber * _Nullable' : 'BOOL'; + return nullable ? 'NSNumber * _Nullable' : 'BOOL'; case 'GenericObjectTypeAnnotation': return wrapIntoNullableIfNeeded('NSDictionary *'); case 'ArrayTypeAnnotation': @@ -116,18 +126,30 @@ function translatePrimitiveJSTypeToObjCType( case 'ObjectTypeAnnotation': return wrapIntoNullableIfNeeded('NSDictionary *'); default: - throw new Error(error); + // TODO (T65847278): Figure out why this does not work. + // (typeAnnotation.type: empty); + throw new Error(createErrorMessage(typeAnnotation.type)); } } function translatePrimitiveJSTypeToObjCTypeForReturn( - type: FunctionTypeAnnotationReturn, - error: string, + typeAnnotation: FunctionTypeAnnotationReturn, + createErrorMessage: (typeName: string) => string, ) { function wrapIntoNullableIfNeeded(generatedType: string) { - return type.nullable ? `${generatedType} _Nullable` : generatedType; + return typeAnnotation.nullable + ? `${generatedType} _Nullable` + : generatedType; } - switch (type.type) { + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return wrapIntoNullableIfNeeded('NSNumber *'); + default: + (typeAnnotation.name: empty); + throw new Error(createErrorMessage(typeAnnotation.name)); + } case 'VoidTypeAnnotation': case 'GenericPromiseTypeAnnotation': return 'void'; @@ -138,7 +160,7 @@ function translatePrimitiveJSTypeToObjCTypeForReturn( case 'Int32TypeAnnotation': return wrapIntoNullableIfNeeded('NSNumber *'); case 'BooleanTypeAnnotation': - return type.nullable ? 'NSNumber * _Nullable' : 'BOOL'; + return typeAnnotation.nullable ? 'NSNumber * _Nullable' : 'BOOL'; case 'GenericObjectTypeAnnotation': return wrapIntoNullableIfNeeded('NSDictionary *'); case 'ArrayTypeAnnotation': @@ -146,9 +168,12 @@ function translatePrimitiveJSTypeToObjCTypeForReturn( case 'ObjectTypeAnnotation': return wrapIntoNullableIfNeeded('NSDictionary *'); default: - throw new Error(error); + // TODO (T65847278): Figure out why this does not work. + // (typeAnnotation.type: empty); + throw new Error(createErrorMessage(typeAnnotation.type)); } } + const methodImplementationTemplate = '- (::_RETURN_VALUE_::) ::_PROPERTY_NAME_::::_ARGS_::;'; @@ -201,7 +226,8 @@ module.exports = { } else { paramObjCType = translatePrimitiveJSTypeToObjCType( param, - `Unspopported type for param "${param.name}" in ${prop.name}. Found: ${param.typeAnnotation.type}`, + typeName => + `Unsupported type for param "${param.name}" in ${prop.name}. Found: ${typeName}`, ); } return `${i === 0 ? '' : param.name}:(${paramObjCType})${ @@ -230,7 +256,8 @@ module.exports = { '::_RETURN_VALUE_::', translatePrimitiveJSTypeToObjCTypeForReturn( returnTypeAnnotation, - `Unspopported return type for ${prop.name}. Found: ${prop.typeAnnotation.returnTypeAnnotation.type}`, + typeName => + `Unsupported return type for ${prop.name}. Found: ${typeName}`, ), ) .replace('::_ARGS_::', nativeArgs); diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js index 0edec3036e63c4..a0807282399c0f 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js @@ -71,8 +71,18 @@ namespace react { } // namespace facebook `; -function translateReturnTypeToKind(type): string { - switch (type) { +function translateReturnTypeToKind(typeAnnotation): string { + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return 'NumberKind'; + default: + (typeAnnotation.name: empty); + throw new Error( + `Invalid ReservedFunctionValueTypeName name, got ${typeAnnotation.name}`, + ); + } case 'VoidTypeAnnotation': return 'VoidKind'; case 'StringTypeAnnotation': @@ -92,23 +102,24 @@ function translateReturnTypeToKind(type): string { case 'ArrayTypeAnnotation': return 'ArrayKind'; default: - (type: empty); - throw new Error(`Unknown prop type for returning value, found: ${type}"`); + // TODO (T65847278): Figure out why this does not work. + // (typeAnnotation.type: empty); + throw new Error( + `Unknown prop type for returning value, found: ${typeAnnotation.type}"`, + ); } } -function tranlsateMethodForImplementation(property): string { +function translateMethodForImplementation(property): string { + const {returnTypeAnnotation} = property.typeAnnotation; + const numberOfParams = property.typeAnnotation.params.length + - (property.typeAnnotation.returnTypeAnnotation.type === - 'GenericPromiseTypeAnnotation' - ? 2 - : 0); + (returnTypeAnnotation.type === 'GenericPromiseTypeAnnotation' ? 2 : 0); const translatedArguments = property.typeAnnotation.params .map(param => param.name) .concat( - property.typeAnnotation.returnTypeAnnotation.type === - 'GenericPromiseTypeAnnotation' + returnTypeAnnotation.type === 'GenericPromiseTypeAnnotation' ? ['resolve', 'reject'] : [], ) @@ -117,20 +128,14 @@ function tranlsateMethodForImplementation(property): string { .concat(':'); if ( property.name === 'getConstants' && - property.typeAnnotation.returnTypeAnnotation.type === - 'ObjectTypeAnnotation' && - property.typeAnnotation.returnTypeAnnotation.properties && - property.typeAnnotation.returnTypeAnnotation.properties.length === 0 + returnTypeAnnotation.type === 'ObjectTypeAnnotation' && + returnTypeAnnotation.properties && + returnTypeAnnotation.properties.length === 0 ) { return ''; } return propertyTemplate - .replace( - /::_KIND_::/g, - translateReturnTypeToKind( - property.typeAnnotation.returnTypeAnnotation.type, - ), - ) + .replace(/::_KIND_::/g, translateReturnTypeToKind(returnTypeAnnotation)) .replace(/::_PROPERTY_NAME_::/g, property.name) .replace( /::_ARGS_::/g, @@ -220,7 +225,7 @@ module.exports = { .map(name => { const {properties} = nativeModules[name]; const translatedMethods = properties - .map(property => tranlsateMethodForImplementation(property)) + .map(property => translateMethodForImplementation(property)) .join('\n'); return moduleTemplate .replace(/::_TURBOMODULE_METHOD_INVOKERS_::/g, translatedMethods) diff --git a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js index 3c44ef81ec1ab5..ae924598b0ee1f 100644 --- a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js +++ b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js @@ -50,6 +50,14 @@ function getInlineMethodSignature( ): string { const {typeAnnotation} = property; switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return `double ${property.name}() const;`; + default: + (typeAnnotation.name: empty); + throw new Error(`Unknown prop type, found: ${typeAnnotation.name}"`); + } case 'StringTypeAnnotation': return `NSString *${property.name}() const;`; case 'NumberTypeAnnotation': @@ -79,6 +87,16 @@ function getInlineMethodImplementation( ): string { const {typeAnnotation} = property; switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return inlineTemplate + .replace(/::_RETURN_TYPE_::/, 'double ') + .replace(/::_RETURN_VALUE_::/, 'RCTBridgingToDouble(p)'); + default: + (typeAnnotation.name: empty); + throw new Error(`Unknown prop type, found: ${typeAnnotation.name}"`); + } case 'StringTypeAnnotation': return inlineTemplate .replace(/::_RETURN_TYPE_::/, 'NSString *') diff --git a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructsForConstants.js b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructsForConstants.js index a0098654c82d5d..adf71dff20d49f 100644 --- a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructsForConstants.js +++ b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructsForConstants.js @@ -63,6 +63,14 @@ function getBuilderInputFieldDeclaration( } const {typeAnnotation} = property; switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return markRequiredIfNecessary('double'); + default: + (typeAnnotation.name: empty); + throw new Error(`Unknown prop type, found: ${typeAnnotation.name}"`); + } case 'StringTypeAnnotation': if (property.optional) { return 'NSString *' + property.name + ';'; @@ -146,6 +154,14 @@ function unsafeGetter(name: string, optional: boolean) { function getObjectProperty(property: ObjectParamTypeAnnotation): string { const {typeAnnotation} = property; switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return numberGetter(property.name, property.optional); + default: + (typeAnnotation.name: empty); + throw new Error(`Unknown prop type, found: ${typeAnnotation.name}"`); + } case 'NumberTypeAnnotation': case 'FloatTypeAnnotation': case 'Int32TypeAnnotation': diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js index f13dae88bd50d5..25725ebaa42c26 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js @@ -183,6 +183,28 @@ const SIMPLE_NATIVE_MODULES: SchemaType = { optional: false, }, }, + { + name: 'getRootTag', + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + params: [ + { + nullable: false, + name: 'arg', + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + }, + ], + optional: false, + }, + }, { name: 'getValue', typeAnnotation: { diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/structFixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/structFixtures.js index 3386c4ce192c14..cbb6fb58ec04c7 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/structFixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/structFixtures.js @@ -99,6 +99,14 @@ const SIMPLE_STRUCT: $ReadOnlyArray< ], }, }, + { + optional: false, + name: 'k', + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + }, ], }, }, @@ -192,6 +200,14 @@ const SIMPLE_CONSTANTS: $ReadOnlyArray< ], }, }, + { + optional: false, + name: 'k', + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + }, ], }, }, diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap index dc3ddba143f078..f79507df8b3d3a 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap @@ -98,6 +98,9 @@ static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray(jsi: static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->getObject(rt, args[0].getObject(rt)); } +static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + return static_cast(&turboModule)->getRootTag(rt, args[0].getNumber()); +} static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { return static_cast(&turboModule)->getValue(rt, args[0].getNumber(), args[1].getString(rt), args[2].getObject(rt)); } @@ -119,6 +122,7 @@ NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared methodMap_[\\"getString\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getString}; methodMap_[\\"getArray\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getArray}; methodMap_[\\"getObject\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getObject}; + methodMap_[\\"getRootTag\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getRootTag}; methodMap_[\\"getValue\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValue}; methodMap_[\\"getValueWithCallback\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithCallback}; methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_getValueWithPromise}; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap index 9a6328bbf103a4..2fcc8834fa2372 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap @@ -93,6 +93,7 @@ virtual double getNumber(jsi::Runtime &rt, double arg) = 0; virtual jsi::String getString(jsi::Runtime &rt, const jsi::String &arg) = 0; virtual jsi::Array getArray(jsi::Runtime &rt, const jsi::Array &arg) = 0; virtual jsi::Object getObject(jsi::Runtime &rt, const jsi::Object &arg) = 0; +virtual double getRootTag(jsi::Runtime &rt, double arg) = 0; virtual jsi::Object getValue(jsi::Runtime &rt, double x, const jsi::String &y, const jsi::Object &z) = 0; virtual void getValueWithCallback(jsi::Runtime &rt, const jsi::Function &callback) = 0; virtual jsi::Value getValueWithPromise(jsi::Runtime &rt, bool error) = 0; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index f7fe456df26a5a..948c86afc4f0e8 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -298,6 +298,7 @@ inline JS::NativeSampleTurboModule::Constants::Builder::Builder(Constants i) : _ - (NSString *) getString:(NSString *)arg; - (NSArray> *) getArray:(NSArray *)arg; - (NSDictionary *) getObject:(NSDictionary *)arg; +- (NSNumber *) getRootTag:(double)arg; - (NSDictionary *) getValue:(double)x y:(NSString *)y z:(NSDictionary *)z; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap index 8093291ccbb3e9..7b9ffc955e1b8d 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap @@ -122,6 +122,10 @@ static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getObj return static_cast(turboModule) .invokeObjCMethod(rt, ObjectKind, \\"getObject\\", @selector(getObject:), args, count); } +static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, NumberKind, \\"getRootTag\\", @selector(getRootTag:), args, count); +} static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { return static_cast(turboModule) .invokeObjCMethod(rt, ObjectKind, \\"getValue\\", @selector(getValue:y:z:), args, count); @@ -144,6 +148,7 @@ NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboMo methodMap_[\\"getString\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getString}; methodMap_[\\"getArray\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getArray}; methodMap_[\\"getObject\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getObject}; + methodMap_[\\"getRootTag\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag}; methodMap_[\\"getValue\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleSpecJSI_getValue}; methodMap_[\\"getValueWithCallback\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback}; methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithPromise}; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateStructs-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateStructs-test.js.snap index 69ed01654183cb..75bb7bfe5dbde1 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateStructs-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateStructs-test.js.snap @@ -101,6 +101,7 @@ namespace JS { RCTRequired b; RCTRequired c; RCTRequired d; + RCTRequired k; }; /** Initialize with a set of values */ @@ -132,6 +133,8 @@ auto c = i.c.get(); d[@\\"c\\"] = c; auto d = i.d.get(); d[@\\"d\\"] = d.buildUnsafeRawValue(); +auto k = i.k.get(); + d[@\\"k\\"] = @(k); return d; }) {} inline JS::NativeSampleTurboModule::Constants::Builder::Builder(Constants i) : _factory(^{ @@ -188,6 +191,7 @@ namespace JS { double b() const; NSString *c() const; JS::NativeSampleTurboModule::SpecSampleFuncReturnTypeD d() const; + double k() const; SpecSampleFuncReturnType(NSDictionary *const v) : _v(v) {} private: @@ -228,6 +232,13 @@ inline JS::NativeSampleTurboModule::SpecSampleFuncReturnTypeD JS::NativeSampleTu } +inline double JS::NativeSampleTurboModule::SpecSampleFuncReturnType::k() const +{ + id const p = _v[@\\"k\\"]; + return RCTBridgingToDouble(p); +} + + inline bool JS::NativeSampleTurboModule::SpecSampleFuncReturnTypeD::e() const { id const p = _v[@\\"e\\"]; diff --git a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap index 34dccd02d6339a..ebfd9e4637b22d 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/modules/__tests__/__snapshots__/module-parser-test.js.snap @@ -1012,13 +1012,15 @@ Object { "name": "rootTag", "nullable": false, "typeAnnotation": Object { - "type": "GenericObjectTypeAnnotation", + "name": "RootTag", + "type": "ReservedFunctionValueTypeAnnotation", }, }, ], "returnTypeAnnotation": Object { + "name": "RootTag", "nullable": false, - "type": "GenericObjectTypeAnnotation", + "type": "ReservedFunctionValueTypeAnnotation", }, "type": "FunctionTypeAnnotation", }, diff --git a/packages/react-native-codegen/src/parsers/flow/modules/methods.js b/packages/react-native-codegen/src/parsers/flow/modules/methods.js index e581b12a2c20e6..7edb91ec1513e4 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/methods.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/methods.js @@ -67,6 +67,11 @@ function getElementTypeForArrayOrObject( : typeAnnotation.type; switch (type) { + case 'RootTag': + return { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }; case 'Array': case '$ReadOnlyArray': if ( @@ -168,6 +173,15 @@ function getTypeAnnotationForParam( : typeAnnotation.type; switch (type) { + case 'RootTag': + return { + name: paramName, + nullable, + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + }; case 'Array': case '$ReadOnlyArray': if ( @@ -300,6 +314,12 @@ function getReturnTypeAnnotation( : typeAnnotation.type; switch (type) { + case 'RootTag': + return { + nullable, + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }; case 'Promise': if ( typeAnnotation.typeParameters && From 4d9fa4b08ef624291a803ddc4631268600bcd67e Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 12:38:35 -0700 Subject: [PATCH 102/235] RN: Add `RootTag` to New Commands Codegen Summary: Adds support for `RootTag` in the new codegen for Native Component Commands. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21169371 fbshipit-source-id: 3b25433f3328e9c04cfe45bb176fc06d63559f14 --- .../react-native-codegen/src/CodegenSchema.js | 6 ++ .../components/GenerateComponentHObjCpp.js | 56 ++++++++++++++++--- .../components/GeneratePropsJavaDelegate.js | 16 +++++- .../components/GeneratePropsJavaInterface.js | 14 ++++- .../components/__test_fixtures__/fixtures.js | 16 ++++++ .../GenerateComponentHObjCpp-test.js.snap | 23 +++++++- .../GeneratePropsJavaDelegate-test.js.snap | 3 + .../GeneratePropsJavaInterface-test.js.snap | 1 + .../GenerateViewConfigJs-test.js.snap | 4 ++ .../components/__test_fixtures__/fixtures.js | 4 +- .../component-parser-test.js.snap | 16 ++++++ .../src/parsers/flow/components/commands.js | 6 ++ 12 files changed, 150 insertions(+), 15 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 0352c48948bb73..51d96416ff772e 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -21,12 +21,18 @@ export type CommandsFunctionTypeParamAnnotation = $ReadOnly<{| |}>; export type CommandsTypeAnnotation = + | ReservedFunctionValueTypeAnnotation | BooleanTypeAnnotation | Int32TypeAnnotation | DoubleTypeAnnotation | FloatTypeAnnotation | StringTypeAnnotation; +type ReservedFunctionValueTypeAnnotation = $ReadOnly<{| + type: 'ReservedFunctionValueTypeAnnotation', + name: ReservedFunctionValueTypeName, +|}>; + export type DoubleTypeAnnotation = $ReadOnly<{| type: 'DoubleTypeAnnotation', |}>; diff --git a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js index db66bacc553b41..6ecc358b3815f4 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js @@ -102,7 +102,17 @@ NS_ASSUME_NONNULL_END `.trim(); function getObjCParamType(param: CommandsFunctionTypeParamAnnotation): string { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return 'double'; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return 'BOOL'; case 'DoubleTypeAnnotation': @@ -114,7 +124,7 @@ function getObjCParamType(param: CommandsFunctionTypeParamAnnotation): string { case 'StringTypeAnnotation': return 'NSString *'; default: - (param.typeAnnotation.type: empty); + (typeAnnotation.type: empty); throw new Error('Received invalid param type annotation'); } } @@ -122,7 +132,17 @@ function getObjCParamType(param: CommandsFunctionTypeParamAnnotation): string { function getObjCExpectedKindParamType( param: CommandsFunctionTypeParamAnnotation, ): string { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return '[NSNumber class]'; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return '[NSNumber class]'; case 'DoubleTypeAnnotation': @@ -134,7 +154,7 @@ function getObjCExpectedKindParamType( case 'StringTypeAnnotation': return '[NSString class]'; default: - (param.typeAnnotation.type: empty); + (typeAnnotation.type: empty); throw new Error('Received invalid param type annotation'); } } @@ -142,7 +162,17 @@ function getObjCExpectedKindParamType( function getReadableExpectedKindParamType( param: CommandsFunctionTypeParamAnnotation, ): string { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return 'double'; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return 'boolean'; case 'DoubleTypeAnnotation': @@ -154,7 +184,7 @@ function getReadableExpectedKindParamType( case 'StringTypeAnnotation': return 'string'; default: - (param.typeAnnotation.type: empty); + (typeAnnotation.type: empty); throw new Error('Received invalid param type annotation'); } } @@ -163,7 +193,17 @@ function getObjCRightHandAssignmentParamType( param: CommandsFunctionTypeParamAnnotation, index: number, ): string { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return `[(NSNumber *)arg${index} doubleValue]`; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return `[(NSNumber *)arg${index} boolValue]`; case 'DoubleTypeAnnotation': @@ -175,7 +215,7 @@ function getObjCRightHandAssignmentParamType( case 'StringTypeAnnotation': return `(NSString *)arg${index}`; default: - (param.typeAnnotation.type: empty); + (typeAnnotation.type: empty); throw new Error('Received invalid param type annotation'); } } diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index afddadb910763a..17f587b0145327 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -153,7 +153,17 @@ function generatePropCasesString( } function getCommandArgJavaType(param, index) { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return `args.getDouble(${index})`; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return `args.getBoolean(${index})`; case 'DoubleTypeAnnotation': @@ -165,8 +175,8 @@ function getCommandArgJavaType(param, index) { case 'StringTypeAnnotation': return `args.getString(${index})`; default: - (param.typeAnnotation.type: empty); - throw new Error('Receieved invalid typeAnnotation'); + (typeAnnotation.type: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.type}`); } } diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js index ea8e4262b9d1b8..bf4f42bbfc891d 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js @@ -125,7 +125,17 @@ function generatePropsString(component: ComponentShape, imports) { } function getCommandArgJavaType(param) { - switch (param.typeAnnotation.type) { + const {typeAnnotation} = param; + + switch (typeAnnotation.type) { + case 'ReservedFunctionValueTypeAnnotation': + switch (typeAnnotation.name) { + case 'RootTag': + return 'double'; + default: + (typeAnnotation.name: empty); + throw new Error(`Receieved invalid type: ${typeAnnotation.name}`); + } case 'BooleanTypeAnnotation': return 'boolean'; case 'DoubleTypeAnnotation': @@ -137,7 +147,7 @@ function getCommandArgJavaType(param) { case 'StringTypeAnnotation': return 'String'; default: - (param.typeAnnotation.type: empty); + (typeAnnotation.type: empty); throw new Error('Receieved invalid typeAnnotation'); } } diff --git a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js index 9461acd92fd445..6f3bf1becb890d 100644 --- a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js @@ -1475,6 +1475,22 @@ const COMMANDS_AND_PROPS: SchemaType = { }, ], commands: [ + { + name: 'handleRootTag', + optional: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + params: [ + { + name: 'rootTag', + typeAnnotation: { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }, + }, + ], + }, + }, { name: 'hotspotUpdate', optional: false, diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap index 70dd19d5b9ed03..93b0a8b7f0ffe8 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap @@ -208,6 +208,7 @@ Map { NS_ASSUME_NONNULL_BEGIN @protocol RCTCommandNativeComponentViewProtocol +- (void)handleRootTag:(double)rootTag; - (void)hotspotUpdate:(NSInteger)x y:(NSInteger)y; @end @@ -216,7 +217,27 @@ RCT_EXTERN inline void RCTCommandNativeComponentHandleCommand( NSString const *commandName, NSArray const *args) { - if ([commandName isEqualToString:@\\"hotspotUpdate\\"]) { + if ([commandName isEqualToString:@\\"handleRootTag\\"]) { +#if RCT_DEBUG + if ([args count] != 1) { + RCTLogError(@\\"%@ command %@ received %d arguments, expected %d.\\", @\\"CommandNativeComponent\\", commandName, (int)[args count], 1); + return; + } +#endif + + NSObject *arg0 = args[0]; +#if RCT_DEBUG + if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @\\"double\\", @\\"CommandNativeComponent\\", commandName, @\\"1st\\")) { + return; + } +#endif + double rootTag = [(NSNumber *)arg0 doubleValue]; + + [componentView handleRootTag:rootTag]; + return; +} + +if ([commandName isEqualToString:@\\"hotspotUpdate\\"]) { #if RCT_DEBUG if ([args count] != 2) { RCTLogError(@\\"%@ command %@ received %d arguments, expected %d.\\", @\\"CommandNativeComponent\\", commandName, (int)[args count], 2); diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap index 27e4baf9895c93..6ae0cd6f4f22c8 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap @@ -266,6 +266,9 @@ public class CommandNativeComponentManagerDelegate viewManager, T view, String commandName, ReadableArray args) { switch (commandName) { + case \\"handleRootTag\\": + viewManager.handleRootTag(view, args.getDouble(0)); + break; case \\"hotspotUpdate\\": viewManager.hotspotUpdate(view, args.getInt(0), args.getInt(1)); break; diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap index 1f52c9c59a8a56..45873d75b224bc 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap @@ -145,6 +145,7 @@ import androidx.annotation.Nullable; public interface CommandNativeComponentManagerInterface { void setAccessibilityHint(T view, @Nullable String value); + void handleRootTag(T view, double rootTag); void hotspotUpdate(T view, int x, int y); } ", diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap index 6a1892f0aa755d..f7e1722e545a8e 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap @@ -227,6 +227,10 @@ export const __INTERNAL_VIEW_CONFIG = CommandNativeComponentViewConfig; export default nativeComponentName; export const Commands = { + handleRootTag(ref, rootTag) { + dispatchCommand(ref, \\"handleRootTag\\", [rootTag]); + }, + hotspotUpdate(ref, x, y) { dispatchCommand(ref, \\"hotspotUpdate\\", [x, y]); } diff --git a/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js index 5a6e24d43dc864..13e5131953358b 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js @@ -837,6 +837,7 @@ const codegenNativeCommands = require('codegenNativeCommands'); const codegenNativeComponent = require('codegenNativeComponent'); import type {Int32, Double, Float} from 'CodegenTypes'; +import type {RootTag} from 'RCTExport'; import type {ViewProps} from 'ViewPropTypes'; import type {HostComponent} from 'react-native'; @@ -849,6 +850,7 @@ export type ModuleProps = $ReadOnly<{| type NativeType = HostComponent; interface NativeCommands { + +handleRootTag: (viewRef: React.ElementRef, rootTag: RootTag) => void; +hotspotUpdate: (viewRef: React.ElementRef, x: Int32, y: Int32) => void; +scrollTo: ( viewRef: React.ElementRef, @@ -860,7 +862,7 @@ interface NativeCommands { } export const Commands = codegenNativeCommands({ - supportedCommands: ['hotspotUpdate', 'scrollTo'], + supportedCommands: ['handleRootTag', 'hotspotUpdate', 'scrollTo'], }); export default (codegenNativeComponent( diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap index bd0b3629a6f71b..8192bb77cdf40a 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap @@ -2336,6 +2336,22 @@ Object { "components": Object { "Module": Object { "commands": Array [ + Object { + "name": "handleRootTag", + "optional": false, + "typeAnnotation": Object { + "params": Array [ + Object { + "name": "rootTag", + "typeAnnotation": Object { + "name": "RootTag", + "type": "ReservedFunctionValueTypeAnnotation", + }, + }, + ], + "type": "FunctionTypeAnnotation", + }, + }, Object { "name": "hotspotUpdate", "optional": false, diff --git a/packages/react-native-codegen/src/parsers/flow/components/commands.js b/packages/react-native-codegen/src/parsers/flow/components/commands.js index 0232a82d1f4002..769039be7a074d 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/commands.js +++ b/packages/react-native-codegen/src/parsers/flow/components/commands.js @@ -47,6 +47,12 @@ function buildCommandSchema(property, types: TypeMap) { let returnType; switch (type) { + case 'RootTag': + returnType = { + type: 'ReservedFunctionValueTypeAnnotation', + name: 'RootTag', + }; + break; case 'BooleanTypeAnnotation': returnType = { type: 'BooleanTypeAnnotation', From a903d1b86ab56163abcdcb584f335949ba0c85fc Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Thu, 23 Apr 2020 14:07:25 -0700 Subject: [PATCH 103/235] BackHandler: specify function return type for handler (#28192) Summary: Following the comment https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42618#discussion_r384584159 Modify the flowtype of BackHandler function to have more specific return type. ## Changelog [General] [Changed] - Changed type of BackHandler to be more specific. Pull Request resolved: https://github.com/facebook/react-native/pull/28192 Test Plan: No flow error in RNTester Reviewed By: TheSavior Differential Revision: D20771113 Pulled By: hramos fbshipit-source-id: 5ca65e2a2b3f8726b8fb4606473d8fad5b0ce730 --- Libraries/Utilities/BackHandler.android.js | 8 ++++---- Libraries/Utilities/BackHandler.ios.js | 8 ++++---- Libraries/Utilities/__mocks__/BackHandler.js | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Libraries/Utilities/BackHandler.android.js b/Libraries/Utilities/BackHandler.android.js index e6e3d035295860..ed5bb00d96abf3 100644 --- a/Libraries/Utilities/BackHandler.android.js +++ b/Libraries/Utilities/BackHandler.android.js @@ -63,11 +63,11 @@ type TBackHandler = {| +exitApp: () => void, +addEventListener: ( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ) => {remove: () => void, ...}, +removeEventListener: ( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ) => void, |}; const BackHandler: TBackHandler = { @@ -87,7 +87,7 @@ const BackHandler: TBackHandler = { */ addEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): {remove: () => void, ...} { if (_backPressSubscriptions.indexOf(handler) === -1) { _backPressSubscriptions.push(handler); @@ -102,7 +102,7 @@ const BackHandler: TBackHandler = { */ removeEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): void { if (_backPressSubscriptions.indexOf(handler) !== -1) { _backPressSubscriptions.splice( diff --git a/Libraries/Utilities/BackHandler.ios.js b/Libraries/Utilities/BackHandler.ios.js index ff2f1c862e548f..f7ed0515f2d485 100644 --- a/Libraries/Utilities/BackHandler.ios.js +++ b/Libraries/Utilities/BackHandler.ios.js @@ -54,11 +54,11 @@ type TBackHandler = {| +exitApp: () => void, +addEventListener: ( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ) => {remove: () => void, ...}, +removeEventListener: ( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ) => void, |}; @@ -93,7 +93,7 @@ if (Platform.isTV) { addEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): {remove: () => void, ...} { _backPressSubscriptions.add(handler); return { @@ -103,7 +103,7 @@ if (Platform.isTV) { removeEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): void { _backPressSubscriptions.delete(handler); }, diff --git a/Libraries/Utilities/__mocks__/BackHandler.js b/Libraries/Utilities/__mocks__/BackHandler.js index 8422b05057c6e5..b90bf09d870fba 100644 --- a/Libraries/Utilities/__mocks__/BackHandler.js +++ b/Libraries/Utilities/__mocks__/BackHandler.js @@ -16,7 +16,7 @@ const BackHandler = { addEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): {remove: () => void} { _backPressSubscriptions.add(handler); return { @@ -26,7 +26,7 @@ const BackHandler = { removeEventListener: function( eventName: BackPressEventName, - handler: Function, + handler: () => ?boolean, ): void { _backPressSubscriptions.delete(handler); }, From 78b1c8574707304150089dd960d57a20f9277b8c Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 23 Apr 2020 14:58:11 -0700 Subject: [PATCH 104/235] Fabric: Simplifying Yoga and Fabric integration Summary: The integration with Yoga was pretty complex from day one. The first attempt to make it simpler was in D19963353 when we removed a bunch of layers of indirection. This is the second iteration that aimed to simplify the structure of methods and their responsibilities. The only conceptual change (that I am aware of) in this diff is that now we don't support (imaginary) case where a non-leaf YogaLayoutableShadowNode can have a non-YogaLayoutableShadowNode child. In the previous version, it was a no-op, now it's not supported and an assert will fire. Alongside with refactoring, this diff implements several helper functions that verify the invariants important for the Concurrent Layout in debug mode. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21198222 fbshipit-source-id: cc085904948056f861562af5bd2571de45a743b9 --- .../view/yoga/YogaLayoutableShadowNode.cpp | 239 +++++++++++++----- .../view/yoga/YogaLayoutableShadowNode.h | 25 +- 2 files changed, 194 insertions(+), 70 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index f625e1467869b3..04c48fda480595 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -58,6 +58,8 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode( updateYogaProps(); updateYogaChildren(); + + ensureConsistency(); } YogaLayoutableShadowNode::YogaLayoutableShadowNode( @@ -84,6 +86,8 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode( if (fragment.children) { updateYogaChildren(); } + + ensureConsistency(); } void YogaLayoutableShadowNode::cleanLayout() { @@ -115,51 +119,108 @@ void YogaLayoutableShadowNode::enableMeasurement() { YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector); } -void YogaLayoutableShadowNode::appendChild(ShadowNode::Shared const &child) { +void YogaLayoutableShadowNode::appendYogaChild(ShadowNode const &childNode) { + // The caller must check this before calling this method. + assert(!getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode)); + + ensureYogaChildrenLookFine(); + + auto &layoutableChildNode = + traitCast(childNode); + yogaNode_.insertChild( + &layoutableChildNode.yogaNode_, yogaNode_.getChildren().size()); + + ensureYogaChildrenLookFine(); +} + +void YogaLayoutableShadowNode::adoptYogaChild(size_t index) { ensureUnsealed(); + ensureYogaChildrenLookFine(); + + // The caller must check this before calling this method. + assert(!getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode)); + + auto &children = getChildren(); + + // Overflow checks. + assert(children.size() > index); + assert(children.size() >= yogaNode_.getChildren().size()); + + auto &childNode = *children.at(index); + + auto &layoutableChildNode = + traitCast(childNode); + + // Note, the following (commented out) assert is conceptually valid but still + // might produce false-positive signals because of the ABA problem (different + // objects with non-interleaving life-times being allocated on the same + // address). assert(layoutableChildNode.yogaNode_.getOwner() != &yogaNode_); + + if (layoutableChildNode.yogaNode_.getOwner() == nullptr) { + // The child node is not owned. + layoutableChildNode.yogaNode_.setOwner(&yogaNode_); + // At this point the child yoga node must be already inserted by the caller. + // assert(layoutableChildNode.yogaNode_.isDirty()); + } else { + // The child is owned by some other node, we need to clone that. + auto clonedChildNode = childNode.clone({}); + auto &layoutableClonedChildNode = + traitCast(*clonedChildNode); + + // The owner must be nullptr for a newly cloned node. + assert(layoutableClonedChildNode.yogaNode_.getOwner() == nullptr); + + // Establishing ownership. + layoutableClonedChildNode.yogaNode_.setOwner(&yogaNode_); - LayoutableShadowNode::appendChild(child); + // Replace the child node with a newly cloned one in the children list. + replaceChild(childNode, clonedChildNode, index); - auto yogaLayoutableChild = - traitCast(child.get()); - if (yogaLayoutableChild) { - appendChildYogaNode(*yogaLayoutableChild); + // Replace the Yoga node inside the Yoga node children list. + yogaNode_.replaceChild(&layoutableClonedChildNode.yogaNode_, index); } -} -bool YogaLayoutableShadowNode::doesOwn( - YogaLayoutableShadowNode const &child) const { - return child.yogaNode_.getOwner() == &yogaNode_; + ensureYogaChildrenLookFine(); } -void YogaLayoutableShadowNode::appendChildYogaNode( - YogaLayoutableShadowNode const &child) { +void YogaLayoutableShadowNode::appendChild( + ShadowNode::Shared const &childNode) { ensureUnsealed(); + ensureConsistency(); + + // Calling the base class (`ShadowNode`) mehtod. + LayoutableShadowNode::appendChild(childNode); if (getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode)) { - // This node is a declared leaf, therefore we must not add the Yoga node as - // a child. + // This node is a declared leaf. return; } - auto yogaNodeRawPtr = &yogaNode_; - auto childYogaNodeRawPtr = &child.yogaNode_; - auto childNodePtr = const_cast(&child); + // Here we don't have information about the previous structure of the node (if + // it that existed before), so we don't have anything to compare the Yoga node + // with (like a previous version of this node). Therefore we must dirty the + // node. + yogaNode_.setDirty(true); - if (childYogaNodeRawPtr->getOwner() != nullptr) { - childNodePtr = - &cloneAndReplaceChild(*childNodePtr, yogaNode_.getChildren().size()); - childYogaNodeRawPtr = &childNodePtr->yogaNode_; - } + // All children of a non-leaf `YogaLayoutableShadowNode` must be a + // `YogaLayoutableShadowNode`s. + assert(traitCast(childNode.get())); - // Inserted node must have a clear owner (must not be shared). - assert(childYogaNodeRawPtr->getOwner() == nullptr); + // Appending the Yoga node. + appendYogaChild(*childNode); - childNodePtr->ensureUnsealed(); - childYogaNodeRawPtr->setOwner(yogaNodeRawPtr); + ensureYogaChildrenLookFine(); + ensureYogaChildrenAlighment(); - yogaNodeRawPtr->insertChild( - childYogaNodeRawPtr, yogaNodeRawPtr->getChildren().size()); + // Adopting the Yoga node. + adoptYogaChild(getChildren().size() - 1); + + ensureConsistency(); +} + +bool YogaLayoutableShadowNode::doesOwn( + YogaLayoutableShadowNode const &child) const { + return child.yogaNode_.getOwner() == &yogaNode_; } void YogaLayoutableShadowNode::updateYogaChildren() { @@ -169,37 +230,29 @@ void YogaLayoutableShadowNode::updateYogaChildren() { ensureUnsealed(); - auto &children = getChildren(); - - // Optimization: - // If the new list of child nodes consists of clean nodes, and if their styles - // are identical to styles of old children, we don't dirty the node. - bool isClean = - !yogaNode_.isDirty() && children.size() == yogaNode_.getChildren().size(); - auto oldChildren = isClean ? yogaNode_.getChildren() : YGVector{}; + bool isClean = !yogaNode_.isDirty() && + getChildren().size() == yogaNode_.getChildren().size(); + auto oldYogaChildren = isClean ? yogaNode_.getChildren() : YGVector{}; yogaNode_.setChildren({}); - // We might undo this later at the end of the method if we can infer that - // dirting is not necessary here. - yogaNode_.setDirty(true); + for (size_t i = 0; i < getChildren().size(); i++) { + appendYogaChild(*getChildren().at(i)); + adoptYogaChild(i); - auto i = int{0}; - for (auto const &child : children) { - auto yogaLayoutableChild = - traitCast(child.get()); + if (isClean) { + auto &oldYogaChildNode = *oldYogaChildren[i]; + auto &newYogaChildNode = + traitCast(*getChildren().at(i)) + .yogaNode_; - if (!yogaLayoutableChild) { - continue; + isClean = isClean && !newYogaChildNode.isDirty() && + (newYogaChildNode.getStyle() == oldYogaChildNode.getStyle()); } - - appendChildYogaNode(*yogaLayoutableChild); - - isClean = isClean && !yogaLayoutableChild->yogaNode_.isDirty() && - yogaLayoutableChild->yogaNode_.getStyle() == - oldChildren[i++]->getStyle(); } + assert(getChildren().size() == yogaNode_.getChildren().size()); + yogaNode_.setDirty(!isClean); } @@ -320,16 +373,6 @@ void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { } } -YogaLayoutableShadowNode &YogaLayoutableShadowNode::cloneAndReplaceChild( - YogaLayoutableShadowNode &child, - int suggestedIndex) { - auto clonedChildShadowNode = child.clone({}); - replaceChild(child, clonedChildShadowNode, suggestedIndex); - auto &node = static_cast(*clonedChildShadowNode); - node.yogaNode_.setDirty(true); - return node; -} - #pragma mark - Yoga Connectors YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector( @@ -344,8 +387,10 @@ YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector( static_cast(parentYogaNode->getContext()); auto oldNode = static_cast(oldYogaNode->getContext()); - auto clonedNode = &parentNode->cloneAndReplaceChild(*oldNode, childIndex); - return &clonedNode->yogaNode_; + + auto clonedNode = oldNode->clone({}); + parentNode->replaceChild(*oldNode, clonedNode, childIndex); + return &static_cast(*clonedNode).yogaNode_; } YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector( @@ -538,5 +583,73 @@ void YogaLayoutableShadowNode::swapLeftAndRightInViewProps( } } +#pragma mark - Consistency Ensuring Helpers + +void YogaLayoutableShadowNode::ensureConsistency() const { + ensureYogaChildrenLookFine(); + ensureYogaChildrenAlighment(); + ensureYogaChildrenOwnersConsistency(); +} + +void YogaLayoutableShadowNode::ensureYogaChildrenOwnersConsistency() const { +#ifndef NDEBUG + // Checking that all Yoga node children have the same `owner`. + // The owner might be not equal to the `yogaNode_` though. + auto &yogaChildren = yogaNode_.getChildren(); + + if (yogaChildren.size() > 0) { + auto owner = yogaChildren.at(0)->getOwner(); + for (auto const &child : yogaChildren) { + assert(child->getOwner() == owner); + } + } +#endif +} + +void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const { +#ifndef NDEBUG + // Checking that the shapes of Yoga node children object look fine. + // This is the only heuristic that might produce false-positive results + // (really broken dangled nodes might look fine). This is useful as an early + // signal that something went wrong. + auto &yogaChildren = yogaNode_.getChildren(); + + for (auto const &yogaChild : yogaChildren) { + assert(yogaChild->getContext()); + assert(yogaChild->getChildren().size() < 16384); + if (yogaChild->getChildren().size() > 0) { + assert(!yogaChild->hasMeasureFunc()); + } + } +#endif +} + +void YogaLayoutableShadowNode::ensureYogaChildrenAlighment() const { +#ifndef NDEBUG + // If the node is not a leaf node, checking that: + // - All children are `YogaLayoutableShadowNode` subclasses. + // - All Yoga children are owned/connected to corresponding children of + // this node. + + auto &yogaChildren = yogaNode_.getChildren(); + auto &children = getChildren(); + + if (getTraits().check(ShadowNodeTraits::Trait::LeafYogaNode)) { + assert(yogaChildren.size() == 0); + return; + } + + assert(yogaChildren.size() == children.size()); + + for (size_t i = 0; i < children.size(); i++) { + auto &yogaChild = yogaChildren.at(i); + auto &child = children.at(i); + assert( + yogaChild->getContext() == + traitCast(child.get())); + } +#endif +} + } // namespace react } // namespace facebook diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.h b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.h index 0ee5dc091a68a5..e9ea29cd477e87 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.h +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.h @@ -107,15 +107,17 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode { bool doesOwn(YogaLayoutableShadowNode const &child) const; /* - * Appends `child`'s Yoga node to the own Yoga node. - * Complements `ShadowNode::appendChild(...)` functionality from Yoga - * perspective. + * Appends a Yoga node to the Yoga node associated with this node. + * The method does *not* do anything besides that (no cloning or `owner` field + * adjustment). */ - void appendChildYogaNode(YogaLayoutableShadowNode const &child); + void appendYogaChild(ShadowNode const &childNode); - YogaLayoutableShadowNode &cloneAndReplaceChild( - YogaLayoutableShadowNode &child, - int suggestedIndex); + /* + * Makes the child node with a given `index` (and Yoga node associated with) a + * valid child node satisfied requirements of the Concurrent Layout approach. + */ + void adoptYogaChild(size_t index); static YGConfig &initializeYogaConfig(YGConfig &config); static YGNode *yogaNodeCloneCallbackConnector( @@ -129,6 +131,8 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode { float height, YGMeasureMode heightMode); +#pragma mark - RTL Legacy Autoflip + /* * Walks though shadow node hierarchy and reassign following values: * - (left|right) → (start|end) @@ -160,6 +164,13 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode { */ static void swapLeftAndRightInYogaStyleProps( YogaLayoutableShadowNode const &shadowNode); + +#pragma mark - Consistency Ensuring Helpers + + void ensureConsistency() const; + void ensureYogaChildrenAlighment() const; + void ensureYogaChildrenOwnersConsistency() const; + void ensureYogaChildrenLookFine() const; }; template <> From 17adf549e2d4678b25356764e3222cd72956912a Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 23 Apr 2020 15:36:20 -0700 Subject: [PATCH 105/235] Clean up comments about null state wrappers Summary: Updating state with a null wrapper is neither desirable, nor possible. The underlying task was closed, just cleaning up comments. Changelog: [Internal] comments only Reviewed By: mdvacca Differential Revision: D21186545 fbshipit-source-id: d14ddd59d42e8fd91c6e7fd50037311d4e8d0b60 --- .../com/facebook/react/views/modal/ReactModalHostManager.java | 1 - .../java/com/facebook/react/views/text/ReactTextViewManager.java | 1 - 2 files changed, 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java index e9a8f66c3b847e..ac0cffd04979fa 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java @@ -140,7 +140,6 @@ protected void onAfterUpdateTransaction(ReactModalHostView view) { @Override public Object updateState( ReactModalHostView view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) { - // TODO T55794595: Add support for updating state with null stateWrapper Point modalSize = ModalHostHelper.getModalHostSize(view.getContext()); view.updateState(stateWrapper, modalSize.x, modalSize.y); return null; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java index 599ab79e666dd8..c3e248bc33b309 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java @@ -83,7 +83,6 @@ public boolean needsCustomLayoutForChildren() { @Override public Object updateState( ReactTextView view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) { - // TODO T55794595: Add support for updating state with null stateWrapper ReadableNativeMap state = stateWrapper.getState(); ReadableMap attributedString = state.getMap("attributedString"); ReadableMap paragraphAttributes = state.getMap("paragraphAttributes"); From bda8aaeec204f355607693885a193d269846fe59 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 23 Apr 2020 15:36:20 -0700 Subject: [PATCH 106/235] Modal: disable view flattening explicitly for the children of Modal, the content wrappers Summary: I noticed that in ModalHostShadowNode.java (not used in Fabric), there's an assumption that the Modal will have exactly one child on the native side; this child is explicitly specified in Modal.js. However, in Fabric, these views are flattened and so the Modal will actually have N children - whatever children the product code passes into the Modal. In *theory* this should be fine, but might be causing issues. Not sure. This is an experiment and shouldn't be landed until we verify that (1) this actually matters, (2) that it fixes an issue with Modal on iOS or Android. Changelog: [Internal] Change to make Fabric consistent with non-Fabric Modal Reviewed By: mdvacca Differential Revision: D21191822 fbshipit-source-id: 9d65f346387fd056649d4063d70220f637ba8828 --- Libraries/Modal/Modal.js | 2 +- Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index ba842b1746431a..17885714dd0340 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -237,7 +237,7 @@ class Modal extends React.Component { supportedOrientations={this.props.supportedOrientations} onOrientationChange={this.props.onOrientationChange}> - + {innerChildren} diff --git a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap index 8c49d6f4aa0821..807bc29ca552b9 100644 --- a/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap +++ b/Libraries/Modal/__tests__/__snapshots__/Modal-test.js.snap @@ -23,6 +23,7 @@ exports[` should render as when not mocked 1`] = ` } > Date: Thu, 23 Apr 2020 15:36:20 -0700 Subject: [PATCH 107/235] Support `contentOffset` property in Android's ScrollView and HorizontalScrollView Summary: For a very long time, iOS has supported the `contentOffset` property but Android has not: https://github.com/facebook/react-native/issues/6849 This property can be used, primarily, to autoscroll the ScrollView to a starting position when it is first rendered, to avoid "jumps" that occur by asynchronously scrolling to a start position. Changelog: [Android][Changed] ScrollView now supports `contentOffset` Reviewed By: mdvacca Differential Revision: D21198236 fbshipit-source-id: 2b0773569ba42120cb1fcf0f3847ca98af2285e7 --- ...roidHorizontalScrollViewNativeComponent.js | 1 + .../scroll/ReactHorizontalScrollView.java | 32 ++++++++++++++++++- .../ReactHorizontalScrollViewManager.java | 8 +++++ .../react/views/scroll/ReactScrollView.java | 32 ++++++++++++++++++- 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js index 22da77e56f1478..2fed508a35adf6 100644 --- a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +++ b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js @@ -37,6 +37,7 @@ const AndroidHorizontalScrollViewViewConfig = { snapToInterval: true, snapToStart: true, snapToOffsets: true, + contentOffset: true, }, }; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index 0dee6f7c8e9d03..c905c5dc9a4f37 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -50,6 +50,8 @@ public class ReactHorizontalScrollView extends HorizontalScrollView private static final String CONTENT_OFFSET_LEFT = "contentOffsetLeft"; private static final String CONTENT_OFFSET_TOP = "contentOffsetTop"; + private static final int UNSET_CONTENT_OFFSET = -1; + private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper(); private final @Nullable OverScroller mScroller; private final VelocityHelper mVelocityHelper = new VelocityHelper(); @@ -76,6 +78,8 @@ public class ReactHorizontalScrollView extends HorizontalScrollView private boolean mSnapToEnd = true; private ReactViewBackgroundManager mReactBackgroundManager; private boolean mPagedArrowScrolling = false; + private int pendingContentOffsetX = UNSET_CONTENT_OFFSET; + private int pendingContentOffsetY = UNSET_CONTENT_OFFSET; private @Nullable StateWrapper mStateWrapper; private final Rect mTempRect = new Rect(); @@ -224,7 +228,13 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { // Call with the present values in order to re-layout if necessary - reactScrollTo(getScrollX(), getScrollY()); + // If a "pending" value has been set, we restore that value. + // That value gets cleared by reactScrollTo. + int scrollToX = + pendingContentOffsetX != UNSET_CONTENT_OFFSET ? pendingContentOffsetX : getScrollX(); + int scrollToY = + pendingContentOffsetY != UNSET_CONTENT_OFFSET ? pendingContentOffsetY : getScrollY(); + reactScrollTo(scrollToX, scrollToY); } /** @@ -906,6 +916,7 @@ public void setBorderStyle(@Nullable String style) { public void reactSmoothScrollTo(int x, int y) { smoothScrollTo(x, y); updateStateOnScroll(x, y); + setPendingContentOffsets(x, y); } /** @@ -917,6 +928,25 @@ public void reactSmoothScrollTo(int x, int y) { public void reactScrollTo(int x, int y) { scrollTo(x, y); updateStateOnScroll(x, y); + setPendingContentOffsets(x, y); + } + + /** + * If contentOffset is set before the View has been laid out, store the values and set them when + * `onLayout` is called. + * + * @param x + * @param y + */ + private void setPendingContentOffsets(int x, int y) { + View child = getChildAt(0); + if (child != null && child.getWidth() != 0 && child.getHeight() != 0) { + pendingContentOffsetX = UNSET_CONTENT_OFFSET; + pendingContentOffsetY = UNSET_CONTENT_OFFSET; + } else { + pendingContentOffsetX = x; + pendingContentOffsetY = y; + } } public void updateState(@Nullable StateWrapper stateWrapper) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java index b7712b3d65387a..8c2b91637ae1fa 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java @@ -12,6 +12,7 @@ import androidx.annotation.Nullable; import androidx.core.view.ViewCompat; import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.uimanager.DisplayMetricsHolder; import com.facebook.react.uimanager.PixelUtil; @@ -299,4 +300,11 @@ public void setFadingEdgeLength(ReactHorizontalScrollView view, int value) { view.setFadingEdgeLength(0); } } + + @ReactProp(name = "contentOffset") + public void setContentOffset(ReactHorizontalScrollView view, ReadableMap value) { + double x = value.getDouble("x"); + double y = value.getDouble("y"); + view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); + } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index 6bd0be836203e1..f0d4e99658553a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -55,6 +55,8 @@ public class ReactScrollView extends ScrollView private static final String CONTENT_OFFSET_LEFT = "contentOffsetLeft"; private static final String CONTENT_OFFSET_TOP = "contentOffsetTop"; + private static final int UNSET_CONTENT_OFFSET = -1; + private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper(); private final @Nullable OverScroller mScroller; private final VelocityHelper mVelocityHelper = new VelocityHelper(); @@ -81,6 +83,8 @@ public class ReactScrollView extends ScrollView private boolean mSnapToEnd = true; private View mContentView; private ReactViewBackgroundManager mReactBackgroundManager; + private int pendingContentOffsetX = UNSET_CONTENT_OFFSET; + private int pendingContentOffsetY = UNSET_CONTENT_OFFSET; private @Nullable StateWrapper mStateWrapper; public ReactScrollView(ReactContext context) { @@ -200,7 +204,13 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { // Call with the present values in order to re-layout if necessary - reactScrollTo(getScrollX(), getScrollY()); + // If a "pending" value has been set, we restore that value. + // That value gets cleared by reactScrollTo. + int scrollToX = + pendingContentOffsetX != UNSET_CONTENT_OFFSET ? pendingContentOffsetX : getScrollX(); + int scrollToY = + pendingContentOffsetY != UNSET_CONTENT_OFFSET ? pendingContentOffsetY : getScrollY(); + reactScrollTo(scrollToX, scrollToY); } @Override @@ -777,6 +787,7 @@ public void onChildViewRemoved(View parent, View child) { public void reactSmoothScrollTo(int x, int y) { smoothScrollTo(x, y); updateStateOnScroll(x, y); + setPendingContentOffsets(x, y); } /** @@ -788,6 +799,25 @@ public void reactSmoothScrollTo(int x, int y) { public void reactScrollTo(int x, int y) { scrollTo(x, y); updateStateOnScroll(x, y); + setPendingContentOffsets(x, y); + } + + /** + * If contentOffset is set before the View has been laid out, store the values and set them when + * `onLayout` is called. + * + * @param x + * @param y + */ + private void setPendingContentOffsets(int x, int y) { + View child = getChildAt(0); + if (child != null && child.getWidth() != 0 && child.getHeight() != 0) { + pendingContentOffsetX = UNSET_CONTENT_OFFSET; + pendingContentOffsetY = UNSET_CONTENT_OFFSET; + } else { + pendingContentOffsetX = x; + pendingContentOffsetY = y; + } } /** From 025be8148a9abc533a8ae108e49cfd3f4512c581 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 23 Apr 2020 19:09:12 -0700 Subject: [PATCH 108/235] RN: Fix Text Layout Ignoring Parent Bounds Summary: Fixes text layout so that the parent bounds are correctly respected. This fixes two bugs: - **Parent width is not respected.** This was caused by the recent change to shrink-wrap text layout. - **Parent height is not respected.** This has always been a bug. After this change, Android will behave like iOS. Changelog: [Android] [Fixed] - Text layout no longer ignores parent bounds Reviewed By: mdvacca Differential Revision: D21199030 fbshipit-source-id: cc072bdcff64167db1f79b7bf965e57a7396cdf4 --- .../react/views/text/ReactTextShadowNode.java | 25 ++++++++++++--- .../react/views/text/TextLayoutManager.java | 31 ++++++++++++++----- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index b9fc8e75a255c4..ac84caae1e07d9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -130,14 +130,29 @@ public long measure( // Instead of using `layout.getWidth()` (which may yield a significantly larger width for // text that is wrapping), compute width using the longest line. float layoutWidth = 0; - for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); - if (lineWidth > layoutWidth) { - layoutWidth = lineWidth; + if (widthMode == YogaMeasureMode.EXACTLY) { + layoutWidth = width; + } else { + for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { + float lineWidth = layout.getLineWidth(lineIndex); + if (lineWidth > layoutWidth) { + layoutWidth = lineWidth; + } + } + if (widthMode == YogaMeasureMode.AT_MOST && layoutWidth > width) { + layoutWidth = width; + } + } + + float layoutHeight = height; + if (heightMode != YogaMeasureMode.EXACTLY) { + layoutHeight = layout.getLineBottom(lineCount - 1); + if (heightMode == YogaMeasureMode.AT_MOST && layoutHeight > height) { + layoutHeight = height; } } - return YogaMeasureOutput.make(layoutWidth, layout.getLineBottom(lineCount - 1)); + return YogaMeasureOutput.make(layoutWidth, layoutHeight); } }; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 2213ec612823e0..bf5849bbe4a94f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -311,14 +311,28 @@ public static long measureText( ? layout.getLineCount() : Math.min(maximumNumberOfLines, layout.getLineCount()); - int calculatedHeight = layout.getLineBottom(calculatedLineCount - 1); // Instead of using `layout.getWidth()` (which may yield a significantly larger width for // text that is wrapping), compute width using the longest line. - int calculatedWidth = 0; - for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); - if (lineWidth > calculatedWidth) { - calculatedWidth = (int) Math.ceil(lineWidth); + float calculatedWidth = 0; + if (widthYogaMeasureMode == YogaMeasureMode.EXACTLY) { + calculatedWidth = width; + } else { + for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { + float lineWidth = layout.getLineWidth(lineIndex); + if (lineWidth > calculatedWidth) { + calculatedWidth = lineWidth; + } + } + if (widthYogaMeasureMode == YogaMeasureMode.AT_MOST && calculatedWidth > width) { + calculatedWidth = width; + } + } + + float calculatedHeight = height; + if (heightYogaMeasureMode != YogaMeasureMode.EXACTLY) { + calculatedHeight = layout.getLineBottom(calculatedLineCount - 1); + if (heightYogaMeasureMode == YogaMeasureMode.AT_MOST && calculatedHeight > height) { + calculatedHeight = height; } } @@ -356,7 +370,7 @@ public static long measureText( isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - (int) layout.getLineWidth(line) + ? (int) calculatedWidth - (int) layout.getLineWidth(line) : (int) layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is heading @@ -379,7 +393,8 @@ public static long measureText( // The result is equivalent to bugless versions of // `getPrimaryHorizontal`/`getSecondaryHorizontal`. placeholderLeftPosition = - calculatedWidth - ((int) layout.getLineRight(line) - placeholderLeftPosition); + (int) calculatedWidth + - ((int) layout.getLineRight(line) - placeholderLeftPosition); } if (isRtlChar) { placeholderLeftPosition -= placeholderWidth; From 4ae2de211ee8435f1dfc6f2816c21d34ade0c1d7 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 24 Apr 2020 01:11:35 -0700 Subject: [PATCH 109/235] Remove unnecessary cast to int in TextInlineView measure functions Summary: This diff removes unnecessary (int) casts in the calculation of layout for TextInlineViews changeLog: [Internal][Android] Internal optimization on the calculation of layout for TextInlineViews Reviewed By: JoshuaGross Differential Revision: D21211532 fbshipit-source-id: 920c1f88d042f3e1f6bfd0f560371f7482a62064 --- .../react/views/text/TextLayoutManager.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index bf5849bbe4a94f..4b64720d80e51c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -356,12 +356,12 @@ public static long measureText( // thing to be truncated. if (!(isLineTruncated && start >= layout.getLineStart(line) + layout.getEllipsisStart(line)) || start >= layout.getLineEnd(line)) { - int placeholderWidth = placeholder.getWidth(); - int placeholderHeight = placeholder.getHeight(); + float placeholderWidth = placeholder.getWidth(); + float placeholderHeight = placeholder.getHeight(); // Calculate if the direction of the placeholder character is Right-To-Left. boolean isRtlChar = layout.isRtlCharAt(start); boolean isRtlParagraph = layout.getParagraphDirection(line) == Layout.DIR_RIGHT_TO_LEFT; - int placeholderLeftPosition; + float placeholderLeftPosition; // There's a bug on Samsung devices where calling getPrimaryHorizontal on // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. @@ -370,8 +370,8 @@ public static long measureText( isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? (int) calculatedWidth - (int) layout.getLineWidth(line) - : (int) layout.getLineRight(line) - placeholderWidth; + ? calculatedWidth - layout.getLineWidth(line) + : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is heading // in at the @@ -381,8 +381,8 @@ public static long measureText( boolean characterAndParagraphDirectionMatch = isRtlParagraph == isRtlChar; placeholderLeftPosition = characterAndParagraphDirectionMatch - ? (int) layout.getPrimaryHorizontal(start) - : (int) layout.getSecondaryHorizontal(start); + ? layout.getPrimaryHorizontal(start) + : layout.getSecondaryHorizontal(start); if (isRtlParagraph) { // Adjust `placeholderLeftPosition` to work around an Android bug. // The bug is when the paragraph is RTL and `setSingleLine(true)`, some layout @@ -393,22 +393,21 @@ public static long measureText( // The result is equivalent to bugless versions of // `getPrimaryHorizontal`/`getSecondaryHorizontal`. placeholderLeftPosition = - (int) calculatedWidth - - ((int) layout.getLineRight(line) - placeholderLeftPosition); + calculatedWidth - (layout.getLineRight(line) - placeholderLeftPosition); } if (isRtlChar) { placeholderLeftPosition -= placeholderWidth; } } // Vertically align the inline view to the baseline of the line of text. - int placeholderTopPosition = layout.getLineBaseline(line) - placeholderHeight; + float placeholderTopPosition = layout.getLineBaseline(line) - placeholderHeight; int attachmentPosition = attachmentIndex * 2; // The attachment array returns the positions of each of the attachments as attachmentsPositions[attachmentPosition] = - (int) PixelUtil.toSPFromPixel(placeholderTopPosition); + (int) Math.ceil(PixelUtil.toSPFromPixel(placeholderTopPosition)); attachmentsPositions[attachmentPosition + 1] = - (int) PixelUtil.toSPFromPixel(placeholderLeftPosition); + (int) Math.ceil(PixelUtil.toSPFromPixel(placeholderLeftPosition)); attachmentIndex++; } } From fa69356742e99f1eeb9eae912674ea4941cc16e2 Mon Sep 17 00:00:00 2001 From: Keith Melmon Date: Fri, 24 Apr 2020 13:59:16 -0700 Subject: [PATCH 110/235] Use RTL in RTLExample when Platform != android (#28742) Summary: This change upstreams a small change we did in react-native-windows to allow the RTLExample RNTester page to function correctly on Windows. The change is part of this Pr: https://github.com/microsoft/react-native-windows/pull/4683 Currently the direction property is gated behind a check for Platform == 'iOS', which means it only works on iOS. Windows supports direction = 'rtl' so I've chanced this check to Platform != 'android'. ## Changelog [Internal] [Changed] - Changed RTLExample RNTester page to use direction = 'rtl' when Platform is not Android. Pull Request resolved: https://github.com/facebook/react-native/pull/28742 Test Plan: Confirmed this change works correctly in RNTester on Windows. Have not confirmed iOS as I don't have Mac hardware. Differential Revision: D21235579 Pulled By: shergin fbshipit-source-id: 47ab93c2bcd0dbc8347c6746081ae3c64f88faa5 --- RNTester/js/examples/RTL/RTLExample.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNTester/js/examples/RTL/RTLExample.js b/RNTester/js/examples/RTL/RTLExample.js index 2008ea0ca8a9e2..e19c1bac3167c0 100644 --- a/RNTester/js/examples/RTL/RTLExample.js +++ b/RNTester/js/examples/RTL/RTLExample.js @@ -521,7 +521,7 @@ const BorderExample = withRTLState(({isRTL, setRTL}) => { }); const directionStyle = isRTL => - Platform.OS === 'ios' ? {direction: isRTL ? 'rtl' : 'ltr'} : null; + Platform.OS !== 'android' ? {direction: isRTL ? 'rtl' : 'ltr'} : null; const styles = StyleSheet.create({ container: { From 2b56011f9cb9f90781428b5b773cbbed5c4fae43 Mon Sep 17 00:00:00 2001 From: simek Date: Fri, 24 Apr 2020 14:33:32 -0700 Subject: [PATCH 111/235] Add Dark Mode support to the App template and NewAppScreen components (#28711) Summary: This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`. Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds. Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed. ~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~ > I have updated the Android splash screen and tested this change on the Android emulator. If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template). ## Changelog [Internal] [Added] - Add dark mode support to the default app template Pull Request resolved: https://github.com/facebook/react-native/pull/28711 Test Plan: I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`. Screen recording on iOS (demonstarates both modes, both splash screens and transition): ![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif) Screenshot of iOS app in Dark Mode: ![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG) Screenshot of iOS app splash screen in Dark Mode: ![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG) Screenshot of Android app in the emulator: ![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png) Differential Revision: D21236148 Pulled By: shergin fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda --- Libraries/NewAppScreen/components/Colors.js | 1 + Libraries/NewAppScreen/components/Header.js | 38 +++-- .../NewAppScreen/components/LearnMoreLinks.js | 56 ++++--- template/App.js | 140 ++++++++++-------- .../app/src/main/res/values/styles.xml | 2 +- template/ios/HelloWorld/AppDelegate.m | 6 +- .../ios/HelloWorld/LaunchScreen.storyboard | 13 +- 7 files changed, 154 insertions(+), 102 deletions(-) diff --git a/Libraries/NewAppScreen/components/Colors.js b/Libraries/NewAppScreen/components/Colors.js index 19416c4cb4b094..471751de7580e4 100644 --- a/Libraries/NewAppScreen/components/Colors.js +++ b/Libraries/NewAppScreen/components/Colors.js @@ -16,5 +16,6 @@ export default { lighter: '#F3F3F3', light: '#DAE1E7', dark: '#444', + darker: '#222', black: '#000', }; diff --git a/Libraries/NewAppScreen/components/Header.js b/Libraries/NewAppScreen/components/Header.js index a2776b0b47f5d9..b69fa5a109149e 100644 --- a/Libraries/NewAppScreen/components/Header.js +++ b/Libraries/NewAppScreen/components/Header.js @@ -11,25 +11,40 @@ 'use strict'; import Colors from './Colors'; import type {Node} from 'react'; -import {Text, StyleSheet, ImageBackground} from 'react-native'; +import {ImageBackground, StyleSheet, Text, useColorScheme} from 'react-native'; import React from 'react'; -const Header = (): Node => ( - - Welcome to React - -); +const Header = (): Node => { + const isDarkMode = useColorScheme() === 'dark'; + return ( + + + Welcome to React + + + ); +}; const styles = StyleSheet.create({ background: { paddingBottom: 40, paddingTop: 96, paddingHorizontal: 32, - backgroundColor: Colors.lighter, }, logo: { opacity: 0.2, @@ -48,7 +63,6 @@ const styles = StyleSheet.create({ fontSize: 40, fontWeight: '600', textAlign: 'center', - color: Colors.black, }, }); diff --git a/Libraries/NewAppScreen/components/LearnMoreLinks.js b/Libraries/NewAppScreen/components/LearnMoreLinks.js index 9effd49e172093..9e12acc8ead130 100644 --- a/Libraries/NewAppScreen/components/LearnMoreLinks.js +++ b/Libraries/NewAppScreen/components/LearnMoreLinks.js @@ -12,8 +12,14 @@ import Colors from './Colors'; import type {Node} from 'react'; import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser'; -import {View, Text, StyleSheet, TouchableOpacity} from 'react-native'; -import React from 'react'; +import { + StyleSheet, + Text, + TouchableOpacity, + useColorScheme, + View, +} from 'react-native'; +import React, {Fragment} from 'react'; const links = [ { @@ -70,24 +76,40 @@ const links = [ }, ]; -const LinkList = (): Node => ( - - {links.map(({id, title, link, description}) => { - return ( - - +const LinkList = (): Node => { + const isDarkMode = useColorScheme() === 'dark'; + return ( + + {links.map(({id, title, link, description}) => ( + + openURLInBrowser(link)} style={styles.linkContainer}> {title} - {description} + + {description} + - - ); - })} - -); + + ))} + + ); +}; const styles = StyleSheet.create({ container: { @@ -112,11 +134,9 @@ const styles = StyleSheet.create({ paddingVertical: 16, fontWeight: '400', fontSize: 18, - color: Colors.dark, }, separator: { - backgroundColor: Colors.light, - height: 1, + height: StyleSheet.hairlineWidth, }, }); diff --git a/template/App.js b/template/App.js index 23cd158d89565c..5d410f6da3f29a 100644 --- a/template/App.js +++ b/template/App.js @@ -7,82 +7,109 @@ */ import React from 'react'; +import type {Node} from 'react'; import { SafeAreaView, - StyleSheet, ScrollView, - View, - Text, StatusBar, + StyleSheet, + Text, + useColorScheme, + View, } from 'react-native'; import { - Header, - LearnMoreLinks, Colors, DebugInstructions, + Header, + LearnMoreLinks, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; -const App: () => React$Node = () => { +const Section = ({children, title}): Node => { + const isDarkMode = useColorScheme() === 'dark'; return ( - <> - - - -

- {global.HermesInternal == null ? null : ( - - Engine: Hermes - - )} - - - Step One - - Edit App.js to change this - screen and then come back to see your edits. - - - - See Your Changes - - - - - - Debug - - - - - - Learn More - - Read the docs to discover what to do next: - - - - - - - + + + {title} + + + {children} + + + ); +}; + +const App: () => Node = () => { + const isDarkMode = useColorScheme() === 'dark'; + + const backgroundStyle = { + backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, + }; + + const hermes = global.HermesInternal ? ( + + + Engine: Hermes + + + ) : null; + + return ( + + + +
+ {hermes} + +
+ Edit App.js to change this + screen and then come back to see your edits. +
+
+ +
+
+ +
+
+ Read the docs to discover what to do next: +
+ +
+ + ); }; const styles = StyleSheet.create({ - scrollView: { - backgroundColor: Colors.lighter, - }, engine: { position: 'absolute', right: 0, }, - body: { - backgroundColor: Colors.white, - }, sectionContainer: { marginTop: 32, paddingHorizontal: 24, @@ -90,19 +117,16 @@ const styles = StyleSheet.create({ sectionTitle: { fontSize: 24, fontWeight: '600', - color: Colors.black, }, sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', - color: Colors.dark, }, highlight: { fontWeight: '700', }, footer: { - color: Colors.dark, fontSize: 12, fontWeight: '600', padding: 4, diff --git a/template/android/app/src/main/res/values/styles.xml b/template/android/app/src/main/res/values/styles.xml index 62fe59fa485459..9fab0be743760d 100644 --- a/template/android/app/src/main/res/values/styles.xml +++ b/template/android/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ - diff --git a/template/ios/HelloWorld/AppDelegate.m b/template/ios/HelloWorld/AppDelegate.m index c680572d44cce3..bea8d2b334b114 100644 --- a/template/ios/HelloWorld/AppDelegate.m +++ b/template/ios/HelloWorld/AppDelegate.m @@ -36,7 +36,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( moduleName:@"HelloWorld" initialProperties:nil]; - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; + if (@available(iOS 13.0, *)) { + rootView.backgroundColor = [UIColor systemBackgroundColor]; + } else { + rootView.backgroundColor = [UIColor whiteColor]; + } self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; diff --git a/template/ios/HelloWorld/LaunchScreen.storyboard b/template/ios/HelloWorld/LaunchScreen.storyboard index 0d0edbb9640b43..e13962e9bf5470 100644 --- a/template/ios/HelloWorld/LaunchScreen.storyboard +++ b/template/ios/HelloWorld/LaunchScreen.storyboard @@ -16,32 +16,21 @@ - - + - - - From 81734276b96941f556611ed51bae1e9a8997176c Mon Sep 17 00:00:00 2001 From: Marc Horowitz Date: Fri, 24 Apr 2020 15:39:46 -0700 Subject: [PATCH 112/235] Allow use of std::tuple<> with decorators directly Summary: Previously, a derived class, WithTuple, was used. This ran into bugs in MSVC (see https://github.com/microsoft/STL/issues/121). Instead, use specialization to get the same result using std::tuple directly. This avoids the bug, and is a cleaner API. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D21233677 fbshipit-source-id: 1d75991847164e525b4ba70f65a90627e5f8cd56 --- ReactCommon/jsi/jsi/decorator.h | 73 +++++++++++++++------------- ReactCommon/jsi/jsi/test/testlib.cpp | 7 +-- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/ReactCommon/jsi/jsi/decorator.h b/ReactCommon/jsi/jsi/decorator.h index 0021794e57786a..d090a47fc9c974 100644 --- a/ReactCommon/jsi/jsi/decorator.h +++ b/ReactCommon/jsi/jsi/decorator.h @@ -407,6 +407,44 @@ struct AfterCaller { } }; +// It's possible to use multiple decorators by nesting +// WithRuntimeDecorator<...>, but this specialization allows use of +// std::tuple of decorator classes instead. See testlib.cpp for an +// example. +template +struct BeforeCaller> { + static void before(std::tuple& tuple) { + all_before<0, T...>(tuple); + } + + private: + template + static void all_before(std::tuple& tuple) { + detail::BeforeCaller::before(std::get(tuple)); + all_before(tuple); + } + + template + static void all_before(std::tuple&) {} +}; + +template +struct AfterCaller> { + static void after(std::tuple& tuple) { + all_after<0, T...>(tuple); + } + + private: + template + static void all_after(std::tuple& tuple) { + all_after(tuple); + detail::AfterCaller::after(std::get(tuple)); + } + + template + static void all_after(std::tuple&) {} +}; + } // namespace detail // A decorator which implements an around idiom. A With instance is @@ -691,40 +729,5 @@ class WithRuntimeDecorator : public RuntimeDecorator { With& with_; }; -// Nesting WithRuntimeDecorator will work, but using this as the With -// type will be easier to read, write, and understand. -template -class WithTuple : public std::tuple { - public: - using std::tuple::tuple; - - void before() { - all_before<0, T...>(); - } - - void after() { - all_after<0, T...>(); - } - - private: - template - void all_before() { - detail::BeforeCaller::before(std::get(*this)); - all_before(); - } - - template - void all_before() {} - - template - void all_after() { - all_after(); - detail::AfterCaller::after(std::get(*this)); - } - - template - void all_after() {} -}; - } // namespace jsi } // namespace facebook diff --git a/ReactCommon/jsi/jsi/test/testlib.cpp b/ReactCommon/jsi/jsi/test/testlib.cpp index ad3b9937584cfd..a8573d6ebb6700 100644 --- a/ReactCommon/jsi/jsi/test/testlib.cpp +++ b/ReactCommon/jsi/jsi/test/testlib.cpp @@ -1197,10 +1197,11 @@ TEST_P(JSITest, MultiDecoratorTest) { int nest = 0; }; - class MultiRuntime final : public WithRuntimeDecorator> { + class MultiRuntime final + : public WithRuntimeDecorator> { public: explicit MultiRuntime(std::unique_ptr rt) - : WithRuntimeDecorator>(*rt, tuple_), + : WithRuntimeDecorator>(*rt, tuple_), rt_(std::move(rt)) {} int count() { @@ -1212,7 +1213,7 @@ TEST_P(JSITest, MultiDecoratorTest) { private: std::unique_ptr rt_; - WithTuple tuple_; + std::tuple tuple_; }; MultiRuntime mrt(factory()); From fef8bc33df6b57803232f0a3b6bd7613e564170a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 24 Apr 2020 21:24:27 -0700 Subject: [PATCH 113/235] Fabric: Added assert in ShadowNode Summary: It's not allowed to return nullptr from the callback. The assert ensures it which is helpful during development. Probably, we should consider using `gsl::not_null<>` here. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21149891 fbshipit-source-id: a5f77b35029f22b499491721036405682f812a38 --- ReactCommon/fabric/core/shadownode/ShadowNode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp index cf88b5a6a78d7a..f54fedcf22b073 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp @@ -263,6 +263,10 @@ ShadowNode::Unshared ShadowNode::cloneTree( auto newShadowNode = callback(*oldShadowNode); + assert( + newShadowNode && + "`callback` returned `nullptr` which is not allowed value."); + auto childNode = newShadowNode; for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) { From aad99607de99bd3ecdd474850147736b1cac72a9 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 24 Apr 2020 21:36:56 -0700 Subject: [PATCH 114/235] Fabric: Test for State Reconciliation mechanism Summary: It's not immediately obvious from the UI/UX when/if this mechanism breaks, so it's good to have a test. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21184718 fbshipit-source-id: 25432a1398cff3ce61f62cf433e3cb73d7a7a93f --- ReactCommon/fabric/mounting/BUCK | 4 + .../tests/StateReconciliationTest.cpp | 176 ++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 ReactCommon/fabric/mounting/tests/StateReconciliationTest.cpp diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index 7bc30293aa96ae..9d6ad218c1d131 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -81,5 +81,9 @@ fb_xplat_cxx_test( ":mounting", "//xplat/folly:molly", "//xplat/third-party/gmock:gtest", + react_native_xplat_target("fabric/element:element"), + react_native_xplat_target("fabric/components/root:root"), + react_native_xplat_target("fabric/components/view:view"), + react_native_xplat_target("fabric/components/scrollview:scrollview"), ], ) diff --git a/ReactCommon/fabric/mounting/tests/StateReconciliationTest.cpp b/ReactCommon/fabric/mounting/tests/StateReconciliationTest.cpp new file mode 100644 index 00000000000000..19ba086ca2e3e3 --- /dev/null +++ b/ReactCommon/fabric/mounting/tests/StateReconciliationTest.cpp @@ -0,0 +1,176 @@ +/* + * 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. + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace facebook::react; + +class DummyShadowTreeDelegate : public ShadowTreeDelegate { + public: + virtual void shadowTreeDidFinishTransaction( + ShadowTree const &shadowTree, + MountingCoordinator::Shared const &mountingCoordinator) const override{}; +}; + +inline ShadowNode const *findDescendantNode( + ShadowNode const &shadowNode, + ShadowNodeFamily const &family) { + auto result = (ShadowNode const *){nullptr}; + shadowNode.cloneTree(family, [&](ShadowNode const &oldShadowNode) { + result = &oldShadowNode; + return oldShadowNode.clone({}); + }); + return result; +} + +inline ShadowNode const *findDescendantNode( + ShadowTree const &shadowTree, + ShadowNodeFamily const &family) { + auto result = (ShadowNode const *){nullptr}; + + shadowTree.tryCommit( + [&](RootShadowNode::Shared const &oldRootShadowNode) { + result = findDescendantNode(*oldRootShadowNode, family); + return nullptr; + }, + false); + + return result; +} + +TEST(StateReconciliationTest, testStateReconciliation) { + auto builder = simpleComponentBuilder(); + + auto shadowNodeA = std::shared_ptr{}; + auto shadowNodeAA = std::shared_ptr{}; + auto shadowNodeAB = std::shared_ptr{}; + auto shadowNodeABA = std::shared_ptr{}; + auto shadowNodeABB = std::shared_ptr{}; + auto shadowNodeABC = std::shared_ptr{}; + + // clang-format off + auto element = + Element() + .reference(shadowNodeA) + .finalize([](RootShadowNode &shadowNode){ + shadowNode.sealRecursive(); + }) + .children({ + Element() + .reference(shadowNodeAA), + Element() + .reference(shadowNodeAB) + .children({ + Element() + .reference(shadowNodeABA), + Element() + .reference(shadowNodeABB), + Element() + .reference(shadowNodeABC) + }) + }); + // clang-format on + + auto shadowNode = builder.build(element); + + auto rootShadowNodeState1 = shadowNode->ShadowNode::clone({}); + + auto &scrollViewComponentDescriptor = shadowNodeAB->getComponentDescriptor(); + auto &family = shadowNodeAB->getFamily(); + auto state1 = shadowNodeAB->getState(); + auto shadowTreeDelegate = DummyShadowTreeDelegate{}; + auto eventDispatcher = EventDispatcher::Shared{}; + auto rootComponentDescriptor = + ComponentDescriptorParameters{eventDispatcher, nullptr, nullptr}; + ShadowTree shadowTree{SurfaceId{11}, + LayoutConstraints{}, + LayoutContext{}, + rootComponentDescriptor, + shadowTreeDelegate}; + + shadowTree.commit( + [&](RootShadowNode::Shared const &oldRootShadowNode) { + return std::static_pointer_cast(rootShadowNodeState1); + }, + true); + + EXPECT_EQ(state1->getMostRecentState(), state1); + + EXPECT_EQ( + findDescendantNode(*rootShadowNodeState1, family)->getState(), state1); + + auto state2 = scrollViewComponentDescriptor.createState( + family, std::make_shared()); + + auto rootShadowNodeState2 = + shadowNode->cloneTree(family, [&](ShadowNode const &oldShadowNode) { + return oldShadowNode.clone({ShadowNodeFragment::propsPlaceholder(), + ShadowNodeFragment::childrenPlaceholder(), + state2}); + }); + + EXPECT_EQ( + findDescendantNode(*rootShadowNodeState2, family)->getState(), state2); + + shadowTree.commit( + [&](RootShadowNode::Shared const &oldRootShadowNode) { + return std::static_pointer_cast(rootShadowNodeState2); + }, + true); + + EXPECT_EQ(state1->getMostRecentState(), state2); + EXPECT_EQ(state2->getMostRecentState(), state2); + + auto state3 = scrollViewComponentDescriptor.createState( + family, std::make_shared()); + + auto rootShadowNodeState3 = rootShadowNodeState2->cloneTree( + family, [&](ShadowNode const &oldShadowNode) { + return oldShadowNode.clone({ShadowNodeFragment::propsPlaceholder(), + ShadowNodeFragment::childrenPlaceholder(), + state3}); + }); + + EXPECT_EQ( + findDescendantNode(*rootShadowNodeState3, family)->getState(), state3); + + shadowTree.commit( + [&](RootShadowNode::Shared const &oldRootShadowNode) { + return std::static_pointer_cast(rootShadowNodeState3); + }, + true); + + EXPECT_EQ(findDescendantNode(shadowTree, family)->getState(), state3); + + EXPECT_EQ(state1->getMostRecentState(), state3); + EXPECT_EQ(state2->getMostRecentState(), state3); + EXPECT_EQ(state3->getMostRecentState(), state3); + + // This is the core part of the whole test. + // Here we commit the old tree but we expect that the state associated with + // the node will stay the same (newer that the old tree has). + shadowTree.commit( + [&](RootShadowNode::Shared const &oldRootShadowNode) { + return std::static_pointer_cast(rootShadowNodeState2); + }, + true); + + EXPECT_EQ(findDescendantNode(shadowTree, family)->getState(), state3); +} From 30cc158a875a0414cf53d4d5155410eea5d5aeea Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 24 Apr 2020 22:09:44 -0700 Subject: [PATCH 115/235] ScrollView, HorizontalScrollView: support `null` contentOffset Summary: According to the Flow types, `contentOffset` is nullable. Support that. Changelog: [Internal] Fix to (1) support null contentOffset in ScrollView and HorizontalScrollView, added on Android after the last release. (2) Correctly add support for contentOffset in ScrollView (I missed that when adding it to HorizontalScrollView in the previous diff). Reviewed By: alsun2001 Differential Revision: D21243028 fbshipit-source-id: ebef9a9054a3e4dd88556739e836b7ece48fda12 --- .../views/scroll/ReactHorizontalScrollViewManager.java | 8 +++++--- .../react/views/scroll/ReactScrollViewManager.java | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java index 8c2b91637ae1fa..ecb72fff78746f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java @@ -303,8 +303,10 @@ public void setFadingEdgeLength(ReactHorizontalScrollView view, int value) { @ReactProp(name = "contentOffset") public void setContentOffset(ReactHorizontalScrollView view, ReadableMap value) { - double x = value.getDouble("x"); - double y = value.getDouble("y"); - view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); + if (value != null) { + double x = value.getDouble("x"); + double y = value.getDouble("y"); + view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); + } } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java index 51dc13166b0952..ed7cd05778836e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java @@ -13,6 +13,7 @@ import androidx.annotation.Nullable; import androidx.core.view.ViewCompat; import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.RetryableMountingLayerException; import com.facebook.react.common.MapBuilder; import com.facebook.react.module.annotations.ReactModule; @@ -304,6 +305,15 @@ public void setFadingEdgeLength(ReactScrollView view, int value) { } } + @ReactProp(name = "contentOffset") + public void setContentOffset(ReactScrollView view, ReadableMap value) { + if (value != null) { + double x = value.getDouble("x"); + double y = value.getDouble("y"); + view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); + } + } + @Override public Object updateState( ReactScrollView view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) { From 8ca5594549455a18cb64b15a5468f696d177d81f Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Sun, 26 Apr 2020 12:25:48 -0700 Subject: [PATCH 116/235] All `measure*` calls should use the latest committed version of a ShadowNode Summary: Because of StateReconciliation (?) it is possible, even likely, that eventually the ShadowNode that ReactJS holds onto will not be the latest ShadowNode, and will not contain the latest LayoutMetrics. This fixes the problem by always resolving the latest committed version of the ShadowNode before measuring it. Changelog: [Internal] Fabric measure bugfix Reviewed By: sammy-SC, mdvacca Differential Revision: D21248472 fbshipit-source-id: a4f034c36d89a91a804f3b4cdf35e7ae748a1b91 --- ReactCommon/fabric/uimanager/UIManager.cpp | 30 +++++++++++++++++----- ReactCommon/fabric/uimanager/UIManager.h | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index c2fa6be9278cf7..08191aa6c12768 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -125,11 +125,11 @@ void UIManager::clearJSResponder() const { } ShadowNode::Shared const *UIManager::getNewestCloneOfShadowNode( - ShadowNode::Shared const &shadowNode) const { + ShadowNode const &shadowNode) const { auto findNewestChildInParent = [&](auto const &parentNode) -> ShadowNode::Shared const * { for (auto const &child : parentNode.getChildren()) { - if (ShadowNode::sameFamily(*child, *shadowNode)) { + if (ShadowNode::sameFamily(*child, shadowNode)) { return &child; } } @@ -138,7 +138,7 @@ ShadowNode::Shared const *UIManager::getNewestCloneOfShadowNode( ShadowNode const *ancestorShadowNode; shadowTreeRegistry_.visit( - shadowNode->getSurfaceId(), [&](ShadowTree const &shadowTree) { + shadowNode.getSurfaceId(), [&](ShadowTree const &shadowTree) { shadowTree.tryCommit( [&](RootShadowNode::Shared const &oldRootShadowNode) { ancestorShadowNode = oldRootShadowNode.get(); @@ -147,7 +147,11 @@ ShadowNode::Shared const *UIManager::getNewestCloneOfShadowNode( true); }); - auto ancestors = shadowNode->getFamily().getAncestors(*ancestorShadowNode); + auto ancestors = shadowNode.getFamily().getAncestors(*ancestorShadowNode); + + if (ancestors.rbegin() == ancestors.rend()) { + return nullptr; + } return findNewestChildInParent(ancestors.rbegin()->first.get()); } @@ -156,7 +160,7 @@ ShadowNode::Shared UIManager::findNodeAtPoint( ShadowNode::Shared const &node, Point point) const { return LayoutableShadowNode::findNodeAtPoint( - *getNewestCloneOfShadowNode(node), point); + *getNewestCloneOfShadowNode(*node), point); } void UIManager::setNativeProps( @@ -202,10 +206,22 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics( }); } + // Get latest version of both the ShadowNode and its ancestor. + // It is possible for JS (or other callers) to have a reference + // to a previous version of ShadowNodes, but we enforce that + // metrics are only calculated on most recently committed versions. + auto newestShadowNode = getNewestCloneOfShadowNode(shadowNode); + auto newestAncestorShadowNode = ancestorShadowNode == nullptr + ? nullptr + : getNewestCloneOfShadowNode(*ancestorShadowNode); + auto layoutableShadowNode = - traitCast(&shadowNode); + traitCast(newestShadowNode->get()); auto layoutableAncestorShadowNode = - traitCast(ancestorShadowNode); + (newestAncestorShadowNode == nullptr + ? nullptr + : traitCast( + newestAncestorShadowNode->get())); if (!layoutableShadowNode || !layoutableAncestorShadowNode) { return EmptyLayoutMetrics; diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index 7d282d43836205..ca42ad6dbb3a35 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -93,7 +93,7 @@ class UIManager final : public ShadowTreeDelegate { Point point) const; ShadowNode::Shared const *getNewestCloneOfShadowNode( - ShadowNode::Shared const &shadowNode) const; + ShadowNode const &shadowNode) const; /* * Returns layout metrics of given `shadowNode` relative to From dfdbf41cc3a9f4d8eb20ab4dd45a1d10a27d11c5 Mon Sep 17 00:00:00 2001 From: simek Date: Sun, 26 Apr 2020 21:35:47 -0700 Subject: [PATCH 117/235] chore: remove tvOS from the e2e CI tests (#28743) Summary: Refs https://github.com/facebook/react-native/issues/28706 This small PR removes `tvOS` platform and `HelloWorld-tvOS` references from the e2e CI tests script. Also a small typo in comment has been fixed. CC: dlowder-salesforce ## Changelog [Internal] [Removed] - remove tvOS from the e2e CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28743 Test Plan: Exec during `node ./scripts/run-ci-e2e-tests.js --ios` was successful. Differential Revision: D21252185 Pulled By: shergin fbshipit-source-id: 56981f2c5c3038412e9f37a81084de87e296d7d2 --- scripts/run-ci-e2e-tests.js | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/scripts/run-ci-e2e-tests.js b/scripts/run-ci-e2e-tests.js index b320375830ada5..be1d304b7607ad 100644 --- a/scripts/run-ci-e2e-tests.js +++ b/scripts/run-ci-e2e-tests.js @@ -13,7 +13,6 @@ * This script tests that React Native end to end installation/bootstrap works for different platforms * Available arguments: * --ios - 'react-native init' and check iOS app doesn't redbox - * --tvos - 'react-native init' and check tvOS app doesn't redbox * --android - 'react-native init' and check Android app doesn't redbox * --js - 'react-native init' and only check the packager returns a bundle * --skip-cli-install - to skip react-native-cli global installation (for local debugging) @@ -192,8 +191,7 @@ try { } } - if (argv.ios || argv.tvos) { - var iosTestType = argv.tvos ? 'tvOS' : 'iOS'; + if (argv.ios) { cd('ios'); // shelljs exec('', {async: true}) does not emit stdout events, so we rely on good old spawn const packagerEnv = Object.create(process.env); @@ -205,7 +203,7 @@ try { }); SERVER_PID = packagerProcess.pid; exec('sleep 15s'); - // prepare cache to reduce chances of possible red screen "Can't fibd variable __fbBatchedBridge..." + // prepare cache to reduce chances of possible red screen "Can't find variable __fbBatchedBridge..." exec( 'response=$(curl --write-out %{http_code} --silent --output /dev/null localhost:8081/index.bundle?platform=ios&dev=true)', ); @@ -214,32 +212,22 @@ try { describe('Install CocoaPod dependencies'); exec('pod install'); - describe('Test: ' + iosTestType + ' end-to-end test'); + describe('Test: iOS end-to-end test'); if ( // TODO: Get target OS and simulator from .tests.env tryExecNTimes( () => { - let destination = 'platform=iOS Simulator,name=iPhone 8,OS=13.3'; - let sdk = 'iphonesimulator'; - let scheme = 'HelloWorld'; - - if (argv.tvos) { - destination = 'platform=tvOS Simulator,name=Apple TV,OS=13.3'; - sdk = 'appletvsimulator'; - scheme = 'HelloWorld-tvOS'; - } - return exec( [ 'xcodebuild', '-workspace', '"HelloWorld.xcworkspace"', '-destination', - `"${destination}"`, + '"platform=iOS Simulator,name=iPhone 8,OS=13.3"', '-scheme', - `"${scheme}"`, + '"HelloWorld"', '-sdk', - sdk, + 'iphonesimulator', '-UseModernBuildSystem=NO', 'test', ].join(' ') + @@ -249,7 +237,7 @@ try { '--report', 'junit', '--output', - `"~/react-native/reports/junit/${iosTestType}-e2e/results.xml"`, + '"~/react-native/reports/junit/iOS-e2e/results.xml"', ].join(' ') + ' && exit ${PIPESTATUS[0]}', ).code; @@ -258,7 +246,7 @@ try { () => exec('sleep 10s'), ) ) { - echo('Failed to run ' + iosTestType + ' end-to-end tests'); + echo('Failed to run iOS end-to-end tests'); echo('Most likely the code is broken'); exitCode = 1; throw Error(exitCode); From b020e7c440f58dabd4cc64b72869f3ae9680ef30 Mon Sep 17 00:00:00 2001 From: Jakub Kinst Date: Sun, 26 Apr 2020 22:11:53 -0700 Subject: [PATCH 118/235] Fix calculating View position within a Window in split-screen mode on Android (#28449) Summary: On Android, when using split-screen mode, the Window-relative position of a native View is not calculated properly when the app is running on the right (or bottom) half of the screen. The coordinates are currently calculated only based on View.getLocationOnScreen() with subtracting status bar height. Scenarios, where the window does not fill the entire screen (such as split-screen mode) are not supported. We need to use a more general solution to subtract the actual position of the window from position of the view within the screen. This PR fixes the issue by subtracting coordinates of the Window retrieved from View.getWindowVisibleDisplayFrame(), which covers all scenarios when Window can be in a different position than the screen (incl. status bar offset). ## Changelog [Android] [Fixed] - Calculating view position within the window in split-screen mode Pull Request resolved: https://github.com/facebook/react-native/pull/28449 Test Plan: 1. Run an app in split-screen mode on the right half of the screen 2. Call UIManagerModule.measureInWindow() from JS to fetch a position of a View within a Window 3. Observe the wrong coordinates returned 4. Try the same with the fix Reviewed By: mdvacca Differential Revision: D21246297 Pulled By: shergin fbshipit-source-id: 1f54b1a5d6610be17bf05521200304db2ba263ab --- .../uimanager/NativeViewHierarchyManager.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index 26d958570bc86c..35c9ff92013033 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -7,8 +7,8 @@ package com.facebook.react.uimanager; -import android.content.res.Resources; import android.graphics.Matrix; +import android.graphics.Rect; import android.graphics.RectF; import android.util.SparseArray; import android.util.SparseBooleanArray; @@ -701,14 +701,12 @@ public synchronized void measureInWindow(int tag, int[] outputBuffer) { v.getLocationOnScreen(outputBuffer); - // We need to remove the status bar from the height. getLocationOnScreen will include the - // status bar. - Resources resources = v.getContext().getResources(); - int statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android"); - if (statusBarId > 0) { - int height = (int) resources.getDimension(statusBarId); - outputBuffer[1] -= height; - } + // we need to subtract visibleWindowCoords - to subtract possible window insets, split screen or + // multi window + Rect visibleWindowFrame = new Rect(); + v.getWindowVisibleDisplayFrame(visibleWindowFrame); + outputBuffer[0] = outputBuffer[0] - visibleWindowFrame.left; + outputBuffer[1] = outputBuffer[1] - visibleWindowFrame.top; // outputBuffer[0,1] already contain what we want outputBuffer[2] = v.getWidth(); From e3e900805b2857ac76b7e5eeb1489a9c0fa0da46 Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Mon, 27 Apr 2020 01:37:05 -0700 Subject: [PATCH 119/235] Fix image instrumentation internal lifecycle Reviewed By: fkgozali Differential Revision: D20980822 fbshipit-source-id: d0a4a031046509425fbf6662471246ed2ab48a4c --- Libraries/Image/RCTImageLoader.mm | 4 +++- Libraries/Image/RCTImageView.mm | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Libraries/Image/RCTImageLoader.mm b/Libraries/Image/RCTImageLoader.mm index 5e123bc7ecb17f..358269129e7e16 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/Libraries/Image/RCTImageLoader.mm @@ -563,7 +563,7 @@ - (RCTImageURLLoaderRequest *)_loadImageOrDataWithURLRequest:(NSURLRequest *)req } } }); - + return [[RCTImageURLLoaderRequest alloc] initWithRequestId:requestId imageURL:request.URL cancellationBlock:^{ BOOL alreadyCancelled = atomic_fetch_or(cancelled.get(), 1); if (alreadyCancelled) { @@ -782,6 +782,7 @@ - (void)trackURLImageContentDidSetForRequest:(RCTImageURLLoaderRequest *)loaderR return; } + // This delegate method is Fabric-only id loadHandler = [self imageURLLoaderForURL:loaderRequest.imageURL]; if ([loadHandler respondsToSelector:@selector(trackURLImageContentDidSetForRequest:)]) { [(id)loadHandler trackURLImageContentDidSetForRequest:loaderRequest]; @@ -805,6 +806,7 @@ - (void)trackURLImageDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest if (!loaderRequest) { return; } + id loadHandler = [self imageURLLoaderForURL:loaderRequest.imageURL]; if ([loadHandler respondsToSelector:@selector(trackURLImageDidDestroy:)]) { [(id)loadHandler trackURLImageDidDestroy:loaderRequest]; diff --git a/Libraries/Image/RCTImageView.mm b/Libraries/Image/RCTImageView.mm index 07ffe3acc2c1ed..6dac02d5ea8014 100644 --- a/Libraries/Image/RCTImageView.mm +++ b/Libraries/Image/RCTImageView.mm @@ -73,13 +73,12 @@ @implementation RCTImageView // Size of the image loaded / being loaded, so we can determine when to issue a reload to accommodate a changing size. CGSize _targetSize; - // A block that can be invoked to cancel the most recent call to -reloadImage, if any - RCTImageLoaderCancellationBlock _reloadImageCancellationBlock; - // Whether the latest change of props requires the image to be reloaded BOOL _needsReload; RCTUIImageViewAnimated *_imageView; + + RCTImageURLLoaderRequest *_loaderRequest; } - (instancetype)initWithBridge:(RCTBridge *)bridge @@ -216,12 +215,11 @@ - (void)setResizeMode:(RCTResizeMode)resizeMode - (void)cancelImageLoad { - RCTImageLoaderCancellationBlock previousCancellationBlock = _reloadImageCancellationBlock; - if (previousCancellationBlock) { - previousCancellationBlock(); - _reloadImageCancellationBlock = nil; + if (_loaderRequest.cancellationBlock) { + _loaderRequest.cancellationBlock(); } + _loaderRequest = nil; _pendingImageSource = nil; } @@ -343,7 +341,7 @@ - (void)reloadImage progressBlock:progressHandler partialLoadBlock:partialLoadHandler completionBlock:completionHandler]; - _reloadImageCancellationBlock = loaderRequest.cancellationBlock; + _loaderRequest = loaderRequest; } else { [self clearImage]; } @@ -471,4 +469,10 @@ - (void)didMoveToWindow } } +- (void)dealloc { + id imageLoader = [_bridge moduleForName:@"ImageLoader" + lazilyLoadIfNecessary:YES]; + [imageLoader trackURLImageDidDestroy:_loaderRequest]; +} + @end From e68f9bf76846dbbc767ec4dbcabc9d83adb5f0dd Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Apr 2020 03:20:29 -0700 Subject: [PATCH 120/235] Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 --- Libraries/Text/TextInput/RCTBaseTextInputView.h | 9 ++++++--- Libraries/Text/TextInput/RCTBaseTextInputView.m | 13 ++----------- .../Text/TextInput/RCTBaseTextInputViewManager.m | 14 ++++++++++++-- .../examples/TextInput/TextInputSharedExamples.js | 4 ++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.h b/Libraries/Text/TextInput/RCTBaseTextInputView.h index 4acb4147ae6d19..fb5f02ec5ad48b 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.h +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.h @@ -40,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy, nullable) RCTDirectEventBlock onScroll; @property (nonatomic, assign) NSInteger mostRecentEventCount; +@property (nonatomic, assign, readonly) NSInteger nativeEventCount; @property (nonatomic, assign) BOOL autoFocus; @property (nonatomic, assign) BOOL blurOnSubmit; @property (nonatomic, assign) BOOL selectTextOnFocus; @@ -51,9 +52,11 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *inputAccessoryViewID; @property (nonatomic, assign) UIKeyboardType keyboardType; -- (void)setText:(NSString *__nullable)text - selectionStart:(NSInteger)start - selectionEnd:(NSInteger)end; +/** + Sets selection intext input if both start and end are within range of the text input. + **/ +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end; @end diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 538832e0e92bcc..aa69593f68fa25 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -24,7 +24,6 @@ @implementation RCTBaseTextInputView { __weak RCTEventDispatcher *_eventDispatcher; BOOL _hasInputAccesoryView; NSString *_Nullable _predictedText; - NSInteger _nativeEventCount; BOOL _didMoveToWindow; } @@ -199,17 +198,9 @@ - (void)setSelection:(RCTTextSelection *)selection } } -- (void)setText:(NSString *__nullable)text - selectionStart:(NSInteger)start - selectionEnd:(NSInteger)end +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end { - if (text) { - NSMutableAttributedString *mutableString = - [[NSMutableAttributedString alloc] initWithAttributedString:self.backedTextInputView.attributedText]; - [mutableString replaceCharactersInRange:NSMakeRange(0, mutableString.string.length) withString:text]; - self.backedTextInputView.attributedText = mutableString; - } - UITextPosition *startPosition = [self.backedTextInputView positionFromPosition:self.backedTextInputView.beginningOfDocument offset:start]; UITextPosition *endPosition = [self.backedTextInputView positionFromPosition:self.backedTextInputView.beginningOfDocument diff --git a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index d0626ee1f4b1bd..dca143760a11a0 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -125,8 +125,18 @@ - (void)setBridge:(RCTBridge *)bridge { [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { RCTBaseTextInputView *view = (RCTBaseTextInputView *)viewRegistry[viewTag]; - view.mostRecentEventCount = mostRecentEventCount; - [view setText:value selectionStart:start selectionEnd:end]; + NSInteger eventLag = view.nativeEventCount - mostRecentEventCount; + if (eventLag != 0) { + return; + } + RCTExecuteOnUIManagerQueue(^{ + RCTBaseTextInputShadowView *shadowView = (RCTBaseTextInputShadowView *)[self.bridge.uiManager shadowViewForReactTag:viewTag]; + [shadowView setText:value]; + [self.bridge.uiManager setNeedsLayout]; + RCTExecuteOnMainQueue(^{ + [view setSelectionStart:start selectionEnd:end]; + }); + }); }]; } diff --git a/RNTester/js/examples/TextInput/TextInputSharedExamples.js b/RNTester/js/examples/TextInput/TextInputSharedExamples.js index 3ca4b958e06866..629991164f97c8 100644 --- a/RNTester/js/examples/TextInput/TextInputSharedExamples.js +++ b/RNTester/js/examples/TextInput/TextInputSharedExamples.js @@ -161,9 +161,9 @@ class RewriteInvalidCharactersAndClearExample extends React.Component< ref={ref => { this.inputRef = ref; }} - multiline={false} + multiline={true} onChangeText={text => { - this.setState({text: text.replace(/\s/g, '')}); + this.setState({text: text.replace(/ /g, '')}); }} style={styles.default} value={this.state.text} From 5cf327ed837862c8d3611320e1d914f5a3401595 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Apr 2020 05:28:20 -0700 Subject: [PATCH 121/235] Blur image in Image component if blurRadius prop is provided Summary: Apply `blurRadius` prop once image is loaded. Changelog: [Internal][iOS] Reviewed By: mdvacca Differential Revision: D21227536 fbshipit-source-id: 241aa45f253a06d61e861f6719f14fabf3467b56 --- .../Image/RCTImageComponentView.mm | 38 +++++++++++++------ .../components/image/ImageShadowNode.cpp | 11 ++++-- .../fabric/components/image/ImageShadowNode.h | 2 +- .../fabric/components/image/ImageState.cpp | 4 ++ .../fabric/components/image/ImageState.h | 15 ++++++-- 5 files changed, 51 insertions(+), 19 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index e393dae3dabd51..4e87e202fab898 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -7,6 +7,7 @@ #import "RCTImageComponentView.h" +#import #import #import #import @@ -41,6 +42,8 @@ - (instancetype)initWithFrame:(CGRect)frame _imageView = [[UIImageView alloc] initWithFrame:self.bounds]; _imageView.clipsToBounds = YES; _imageView.contentMode = (UIViewContentMode)RCTResizeModeFromImageResizeMode(defaultProps->resizeMode); + _imageView.layer.minificationFilter = kCAFilterTrilinear; + _imageView.layer.magnificationFilter = kCAFilterTrilinear; _imageResponseObserverProxy = RCTImageResponseObserverProxy(self); @@ -161,17 +164,30 @@ - (void)didReceiveImage:(UIImage *)image fromObserver:(void const *)observer resizingMode:UIImageResizingModeStretch]; } - self->_imageView.image = image; - - // Apply trilinear filtering to smooth out mis-sized images. - self->_imageView.layer.minificationFilter = kCAFilterTrilinear; - self->_imageView.layer.magnificationFilter = kCAFilterTrilinear; - - auto data = _state->getData(); - auto instrumentation = std::static_pointer_cast( - data.getImageRequest().getSharedImageInstrumentation()); - if (instrumentation) { - instrumentation->didSetImage(); + void (^didSetImage)() = ^() { + if (!self->_state) { + return; + } + auto data = self->_state->getData(); + auto instrumentation = std::static_pointer_cast( + data.getImageRequest().getSharedImageInstrumentation()); + if (instrumentation) { + instrumentation->didSetImage(); + } + }; + + if (imageProps.blurRadius > __FLT_EPSILON__) { + // Blur on a background thread to avoid blocking interaction. + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + UIImage *blurredImage = RCTBlurredImageWithRadius(image, imageProps.blurRadius); + RCTExecuteOnMainQueue(^{ + self->_imageView.image = blurredImage; + didSetImage(); + }); + }); + } else { + self->_imageView.image = image; + didSetImage(); } } diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.cpp b/ReactCommon/fabric/components/image/ImageShadowNode.cpp index 5c34ca0ad34374..68d0667aa4e846 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.cpp +++ b/ReactCommon/fabric/components/image/ImageShadowNode.cpp @@ -27,13 +27,18 @@ void ImageShadowNode::updateStateIfNeeded() { auto const &imageSource = getImageSource(); auto const ¤tState = getStateData(); + bool hasSameRadius = + getConcreteProps().blurRadius == currentState.getBlurRadius(); + bool hasSameImageSource = currentState.getImageSource() == imageSource; - if (currentState.getImageSource() == imageSource) { + if (hasSameImageSource && hasSameRadius) { return; } - auto state = ImageState{ - imageSource, imageManager_->requestImage(imageSource, getSurfaceId())}; + auto state = + ImageState{imageSource, + imageManager_->requestImage(imageSource, getSurfaceId()), + getConcreteProps().blurRadius}; setStateData(std::move(state)); } diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.h b/ReactCommon/fabric/components/image/ImageShadowNode.h index a723a000b195dc..9ebcbdc97ada63 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.h +++ b/ReactCommon/fabric/components/image/ImageShadowNode.h @@ -46,7 +46,7 @@ class ImageShadowNode final : public ConcreteViewShadowNode< ShadowNodeFamilyFragment const &familyFragment, ComponentDescriptor const &componentDescriptor) { auto imageSource = ImageSource{ImageSource::Type::Invalid}; - return {imageSource, {imageSource, nullptr}}; + return {imageSource, {imageSource, nullptr}, 0}; } #pragma mark - LayoutableShadowNode diff --git a/ReactCommon/fabric/components/image/ImageState.cpp b/ReactCommon/fabric/components/image/ImageState.cpp index 3521716d0b750e..d30d21680fb990 100644 --- a/ReactCommon/fabric/components/image/ImageState.cpp +++ b/ReactCommon/fabric/components/image/ImageState.cpp @@ -18,5 +18,9 @@ ImageRequest const &ImageState::getImageRequest() const { return *imageRequest_; } +Float ImageState::getBlurRadius() const { + return blurRadius_; +} + } // namespace react } // namespace facebook diff --git a/ReactCommon/fabric/components/image/ImageState.h b/ReactCommon/fabric/components/image/ImageState.h index 5280e4b0c65350..e41a9f5be48c3d 100644 --- a/ReactCommon/fabric/components/image/ImageState.h +++ b/ReactCommon/fabric/components/image/ImageState.h @@ -19,10 +19,13 @@ namespace react { */ class ImageState final { public: - ImageState(ImageSource const &imageSource, ImageRequest imageRequest) + ImageState( + ImageSource const &imageSource, + ImageRequest imageRequest, + Float const blurRadius) : imageSource_(imageSource), - imageRequest_( - std::make_shared(std::move(imageRequest))){}; + imageRequest_(std::make_shared(std::move(imageRequest))), + blurRadius_(blurRadius){}; /* * Returns stored ImageSource object. @@ -35,8 +38,11 @@ class ImageState final { */ ImageRequest const &getImageRequest() const; + Float getBlurRadius() const; + #ifdef ANDROID - ImageState(ImageState const &previousState, folly::dynamic data){}; + ImageState(ImageState const &previousState, folly::dynamic data) + : blurRadius_{0} {}; /* * Empty implementation for Android because it doesn't use this class. @@ -49,6 +55,7 @@ class ImageState final { private: ImageSource imageSource_; std::shared_ptr imageRequest_; + Float const blurRadius_; }; } // namespace react From a4b15a4a8821181cf272775188d0006f899d6b9f Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 27 Apr 2020 10:35:06 -0700 Subject: [PATCH 122/235] Fabric: Marking TextInput as a leaf Yoga node Summary: TextInput must have `LeafYogaNode` trait to be able contain non-yoga nodes. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21252322 fbshipit-source-id: 820f3ae4811cb475550419af501739c57c7164e1 --- .../androidtextinput/AndroidTextInputShadowNode.h | 7 +++++++ .../textinput/iostextinput/TextInputShadowNode.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h index 288545367b8b7e..be480cc8a13aba 100644 --- a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h +++ b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h @@ -30,6 +30,13 @@ class AndroidTextInputShadowNode : public ConcreteViewShadowNode< AndroidTextInputEventEmitter, AndroidTextInputState> { public: + static ShadowNodeTraits BaseTraits() { + auto traits = ConcreteViewShadowNode::BaseTraits(); + traits.set(ShadowNodeTraits::Trait::TextKind); + traits.set(ShadowNodeTraits::Trait::LeafYogaNode); + return traits; + } + using ConcreteViewShadowNode::ConcreteViewShadowNode; void setContextContainer(ContextContainer *contextContainer); diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h index 96d3192c22d3ea..cfa7849ac7bd0d 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h @@ -36,6 +36,7 @@ class TextInputShadowNode : public ConcreteViewShadowNode< static ShadowNodeTraits BaseTraits() { auto traits = ConcreteViewShadowNode::BaseTraits(); traits.set(ShadowNodeTraits::Trait::TextKind); + traits.set(ShadowNodeTraits::Trait::LeafYogaNode); return traits; } From 79d5b20ced38d774aad6ccc8394a684604062bce Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Mon, 27 Apr 2020 11:33:01 -0700 Subject: [PATCH 123/235] Move RuntimeExecutor to its own BUCK module (#28730) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28730 Moving RuntimeExecutor out of react/utils and into its own subdir of ReactCommon. I'm doing this because I'm going to be pulling this into CatalystInstance on Android, and I don't want to pull in all the files we don't need there; also, this should hopefully make the OSS NDK stuff easier (this uses the react/utils prefix to export, and I'm not sure if you can include a '/' in a gradle module name?) Changelog: [Internal] Reviewed By: shergin, mdvacca Differential Revision: D21098528 fbshipit-source-id: 9fbd72901ece522b1caec3ec34fafb8f9b327275 --- React/Fabric/RCTSurfacePresenter.h | 2 +- .../RCTSurfacePresenterBridgeAdapter.mm | 2 +- React/Fabric/Utils/MainRunLoopEventBeat.h | 2 +- React/Fabric/Utils/RuntimeEventBeat.h | 2 +- .../java/com/facebook/react/fabric/jni/BUCK | 2 +- .../react/fabric/jni/EventBeatManager.h | 2 +- ReactCommon/fabric/scheduler/Scheduler.h | 2 +- .../fabric/scheduler/SchedulerToolbox.h | 2 +- ReactCommon/fabric/uimanager/BUCK | 2 +- ReactCommon/runtimeexecutor/.clang-tidy | 5 ++ ReactCommon/runtimeexecutor/BUCK | 53 +++++++++++++++++++ .../ReactCommon}/RuntimeExecutor.h | 0 12 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 ReactCommon/runtimeexecutor/.clang-tidy create mode 100644 ReactCommon/runtimeexecutor/BUCK rename ReactCommon/{utils => runtimeexecutor/ReactCommon}/RuntimeExecutor.h (100%) diff --git a/React/Fabric/RCTSurfacePresenter.h b/React/Fabric/RCTSurfacePresenter.h index a5e8f79632beee..abacc2f74718e1 100644 --- a/React/Fabric/RCTSurfacePresenter.h +++ b/React/Fabric/RCTSurfacePresenter.h @@ -10,8 +10,8 @@ #import #import #import +#import #import -#import NS_ASSUME_NONNULL_BEGIN diff --git a/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm b/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm index 3a97f969a20ef5..307e6aff299acd 100644 --- a/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +++ b/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm @@ -17,9 +17,9 @@ #import #import +#import #import #import -#import using namespace facebook::react; diff --git a/React/Fabric/Utils/MainRunLoopEventBeat.h b/React/Fabric/Utils/MainRunLoopEventBeat.h index 055728e322b37f..eeb2aeea4538e7 100644 --- a/React/Fabric/Utils/MainRunLoopEventBeat.h +++ b/React/Fabric/Utils/MainRunLoopEventBeat.h @@ -9,8 +9,8 @@ #include #include +#include #include -#include namespace facebook { namespace react { diff --git a/React/Fabric/Utils/RuntimeEventBeat.h b/React/Fabric/Utils/RuntimeEventBeat.h index bc95c141ea9b09..d55980f40c604f 100644 --- a/React/Fabric/Utils/RuntimeEventBeat.h +++ b/React/Fabric/Utils/RuntimeEventBeat.h @@ -7,8 +7,8 @@ #include #include +#include #include -#include namespace facebook { namespace react { diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK index fc4d7c9c768531..3023a1498477c2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK @@ -32,7 +32,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/scheduler:scheduler"), react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/components/scrollview:scrollview"), - react_native_xplat_target("utils:utils"), + react_native_xplat_target("runtimeexecutor:runtimeexecutor"), react_native_target("jni/react/jni:jni"), "//xplat/fbsystrace:fbsystrace", "//xplat/folly:molly", diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventBeatManager.h b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventBeatManager.h index 5a36037c7d3334..5ed943f226cec2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventBeatManager.h +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/EventBeatManager.h @@ -10,9 +10,9 @@ #include #include +#include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/scheduler/Scheduler.h b/ReactCommon/fabric/scheduler/Scheduler.h index 59e91c5dfa711a..fe1d9c0980979e 100644 --- a/ReactCommon/fabric/scheduler/Scheduler.h +++ b/ReactCommon/fabric/scheduler/Scheduler.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/scheduler/SchedulerToolbox.h b/ReactCommon/fabric/scheduler/SchedulerToolbox.h index 1862f1889fd0de..87462d89377ff1 100644 --- a/ReactCommon/fabric/scheduler/SchedulerToolbox.h +++ b/ReactCommon/fabric/scheduler/SchedulerToolbox.h @@ -7,10 +7,10 @@ #pragma once +#include #include #include #include -#include namespace facebook { namespace react { diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index e2bdd3b4c26864..837f71a35ce542 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -63,7 +63,7 @@ rn_xplat_cxx_library( react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/componentregistry:componentregistry"), react_native_xplat_target("fabric/debug:debug"), - react_native_xplat_target("utils:utils"), + react_native_xplat_target("runtimeexecutor:runtimeexecutor"), ], ) diff --git a/ReactCommon/runtimeexecutor/.clang-tidy b/ReactCommon/runtimeexecutor/.clang-tidy new file mode 100644 index 00000000000000..c98fd78ff64baa --- /dev/null +++ b/ReactCommon/runtimeexecutor/.clang-tidy @@ -0,0 +1,5 @@ +--- +Checks: '> +clang-diagnostic-*, +' +... diff --git a/ReactCommon/runtimeexecutor/BUCK b/ReactCommon/runtimeexecutor/BUCK new file mode 100644 index 00000000000000..561b4c8d208b49 --- /dev/null +++ b/ReactCommon/runtimeexecutor/BUCK @@ -0,0 +1,53 @@ +load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode") +load( + "//tools/build_defs/oss:rn_defs.bzl", + "ANDROID", + "APPLE", + "CXX", + "get_apple_compiler_flags", + "get_apple_inspector_flags", + "rn_xplat_cxx_library", +) + +APPLE_COMPILER_FLAGS = get_apple_compiler_flags() + +rn_xplat_cxx_library( + name = "runtimeexecutor", + srcs = glob( + [ + "**/*.cpp", + "**/*.mm", + ], + exclude = glob(["tests/**/*.cpp"]), + ), + headers = glob( + ["**/*.h"], + exclude = glob(["tests/**/*.h"]), + ), + header_namespace = "", + exported_headers = { + "ReactCommon/RuntimeExecutor.h": "ReactCommon/RuntimeExecutor.h", + }, + compiler_flags = [ + "-fexceptions", + "-frtti", + "-std=c++14", + "-Wall", + ], + fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, + fbobjc_frameworks = ["Foundation"], + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], + fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), + force_static = True, + macosx_tests_override = [], + platforms = (ANDROID, APPLE, CXX), + preprocessor_flags = [ + "-DLOG_TAG=\"ReactNative\"", + "-DWITH_FBSYSTRACE=1", + ], + tests = [], + visibility = ["PUBLIC"], + deps = [ + "//xplat/jsi:jsi", + ], +) diff --git a/ReactCommon/utils/RuntimeExecutor.h b/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h similarity index 100% rename from ReactCommon/utils/RuntimeExecutor.h rename to ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h From 027e8f9b1600c931aa4b826b905a67969733c6ea Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Apr 2020 11:44:14 -0700 Subject: [PATCH 124/235] Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b --- .../TextInput/RCTTextInputComponentView.mm | 5 ++- .../iostextinput/TextInputEventEmitter.cpp | 32 +++++++++++++++++-- .../iostextinput/TextInputEventEmitter.h | 8 ++++- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 1879ac90e7efc3..05b8f7ac3f7238 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -306,7 +306,10 @@ - (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range { if (!_backedTextInputView.textWasPasted) { if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onKeyPress([self _textInputMetrics]); + KeyPressMetrics keyPressMetrics; + keyPressMetrics.text = RCTStringFromNSString(text); + keyPressMetrics.eventCount = _mostRecentEventCount; + std::static_pointer_cast(_eventEmitter)->onKeyPress(keyPressMetrics); } } diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.cpp b/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.cpp index 7aec3aed53fff5..6342a6c1ff239a 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.cpp +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.cpp @@ -37,6 +37,29 @@ static jsi::Value textInputMetricsPayload( return payload; }; +static jsi::Value keyPressMetricsPayload( + jsi::Runtime &runtime, + KeyPressMetrics const &keyPressMetrics) { + auto payload = jsi::Object(runtime); + payload.setProperty(runtime, "eventCount", keyPressMetrics.eventCount); + + std::string key; + if (keyPressMetrics.text.empty()) { + key = "Backspace"; + } else { + if (keyPressMetrics.text.front() == '\n') { + key = "Enter"; + } else if (keyPressMetrics.text.front() == '\t') { + key = "Tab"; + } else { + key = keyPressMetrics.text.front(); + } + } + payload.setProperty( + runtime, "key", jsi::String::createFromUtf8(runtime, key)); + return payload; +}; + void TextInputEventEmitter::onFocus( TextInputMetrics const &textInputMetrics) const { dispatchTextInputEvent("focus", textInputMetrics); @@ -78,8 +101,13 @@ void TextInputEventEmitter::onSubmitEditing( } void TextInputEventEmitter::onKeyPress( - TextInputMetrics const &textInputMetrics) const { - dispatchTextInputEvent("keyPress", textInputMetrics); + KeyPressMetrics const &keyPressMetrics) const { + dispatchEvent( + "keyPress", + [keyPressMetrics](jsi::Runtime &runtime) { + return keyPressMetricsPayload(runtime, keyPressMetrics); + }, + EventPriority::AsynchronousBatched); } void TextInputEventEmitter::dispatchTextInputEvent( diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.h b/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.h index 09989924b91b6a..3a143dfbd1d92a 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.h +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputEventEmitter.h @@ -25,6 +25,12 @@ class TextInputMetrics { int eventCount; }; +class KeyPressMetrics { + public: + std::string text; + int eventCount; +}; + class TextInputEventEmitter : public ViewEventEmitter { public: using ViewEventEmitter::ViewEventEmitter; @@ -37,7 +43,7 @@ class TextInputEventEmitter : public ViewEventEmitter { void onSelectionChange(TextInputMetrics const &textInputMetrics) const; void onEndEditing(TextInputMetrics const &textInputMetrics) const; void onSubmitEditing(TextInputMetrics const &textInputMetrics) const; - void onKeyPress(TextInputMetrics const &textInputMetrics) const; + void onKeyPress(KeyPressMetrics const &textInputMetrics) const; private: void dispatchTextInputEvent( From b871979a8986f4c832abb42ac7d3c127972496e3 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Apr 2020 11:44:14 -0700 Subject: [PATCH 125/235] Do not send events for changes coming from JavaScript Summary: Changelog: [Internal] When there is a change coming from javascript, avoid triggering `onChange ` and `onSelectionChange` events since JavaScript already has these changes. This is only necessary for multiline text. For changes coming through view commands, do not increment `_mostRecentEventCount`. Reviewed By: shergin Differential Revision: D21255228 fbshipit-source-id: e972dab0eb3dd21f611ee5c71d755bab593ae9cc --- .../TextInput/RCTTextInputComponentView.mm | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 05b8f7ac3f7238..1e7b92a2d104bb 100644 --- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -42,6 +42,16 @@ @implementation RCTTextInputComponentView { * textInputDidChange]` call. */ BOOL _ignoreNextTextInputCall; + + /* + * A flag that when set to true, `_mostRecentEventCount` won't be incremented when `[self _updateState]` + * and delegate methods `textInputDidChange` and `textInputDidChangeSelection` will exit early. + * + * Setting `_backedTextInputView.attributedText` triggers delegate methods `textInputDidChange` and + * `textInputDidChangeSelection` for multiline text input only. + * In multiline text input this is undesirable as we don't want to be sending events for changes that JS triggered. + */ + BOOL _comingFromJS; } - (instancetype)initWithFrame:(CGRect)frame @@ -55,6 +65,7 @@ - (instancetype)initWithFrame:(CGRect)frame _backedTextInputView.frame = self.bounds; _backedTextInputView.textInputDelegate = self; _ignoreNextTextInputCall = NO; + _comingFromJS = NO; [self addSubview:_backedTextInputView]; } @@ -185,7 +196,9 @@ - (void)updateState:(State::Shared const &)state oldState:(State::Shared const & if (_mostRecentEventCount == _state->getData().mostRecentEventCount) { auto data = _state->getData(); + _comingFromJS = YES; [self _setAttributedString:RCTNSAttributedStringFromAttributedStringBox(data.attributedStringBox)]; + _comingFromJS = NO; } } @@ -204,11 +217,6 @@ - (void)_setAttributedString:(NSAttributedString *)attributedString { UITextRange *selectedRange = [_backedTextInputView selectedTextRange]; _backedTextInputView.attributedText = attributedString; - // Calling `[_backedTextInputView setAttributedText]` results - // in `textInputDidChangeSelection` being called but not `textInputDidChange`. - // For `_ignoreNextTextInputCall` to have correct value, these calls - // need to be balanced, that's why we manually set the flag here. - _ignoreNextTextInputCall = NO; if (_lastStringStateWasUpdatedWith.length == attributedString.length) { // Calling `[_backedTextInputView setAttributedText]` moves caret // to the end of text input field. This cancels any selection as well @@ -225,6 +233,7 @@ - (void)prepareForRecycle _backedTextInputView.attributedText = [[NSAttributedString alloc] init]; _mostRecentEventCount = 0; _state.reset(); + _comingFromJS = NO; _lastStringStateWasUpdatedWith = nil; _ignoreNextTextInputCall = NO; } @@ -334,10 +343,15 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin - (void)textInputDidChange { + if (_comingFromJS) { + return; + } + if (_ignoreNextTextInputCall) { _ignoreNextTextInputCall = NO; return; } + [self _updateState]; if (_eventEmitter) { @@ -347,6 +361,9 @@ - (void)textInputDidChange - (void)textInputDidChangeSelection { + if (_comingFromJS) { + return; + } auto const &props = *std::static_pointer_cast(_props); if (props.traits.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { [self textInputDidChange]; @@ -379,7 +396,7 @@ - (void)_updateState auto data = _state->getData(); _lastStringStateWasUpdatedWith = attributedString; data.attributedStringBox = RCTAttributedStringBoxFromNSAttributedString(attributedString); - _mostRecentEventCount += 1; + _mostRecentEventCount += _comingFromJS ? 0 : 1; data.mostRecentEventCount = _mostRecentEventCount; _state->updateState(std::move(data)); } @@ -419,8 +436,8 @@ - (void)setTextAndSelection:(NSInteger)eventCount if (_mostRecentEventCount != eventCount) { return; } - - if (value) { + _comingFromJS = YES; + if (![value isEqualToString:_backedTextInputView.attributedText.string]) { NSMutableAttributedString *mutableString = [[NSMutableAttributedString alloc] initWithAttributedString:_backedTextInputView.attributedText]; [mutableString replaceCharactersInRange:NSMakeRange(0, _backedTextInputView.attributedText.length) @@ -438,6 +455,7 @@ - (void)setTextAndSelection:(NSInteger)eventCount UITextRange *range = [_backedTextInputView textRangeFromPosition:startPosition toPosition:endPosition]; [_backedTextInputView setSelectedTextRange:range notifyDelegate:NO]; } + _comingFromJS = NO; } @end From 26d3bcae721098d8d0574f3a6f523a70d4a4d133 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 27 Apr 2020 12:53:39 -0700 Subject: [PATCH 126/235] Fabric: Increasing threshold for MountingTelemetryTest Summary: We neede that to make the test less flaky. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21261487 fbshipit-source-id: afec45e03be10ba071a5ab808ce13f95b5f475e3 --- ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp b/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp index 8d1426675b85bb..cf31109a38fa32 100644 --- a/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp +++ b/ReactCommon/fabric/mounting/tests/MountingTelemetryTest.cpp @@ -27,7 +27,7 @@ void sleep(double durationInSeconds) { } TEST(MountingTelemetryTest, timepoints) { - auto threshold = int64_t{10}; + auto threshold = int64_t{70}; auto timepointA = telemetryTimePointNow(); sleep(0.1); @@ -39,7 +39,7 @@ TEST(MountingTelemetryTest, timepoints) { } TEST(MountingTelemetryTest, normalUseCase) { - auto threshold = int64_t{10}; + auto threshold = int64_t{70}; auto telemetry = MountingTelemetry{}; telemetry.willCommit(); From 702ff6d1cdc378815ff1beb563c2c8cc4f30585c Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 27 Apr 2020 13:29:41 -0700 Subject: [PATCH 127/235] iOS: Fix refreshControl layouting (#28236) Summary: In `react-native-navigation` we allow the usage of native iOS navigationBar **largeTitle** which cause the title to "jump" when pulling to refresh. We found that the layout calculations of the refreshControl element mess up the system behaviour. ## Changelog [iOS] [Fixed] - Fix refreshControl messes up navigationBar largeTitles Pull Request resolved: https://github.com/facebook/react-native/pull/28236 Test Plan: ### Before the fix: ![before](https://user-images.githubusercontent.com/10794586/75991307-f7c7ec00-5efe-11ea-8cd9-ab8c3fbe1dc1.gif) ### And after: ![after](https://user-images.githubusercontent.com/10794586/75990618-d9152580-5efd-11ea-8c72-5deb6d83a840.gif) ### How it looks like with react-native init app after the fix: ![ezgif com-video-to-gif (4)](https://user-images.githubusercontent.com/10794586/77253369-54970680-6c62-11ea-9ad6-3265e23044e6.gif) Differential Revision: D20587945 Pulled By: shergin fbshipit-source-id: 94f560b17e367f4ef5e789f40c052396949b51a3 --- React/Views/RefreshControl/RCTRefreshControl.m | 6 ------ React/Views/ScrollView/RCTScrollView.m | 18 ++++-------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.m index 428a5e7fa406b9..419535bcb461f5 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.m +++ b/React/Views/RefreshControl/RCTRefreshControl.m @@ -41,12 +41,6 @@ - (void)layoutSubviews { [super layoutSubviews]; - // Fix for bug #7976 - // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop. - if (self.backgroundColor == nil) { - self.backgroundColor = [UIColor clearColor]; - } - // If the control is refreshing when mounted we need to call // beginRefreshing in layoutSubview or it doesn't work. if (_currentRefreshingState && _isInitialRender) { diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index 56d63505b9e630..bb49c8d73638e5 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -32,7 +32,7 @@ @interface RCTCustomScrollView : UIScrollView @property (nonatomic, assign) BOOL centerContent; #if !TARGET_OS_TV -@property (nonatomic, strong) UIView *customRefreshControl; +@property (nonatomic, strong) UIRefreshControl *customRefreshControl; @property (nonatomic, assign) BOOL pinchGestureEnabled; #endif @@ -224,13 +224,13 @@ - (void)setFrame:(CGRect)frame } #if !TARGET_OS_TV -- (void)setCustomRefreshControl:(UIView *)refreshControl +- (void)setCustomRefreshControl:(UIRefreshControl *)refreshControl { if (_customRefreshControl) { [_customRefreshControl removeFromSuperview]; } _customRefreshControl = refreshControl; - [self addSubview:_customRefreshControl]; + self.refreshControl = refreshControl; } - (void)setPinchGestureEnabled:(BOOL)pinchGestureEnabled @@ -344,7 +344,7 @@ - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex [super insertReactSubview:view atIndex:atIndex]; #if !TARGET_OS_TV if ([view conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) { - [_scrollView setCustomRefreshControl:(UIView *)view]; + [_scrollView setCustomRefreshControl:(UIRefreshControl *)view]; if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) { [self addScrollListener:(UIView *)view]; } @@ -418,16 +418,6 @@ - (void)layoutSubviews [super layoutSubviews]; RCTAssert(self.subviews.count == 1, @"we should only have exactly one subview"); RCTAssert([self.subviews lastObject] == _scrollView, @"our only subview should be a scrollview"); - -#if !TARGET_OS_TV - // Adjust the refresh control frame if the scrollview layout changes. - UIView *refreshControl = _scrollView.customRefreshControl; - if (refreshControl && refreshControl.isRefreshing) { - refreshControl.frame = - (CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}}; - } -#endif - [self updateClippedSubviews]; } From fc5a626e38dc64539b3705e4147179e6e3d84e7c Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Mon, 27 Apr 2020 14:38:51 -0700 Subject: [PATCH 128/235] Fix rounding error using double instead of float Summary: Changelog: [Internal] [Yoga] Use double instead of float during rounding process to prevent loss of precision. Reviewed By: mdvacca Differential Revision: D21227565 fbshipit-source-id: 380b57535a356624cda8dc2017871a4ef3c882d1 --- ReactCommon/yoga/yoga/Yoga.cpp | 26 +++++++++++++------------- ReactCommon/yoga/yoga/Yoga.h | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index bb7da7bfd91d88..c2a5c286f99580 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -3664,8 +3664,8 @@ static inline bool YGMeasureModeNewMeasureSizeIsStricterAndStillValid( } YOGA_EXPORT float YGRoundValueToPixelGrid( - const float value, - const float pointScaleFactor, + const double value, + const double pointScaleFactor, const bool forceCeil, const bool forceFloor) { double scaledValue = ((double) value) * pointScaleFactor; @@ -4081,24 +4081,24 @@ YOGA_EXPORT void YGConfigSetPointScaleFactor( static void YGRoundToPixelGrid( const YGNodeRef node, - const float pointScaleFactor, - const float absoluteLeft, - const float absoluteTop) { + const double pointScaleFactor, + const double absoluteLeft, + const double absoluteTop) { if (pointScaleFactor == 0.0f) { return; } - const float nodeLeft = node->getLayout().position[YGEdgeLeft]; - const float nodeTop = node->getLayout().position[YGEdgeTop]; + const double nodeLeft = node->getLayout().position[YGEdgeLeft]; + const double nodeTop = node->getLayout().position[YGEdgeTop]; - const float nodeWidth = node->getLayout().dimensions[YGDimensionWidth]; - const float nodeHeight = node->getLayout().dimensions[YGDimensionHeight]; + const double nodeWidth = node->getLayout().dimensions[YGDimensionWidth]; + const double nodeHeight = node->getLayout().dimensions[YGDimensionHeight]; - const float absoluteNodeLeft = absoluteLeft + nodeLeft; - const float absoluteNodeTop = absoluteTop + nodeTop; + const double absoluteNodeLeft = absoluteLeft + nodeLeft; + const double absoluteNodeTop = absoluteTop + nodeTop; - const float absoluteNodeRight = absoluteNodeLeft + nodeWidth; - const float absoluteNodeBottom = absoluteNodeTop + nodeHeight; + const double absoluteNodeRight = absoluteNodeLeft + nodeWidth; + const double absoluteNodeBottom = absoluteNodeTop + nodeHeight; // If a node has a custom measure function we never want to round down its // size as this could lead to unwanted text truncation. diff --git a/ReactCommon/yoga/yoga/Yoga.h b/ReactCommon/yoga/yoga/Yoga.h index 2fe60a4170da3e..87901a280ee84a 100644 --- a/ReactCommon/yoga/yoga/Yoga.h +++ b/ReactCommon/yoga/yoga/Yoga.h @@ -352,8 +352,8 @@ WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context); WIN_EXPORT void* YGConfigGetContext(YGConfigRef config); WIN_EXPORT float YGRoundValueToPixelGrid( - float value, - float pointScaleFactor, + double value, + double pointScaleFactor, bool forceCeil, bool forceFloor); From 81bdeade544eba065c2b85692c7604b0f1c21105 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 27 Apr 2020 15:13:07 -0700 Subject: [PATCH 129/235] Fix broken touches on all Fabric surfaces Reviewed By: shergin Differential Revision: D21261996 fbshipit-source-id: f42c19295ac127eca653631faad0ced4900f4758 --- ReactCommon/fabric/uimanager/UIManager.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index 08191aa6c12768..f203535c6d6d1f 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -149,10 +149,6 @@ ShadowNode::Shared const *UIManager::getNewestCloneOfShadowNode( auto ancestors = shadowNode.getFamily().getAncestors(*ancestorShadowNode); - if (ancestors.rbegin() == ancestors.rend()) { - return nullptr; - } - return findNewestChildInParent(ancestors.rbegin()->first.get()); } @@ -204,6 +200,8 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics( }, true); }); + } else { + ancestorShadowNode = getNewestCloneOfShadowNode(*ancestorShadowNode)->get(); } // Get latest version of both the ShadowNode and its ancestor. @@ -211,17 +209,11 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics( // to a previous version of ShadowNodes, but we enforce that // metrics are only calculated on most recently committed versions. auto newestShadowNode = getNewestCloneOfShadowNode(shadowNode); - auto newestAncestorShadowNode = ancestorShadowNode == nullptr - ? nullptr - : getNewestCloneOfShadowNode(*ancestorShadowNode); auto layoutableShadowNode = traitCast(newestShadowNode->get()); auto layoutableAncestorShadowNode = - (newestAncestorShadowNode == nullptr - ? nullptr - : traitCast( - newestAncestorShadowNode->get())); + traitCast(ancestorShadowNode); if (!layoutableShadowNode || !layoutableAncestorShadowNode) { return EmptyLayoutMetrics; From 423b55b2d7253fa1736c7f3e51fee1cc5c2e527d Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Tue, 28 Apr 2020 06:30:48 -0700 Subject: [PATCH 130/235] Move ART Android files to FB internal Summary: ## Changelog: [General] [Changed] - Moves ART android files from RN to internal react shell. Reviewed By: cpojer Differential Revision: D21261077 fbshipit-source-id: 1d3dc404313192540d64991911e3599e3e86351b --- .../main/java/com/facebook/react/shell/BUCK | 1 - .../react/shell/MainReactPackage.java | 6 - .../react/views/art/ARTGroupShadowNode.java | 76 ----- .../react/views/art/ARTGroupViewManager.java | 19 -- .../views/art/ARTRenderableViewManager.java | 84 ----- .../react/views/art/ARTShapeShadowNode.java | 320 ------------------ .../react/views/art/ARTShapeViewManager.java | 19 -- .../react/views/art/ARTSurfaceView.java | 19 -- .../views/art/ARTSurfaceViewManager.java | 75 ---- .../views/art/ARTSurfaceViewShadowNode.java | 155 --------- .../react/views/art/ARTTextShadowNode.java | 137 -------- .../react/views/art/ARTTextViewManager.java | 19 -- .../react/views/art/ARTVirtualNode.java | 109 ------ .../java/com/facebook/react/views/art/BUCK | 21 -- .../facebook/react/views/art/PropHelper.java | 48 --- 15 files changed, 1108 deletions(-) delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupShadowNode.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupViewManager.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeViewManager.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceView.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewShadowNode.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextShadowNode.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextViewManager.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/ARTVirtualNode.java delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/BUCK delete mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/art/PropHelper.java diff --git a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK index 4df1ab9930362d..3b5d4e7f99fc7e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK @@ -51,7 +51,6 @@ rn_android_library( react_native_target("java/com/facebook/react/modules/websocket:websocket"), react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"), react_native_target("java/com/facebook/react/uimanager:uimanager"), - react_native_target("java/com/facebook/react/views/art:art"), react_native_target("java/com/facebook/react/views/drawer:drawer"), react_native_target("java/com/facebook/react/views/image:image"), react_native_target("java/com/facebook/react/views/modal:modal"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java b/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java index 7c60cda3300a9d..e5d6f99a3186b9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +++ b/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java @@ -43,8 +43,6 @@ import com.facebook.react.modules.websocket.WebSocketModule; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.react.uimanager.ViewManager; -import com.facebook.react.views.art.ARTRenderableViewManager; -import com.facebook.react.views.art.ARTSurfaceViewManager; import com.facebook.react.views.drawer.ReactDrawerLayoutManager; import com.facebook.react.views.image.ReactImageManager; import com.facebook.react.views.modal.ReactModalHostManager; @@ -174,9 +172,6 @@ public MainReactPackage(MainPackageConfig config) { public List createViewManagers(ReactApplicationContext reactContext) { List viewManagers = new ArrayList<>(); - viewManagers.add(ARTRenderableViewManager.createARTGroupViewManager()); - viewManagers.add(ARTRenderableViewManager.createARTShapeViewManager()); - viewManagers.add(ARTRenderableViewManager.createARTTextViewManager()); viewManagers.add(new ReactDialogPickerManager()); viewManagers.add(new ReactDrawerLayoutManager()); viewManagers.add(new ReactDropdownPickerManager()); @@ -189,7 +184,6 @@ public List createViewManagers(ReactApplicationContext reactContext viewManagers.add(new SwipeRefreshLayoutManager()); // Native equivalents - viewManagers.add(new ARTSurfaceViewManager()); viewManagers.add(new FrescoBasedReactTextInlineImageViewManager()); viewManagers.add(new ReactImageManager()); viewManagers.add(new ReactModalHostManager()); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupShadowNode.java deleted file mode 100644 index bc941ac54c090c..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupShadowNode.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.RectF; -import androidx.annotation.Nullable; -import com.facebook.react.bridge.JSApplicationIllegalArgumentException; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** Shadow node for virtual ARTGroup view */ -public class ARTGroupShadowNode extends ARTVirtualNode { - - protected @Nullable RectF mClipping; - - public ARTGroupShadowNode() {} - - @ReactProp(name = "clipping") - public void setClipping(@Nullable ReadableArray clippingDims) { - float[] clippingData = PropHelper.toFloatArray(clippingDims); - if (clippingData != null) { - mClipping = createClipping(clippingData); - markUpdated(); - } - } - - @Override - public boolean isVirtual() { - return true; - } - - public void draw(Canvas canvas, Paint paint, float opacity) { - opacity *= mOpacity; - if (opacity > MIN_OPACITY_FOR_DRAW) { - saveAndSetupCanvas(canvas); - - if (mClipping != null) { - canvas.clipRect( - mClipping.left * mScale, - mClipping.top * mScale, - mClipping.right * mScale, - mClipping.bottom * mScale); - } - - for (int i = 0; i < getChildCount(); i++) { - ARTVirtualNode child = (ARTVirtualNode) getChildAt(i); - child.draw(canvas, paint, opacity); - child.markUpdateSeen(); - } - - restoreCanvas(canvas); - } - } - - /** - * Creates a {@link RectF} from an array of dimensions (e.g. [x, y, width, height]) - * - * @param data the array of dimensions - * @return the {@link RectF} that can used to clip the canvas - */ - private static RectF createClipping(float[] data) { - if (data.length != 4) { - throw new JSApplicationIllegalArgumentException( - "Clipping should be array of length 4 (e.g. [x, y, width, height])"); - } - RectF clippingRect = new RectF(data[0], data[1], data[0] + data[2], data[1] + data[3]); - return clippingRect; - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupViewManager.java deleted file mode 100644 index cde81adf02c1c6..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTGroupViewManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import com.facebook.react.module.annotations.ReactModule; - -/** ViewManager for shadowed ART group views. */ -@ReactModule(name = ARTRenderableViewManager.CLASS_GROUP) -public class ARTGroupViewManager extends ARTRenderableViewManager { - - /* package */ ARTGroupViewManager() { - super(CLASS_GROUP); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java deleted file mode 100644 index c1515647fa324e..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTRenderableViewManager.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.view.View; -import com.facebook.react.uimanager.ReactShadowNode; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.ViewManager; - -/** - * ViewManager for all shadowed ART views: Group, Shape and Text. Since these never get rendered - * into native views and don't need any logic (all the logic is in {@link ARTSurfaceView}), this - * "stubbed" ViewManager is used for all of them. - */ -public class ARTRenderableViewManager extends ViewManager { - - public static final String CLASS_GROUP = "ARTGroup"; - public static final String CLASS_SHAPE = "ARTShape"; - public static final String CLASS_TEXT = "ARTText"; - - private final String mClassName; - - public static ARTRenderableViewManager createARTGroupViewManager() { - return new ARTGroupViewManager(); - } - - public static ARTRenderableViewManager createARTShapeViewManager() { - return new ARTShapeViewManager(); - } - - public static ARTRenderableViewManager createARTTextViewManager() { - return new ARTTextViewManager(); - } - - /* package */ ARTRenderableViewManager(String className) { - mClassName = className; - } - - @Override - public String getName() { - return mClassName; - } - - @Override - public ReactShadowNode createShadowNodeInstance() { - if (CLASS_GROUP.equals(mClassName)) { - return new ARTGroupShadowNode(); - } else if (CLASS_SHAPE.equals(mClassName)) { - return new ARTShapeShadowNode(); - } else if (CLASS_TEXT.equals(mClassName)) { - return new ARTTextShadowNode(); - } else { - throw new IllegalStateException("Unexpected type " + mClassName); - } - } - - @Override - public Class getShadowNodeClass() { - if (CLASS_GROUP.equals(mClassName)) { - return ARTGroupShadowNode.class; - } else if (CLASS_SHAPE.equals(mClassName)) { - return ARTShapeShadowNode.class; - } else if (CLASS_TEXT.equals(mClassName)) { - return ARTTextShadowNode.class; - } else { - throw new IllegalStateException("Unexpected type " + mClassName); - } - } - - @Override - protected View createViewInstance(ThemedReactContext reactContext) { - throw new IllegalStateException("ARTShape does not map into a native view"); - } - - @Override - public void updateExtraData(View root, Object extraData) { - throw new IllegalStateException("ARTShape does not map into a native view"); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java deleted file mode 100644 index 380e239347c01a..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.DashPathEffect; -import android.graphics.LinearGradient; -import android.graphics.Paint; -import android.graphics.Path; -import android.graphics.RectF; -import android.graphics.Shader; -import androidx.annotation.Nullable; -import com.facebook.common.logging.FLog; -import com.facebook.react.bridge.JSApplicationIllegalArgumentException; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.common.ReactConstants; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** Shadow node for virtual ARTShape view */ -public class ARTShapeShadowNode extends ARTVirtualNode { - - private static final int CAP_BUTT = 0; - private static final int CAP_ROUND = 1; - private static final int CAP_SQUARE = 2; - - private static final int JOIN_BEVEL = 2; - private static final int JOIN_MITER = 0; - private static final int JOIN_ROUND = 1; - - private static final int PATH_TYPE_ARC = 4; - private static final int PATH_TYPE_CLOSE = 1; - private static final int PATH_TYPE_CURVETO = 3; - private static final int PATH_TYPE_LINETO = 2; - private static final int PATH_TYPE_MOVETO = 0; - - // For color type JS and ObjectiveC definitions counterparts - // refer to ReactNativeART.js and RCTConvert+ART.m - private static final int COLOR_TYPE_SOLID_COLOR = 0; - private static final int COLOR_TYPE_LINEAR_GRADIENT = 1; - private static final int COLOR_TYPE_RADIAL_GRADIENT = 2; - private static final int COLOR_TYPE_PATTERN = 3; - - protected @Nullable Path mPath; - private @Nullable float[] mStrokeColor; - private @Nullable float[] mBrushData; - private @Nullable float[] mStrokeDash; - private float mStrokeWidth = 1; - private int mStrokeCap = CAP_ROUND; - private int mStrokeJoin = JOIN_ROUND; - - public ARTShapeShadowNode() {} - - @ReactProp(name = "d") - public void setShapePath(@Nullable ReadableArray shapePath) { - float[] pathData = PropHelper.toFloatArray(shapePath); - mPath = createPath(pathData); - markUpdated(); - } - - @ReactProp(name = "stroke") - public void setStroke(@Nullable ReadableArray strokeColors) { - mStrokeColor = PropHelper.toFloatArray(strokeColors); - markUpdated(); - } - - @ReactProp(name = "strokeDash") - public void setStrokeDash(@Nullable ReadableArray strokeDash) { - mStrokeDash = PropHelper.toFloatArray(strokeDash); - markUpdated(); - } - - @ReactProp(name = "fill") - public void setFill(@Nullable ReadableArray fillColors) { - mBrushData = PropHelper.toFloatArray(fillColors); - markUpdated(); - } - - @ReactProp(name = "strokeWidth", defaultFloat = 1f) - public void setStrokeWidth(float strokeWidth) { - mStrokeWidth = strokeWidth; - markUpdated(); - } - - @ReactProp(name = "strokeCap", defaultInt = CAP_ROUND) - public void setStrokeCap(int strokeCap) { - mStrokeCap = strokeCap; - markUpdated(); - } - - @ReactProp(name = "strokeJoin", defaultInt = JOIN_ROUND) - public void setStrokeJoin(int strokeJoin) { - mStrokeJoin = strokeJoin; - markUpdated(); - } - - @Override - public void draw(Canvas canvas, Paint paint, float opacity) { - opacity *= mOpacity; - if (opacity > MIN_OPACITY_FOR_DRAW) { - saveAndSetupCanvas(canvas); - if (mPath == null) { - throw new JSApplicationIllegalArgumentException("Shapes should have a valid path (d) prop"); - } - if (setupFillPaint(paint, opacity)) { - canvas.drawPath(mPath, paint); - } - if (setupStrokePaint(paint, opacity)) { - canvas.drawPath(mPath, paint); - } - restoreCanvas(canvas); - } - markUpdateSeen(); - } - - /** - * Sets up {@link #mPaint} according to the props set on a shadow view. Returns {@code true} if - * the stroke should be drawn, {@code false} if not. - */ - protected boolean setupStrokePaint(Paint paint, float opacity) { - if (mStrokeWidth == 0 || mStrokeColor == null || mStrokeColor.length == 0) { - return false; - } - paint.reset(); - paint.setFlags(Paint.ANTI_ALIAS_FLAG); - paint.setStyle(Paint.Style.STROKE); - switch (mStrokeCap) { - case CAP_BUTT: - paint.setStrokeCap(Paint.Cap.BUTT); - break; - case CAP_SQUARE: - paint.setStrokeCap(Paint.Cap.SQUARE); - break; - case CAP_ROUND: - paint.setStrokeCap(Paint.Cap.ROUND); - break; - default: - throw new JSApplicationIllegalArgumentException( - "strokeCap " + mStrokeCap + " unrecognized"); - } - switch (mStrokeJoin) { - case JOIN_MITER: - paint.setStrokeJoin(Paint.Join.MITER); - break; - case JOIN_BEVEL: - paint.setStrokeJoin(Paint.Join.BEVEL); - break; - case JOIN_ROUND: - paint.setStrokeJoin(Paint.Join.ROUND); - break; - default: - throw new JSApplicationIllegalArgumentException( - "strokeJoin " + mStrokeJoin + " unrecognized"); - } - paint.setStrokeWidth(mStrokeWidth * mScale); - paint.setARGB( - (int) (mStrokeColor.length > 3 ? mStrokeColor[3] * opacity * 255 : opacity * 255), - (int) (mStrokeColor[0] * 255), - (int) (mStrokeColor[1] * 255), - (int) (mStrokeColor[2] * 255)); - if (mStrokeDash != null && mStrokeDash.length > 0) { - paint.setPathEffect(new DashPathEffect(mStrokeDash, 0)); - } - return true; - } - - /** - * Sets up {@link #mPaint} according to the props set on a shadow view. Returns {@code true} if - * the fill should be drawn, {@code false} if not. - */ - protected boolean setupFillPaint(Paint paint, float opacity) { - if (mBrushData != null && mBrushData.length > 0) { - paint.reset(); - paint.setFlags(Paint.ANTI_ALIAS_FLAG); - paint.setStyle(Paint.Style.FILL); - int colorType = (int) mBrushData[0]; - switch (colorType) { - case COLOR_TYPE_SOLID_COLOR: - paint.setARGB( - (int) (mBrushData.length > 4 ? mBrushData[4] * opacity * 255 : opacity * 255), - (int) (mBrushData[1] * 255), - (int) (mBrushData[2] * 255), - (int) (mBrushData[3] * 255)); - break; - case COLOR_TYPE_LINEAR_GRADIENT: - // For mBrushData format refer to LinearGradient and insertColorStopsIntoArray functions - // in ReactNativeART.js - if (mBrushData.length < 5) { - FLog.w( - ReactConstants.TAG, - "[ARTShapeShadowNode setupFillPaint] expects 5 elements, received " - + mBrushData.length); - return false; - } - float gradientStartX = mBrushData[1] * mScale; - float gradientStartY = mBrushData[2] * mScale; - float gradientEndX = mBrushData[3] * mScale; - float gradientEndY = mBrushData[4] * mScale; - int stops = (mBrushData.length - 5) / 5; - int[] colors = null; - float[] positions = null; - if (stops > 0) { - colors = new int[stops]; - positions = new float[stops]; - for (int i = 0; i < stops; i++) { - positions[i] = mBrushData[5 + 4 * stops + i]; - int r = (int) (255 * mBrushData[5 + 4 * i + 0]); - int g = (int) (255 * mBrushData[5 + 4 * i + 1]); - int b = (int) (255 * mBrushData[5 + 4 * i + 2]); - int a = (int) (255 * mBrushData[5 + 4 * i + 3]); - colors[i] = Color.argb(a, r, g, b); - } - } - paint.setShader( - new LinearGradient( - gradientStartX, - gradientStartY, - gradientEndX, - gradientEndY, - colors, - positions, - Shader.TileMode.CLAMP)); - break; - case COLOR_TYPE_RADIAL_GRADIENT: - // TODO(6352048): Support radial gradient etc. - case COLOR_TYPE_PATTERN: - // TODO(6352048): Support patterns etc. - default: - FLog.w(ReactConstants.TAG, "ART: Color type " + colorType + " not supported!"); - } - return true; - } - return false; - } - - /** - * Returns the floor modulus of the float arguments. Java modulus will return a negative remainder - * when the divisor is negative. Modulus should always be positive. This mimics the behavior of - * Math.floorMod, introduced in Java 8. - */ - private float modulus(float x, float y) { - float remainder = x % y; - float modulus = remainder; - if (remainder < 0) { - modulus += y; - } - return modulus; - } - - /** - * Creates a {@link Path} from an array of instructions constructed by JS (see - * ARTSerializablePath.js). Each instruction starts with a type (see PATH_TYPE_*) followed by - * arguments for that instruction. For example, to create a line the instruction will be 2 - * (PATH_LINE_TO), x, y. This will draw a line from the last draw point (or 0,0) to x,y. - * - * @param data the array of instructions - * @return the {@link Path} that can be drawn to a canvas - */ - private Path createPath(float[] data) { - Path path = new Path(); - path.moveTo(0, 0); - int i = 0; - while (i < data.length) { - int type = (int) data[i++]; - switch (type) { - case PATH_TYPE_MOVETO: - path.moveTo(data[i++] * mScale, data[i++] * mScale); - break; - case PATH_TYPE_CLOSE: - path.close(); - break; - case PATH_TYPE_LINETO: - path.lineTo(data[i++] * mScale, data[i++] * mScale); - break; - case PATH_TYPE_CURVETO: - path.cubicTo( - data[i++] * mScale, - data[i++] * mScale, - data[i++] * mScale, - data[i++] * mScale, - data[i++] * mScale, - data[i++] * mScale); - break; - case PATH_TYPE_ARC: - { - float x = data[i++] * mScale; - float y = data[i++] * mScale; - float r = data[i++] * mScale; - float start = (float) Math.toDegrees(data[i++]); - float end = (float) Math.toDegrees(data[i++]); - - boolean counterClockwise = !(data[i++] == 1f); - float sweep = end - start; - if (Math.abs(sweep) >= 360) { - path.addCircle(x, y, r, counterClockwise ? Path.Direction.CCW : Path.Direction.CW); - } else { - sweep = modulus(sweep, 360); - if (counterClockwise && sweep < 360) { - // Counter-clockwise sweeps are negative - sweep = -1 * (360 - sweep); - } - - RectF oval = new RectF(x - r, y - r, x + r, y + r); - path.arcTo(oval, start, sweep); - } - break; - } - default: - throw new JSApplicationIllegalArgumentException( - "Unrecognized drawing instruction " + type); - } - } - return path; - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeViewManager.java deleted file mode 100644 index f192481fabfbdc..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeViewManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import com.facebook.react.module.annotations.ReactModule; - -/** ViewManager for shadowed ART shape views. */ -@ReactModule(name = ARTRenderableViewManager.CLASS_SHAPE) -public class ARTShapeViewManager extends ARTRenderableViewManager { - - /* package */ ARTShapeViewManager() { - super(CLASS_SHAPE); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceView.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceView.java deleted file mode 100644 index 95d0d6fbb8956b..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceView.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.content.Context; -import android.view.TextureView; - -/** Custom {@link View} implementation that draws an ARTSurface React view and its children. */ -public class ARTSurfaceView extends TextureView { - public ARTSurfaceView(Context context) { - super(context); - setOpaque(false); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java deleted file mode 100644 index 5a3e42c6b62da4..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import com.facebook.react.module.annotations.ReactModule; -import com.facebook.react.uimanager.BaseViewManager; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaMeasureMode; -import com.facebook.yoga.YogaNode; - -/** - * ViewManager for ARTSurfaceView React views. Renders as a {@link ARTSurfaceView} and handles - * invalidating the native view on shadow view updates happening in the underlying tree. - */ -@ReactModule(name = ARTSurfaceViewManager.REACT_CLASS) -public class ARTSurfaceViewManager - extends BaseViewManager { - - public static final String REACT_CLASS = "ARTSurfaceView"; - - private static final YogaMeasureFunction MEASURE_FUNCTION = - new YogaMeasureFunction() { - @Override - public long measure( - YogaNode node, - float width, - YogaMeasureMode widthMode, - float height, - YogaMeasureMode heightMode) { - throw new IllegalStateException("SurfaceView should have explicit width and height set"); - } - }; - - @Override - public String getName() { - return REACT_CLASS; - } - - @Override - public ARTSurfaceViewShadowNode createShadowNodeInstance() { - ARTSurfaceViewShadowNode node = new ARTSurfaceViewShadowNode(); - node.setMeasureFunction(MEASURE_FUNCTION); - return node; - } - - @Override - public Class getShadowNodeClass() { - return ARTSurfaceViewShadowNode.class; - } - - @Override - protected ARTSurfaceView createViewInstance(ThemedReactContext reactContext) { - return new ARTSurfaceView(reactContext); - } - - @Override - public void updateExtraData(ARTSurfaceView root, Object extraData) { - ARTSurfaceViewShadowNode shadowNode = (ARTSurfaceViewShadowNode) extraData; - shadowNode.setupSurfaceTextureListener(root); - } - - @Override - public void setBackgroundColor(ARTSurfaceView view, int backgroundColor) { - // As of Android N TextureView does not support calling setBackground on it. - // It will also throw an exception when target SDK is set to N or higher. - - // Setting the background color for this view is handled in the shadow node. - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewShadowNode.java deleted file mode 100644 index acc7fcaeec9287..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewShadowNode.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.PorterDuff; -import android.graphics.SurfaceTexture; -import android.os.Build; -import android.view.Surface; -import android.view.TextureView; -import androidx.annotation.Nullable; -import com.facebook.common.logging.FLog; -import com.facebook.react.bridge.LifecycleEventListener; -import com.facebook.react.common.ReactConstants; -import com.facebook.react.uimanager.LayoutShadowNode; -import com.facebook.react.uimanager.ReactShadowNode; -import com.facebook.react.uimanager.ThemedReactContext; -import com.facebook.react.uimanager.UIViewOperationQueue; -import com.facebook.react.uimanager.ViewProps; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** Shadow node for ART virtual tree root - ARTSurfaceView */ -public class ARTSurfaceViewShadowNode extends LayoutShadowNode - implements TextureView.SurfaceTextureListener, LifecycleEventListener { - - private @Nullable Surface mSurface; - - private @Nullable Integer mBackgroundColor; - - @ReactProp(name = ViewProps.BACKGROUND_COLOR, customType = "Color") - public void setBackgroundColor(Integer color) { - mBackgroundColor = color; - markUpdated(); - } - - @Override - public boolean isVirtual() { - return false; - } - - @Override - public boolean isVirtualAnchor() { - return true; - } - - @Override - public void onCollectExtraUpdates(UIViewOperationQueue uiUpdater) { - super.onCollectExtraUpdates(uiUpdater); - drawOutput(false); - uiUpdater.enqueueUpdateExtraData(getReactTag(), this); - } - - private void drawOutput(boolean markAsUpdated) { - if (mSurface == null || !mSurface.isValid()) { - markChildrenUpdatesSeen(this); - return; - } - - try { - Canvas canvas = mSurface.lockCanvas(null); - canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); - if (mBackgroundColor != null) { - canvas.drawColor(mBackgroundColor); - } - - Paint paint = new Paint(); - for (int i = 0; i < getChildCount(); i++) { - ARTVirtualNode child = (ARTVirtualNode) getChildAt(i); - child.draw(canvas, paint, 1f); - if (markAsUpdated) { - child.markUpdated(); - } else { - child.markUpdateSeen(); - } - } - - if (mSurface == null) { - return; - } - mSurface.unlockCanvasAndPost(canvas); - } catch (IllegalArgumentException | IllegalStateException e) { - FLog.e(ReactConstants.TAG, e.getClass().getSimpleName() + " in Surface.unlockCanvasAndPost"); - } - } - - public void setupSurfaceTextureListener(ARTSurfaceView surfaceView) { - SurfaceTexture surface = surfaceView.getSurfaceTexture(); - surfaceView.setSurfaceTextureListener(this); - if (surface != null && mSurface == null) { - mSurface = new Surface(surface); - drawOutput(true); - } - } - - private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) { - for (int i = 0; i < shadowNode.getChildCount(); i++) { - ReactShadowNode child = shadowNode.getChildAt(i); - child.markUpdateSeen(); - markChildrenUpdatesSeen(child); - } - } - - @Override - public void setThemedContext(ThemedReactContext themedContext) { - super.setThemedContext(themedContext); - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) { - themedContext.addLifecycleEventListener(this); - } - } - - @Override - public void dispose() { - super.dispose(); - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) { - getThemedContext().removeLifecycleEventListener(this); - } - } - - @Override - public void onHostResume() { - drawOutput(false); - } - - @Override - public void onHostPause() {} - - @Override - public void onHostDestroy() {} - - @Override - public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { - mSurface = new Surface(surface); - drawOutput(false); - } - - @Override - public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { - mSurface.release(); - mSurface = null; - return true; - } - - @Override - public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {} - - @Override - public void onSurfaceTextureUpdated(SurfaceTexture surface) {} -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextShadowNode.java deleted file mode 100644 index dca51da7f92e95..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextShadowNode.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.Typeface; -import android.text.TextUtils; -import androidx.annotation.Nullable; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** Shadow node for virtual ARTText view */ -public class ARTTextShadowNode extends ARTShapeShadowNode { - - private static final String PROP_LINES = "lines"; - - private static final String PROP_FONT = "font"; - private static final String PROP_FONT_FAMILY = "fontFamily"; - private static final String PROP_FONT_SIZE = "fontSize"; - private static final String PROP_FONT_STYLE = "fontStyle"; - private static final String PROP_FONT_WEIGHT = "fontWeight"; - - private static final int DEFAULT_FONT_SIZE = 12; - - private static final int TEXT_ALIGNMENT_CENTER = 2; - private static final int TEXT_ALIGNMENT_LEFT = 0; - private static final int TEXT_ALIGNMENT_RIGHT = 1; - - private @Nullable ReadableMap mFrame; - private int mTextAlignment = TEXT_ALIGNMENT_LEFT; - - public ARTTextShadowNode() {} - - @ReactProp(name = "frame") - public void setFrame(@Nullable ReadableMap frame) { - mFrame = frame; - } - - @ReactProp(name = "alignment", defaultInt = TEXT_ALIGNMENT_LEFT) - public void setAlignment(int alignment) { - mTextAlignment = alignment; - } - - @Override - public void draw(Canvas canvas, Paint paint, float opacity) { - if (mFrame == null) { - return; - } - opacity *= mOpacity; - if (opacity <= MIN_OPACITY_FOR_DRAW) { - return; - } - if (!mFrame.hasKey(PROP_LINES)) { - return; - } - ReadableArray linesProp = mFrame.getArray(PROP_LINES); - if (linesProp == null || linesProp.size() == 0) { - return; - } - - // only set up the canvas if we have something to draw - saveAndSetupCanvas(canvas); - String[] lines = new String[linesProp.size()]; - for (int i = 0; i < lines.length; i++) { - lines[i] = linesProp.getString(i); - } - String text = TextUtils.join("\n", lines); - if (setupStrokePaint(paint, opacity)) { - applyTextPropertiesToPaint(paint); - if (mPath == null) { - canvas.drawText(text, 0, -paint.ascent(), paint); - } else { - canvas.drawTextOnPath(text, mPath, 0, 0, paint); - } - } - if (setupFillPaint(paint, opacity)) { - applyTextPropertiesToPaint(paint); - if (mPath == null) { - canvas.drawText(text, 0, -paint.ascent(), paint); - } else { - canvas.drawTextOnPath(text, mPath, 0, 0, paint); - } - } - restoreCanvas(canvas); - markUpdateSeen(); - } - - private void applyTextPropertiesToPaint(Paint paint) { - int alignment = mTextAlignment; - switch (alignment) { - case TEXT_ALIGNMENT_LEFT: - paint.setTextAlign(Paint.Align.LEFT); - break; - case TEXT_ALIGNMENT_RIGHT: - paint.setTextAlign(Paint.Align.RIGHT); - break; - case TEXT_ALIGNMENT_CENTER: - paint.setTextAlign(Paint.Align.CENTER); - break; - } - if (mFrame != null) { - if (mFrame.hasKey(PROP_FONT)) { - ReadableMap font = mFrame.getMap(PROP_FONT); - if (font != null) { - float fontSize = DEFAULT_FONT_SIZE; - if (font.hasKey(PROP_FONT_SIZE)) { - fontSize = (float) font.getDouble(PROP_FONT_SIZE); - } - paint.setTextSize(fontSize * mScale); - boolean isBold = - font.hasKey(PROP_FONT_WEIGHT) && "bold".equals(font.getString(PROP_FONT_WEIGHT)); - boolean isItalic = - font.hasKey(PROP_FONT_STYLE) && "italic".equals(font.getString(PROP_FONT_STYLE)); - int fontStyle; - if (isBold && isItalic) { - fontStyle = Typeface.BOLD_ITALIC; - } else if (isBold) { - fontStyle = Typeface.BOLD; - } else if (isItalic) { - fontStyle = Typeface.ITALIC; - } else { - fontStyle = Typeface.NORMAL; - } - // NB: if the font family is null / unsupported, the default one will be used - paint.setTypeface(Typeface.create(font.getString(PROP_FONT_FAMILY), fontStyle)); - } - } - } - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextViewManager.java deleted file mode 100644 index b49b95b76d8c5f..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTTextViewManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import com.facebook.react.module.annotations.ReactModule; - -/** ViewManager for shadowed ART text views. */ -@ReactModule(name = ARTRenderableViewManager.CLASS_TEXT) -public class ARTTextViewManager extends ARTRenderableViewManager { - - /* package */ ARTTextViewManager() { - super(CLASS_TEXT); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTVirtualNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTVirtualNode.java deleted file mode 100644 index 8f6592924e4e54..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTVirtualNode.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import android.graphics.Canvas; -import android.graphics.Matrix; -import android.graphics.Paint; -import androidx.annotation.Nullable; -import com.facebook.react.bridge.JSApplicationIllegalArgumentException; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.uimanager.DisplayMetricsHolder; -import com.facebook.react.uimanager.ReactShadowNodeImpl; -import com.facebook.react.uimanager.annotations.ReactProp; - -/** - * Base class for ARTView virtual nodes: {@link ARTGroupShadowNode}, {@link ARTShapeShadowNode} and - * indirectly for {@link ARTTextShadowNode}. - */ -public abstract class ARTVirtualNode extends ReactShadowNodeImpl { - - protected static final float MIN_OPACITY_FOR_DRAW = 0.01f; - - private static final float[] sMatrixData = new float[9]; - private static final float[] sRawMatrix = new float[9]; - - protected float mOpacity = 1f; - private @Nullable Matrix mMatrix = new Matrix(); - - protected final float mScale; - - public ARTVirtualNode() { - mScale = DisplayMetricsHolder.getWindowDisplayMetrics().density; - } - - @Override - public boolean isVirtual() { - return true; - } - - public abstract void draw(Canvas canvas, Paint paint, float opacity); - - /** - * Sets up the transform matrix on the canvas before an element is drawn. - * - *

NB: for perf reasons this does not apply opacity, as that would mean creating a new canvas - * layer (which allocates an offscreen bitmap) and having it composited afterwards. Instead, the - * drawing code should apply opacity recursively. - * - * @param canvas the canvas to set up - */ - protected final void saveAndSetupCanvas(Canvas canvas) { - canvas.save(); - if (mMatrix != null) { - canvas.concat(mMatrix); - } - } - - /** - * Restore the canvas after an element was drawn. This is always called in mirror with {@link - * #saveAndSetupCanvas}. - * - * @param canvas the canvas to restore - */ - protected void restoreCanvas(Canvas canvas) { - canvas.restore(); - } - - @ReactProp(name = "opacity", defaultFloat = 1f) - public void setOpacity(float opacity) { - mOpacity = opacity; - markUpdated(); - } - - @ReactProp(name = "transform") - public void setTransform(@Nullable ReadableArray transformArray) { - if (transformArray != null) { - int matrixSize = PropHelper.toFloatArray(transformArray, sMatrixData); - if (matrixSize == 6) { - setupMatrix(); - } else if (matrixSize != -1) { - throw new JSApplicationIllegalArgumentException("Transform matrices must be of size 6"); - } - } else { - mMatrix = null; - } - markUpdated(); - } - - protected void setupMatrix() { - sRawMatrix[0] = sMatrixData[0]; - sRawMatrix[1] = sMatrixData[2]; - sRawMatrix[2] = sMatrixData[4] * mScale; - sRawMatrix[3] = sMatrixData[1]; - sRawMatrix[4] = sMatrixData[3]; - sRawMatrix[5] = sMatrixData[5] * mScale; - sRawMatrix[6] = 0; - sRawMatrix[7] = 0; - sRawMatrix[8] = 1; - if (mMatrix == null) { - mMatrix = new Matrix(); - } - mMatrix.setValues(sRawMatrix); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/art/BUCK deleted file mode 100644 index b5eae199917ce9..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library") - -rn_android_library( - name = "art", - srcs = glob(["*.java"]), - is_androidx = True, - visibility = [ - "PUBLIC", - ], - deps = [ - YOGA_TARGET, - react_native_dep("third-party/android/androidx:annotation"), - react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"), - react_native_dep("third-party/java/jsr-305:jsr-305"), - react_native_target("java/com/facebook/react/bridge:bridge"), - react_native_target("java/com/facebook/react/common:common"), - react_native_target("java/com/facebook/react/module/annotations:annotations"), - react_native_target("java/com/facebook/react/uimanager:uimanager"), - react_native_target("java/com/facebook/react/uimanager/annotations:annotations"), - ], -) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/PropHelper.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/PropHelper.java deleted file mode 100644 index 970f505661b99b..00000000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/PropHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -package com.facebook.react.views.art; - -import androidx.annotation.Nullable; -import com.facebook.react.bridge.ReadableArray; - -/** Contains static helper methods for accessing props. */ -/* package */ class PropHelper { - - /** - * Converts {@link ReadableArray} to an array of {@code float}. Returns newly created array. - * - * @return a {@code float[]} if converted successfully, or {@code null} if {@param value} was - * {@code null}. - */ - /*package*/ static @Nullable float[] toFloatArray(@Nullable ReadableArray value) { - if (value != null) { - float[] result = new float[value.size()]; - toFloatArray(value, result); - return result; - } - return null; - } - - /** - * Converts given {@link ReadableArray} to an array of {@code float}. Writes result to the array - * passed in {@param into}. This method will write to the output array up to the number of items - * from the input array. If the input array is longer than output the remaining part of the input - * will not be converted. - * - * @param value input array - * @param into output array - * @return number of items copied from input to the output array - */ - /*package*/ static int toFloatArray(ReadableArray value, float[] into) { - int length = value.size() > into.length ? into.length : value.size(); - for (int i = 0; i < length; i++) { - into[i] = (float) value.getDouble(i); - } - return value.size(); - } -} From b2b23a20170d12f6d8bf2733b93d7f9ab9c6cb15 Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Tue, 28 Apr 2020 09:29:43 -0700 Subject: [PATCH 131/235] Check en0..en8 when generating ip.txt for iOS debug builds (#28764) Summary: When generating ip.txt in an iOS debug build, search en0 through en8 for an IP address rather than only checking en0 and en1. For example, on my Mac, the IP address I needed to use was on en5 and the IP address actually detected was a private network of one of my Parallels virtual machines (interface vnic0). ## Changelog [iOS] [Fixed] - Search en0 through en8 for the Metro Bundler's IP address when generating iOS debug builds Pull Request resolved: https://github.com/facebook/react-native/pull/28764 Test Plan: Should make no difference to users for whom react-native-xcode.sh already worked. On a Mac with multiple virtual machines installed, should prevent ip.txt getting the private IP address of a virtual machine. Differential Revision: D21280671 Pulled By: shergin fbshipit-source-id: e6fe9c8344146626df96129968981462463201f7 --- scripts/react-native-xcode.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 328085fb5204c9..f0cfa0fd54f12d 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -14,10 +14,12 @@ DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH # Enables iOS devices to get the IP address of the machine running Metro if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then - IP=$(ipconfig getifaddr en0) - if [[ -z "$IP" || -n "`ifconfig $value | grep 'baseT'`" ]]; then - IP=$(ipconfig getifaddr en1) - fi + for num in 0 1 2 3 4 5 6 7 8; do + IP=$(ipconfig getifaddr en${num}) + if [ ! -z "$IP" ]; then + break + fi + done if [ -z "$IP" ]; then IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | grep -v ' 169.254.' |cut -d\ -f2 | awk 'NR==1{print $1}') fi From 1cef72af047bd2e56d774858093f1ee6269c2d27 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 28 Apr 2020 12:14:48 -0700 Subject: [PATCH 132/235] Part 1: Make CatalystInstanceImpl.getNativeModule Nullable Summary: ## Description When the TurboModule and the NativeModule systems are alive at the same time, after RN cleanup, if a TurboModule is required, we return `null` from TurboModuleManager. This causes `CatalystInstanceImpl.getNativeModule` to do a lookup on NativeModule registry, which throws an `AssertionError`, because the TurboModule isn't found. Instead of throwing an `AssertionError` from `CatalystInstanceImpl.getNativeModule`, this diff instead has that method return `null` in this particular case. ## Rationale This should eliminate the crashes we're seeing in T46487253. ## Future action In the future, we should guard `CatalystInstanceImpl.getNativeModule` with an `if (mDestroyed) return null;` statement. This'll ensure that if NativeModules are required after React Native has started cleanup, they'll be returned as `null`. Right now, we either return the destroyed NativeModule object, or create/initialize the NativeMoulde and return it, which is wrong. Changelog: [Android][Changed] - Make CatalystInstance.getNativeModule nullable Reviewed By: JoshuaGross Differential Revision: D21272029 fbshipit-source-id: 099ad9ab9fa2146299df4cf7f86ae7a8e526bb15 --- .../java/com/facebook/react/bridge/CatalystInstance.java | 2 ++ .../com/facebook/react/bridge/CatalystInstanceImpl.java | 6 +++++- .../main/java/com/facebook/react/bridge/ReactContext.java | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java index 09f0f6db3f10e3..f95b974e30d064 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java @@ -62,8 +62,10 @@ public interface CatalystInstance boolean hasNativeModule(Class nativeModuleInterface); + @Nullable T getNativeModule(Class nativeModuleInterface); + @Nullable NativeModule getNativeModule(String moduleName); JSIModule getJSIModule(JSIModuleType moduleType); diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index a6ac1405b054a4..6e481bbd2cd12b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -562,6 +562,7 @@ public boolean hasNativeModule(Class nativeModuleInt } @Override + @Nullable public T getNativeModule(Class nativeModuleInterface) { return (T) getNativeModule(getNameFromAnnotation(nativeModuleInterface)); } @@ -577,6 +578,7 @@ private TurboModuleRegistry getTurboModuleRegistry() { } @Override + @Nullable public NativeModule getNativeModule(String moduleName) { if (getTurboModuleRegistry() != null) { TurboModule turboModule = getTurboModuleRegistry().getModule(moduleName); @@ -593,7 +595,9 @@ public NativeModule getNativeModule(String moduleName) { } } - return mNativeModuleRegistry.getModule(moduleName); + return mNativeModuleRegistry.hasModule(moduleName) + ? mNativeModuleRegistry.getModule(moduleName) + : null; } private String getNameFromAnnotation(Class nativeModuleInterface) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index fe13dd689810e1..126237e74e8e31 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -158,6 +158,7 @@ public boolean hasNativeModule(Class nativeModuleInt } /** @return the instance of the specified module interface associated with this ReactContext. */ + @Nullable public T getNativeModule(Class nativeModuleInterface) { if (mCatalystInstance == null) { raiseCatalystInstanceMissingException(); From 9263eb5d3864a42925b699343db2c09cc8934ed0 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 28 Apr 2020 12:14:48 -0700 Subject: [PATCH 133/235] Part 2: Make CatalystInstanceImpl.getNativeModule Nullable Summary: This is the codemod portion of the parent diff. I modified all call-sites to `ReactContext.getNativeModule` to do a null check on the returned NativeModule. Changelog: [Android][Fixed] - Check if NativeModules returned from CatalystInstanceImpl.getNativeModule are null before using them. Reviewed By: JoshuaGross Differential Revision: D21272028 fbshipit-source-id: 6bd16c6bf30605f2dfdf4c481352063712965342 --- .../testing/rule/ReactNativeTestRule.java | 5 +++ .../facebook/react/ReactInstanceManager.java | 17 +++++++--- .../com/facebook/react/ReactRootView.java | 28 +++++++++------ .../react/animated/NativeAnimatedModule.java | 7 ++-- .../devsupport/DevSupportManagerBase.java | 27 ++++++++------- .../react/fabric/FabricJSIModuleProvider.java | 4 ++- .../modules/debug/FpsDebugFrameCallback.java | 3 +- .../react/uimanager/UIViewOperationQueue.java | 13 ++++--- .../drawer/ReactDrawerLayoutManager.java | 9 +++-- .../views/modal/ReactModalHostManager.java | 8 +++-- .../react/views/modal/ReactModalHostView.java | 11 ++++-- .../views/picker/ReactPickerManager.java | 10 ++++-- .../views/slider/ReactSliderManager.java | 34 ++++++++++++------- .../views/switchview/ReactSwitchManager.java | 10 ++++-- .../react/views/text/ReactTextView.java | 4 ++- .../react/views/textinput/ReactEditText.java | 4 ++- .../ReactEditTextInputConnectionWrapper.java | 5 ++- .../textinput/ReactTextInputManager.java | 9 +++-- .../react/views/view/ReactViewManager.java | 12 ++++--- .../react/views/viewpager/ReactViewPager.java | 5 ++- 20 files changed, 153 insertions(+), 72 deletions(-) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/ReactNativeTestRule.java b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/ReactNativeTestRule.java index 1dd5b381a79bc7..8d6252f28b8c88 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/ReactNativeTestRule.java +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/ReactNativeTestRule.java @@ -95,6 +95,11 @@ public void run() { public void onReactContextInitialized(ReactContext reactContext) { final UIManagerModule uiManagerModule = reactContext.getCatalystInstance().getNativeModule(UIManagerModule.class); + + if (uiManagerModule == null) { + return; + } + uiManagerModule .getUIImplementation() .setLayoutUpdateListener( diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 17eae9a95057da..07f26501f6e283 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -470,7 +470,9 @@ public void onBackPressed() { } else { DeviceEventManagerModule deviceEventManagerModule = reactContext.getNativeModule(DeviceEventManagerModule.class); - deviceEventManagerModule.emitHardwareBackPressed(); + if (deviceEventManagerModule != null) { + deviceEventManagerModule.emitHardwareBackPressed(); + } } } @@ -497,7 +499,9 @@ public void onNewIntent(Intent intent) { || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) { DeviceEventManagerModule deviceEventManagerModule = currentContext.getNativeModule(DeviceEventManagerModule.class); - deviceEventManagerModule.emitNewIntentReceived(uri); + if (deviceEventManagerModule != null) { + deviceEventManagerModule.emitNewIntentReceived(uri); + } } currentContext.onNewIntent(mCurrentActivity, intent); } @@ -775,9 +779,12 @@ public void onConfigurationChanged(Context updatedContext, @Nullable Configurati ReactContext currentReactContext = getCurrentReactContext(); if (currentReactContext != null) { - currentReactContext - .getNativeModule(AppearanceModule.class) - .onConfigurationChanged(updatedContext); + AppearanceModule appearanceModule = + currentReactContext.getNativeModule(AppearanceModule.class); + + if (appearanceModule != null) { + appearanceModule.onConfigurationChanged(updatedContext); + } } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index b40196b11e3ec1..26c39f9df01ae3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -200,9 +200,12 @@ public void onChildStartedNativeGesture(MotionEvent androidEvent) { return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); - EventDispatcher eventDispatcher = - reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); - mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager != null) { + EventDispatcher eventDispatcher = uiManager.getEventDispatcher(); + mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher); + } } @Override @@ -285,9 +288,12 @@ private void dispatchJSTouchEvent(MotionEvent event) { return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); - EventDispatcher eventDispatcher = - reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); - mJSTouchDispatcher.handleTouchEvent(event, eventDispatcher); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager != null) { + EventDispatcher eventDispatcher = uiManager.getEventDispatcher(); + mJSTouchDispatcher.handleTouchEvent(event, eventDispatcher); + } } @Override @@ -749,10 +755,12 @@ private void emitOrientationChanged(final int newRotation) { } private void emitUpdateDimensionsEvent() { - mReactInstanceManager - .getCurrentReactContext() - .getNativeModule(DeviceInfoModule.class) - .emitUpdateDimensionsEvent(); + DeviceInfoModule deviceInfo = + mReactInstanceManager.getCurrentReactContext().getNativeModule(DeviceInfoModule.class); + + if (deviceInfo != null) { + deviceInfo.emitUpdateDimensionsEvent(); + } } private WritableMap createKeyboardEventPayload( diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 919b5a5f16e9f4..ead07f9512229b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -130,7 +130,8 @@ public void initialize() { // TODO T59412313 Implement this API on FabricUIManager to use in bridgeless mode if (reactApplicationContext != null && !reactApplicationContext.isBridgeless()) { reactApplicationContext.addLifecycleEventListener(this); - UIManagerModule uiManager = reactApplicationContext.getNativeModule(UIManagerModule.class); + UIManagerModule uiManager = + Assertions.assertNotNull(reactApplicationContext.getNativeModule(UIManagerModule.class)); uiManager.addUIManagerListener(this); } } @@ -191,7 +192,9 @@ private NativeAnimatedNodesManager getNodesManager() { ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn(); if (reactApplicationContext != null) { - UIManagerModule uiManager = reactApplicationContext.getNativeModule(UIManagerModule.class); + UIManagerModule uiManager = + Assertions.assertNotNull( + reactApplicationContext.getNativeModule(UIManagerModule.class)); mNodesManager = new NativeAnimatedNodesManager(uiManager); } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 8a99c522ba9fbf..e93b645cb83bd5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -962,19 +962,22 @@ private void handleCaptureHeap(final Responder responder) { return; } JSCHeapCapture heapCapture = mCurrentContext.getNativeModule(JSCHeapCapture.class); - heapCapture.captureHeap( - mApplicationContext.getCacheDir().getPath(), - new JSCHeapCapture.CaptureCallback() { - @Override - public void onSuccess(File capture) { - responder.respond(capture.toString()); - } - @Override - public void onFailure(JSCHeapCapture.CaptureException error) { - responder.error(error.toString()); - } - }); + if (heapCapture != null) { + heapCapture.captureHeap( + mApplicationContext.getCacheDir().getPath(), + new JSCHeapCapture.CaptureCallback() { + @Override + public void onSuccess(File capture) { + responder.respond(capture.toString()); + } + + @Override + public void onFailure(JSCHeapCapture.CaptureException error) { + responder.error(error.toString()); + } + }); + } } private void updateLastErrorInfo( diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java index 4d55cf236d6038..38b4c39cbfafb2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java @@ -8,6 +8,7 @@ package com.facebook.react.fabric; import androidx.annotation.NonNull; +import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.JSIModuleProvider; import com.facebook.react.bridge.JavaScriptContextHolder; import com.facebook.react.bridge.ReactApplicationContext; @@ -83,7 +84,8 @@ public UIManager get() { private FabricUIManager createUIManager(@NonNull EventBeatManager eventBeatManager) { Systrace.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.createUIManager"); - UIManagerModule nativeModule = mReactApplicationContext.getNativeModule(UIManagerModule.class); + UIManagerModule nativeModule = + Assertions.assertNotNull(mReactApplicationContext.getNativeModule(UIManagerModule.class)); EventDispatcher eventDispatcher = nativeModule.getEventDispatcher(); FabricUIManager fabricUIManager = new FabricUIManager( diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java index 6eae4d7a5c8200..df4b653cc9bfce 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.java @@ -75,7 +75,8 @@ public FpsInfo( public FpsDebugFrameCallback(ReactContext reactContext) { mReactContext = reactContext; - mUIManagerModule = reactContext.getNativeModule(UIManagerModule.class); + mUIManagerModule = + Assertions.assertNotNull(reactContext.getNativeModule(UIManagerModule.class)); mDidJSUpdateUiDuringFrameDetector = new DidJSUpdateUiDuringFrameDetector(); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java index 9c2eed060a7110..4f8844cba117ad 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java @@ -113,11 +113,14 @@ public EmitOnLayoutEventOperation( @Override public void execute() { - mReactApplicationContext - .getNativeModule(UIManagerModule.class) - .getEventDispatcher() - .dispatchEvent( - OnLayoutEvent.obtain(mTag, mScreenX, mScreenY, mScreenWidth, mScreenHeight)); + UIManagerModule uiManager = mReactApplicationContext.getNativeModule(UIManagerModule.class); + + if (uiManager != null) { + uiManager + .getEventDispatcher() + .dispatchEvent( + OnLayoutEvent.obtain(mTag, mScreenX, mScreenY, mScreenWidth, mScreenHeight)); + } } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java index d2f22623a81508..712353eb0a42f2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayoutManager.java @@ -56,9 +56,12 @@ public ReactDrawerLayoutManager() { @Override protected void addEventEmitters(ThemedReactContext reactContext, ReactDrawerLayout view) { - view.addDrawerListener( - new DrawerEventEmitter( - view, reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher())); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + if (uiManager == null) { + return; + } + + view.addDrawerListener(new DrawerEventEmitter(view, uiManager.getEventDispatcher())); } @Override diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java index ac0cffd04979fa..00e0066b97a125 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java @@ -105,8 +105,12 @@ public void setIdentifier(ReactModalHostView view, int value) {} @Override protected void addEventEmitters(ThemedReactContext reactContext, final ReactModalHostView view) { - final EventDispatcher dispatcher = - reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + if (uiManager == null) { + return; + } + + final EventDispatcher dispatcher = uiManager.getEventDispatcher(); view.setOnRequestCloseListener( new ReactModalHostView.OnRequestCloseListener() { @Override diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java index 110ebdf34be342..d5312acdb18672 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java @@ -414,9 +414,14 @@ private void updateFirstChildView() { new GuardedRunnable(reactContext) { @Override public void runGuarded() { - (getReactContext()) - .getNativeModule(UIManagerModule.class) - .updateNodeSize(viewTag, viewWidth, viewHeight); + UIManagerModule uiManager = + (getReactContext()).getNativeModule(UIManagerModule.class); + + if (uiManager == null) { + return; + } + + uiManager.updateNodeSize(viewTag, viewWidth, viewHeight); } }); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java index b03783ca3fea8f..e5c42e059905e6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/picker/ReactPickerManager.java @@ -62,9 +62,13 @@ protected void onAfterUpdateTransaction(ReactPicker view) { @Override protected void addEventEmitters(final ThemedReactContext reactContext, final ReactPicker picker) { - picker.setOnSelectListener( - new PickerEventEmitter( - picker, reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher())); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager == null) { + return; + } + + picker.setOnSelectListener(new PickerEventEmitter(picker, uiManager.getEventDispatcher())); } @Override diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java index 9215864a9c6391..2bab0c053204a3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java @@ -91,12 +91,17 @@ public long measure( @Override public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) { ReactContext reactContext = (ReactContext) seekbar.getContext(); - reactContext - .getNativeModule(UIManagerModule.class) - .getEventDispatcher() - .dispatchEvent( - new ReactSliderEvent( - seekbar.getId(), ((ReactSlider) seekbar).toRealProgress(progress), fromUser)); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager != null) { + uiManager + .getEventDispatcher() + .dispatchEvent( + new ReactSliderEvent( + seekbar.getId(), + ((ReactSlider) seekbar).toRealProgress(progress), + fromUser)); + } } @Override @@ -105,13 +110,16 @@ public void onStartTrackingTouch(SeekBar seekbar) {} @Override public void onStopTrackingTouch(SeekBar seekbar) { ReactContext reactContext = (ReactContext) seekbar.getContext(); - reactContext - .getNativeModule(UIManagerModule.class) - .getEventDispatcher() - .dispatchEvent( - new ReactSlidingCompleteEvent( - seekbar.getId(), - ((ReactSlider) seekbar).toRealProgress(seekbar.getProgress()))); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager != null) { + uiManager + .getEventDispatcher() + .dispatchEvent( + new ReactSlidingCompleteEvent( + seekbar.getId(), + ((ReactSlider) seekbar).toRealProgress(seekbar.getProgress()))); + } } }; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java index bd5336ad6b92d8..0a6b8c8762e740 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java @@ -80,8 +80,14 @@ public long measure( @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { ReactContext reactContext = (ReactContext) buttonView.getContext(); - reactContext - .getNativeModule(UIManagerModule.class) + + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + + if (uiManager == null) { + return; + } + + uiManager .getEventDispatcher() .dispatchEvent(new ReactSwitchEvent(buttonView.getId(), isChecked)); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 68bfc3455e7fe6..3d7988087ffaeb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -25,6 +25,7 @@ import androidx.appcompat.widget.AppCompatTextView; import androidx.appcompat.widget.TintContextWrapper; import com.facebook.common.logging.FLog; +import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.WritableArray; @@ -118,7 +119,8 @@ protected void onLayout( } ReactContext reactContext = getReactContext(); - UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + UIManagerModule uiManager = + Assertions.assertNotNull(reactContext.getNativeModule(UIManagerModule.class)); Spanned text = (Spanned) getText(); Layout layout = getLayout(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java index 86ae295b262c43..1638b75147d78f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java @@ -609,7 +609,9 @@ private void setIntrinsicContentSize() { ReactContext reactContext = getReactContext(this); final ReactTextInputLocalData localData = new ReactTextInputLocalData(this); UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); - uiManager.setViewLocalData(getId(), localData); + if (uiManager != null) { + uiManager.setViewLocalData(getId(), localData); + } } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java index b56789ddf06e67..47b4391c327f11 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java @@ -12,6 +12,7 @@ import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputConnectionWrapper; import androidx.annotation.Nullable; +import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.ReactContext; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.events.EventDispatcher; @@ -62,7 +63,9 @@ class ReactEditTextInputConnectionWrapper extends InputConnectionWrapper { public ReactEditTextInputConnectionWrapper( InputConnection target, final ReactContext reactContext, final ReactEditText editText) { super(target, false); - mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); + mEventDispatcher = + Assertions.assertNotNull(reactContext.getNativeModule(UIManagerModule.class)) + .getEventDispatcher(); mEditText = editText; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 2f228cd0566005..8b5b13a6a5be75 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -1090,18 +1090,23 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) { private class ReactContentSizeWatcher implements ContentSizeWatcher { private ReactEditText mEditText; - private EventDispatcher mEventDispatcher; + private @Nullable EventDispatcher mEventDispatcher; private int mPreviousContentWidth = 0; private int mPreviousContentHeight = 0; public ReactContentSizeWatcher(ReactEditText editText) { mEditText = editText; ReactContext reactContext = getReactContext(editText); - mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); + UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); + mEventDispatcher = uiManager != null ? uiManager.getEventDispatcher() : null; } @Override public void onLayout() { + if (mEventDispatcher == null) { + return; + } + int contentWidth = mEditText.getWidth(); int contentHeight = mEditText.getHeight(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java index cad4db8b4f14b5..beb51d86fb4e39 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java @@ -233,10 +233,14 @@ public void setFocusable(final ReactViewGroup view, boolean focusable) { new View.OnClickListener() { @Override public void onClick(View v) { - final EventDispatcher mEventDispatcher = - ((ReactContext) view.getContext()) - .getNativeModule(UIManagerModule.class) - .getEventDispatcher(); + UIManagerModule uiManager = + ((ReactContext) view.getContext()).getNativeModule(UIManagerModule.class); + + if (uiManager == null) { + return; + } + + final EventDispatcher mEventDispatcher = uiManager.getEventDispatcher(); mEventDispatcher.dispatchEvent(new ViewGroupClickEvent(view.getId())); } }); diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java b/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java index 2c6fc370d0d15a..398751a8f6e79e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/ReactViewPager.java @@ -13,6 +13,7 @@ import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; import com.facebook.common.logging.FLog; +import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.ReactContext; import com.facebook.react.common.ReactConstants; import com.facebook.react.uimanager.UIManagerModule; @@ -154,7 +155,9 @@ public void onPageScrollStateChanged(int state) { public ReactViewPager(ReactContext reactContext) { super(reactContext); - mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher(); + mEventDispatcher = + Assertions.assertNotNull(reactContext.getNativeModule(UIManagerModule.class)) + .getEventDispatcher(); mIsCurrentItemFromJs = false; setOnPageChangeListener(new PageChangeListener()); setAdapter(new Adapter()); From 79bc7f9fad78e15cacadd8426bd33bf5f571a192 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 28 Apr 2020 13:06:06 -0700 Subject: [PATCH 134/235] Revert D20587945: iOS: Fix refreshControl layouting Differential Revision: D20587945 Original commit changeset: 94f560b17e36 fbshipit-source-id: e8ec95b2ea8632ef09e132351a1458cf97671206 --- React/Views/RefreshControl/RCTRefreshControl.m | 6 ++++++ React/Views/ScrollView/RCTScrollView.m | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.m index 419535bcb461f5..428a5e7fa406b9 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.m +++ b/React/Views/RefreshControl/RCTRefreshControl.m @@ -41,6 +41,12 @@ - (void)layoutSubviews { [super layoutSubviews]; + // Fix for bug #7976 + // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop. + if (self.backgroundColor == nil) { + self.backgroundColor = [UIColor clearColor]; + } + // If the control is refreshing when mounted we need to call // beginRefreshing in layoutSubview or it doesn't work. if (_currentRefreshingState && _isInitialRender) { diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index bb49c8d73638e5..56d63505b9e630 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -32,7 +32,7 @@ @interface RCTCustomScrollView : UIScrollView @property (nonatomic, assign) BOOL centerContent; #if !TARGET_OS_TV -@property (nonatomic, strong) UIRefreshControl *customRefreshControl; +@property (nonatomic, strong) UIView *customRefreshControl; @property (nonatomic, assign) BOOL pinchGestureEnabled; #endif @@ -224,13 +224,13 @@ - (void)setFrame:(CGRect)frame } #if !TARGET_OS_TV -- (void)setCustomRefreshControl:(UIRefreshControl *)refreshControl +- (void)setCustomRefreshControl:(UIView *)refreshControl { if (_customRefreshControl) { [_customRefreshControl removeFromSuperview]; } _customRefreshControl = refreshControl; - self.refreshControl = refreshControl; + [self addSubview:_customRefreshControl]; } - (void)setPinchGestureEnabled:(BOOL)pinchGestureEnabled @@ -344,7 +344,7 @@ - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex [super insertReactSubview:view atIndex:atIndex]; #if !TARGET_OS_TV if ([view conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) { - [_scrollView setCustomRefreshControl:(UIRefreshControl *)view]; + [_scrollView setCustomRefreshControl:(UIView *)view]; if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) { [self addScrollListener:(UIView *)view]; } @@ -418,6 +418,16 @@ - (void)layoutSubviews [super layoutSubviews]; RCTAssert(self.subviews.count == 1, @"we should only have exactly one subview"); RCTAssert([self.subviews lastObject] == _scrollView, @"our only subview should be a scrollview"); + +#if !TARGET_OS_TV + // Adjust the refresh control frame if the scrollview layout changes. + UIView *refreshControl = _scrollView.customRefreshControl; + if (refreshControl && refreshControl.isRefreshing) { + refreshControl.frame = + (CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}}; + } +#endif + [self updateClippedSubviews]; } From 3d20f49aff5a1af61921258ab1d80f598e021803 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 28 Apr 2020 14:30:15 -0700 Subject: [PATCH 135/235] Back out "Control concurrent calls into TMMDelegate from TMM" Summary: Original commit changeset: d22c4abfe87f This synchronization is redundant. See D21025965. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D21283284 fbshipit-source-id: dae737fe08bbc8f60913baa6c6a58228611257ef --- .../turbomodule/core/TurboModuleManager.java | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java index 004c8e8a7407a0..1b97c5bd62db12 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java @@ -32,7 +32,7 @@ */ public class TurboModuleManager implements JSIModule, TurboModuleRegistry { private static volatile boolean sIsSoLibraryLoaded; - private final List mEagerInitModuleNames = new ArrayList<>(); + private final List mEagerInitModuleNames; private final TurboModuleProvider mJavaModuleProvider; private final TurboModuleProvider mCxxModuleProvider; @@ -64,11 +64,8 @@ public TurboModuleManager( delegate); installJSIBindings(); - if (delegate != null) { - synchronized (delegate) { - mEagerInitModuleNames.addAll(delegate.getEagerInitModuleNames()); - } - } + mEagerInitModuleNames = + delegate == null ? new ArrayList() : delegate.getEagerInitModuleNames(); mJavaModuleProvider = new TurboModuleProvider() { @@ -78,10 +75,7 @@ public TurboModule getModule(String moduleName) { return null; } - /** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */ - synchronized (delegate) { - return delegate.getModule(moduleName); - } + return delegate.getModule(moduleName); } }; @@ -93,13 +87,7 @@ public TurboModule getModule(String moduleName) { return null; } - CxxModuleWrapper nativeModule; - - /** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */ - synchronized (delegate) { - nativeModule = delegate.getLegacyCxxModule(moduleName); - } - + CxxModuleWrapper nativeModule = delegate.getLegacyCxxModule(moduleName); if (nativeModule != null) { // TurboModuleManagerDelegate must always return TurboModules Assertions.assertCondition( From 6de9f37d66d2ddf69e46ec09cff05c7e0dd4cfdb Mon Sep 17 00:00:00 2001 From: Jason Safaiyeh Date: Tue, 28 Apr 2020 14:39:05 -0700 Subject: [PATCH 136/235] Resolve RNTester Xcode warnings (#28676) Summary: Resolve RNTester Xcode warnings. ## Changelog [Internal] [iOS] - Resolve RNTester Xcode warnings Pull Request resolved: https://github.com/facebook/react-native/pull/28676 Test Plan: Building RNTester no longer shows project setting warnings Differential Revision: D21109702 Pulled By: hramos fbshipit-source-id: f7552d3a9857ee7415cd96622a0a79797a168698 --- RNTester/RNTesterPods.xcodeproj/project.pbxproj | 4 +++- .../xcshareddata/xcschemes/RNTester.xcscheme | 2 +- .../xcshareddata/xcschemes/RNTesterIntegrationTests.xcscheme | 2 +- .../xcshareddata/xcschemes/RNTesterUnitTests.xcscheme | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index 8f9b9b6a6a2142..5d598deb0534a9 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -454,7 +454,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1140; ORGANIZATIONNAME = Facebook; TargetAttributes = { E7DB209E22B2BA84005AC45F = { @@ -735,6 +735,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 98233960D1D6A1977D1C7EAF /* Pods-RNTester.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; @@ -806,6 +807,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5BEC8567F3741044B6A5EFC5 /* Pods-RNTester.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; diff --git a/RNTester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/RNTester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index aa5eb07b7a0e40..938a25682dbd5c 100644 --- a/RNTester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/RNTester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 28 Apr 2020 14:40:25 -0700 Subject: [PATCH 137/235] Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 --- react.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react.gradle b/react.gradle index ea3fee2ee6c20e..6441d93f70ecdd 100644 --- a/react.gradle +++ b/react.gradle @@ -29,7 +29,7 @@ def detectCliPath(config) { return config.cliPath } - def cliPath = ["node", "-e", "console.log(require('react-native/cli').bin);"].execute([], projectDir).text + def cliPath = ["node", "-e", "console.log(require('react-native/cli').bin);"].execute([], projectDir).text.trim() if (cliPath) { return cliPath From 00b3cbfa9745b443443d536471f8598a685855b1 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 28 Apr 2020 16:53:36 -0700 Subject: [PATCH 138/235] Fix cleanup bug Summary: This is the iOS analogue to D21290582. Changelog: [iOS][Fixed] - TurboModule cleanup Reviewed By: fkgozali Differential Revision: D21290852 fbshipit-source-id: c0975a1f320ad4ad4ef16eec82eca38389c71a0a --- .../platform/ios/RCTTurboModuleManager.mm | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index f5a12a6dce6b26..f6179e0d344995 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -321,12 +321,22 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name */ - (id)provideRCTTurboModule:(const char *)moduleName { - TurboModuleHolder *moduleHolder = [self _getOrCreateTurboModuleHolder:moduleName]; + TurboModuleHolder *moduleHolder; - if (!moduleHolder) { - return nil; + { + std::lock_guard guard(_turboModuleHoldersMutex); + if (_invalidating) { + return nil; + } + + moduleHolder = &_turboModuleHolders[moduleName]; } + return [self _provideRCTTurboModule:moduleName moduleHolder:moduleHolder]; +} + +- (id)_provideRCTTurboModule:(const char *)moduleName moduleHolder:(TurboModuleHolder *)moduleHolder +{ bool shouldCreateModule = false; { @@ -565,20 +575,6 @@ - (void)notifyAboutTurboModuleSetup:(const char *)name return module; } -/** - * Return a pointer to this TurboModule's TurboModuleHolder entry, creating one if it doesn't exist. - * Return nullptr if we've started teardown of TurboModuleManager. - */ -- (TurboModuleHolder *)_getOrCreateTurboModuleHolder:(const char *)moduleName -{ - std::lock_guard guard(_turboModuleHoldersMutex); - if (_invalidating) { - return nullptr; - } - - return &_turboModuleHolders[moduleName]; -} - /** * Should this TurboModule be created and initialized on the main queue? * @@ -732,15 +728,16 @@ - (void)bridgeDidInvalidateModules:(NSNotification *)notification // Backward-compatibility: RCTInvalidating handling. dispatch_group_t moduleInvalidationGroup = dispatch_group_create(); - for (const auto &pair : _turboModuleHolders) { + for (auto &pair : _turboModuleHolders) { std::string moduleName = pair.first; + TurboModuleHolder *moduleHolder = &pair.second; /** * We could start tearing down ReactNative before a TurboModule is fully initialized. In this case, we should wait - * for init to finish before we call invalidate on the module. Therefore, we call provideRCTTurboModule (because - * it's guaranteed to return a fully initialized NativeModule). + * for TurboModule init to finish before calling invalidate on it. So, we call _provideRCTTurboModule:moduleHolder, + * because it's guaranteed to return a fully initialized NativeModule. */ - id module = [self provideRCTTurboModule:moduleName.c_str()]; + id module = [self _provideRCTTurboModule:moduleName.c_str() moduleHolder:moduleHolder]; if ([module respondsToSelector:@selector(invalidate)]) { if ([module respondsToSelector:@selector(methodQueue)]) { From e171c2b92aa5cfe4634edb64c3cd7c9ab6167ce7 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 28 Apr 2020 17:44:15 -0700 Subject: [PATCH 139/235] Fix cleanup bug Summary: When I initially made TurboModuleManager.getModule thread-safe, I unintentionally broken TurboModule cleanup. This diff fixes that mistake. ## Mistake ``` Override public void onCatalystInstanceDestroy() { synchronized (mTurboModuleCleanupLock) { mTurboModuleCleanupStarted = true; } final Set turboModuleNames = new HashSet<>(mTurboModuleHolders.keySet()); for (final String moduleName : turboModuleNames) { // Retrieve the TurboModule, possibly waiting for it to finish instantiating. final TurboModule turboModule = getModule(moduleName); // ERROR! if (turboModule != null) { // TODO(T48014458): Rename this to invalidate() ((NativeModule) turboModule).onCatalystInstanceDestroy(); } } ``` Before calling `getModule(moduleName)`, I set `mTurboModuleCleanupStarted = true`. This assignment makes all calls to `getModule` return `null`, which means that none of the TurboModules were having their `onCatalystInstanceDestroy()` method invoked. Changelog: [Android][Fixed] - TurboModule cleanup Reviewed By: fkgozali Differential Revision: D21290582 fbshipit-source-id: 3645b9a4f8c6f41498ebd9d51f9b5775edf2dbd7 --- .../turbomodule/core/TurboModuleManager.java | 89 ++++++++++--------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java index 1b97c5bd62db12..d2afb785c8b36f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java @@ -104,13 +104,38 @@ public List getEagerInitModuleNames() { return mEagerInitModuleNames; } + @DoNotStrip + @Nullable + private CxxModuleWrapper getLegacyCxxModule(String moduleName) { + final TurboModule turboModule = getModule(moduleName); + if (!(turboModule instanceof CxxModuleWrapper)) { + return null; + } + + return (CxxModuleWrapper) turboModule; + } + + @DoNotStrip + @Nullable + private TurboModule getJavaModule(String moduleName) { + final TurboModule turboModule = getModule(moduleName); + if (turboModule instanceof CxxModuleWrapper) { + return null; + } + + return turboModule; + } + /** - * TurboModuleHolders are used as locks to ensure that when n threads race to create a - * TurboModule, only the first thread creates that TurboModule. All other n - 1 threads wait until - * the TurboModule is created and initialized. + * Return the TurboModule instance that corresponds to the provided moduleName. + * + *

This method: - Creates and initializes the module if it doesn't already exist. - Returns + * null after TurboModuleManager has been torn down. */ @Nullable - private TurboModuleHolder getOrMaybeCreateTurboModuleHolder(String moduleName) { + public TurboModule getModule(String moduleName) { + TurboModuleHolder moduleHolder; + synchronized (mTurboModuleCleanupLock) { if (mTurboModuleCleanupStarted) { /* @@ -132,24 +157,22 @@ private TurboModuleHolder getOrMaybeCreateTurboModuleHolder(String moduleName) { if (!mTurboModuleHolders.containsKey(moduleName)) { mTurboModuleHolders.put(moduleName, new TurboModuleHolder()); } - return mTurboModuleHolders.get(moduleName); + + moduleHolder = mTurboModuleHolders.get(moduleName); } + + return getModule(moduleName, moduleHolder); } /** - * If n threads race to create TurboModule x, then only the first thread should create x. All n - - * 1 other threads should wait until x is created and initialized. + * Given a TurboModuleHolder, and the TurboModule's moduleName, return the TurboModule instance. * - *

Note: After we've started cleanup, getModule will always return null. + *

Use the TurboModuleHolder to ensure that if n threads race to create TurboModule x, then + * only the first thread creates x. All n - 1 other threads wait until the x is created and + * initialized. */ @Nullable - public TurboModule getModule(String moduleName) { - final TurboModuleHolder moduleHolder = getOrMaybeCreateTurboModuleHolder(moduleName); - - if (moduleHolder == null) { - return null; - } - + private TurboModule getModule(String moduleName, @NonNull TurboModuleHolder moduleHolder) { boolean shouldCreateModule = false; synchronized (moduleHolder) { @@ -220,28 +243,6 @@ public TurboModule getModule(String moduleName) { } } - @DoNotStrip - @Nullable - private CxxModuleWrapper getLegacyCxxModule(String moduleName) { - final TurboModule turboModule = getModule(moduleName); - if (!(turboModule instanceof CxxModuleWrapper)) { - return null; - } - - return (CxxModuleWrapper) turboModule; - } - - @DoNotStrip - @Nullable - private TurboModule getJavaModule(String moduleName) { - final TurboModule turboModule = getModule(moduleName); - if (turboModule instanceof CxxModuleWrapper) { - return null; - } - - return turboModule; - } - /** Which TurboModules have been created? */ public Collection getModules() { final List turboModuleHolders = new ArrayList<>(); @@ -305,11 +306,17 @@ public void onCatalystInstanceDestroy() { mTurboModuleCleanupStarted = true; } - final Set turboModuleNames = new HashSet<>(mTurboModuleHolders.keySet()); + for (final Map.Entry moduleHolderEntry : + mTurboModuleHolders.entrySet()) { + final String moduleName = moduleHolderEntry.getKey(); + final TurboModuleHolder moduleHolder = moduleHolderEntry.getValue(); - for (final String moduleName : turboModuleNames) { - // Retrieve the TurboModule, possibly waiting for it to finish instantiating. - final TurboModule turboModule = getModule(moduleName); + /** + * ReactNative could start tearing down before this particular TurboModule has been fully + * initialized. In this case, we should wait for initialization to complete, before destroying + * the TurboModule. + */ + final TurboModule turboModule = getModule(moduleName, moduleHolder); if (turboModule != null) { // TODO(T48014458): Rename this to invalidate() From 23d6b8d4c0bba39f4de9b532786862c05c0c1369 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Tue, 28 Apr 2020 17:53:53 -0700 Subject: [PATCH 140/235] Create JRuntimeExecutor (#28779) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28779 Creating a JNI wrapper class for RuntimeExecutor so we can pass it to Fabric and TurboModules in Java. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D21049385 fbshipit-source-id: f833004225d9837acf6ffafd3988f89748cf12aa --- .../react/bridge/RuntimeExecutor.java | 21 +++++++++++++ .../src/main/jni/react/jni/Android.mk | 3 +- ReactAndroid/src/main/jni/react/jni/BUCK | 2 ++ .../main/jni/react/jni/JRuntimeExecutor.cpp | 21 +++++++++++++ .../src/main/jni/react/jni/JRuntimeExecutor.h | 30 +++++++++++++++++++ ReactCommon/runtimeexecutor/Android.mk | 19 ++++++++++++ 6 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeExecutor.java create mode 100644 ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.cpp create mode 100644 ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.h create mode 100644 ReactCommon/runtimeexecutor/Android.mk diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeExecutor.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeExecutor.java new file mode 100644 index 00000000000000..2e001202e43185 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeExecutor.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +package com.facebook.react.bridge; + +import com.facebook.jni.HybridData; +import com.facebook.proguard.annotations.DoNotStrip; + +/** A Java holder for a C++ RuntimeExecutor. */ +public class RuntimeExecutor { + + @DoNotStrip private HybridData mHybridData; + + public RuntimeExecutor(HybridData hybridData) { + mHybridData = hybridData; + } +} diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index ed19e7fbc33810..dabd4b7c5125c9 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -25,7 +25,7 @@ LOCAL_LDLIBS += -landroid LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga # The static libraries (.a files) that this module depends on. -LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder +LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder libruntimeexecutor # Name of this module. # @@ -70,6 +70,7 @@ $(call import-module,jsi) $(call import-module,jsiexecutor) $(call import-module,callinvoker) $(call import-module,hermes) +$(call import-module,runtimeexecutor) include $(REACT_SRC_DIR)/turbomodule/core/jni/Android.mk diff --git a/ReactAndroid/src/main/jni/react/jni/BUCK b/ReactAndroid/src/main/jni/react/jni/BUCK index 53f2353ee8ab1b..780d8baee0d83b 100644 --- a/ReactAndroid/src/main/jni/react/jni/BUCK +++ b/ReactAndroid/src/main/jni/react/jni/BUCK @@ -19,6 +19,7 @@ EXPORTED_HEADERS = [ "NativeMap.h", "ReadableNativeArray.h", "ReadableNativeMap.h", + "JRuntimeExecutor.h", "WritableNativeArray.h", "WritableNativeMap.h", ] @@ -64,6 +65,7 @@ rn_xplat_cxx_library( react_native_xplat_target("cxxreact:jsbigstring"), react_native_xplat_target("cxxreact:module"), react_native_xplat_target("jsinspector:jsinspector"), + react_native_xplat_target("runtimeexecutor:runtimeexecutor"), react_native_xplat_dep("jsi:jsi"), FBJNI_TARGET, ]) if not IS_OSS_BUILD else [], diff --git a/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.cpp b/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.cpp new file mode 100644 index 00000000000000..e8e6436c294ff2 --- /dev/null +++ b/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.cpp @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#include "JRuntimeExecutor.h" + +namespace facebook { +namespace react { + +JRuntimeExecutor::JRuntimeExecutor(RuntimeExecutor runtimeExecutor) + : runtimeExecutor_(runtimeExecutor) {} + +RuntimeExecutor JRuntimeExecutor::get() { + return runtimeExecutor_; +} + +} // namespace react +} // namespace facebook diff --git a/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.h b/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.h new file mode 100644 index 00000000000000..1a250d7a867b52 --- /dev/null +++ b/ReactAndroid/src/main/jni/react/jni/JRuntimeExecutor.h @@ -0,0 +1,30 @@ +/* + * 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. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace react { + +class JRuntimeExecutor : public jni::HybridClass { + public: + static auto constexpr kJavaDescriptor = + "Lcom/facebook/react/bridge/RuntimeExecutor;"; + + RuntimeExecutor get(); + + private: + friend HybridBase; + JRuntimeExecutor(RuntimeExecutor runtimeExecutor); + RuntimeExecutor runtimeExecutor_; +}; + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/runtimeexecutor/Android.mk b/ReactCommon/runtimeexecutor/Android.mk new file mode 100644 index 00000000000000..b22071ecdab708 --- /dev/null +++ b/ReactCommon/runtimeexecutor/Android.mk @@ -0,0 +1,19 @@ +# 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. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := runtimeexecutor + +LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/ReactCommon/*.cpp) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/ReactCommon +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall + +include $(BUILD_STATIC_LIBRARY) From 78d2b3c8138f54c2433958b0ad6b9f52ca59115a Mon Sep 17 00:00:00 2001 From: Daiki Ihara Date: Tue, 28 Apr 2020 19:11:53 -0700 Subject: [PATCH 141/235] refine invariant error message at scrollToIndex (#28464) Summary: I refined the error message of scrollToIndex. When I used scrollToIndex with `index:0` and data that length is 0, I met the odd error message `Invariant Violation scrollToIndex out of range: requested index 0 but maximum is -1`. Next, I thought that scrollToIndex with `index:-1` meant scrollToTop without checking data length. I met `Invariant Violation: scrollToIndex out of range: requested index -1 but maximum is -1` Finally, I wondered what will happen to use scrollToIndex with `index:-1` and data that length is `5`. The result is `Invariant Violation: scrollToIndex out of range: requested index -1 but maximum is 5` The above error messages will confuse us. I clarified the boudaries and separated the error messages ## Changelog [General] [Fixed] - Clarified the boundaries in error message of scrollToIndex Pull Request resolved: https://github.com/facebook/react-native/pull/28464 Test Plan: I added 3 test cases to cover the new error messages for VirtualizedList. Run `yarn test` and confirm it passes. Reviewed By: cpojer Differential Revision: D21140133 Pulled By: TheSavior fbshipit-source-id: 9a7a704f7ec599d833d2ed3ca2be059d950539b5 --- Libraries/Lists/VirtualizedList.js | 14 +++++- .../Lists/__tests__/VirtualizedList-test.js | 48 +++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 6a71f04d017065..5a7205b765228b 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -418,8 +418,18 @@ class VirtualizedList extends React.PureComponent { } = this.props; const {animated, index, viewOffset, viewPosition} = params; invariant( - index >= 0 && index < getItemCount(data), - `scrollToIndex out of range: requested index ${index} but maximum is ${getItemCount( + index >= 0, + `scrollToIndex out of range: requested index ${index} but minimum is 0`, + ); + invariant( + getItemCount(data) >= 1, + `scrollToIndex out of range: item length ${getItemCount( + data, + )} but minimum is 1`, + ); + invariant( + index < getItemCount(data), + `scrollToIndex out of range: requested index ${index} is out of 0 to ${getItemCount( data, ) - 1}`, ); diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js index e99215a2d867d1..271fad276fe55e 100644 --- a/Libraries/Lists/__tests__/VirtualizedList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedList-test.js @@ -456,4 +456,52 @@ describe('VirtualizedList', () => { console.error.mockRestore(); } }); + + it('throws if using scrollToIndex with index less than 0', () => { + const component = ReactTestRenderer.create( + } + getItem={(data, index) => data[index]} + getItemCount={data => data.length} + />, + ); + const instance = component.getInstance(); + + expect(() => instance.scrollToIndex({index: -1})).toThrow( + 'scrollToIndex out of range: requested index -1 but minimum is 0', + ); + }); + + it('throws if using scrollToIndex when item length is less than 1', () => { + const component = ReactTestRenderer.create( + } + getItem={(data, index) => data[index]} + getItemCount={data => data.length} + />, + ); + const instance = component.getInstance(); + + expect(() => instance.scrollToIndex({index: 1})).toThrow( + 'scrollToIndex out of range: item length 0 but minimum is 1', + ); + }); + + it('throws if using scrollToIndex when requested index is bigger than or equal to item length', () => { + const component = ReactTestRenderer.create( + } + getItem={(data, index) => data[index]} + getItemCount={data => data.length} + />, + ); + const instance = component.getInstance(); + + expect(() => instance.scrollToIndex({index: 3})).toThrow( + 'scrollToIndex out of range: requested index 3 is out of 0 to 2', + ); + }); }); From e9f29a32913fc6e3caaaa7e4feaccb1f2e3914e6 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 28 Apr 2020 21:44:23 -0700 Subject: [PATCH 142/235] Reject promise when if an error occurs while processing prefetching result Summary: This diff rejects the promise when if an error occurs while processing prefetching result, it applies the same concept as other methods in this class (e.g. see getSizeWithHeaders) changelog: [internal][Android] Internal change in RN Image prefetching Reviewed By: JoshuaGross Differential Revision: D21295612 fbshipit-source-id: c3675e5f2d9c8e38094a538b388ff63a6ea18360 --- .../com/facebook/react/modules/image/ImageLoaderModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java index aca084ed9f307c..aec08eea1f76b3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java @@ -9,6 +9,7 @@ import android.net.Uri; import android.util.SparseArray; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.facebook.common.executors.CallerThreadExecutor; import com.facebook.common.references.CloseableReference; @@ -58,6 +59,7 @@ public ImageLoaderModule(ReactApplicationContext reactContext, Object callerCont } @Override + @NonNull public String getName() { return NAME; } @@ -212,6 +214,8 @@ protected void onNewResultImpl(DataSource dataSource) { try { removeRequest(requestId); promise.resolve(true); + } catch (Exception e) { + promise.reject(ERROR_PREFETCH_FAILURE, e); } finally { dataSource.close(); } From 96999339b6a7aeabd0cd706ef7736fd91d9ecf80 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 28 Apr 2020 23:16:58 -0700 Subject: [PATCH 143/235] Add hostname to loading banner on iOS Summary: This diff adds a hostname to the loading banner on iOS so it's clear which server you're loading from. Changelog: [Added] [iOS] Added hostname to loading banner. Reviewed By: PeteTheHeat Differential Revision: D21280252 fbshipit-source-id: d7733c056f5fb63e32b247a4fa1476ab42c7da17 --- React/CoreModules/RCTDevLoadingView.mm | 46 ++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index d150607ab233aa..a17614e87d77fe 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -29,6 +29,7 @@ @interface RCTDevLoadingView () @implementation RCTDevLoadingView { UIWindow *_window; UILabel *_label; + UILabel *_host; NSDate *_showDate; } @@ -64,6 +65,24 @@ - (void)setBridge:(RCTBridge *)bridge } } +- (UIColor *)dimColor:(UIColor *)c +{ + // Given a color, return a slightly lighter or darker color for dim effect. + CGFloat h, s, b, a; + if ([c getHue:&h saturation:&s brightness:&b alpha:&a]) + return [UIColor colorWithHue:h saturation:s brightness:b < 0.5 ? b * 1.25 : b * 0.75 alpha:a]; + return nil; +} + +- (NSString *)getTextForHost +{ + if (self->_bridge.bundleURL == nil || self->_bridge.bundleURL.fileURL) { + return @"React Native"; + } + + return [NSString stringWithFormat:@"%@:%@", self->_bridge.bundleURL.host, self->_bridge.bundleURL.port]; +} + - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor { if (!RCTDevLoadingViewGetEnabled()) { @@ -78,18 +97,25 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( if (@available(iOS 11.0, *)) { UIWindow *window = RCTSharedApplication().keyWindow; self->_window = - [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 30)]; - self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top, screenSize.width, 30)]; + [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 52)]; + self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top, screenSize.width, 22)]; + self->_host = + [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top + 20, screenSize.width, 22)]; + self->_host.font = [UIFont monospacedDigitSystemFontOfSize:10.0 weight:UIFontWeightRegular]; + self->_host.textAlignment = NSTextAlignmentCenter; + + [self->_window addSubview:self->_label]; + [self->_window addSubview:self->_host]; + } else { self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, 22)]; self->_label = [[UILabel alloc] initWithFrame:self->_window.bounds]; + + [self->_window addSubview:self->_label]; + // TODO: Add host to iOS < 11.0 } - [self->_window addSubview:self->_label]; -#if TARGET_OS_TV - self->_window.windowLevel = UIWindowLevelNormal + 1; -#else + self->_window.windowLevel = UIWindowLevelStatusBar + 1; -#endif // set a root VC so rotation is supported self->_window.rootViewController = [UIViewController new]; @@ -99,6 +125,12 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( self->_label.text = message; self->_label.textColor = color; + + if (self->_host != nil) { + self->_host.text = [self getTextForHost]; + self->_host.textColor = [self dimColor:color]; + } + self->_window.backgroundColor = backgroundColor; self->_window.hidden = NO; From 3729fe8de0109c80014f6c20fae8b949b3628de2 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 28 Apr 2020 23:16:58 -0700 Subject: [PATCH 144/235] Update loading banner text and colors Summary: This diff updates the loading banner text and color on iOS for better UX. Flow before: - Loading from localhost:8081... - Loading 20% (1000/5000)... - Downloading JavaScript Bundle 20% (10/50) - Downloading JavaScript Bundle... After: - Loading from Metro... - Bundling 20%... - Downloading 20%... - Downloading... Changelog: [Added] [iOS] Updated loading banner messages and color Reviewed By: PeteTheHeat Differential Revision: D21279939 fbshipit-source-id: fd7d90f85e25ce175a87087dfccf2180d49e3e98 --- Libraries/Utilities/LoadingView.ios.js | 13 ++++++------- React/Base/RCTJavaScriptLoader.mm | 8 +++++--- React/CoreModules/RCTDevLoadingView.mm | 7 +++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Libraries/Utilities/LoadingView.ios.js b/Libraries/Utilities/LoadingView.ios.js index e8f7d133f5caf3..ad2caad48310ea 100644 --- a/Libraries/Utilities/LoadingView.ios.js +++ b/Libraries/Utilities/LoadingView.ios.js @@ -16,20 +16,19 @@ import NativeDevLoadingView from './NativeDevLoadingView'; module.exports = { showMessage(message: string, type: 'load' | 'refresh') { if (NativeDevLoadingView) { - const green = processColor('#005a00'); - const blue = processColor('#2584e8'); + const loadColor = processColor('#404040'); + const refreshColor = processColor('#2584e8'); const white = processColor('#ffffff'); NativeDevLoadingView.showMessage( message, - // Use same colors as iOS "Personal Hotspot" bar. typeof white === 'number' ? white : null, type && type === 'load' - ? typeof green === 'number' - ? green + ? typeof loadColor === 'number' + ? loadColor : null - : typeof blue === 'number' - ? blue + : typeof refreshColor === 'number' + ? refreshColor : null, ); } diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index 8c8e5fad02ff17..ce347a26ff8759 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -50,10 +50,12 @@ @implementation RCTLoadingProgress - (NSString *)description { NSMutableString *desc = [NSMutableString new]; - [desc appendString:_status ?: @"Loading"]; + [desc appendString:_status ?: @"Bundling"]; if ([_total integerValue] > 0) { - [desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total]; + [desc appendFormat:@" %ld%%", (long)(100 * [_done integerValue] / [_total integerValue])]; + } else { + [desc appendFormat:@" %ld%%", (long)0]; } [desc appendString:@"\u2026"]; return desc; @@ -346,7 +348,7 @@ static void attemptAsynchronousLoadOfBundleAtURL( static RCTLoadingProgress *progressEventFromDownloadProgress(NSNumber *total, NSNumber *done) { RCTLoadingProgress *progress = [RCTLoadingProgress new]; - progress.status = @"Downloading JavaScript bundle"; + progress.status = @"Downloading"; // Progress values are in bytes transform them to kilobytes for smaller numbers. progress.done = done != nil ? @([done integerValue] / 1024) : nil; progress.total = total != nil ? @([total integerValue] / 1024) : nil; diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index a17614e87d77fe..9a4c4453d7bf40 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -188,14 +188,13 @@ - (void)showWithURL:(NSURL *)URL return; #endif color = [UIColor whiteColor]; - backgroundColor = [UIColor blackColor]; + backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME]; } else { color = [UIColor whiteColor]; - backgroundColor = [UIColor colorWithHue:1. / 3 saturation:1 brightness:.35 alpha:1]; - message = [NSString stringWithFormat:@"Loading from %@:%@...", URL.host, URL.port]; + backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; + message = [NSString stringWithFormat:@"Loading from %@\u2026", RCT_PACKAGER_NAME]; } - [self showMessage:message color:color backgroundColor:backgroundColor]; } From 131c497aa2c081f9dfd03e45b25fb7ae388b98bd Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 28 Apr 2020 23:16:58 -0700 Subject: [PATCH 145/235] Do not update loading banner message while hiding Summary: This diff fixes an issue where the loading banner message could update while the banner hide animation is going, catching your eye for no reason. Changelog: [Fixed] [iOS] Do not update loading banner message while hiding Reviewed By: PeteTheHeat Differential Revision: D21280786 fbshipit-source-id: a10b33cd72f263d08eea6d8e94963514affbe24d --- React/CoreModules/RCTDevLoadingView.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index 9a4c4453d7bf40..6dd3d6f46eb76d 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -31,6 +31,7 @@ @implementation RCTDevLoadingView { UILabel *_label; UILabel *_host; NSDate *_showDate; + BOOL _hiding; } @synthesize bridge = _bridge; @@ -85,7 +86,7 @@ - (NSString *)getTextForHost - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor { - if (!RCTDevLoadingViewGetEnabled()) { + if (!RCTDevLoadingViewGetEnabled() || self->_hiding) { return; } @@ -159,6 +160,7 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( } dispatch_async(dispatch_get_main_queue(), ^{ + self->_hiding = true; const NSTimeInterval MIN_PRESENTED_TIME = 0.6; NSTimeInterval presentedTime = [[NSDate date] timeIntervalSinceDate:self->_showDate]; NSTimeInterval delay = MAX(0, MIN_PRESENTED_TIME - presentedTime); @@ -173,6 +175,7 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( self->_window.frame = windowFrame; self->_window.hidden = YES; self->_window = nil; + self->_hiding = false; }]; }); } From 2b771b0129f2ef921c7cdb9c952e004f931927c3 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 28 Apr 2020 23:16:58 -0700 Subject: [PATCH 146/235] Delay loading banner inital message by 200ms to prevent flashing Summary: This diff fixes an issue where the initial "Loading from Metro..." message is flashed for a few milliseconds before the download progress kicks in. It's just jarring enough to be noticed and is ~600ms too fast to be read. This diff adds a delay so that if the loading progress starts within 200ms we go straight to the progress. Changelog: [Fixed] [iOS] Delay loading banner message to prevent flashing messages Reviewed By: PeteTheHeat Differential Revision: D21281870 fbshipit-source-id: d28c1eae01c2ac9d79f356f1870f17dbb22a9d84 --- React/CoreModules/RCTDevLoadingView.mm | 50 ++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index 6dd3d6f46eb76d..6c987b3e405ec8 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -32,6 +32,7 @@ @implementation RCTDevLoadingView { UILabel *_host; NSDate *_showDate; BOOL _hiding; + dispatch_block_t _initialMessageBlock; } @synthesize bridge = _bridge; @@ -66,6 +67,27 @@ - (void)setBridge:(RCTBridge *)bridge } } +- (void)clearInitialMessageDelay +{ + if (self->_initialMessageBlock != nil) { + dispatch_block_cancel(self->_initialMessageBlock); + self->_initialMessageBlock = nil; + } +} + +- (void)showInitialMessageDelayed:(void (^)())initialMessage +{ + self->_initialMessageBlock = dispatch_block_create(static_cast(0), initialMessage); + + // We delay the initial loading message to prevent flashing it + // when loading progress starts quickly. To do that, we + // schedule the message to be shown in a block, and cancel + // the block later when the progress starts coming in. + // If the progress beats this timer, this message is not shown. + dispatch_after( + dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), self->_initialMessageBlock); +} + - (UIColor *)dimColor:(UIColor *)c { // Given a color, return a slightly lighter or darker color for dim effect. @@ -159,6 +181,9 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( return; } + // Cancel the initial message block so it doesn't display later and get stuck. + [self clearInitialMessageDelay]; + dispatch_async(dispatch_get_main_queue(), ^{ self->_hiding = true; const NSTimeInterval MIN_PRESENTED_TIME = 0.6; @@ -186,19 +211,23 @@ - (void)showWithURL:(NSURL *)URL UIColor *backgroundColor; NSString *message; if (URL.fileURL) { - // If dev mode is not enabled, we don't want to show this kind of notification + // If dev mode is not enabled, we don't want to show this kind of notification. #if !RCT_DEV return; #endif color = [UIColor whiteColor]; backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME]; + [self showMessage:message color:color backgroundColor:backgroundColor]; } else { color = [UIColor whiteColor]; backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; message = [NSString stringWithFormat:@"Loading from %@\u2026", RCT_PACKAGER_NAME]; + + [self showInitialMessageDelayed:^{ + [self showMessage:message color:color backgroundColor:backgroundColor]; + }]; } - [self showMessage:message color:color backgroundColor:backgroundColor]; } - (void)updateProgress:(RCTLoadingProgress *)progress @@ -206,8 +235,23 @@ - (void)updateProgress:(RCTLoadingProgress *)progress if (!progress) { return; } + + // Cancel the initial message block so it's not flashed before progress. + [self clearInitialMessageDelay]; + dispatch_async(dispatch_get_main_queue(), ^{ - self->_label.text = [progress description]; + if (self->_window == nil) { + // If we didn't show the initial message, then there's no banner window. + // We need to create it here so that the progress is actually displayed. + UIColor *color = [UIColor whiteColor]; + UIColor *backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; + [self showMessage:[progress description] color:color backgroundColor:backgroundColor]; + } else { + // This is an optimization. Since the progress can come in quickly, + // we want to do the minimum amount of work to update the UI, + // which is to only update the label text. + self->_label.text = [progress description]; + } }); } From 3fb37b4326090def3aea43bd8189a0df648ccb34 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Tue, 28 Apr 2020 23:16:58 -0700 Subject: [PATCH 147/235] Speed up loading banner animations Summary: This diff reduces the minimum loading banner time and animation time to make the locating banner faster. Changelog: [General] [iOS] Speed up loading banner animations Reviewed By: PeteTheHeat Differential Revision: D21290517 fbshipit-source-id: 111dff41df53b0246548e1da1db80c2188498a9c --- React/CoreModules/RCTDevLoadingView.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index 6c987b3e405ec8..9d91d62863bac2 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -186,11 +186,11 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( dispatch_async(dispatch_get_main_queue(), ^{ self->_hiding = true; - const NSTimeInterval MIN_PRESENTED_TIME = 0.6; + const NSTimeInterval MIN_PRESENTED_TIME = 0.5; NSTimeInterval presentedTime = [[NSDate date] timeIntervalSinceDate:self->_showDate]; NSTimeInterval delay = MAX(0, MIN_PRESENTED_TIME - presentedTime); CGRect windowFrame = self->_window.frame; - [UIView animateWithDuration:0.25 + [UIView animateWithDuration:0.1 delay:delay options:0 animations:^{ From 97bc0845ecd588b587c7b7dad07c1475bcebf80b Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 29 Apr 2020 09:13:45 -0700 Subject: [PATCH 148/235] Guard all debug logs behind an MC Reviewed By: PeteTheHeat Differential Revision: D21292280 fbshipit-source-id: 1701a945f126f35a53417b57e3162372d39e75f1 --- .../facebook/react/ReactInstanceManager.java | 36 +++++++++++-------- .../react/bridge/CatalystInstanceImpl.java | 16 +++++---- .../react/config/ReactFeatureFlags.java | 3 ++ .../turbomodule/core/TurboModuleManager.java | 14 +++++--- 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 07f26501f6e283..12f0c9e3f47f8f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1252,32 +1252,38 @@ private ReactApplicationContext createReactContext( reactContext.initializeWithInstance(catalystInstance); - // TODO(T46487253): Remove after task is closed - FLog.e( - ReactConstants.TAG, - "ReactInstanceManager.createReactContext: mJSIModulePackage " - + (mJSIModulePackage != null ? "not null" : "null")); + if (ReactFeatureFlags.enableTurboModuleDebugLogs) { + // TODO(T46487253): Remove after task is closed + FLog.e( + ReactConstants.TAG, + "ReactInstanceManager.createReactContext: mJSIModulePackage " + + (mJSIModulePackage != null ? "not null" : "null")); + } if (mJSIModulePackage != null) { catalystInstance.addJSIModules( mJSIModulePackage.getJSIModules( reactContext, catalystInstance.getJavaScriptContextHolder())); - // TODO(T46487253): Remove after task is closed - FLog.e( - ReactConstants.TAG, - "ReactInstanceManager.createReactContext: ReactFeatureFlags.useTurboModules == " - + (ReactFeatureFlags.useTurboModules == false ? "false" : "true")); + if (ReactFeatureFlags.enableTurboModuleDebugLogs) { + // TODO(T46487253): Remove after task is closed + FLog.e( + ReactConstants.TAG, + "ReactInstanceManager.createReactContext: ReactFeatureFlags.useTurboModules == " + + (ReactFeatureFlags.useTurboModules == false ? "false" : "true")); + } if (ReactFeatureFlags.useTurboModules) { JSIModule turboModuleManager = catalystInstance.getJSIModule(JSIModuleType.TurboModuleManager); - // TODO(T46487253): Remove after task is closed - FLog.e( - ReactConstants.TAG, - "ReactInstanceManager.createReactContext: TurboModuleManager " - + (turboModuleManager == null ? "not created" : "created")); + if (ReactFeatureFlags.enableTurboModuleDebugLogs) { + // TODO(T46487253): Remove after task is closed + FLog.e( + ReactConstants.TAG, + "ReactInstanceManager.createReactContext: TurboModuleManager " + + (turboModuleManager == null ? "not created" : "created")); + } catalystInstance.setTurboModuleManager(turboModuleManager); diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 6e481bbd2cd12b..864c85c73601e6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -583,13 +583,15 @@ public NativeModule getNativeModule(String moduleName) { if (getTurboModuleRegistry() != null) { TurboModule turboModule = getTurboModuleRegistry().getModule(moduleName); - // TODO(T46487253): Remove after task is closed - FLog.e( - ReactConstants.TAG, - "CatalystInstanceImpl.getNativeModule: TurboModule " - + moduleName - + (turboModule == null ? " not" : "") - + " found"); + if (ReactFeatureFlags.enableTurboModuleDebugLogs) { + // TODO(T46487253): Remove after task is closed + FLog.e( + ReactConstants.TAG, + "CatalystInstanceImpl.getNativeModule: TurboModule " + + moduleName + + (turboModule == null ? " not" : "") + + " found"); + } if (turboModule != null) { return (NativeModule) turboModule; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index c5b9de82a4453f..c04a883d5fb5cc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -23,6 +23,9 @@ public class ReactFeatureFlags { */ public static volatile boolean useTurboModules = false; + /** Should we output debug logs to debug the TurboModule infra? */ + public static volatile boolean enableTurboModuleDebugLogs = false; + /* * This feature flag enables logs for Fabric */ diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java index d2afb785c8b36f..6b01a2008308ad 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java @@ -19,6 +19,7 @@ import com.facebook.react.bridge.JavaScriptContextHolder; import com.facebook.react.bridge.NativeModule; import com.facebook.react.common.ReactConstants; +import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry; @@ -142,11 +143,14 @@ public TurboModule getModule(String moduleName) { * Always return null after cleanup has started, so that getModule(moduleName) returns null. */ - FLog.e( - ReactConstants.TAG, - "TurboModuleManager.getOrMaybeCreateTurboModuleHolder: Tried to require TurboModule " - + moduleName - + " after cleanup initiated"); + if (ReactFeatureFlags.enableTurboModuleDebugLogs) { + // TODO(T46487253): Remove after task is closed + FLog.e( + ReactConstants.TAG, + "TurboModuleManager.getOrMaybeCreateTurboModuleHolder: Tried to require TurboModule " + + moduleName + + " after cleanup initiated"); + } return null; } From e27542bb13d1f8f422cd307c4d43148c8bd82bc0 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 29 Apr 2020 09:24:33 -0700 Subject: [PATCH 149/235] Don't allow download percentage to exceed expectations Summary: This diff updates the loading banner to protect against showing percentages over 100% Changelog: [Fixed] [iOS] Cap loading bar percentage at 100% Reviewed By: shergin Differential Revision: D21295809 fbshipit-source-id: 343f53acafa126800367444562730eff4ae67af4 --- React/Base/RCTJavaScriptLoader.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index ce347a26ff8759..d15738c549eabe 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -52,7 +52,9 @@ - (NSString *)description NSMutableString *desc = [NSMutableString new]; [desc appendString:_status ?: @"Bundling"]; - if ([_total integerValue] > 0) { + if ([_total integerValue] > 0 && [_done integerValue] > [_total integerValue]) { + [desc appendFormat:@" %ld%%", (long)100]; + } else if ([_total integerValue] > 0) { [desc appendFormat:@" %ld%%", (long)(100 * [_done integerValue] / [_total integerValue])]; } else { [desc appendFormat:@" %ld%%", (long)0]; From d7299e8f7644b635922b94c57b2a3948040c00f9 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 29 Apr 2020 10:45:41 -0700 Subject: [PATCH 150/235] cleanup unused TODO Summary: Task is closed, I'm removing the TODO. I verified that the soft error is not being triggered changelog:[Internal][Android] Internal cleanup of fabric android Reviewed By: sammy-SC Differential Revision: D21303999 fbshipit-source-id: 11d4a14c71d27ffc70a6d3b955a21085dd11859b --- .../java/com/facebook/react/fabric/FabricUIManager.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index d63206e3f2267c..a661c1c48d7d07 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -842,12 +842,6 @@ public void updateRootLayoutSpecs( if (reactContext != null) { isRTL = I18nUtil.getInstance().isRTL(reactContext); doLeftAndRightSwapInRTL = I18nUtil.getInstance().doLeftAndRightSwapInRTL(reactContext); - } else { - // TODO T65116569: analyze why this happens - ReactSoftException.logSoftException( - TAG, - new IllegalStateException( - "updateRootLayoutSpecs called before ReactContext set for tag: " + rootTag)); } mBinding.setConstraints( From d8e6c45782a5c9132bb7ec315fe0b9ba3999e830 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 29 Apr 2020 12:23:47 -0700 Subject: [PATCH 151/235] Move DevSettingsActivity from main to debug (#28770) Summary: As described in DevSettingsActivity, it should be added to the apps debug/ instead of main/ manifest. ## Changelog Android Changed - Move DevSettingsActivity from `main` to `debug` manifest Pull Request resolved: https://github.com/facebook/react-native/pull/28770 Test Plan: Tested locally by building example app Differential Revision: D21281922 Pulled By: shergin fbshipit-source-id: ec4dc7c0ac54367aa38cca5b4146ef71cf18b73b --- template/android/app/src/debug/AndroidManifest.xml | 7 ++++++- template/android/app/src/main/AndroidManifest.xml | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/template/android/app/src/debug/AndroidManifest.xml b/template/android/app/src/debug/AndroidManifest.xml index fa26aa56e1c144..b2f3ad9fce9234 100644 --- a/template/android/app/src/debug/AndroidManifest.xml +++ b/template/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,10 @@ - + + + diff --git a/template/android/app/src/main/AndroidManifest.xml b/template/android/app/src/main/AndroidManifest.xml index 0a7a9cfc66ce3f..6db8bad363a138 100644 --- a/template/android/app/src/main/AndroidManifest.xml +++ b/template/android/app/src/main/AndroidManifest.xml @@ -21,7 +21,5 @@ - - From 7566bb4b811d2b29966b8fb30cb98584846a805a Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 29 Apr 2020 18:46:54 -0700 Subject: [PATCH 152/235] Delete .clang-tidy for jscallinvoker Summary: `JSCallInvoker` doesn't exist anymore, because it was renamed to `CallInvoker`. So, this `.clang-tidy` dotfile isn't necessary. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D21318061 fbshipit-source-id: 8098eef670cae35bf3c027c91f18f45eb7bcd33a --- ReactCommon/jscallinvoker/.clang-tidy | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 ReactCommon/jscallinvoker/.clang-tidy diff --git a/ReactCommon/jscallinvoker/.clang-tidy b/ReactCommon/jscallinvoker/.clang-tidy deleted file mode 100644 index c98fd78ff64baa..00000000000000 --- a/ReactCommon/jscallinvoker/.clang-tidy +++ /dev/null @@ -1,5 +0,0 @@ ---- -Checks: '> -clang-diagnostic-*, -' -... From f7e88387fb9409f85ce382a4d5b9dd4f469b3339 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 29 Apr 2020 19:30:30 -0700 Subject: [PATCH 153/235] Enable Animated in Venice Summary: This diff extends venice app to render an Animation example test changelog: [Internal][Android] Internal change to enable Animated in RN Bridgless mode Reviewed By: PeteTheHeat Differential Revision: D21317630 fbshipit-source-id: 9726fea9baba86191e63df909639d1d47ef5f359 --- Libraries/Animated/src/Animated.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Animated/src/Animated.js b/Libraries/Animated/src/Animated.js index 450fc1c0264f13..9e6e2b54d8aa03 100644 --- a/Libraries/Animated/src/Animated.js +++ b/Libraries/Animated/src/Animated.js @@ -19,7 +19,8 @@ const AnimatedMock = require('./AnimatedMock'); const AnimatedImplementation = require('./AnimatedImplementation'); //TODO(T57411659): Remove the bridgeless check when Animated perf regressions are fixed. -const Animated = ((Platform.isTesting || global.RN$Bridgeless +const Animated = ((Platform.isTesting || +(global.RN$Bridgeless && Platform.OS === 'ios') ? AnimatedMock : AnimatedImplementation): typeof AnimatedMock); From afc3c97111c4897998227f9fc646fb420a494ca2 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 29 Apr 2020 20:53:15 -0700 Subject: [PATCH 154/235] Fabric: Changes in State reconciliation Summary: I spent the last several days thinking about state reconciliation issues, some crashes (T65586949) that suspiciously happen somewhere inside, and a bunch of issues that might be connected to that (possibly, some of T65516263 sub-task). I cannot see some obvious problems in the current state reconciliation algorithm that might cause the crash (because of some use-after-free or other pure C++ issues), but I suspect some of the problems we experience might be caused by some details of how we reconcile states. In the current approach, we rank all states based on the "hierarchical" history of their creation (state version is being calculated based on the version of the base tree). That's usually fine but in some cases when trees are being constructed concurrently, a logical version of a based tree does not correspond to the local version of a committed tree. In other words, the linear history of commits does not always correspond to the "hierarchical" history of trees generation that was done by different parties (e.g. React vs native state update pipeline). In this diff, I tried to change the approach to change the algorithm to follow this logic: If some state is `obsolete` (already been committed and then replaced with newer one), we replace that with the most recent one. This change does not introduce the `obsolete` flag; is already used by State infra to avoid cloning nodes with an outdated state. Interestingly, it fixes the issue with an empty BottomSheet on Android (T66177144). See the attached video. The hope is that it's also will This change theoretically might affect all things that use State, so it hard to predict what can break and how. So, if we don't see obvious problems here, I would set up a GK/QE and run the experiment in prod. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21295137 fbshipit-source-id: e5613218d3e11a56623cab9bbf2540495b2b24e8 --- .../core/shadownode/ShadowNodeFamily.cpp | 9 + .../fabric/core/shadownode/ShadowNodeFamily.h | 9 + ReactCommon/fabric/core/state/State.cpp | 9 + ReactCommon/fabric/core/state/State.h | 6 + ReactCommon/fabric/mounting/ShadowTree.cpp | 158 +++++++++++++++++- ReactCommon/fabric/mounting/ShadowTree.h | 1 + 6 files changed, 185 insertions(+), 7 deletions(-) diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp index 2dd49e53065e66..fe2aaa84a753b4 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.cpp @@ -119,6 +119,15 @@ void ShadowNodeFamily::setMostRecentState(State::Shared const &state) const { mostRecentState_ = state; } +std::shared_ptr ShadowNodeFamily::getMostRecentStateIfObsolete( + State const &state) const { + std::unique_lock lock(mutex_); + if (!state.isObsolete_) { + return {}; + } + return mostRecentState_; +} + void ShadowNodeFamily::dispatchRawState( StateUpdate &&stateUpdate, EventPriority priority) const { diff --git a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h index 15998067f44222..1bf431061cb6b8 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNodeFamily.h @@ -88,6 +88,15 @@ class ShadowNodeFamily { private: friend ShadowNode; friend ShadowNodeFamilyFragment; + friend State; + + /* + * Returns the most recent state if the given `state` is obsolete, + * otherwise returns `nullptr`. + * To be used by `State` only. + */ + std::shared_ptr getMostRecentStateIfObsolete( + State const &state) const; EventDispatcher::Weak eventDispatcher_; mutable std::shared_ptr mostRecentState_; diff --git a/ReactCommon/fabric/core/state/State.cpp b/ReactCommon/fabric/core/state/State.cpp index d6fb8afe8e5737..d8407cb7e64afe 100644 --- a/ReactCommon/fabric/core/state/State.cpp +++ b/ReactCommon/fabric/core/state/State.cpp @@ -32,6 +32,15 @@ State::Shared State::getMostRecentState() const { return family->getMostRecentState(); } +State::Shared State::getMostRecentStateIfObsolete() const { + auto family = family_.lock(); + if (!family) { + return {}; + } + + return family->getMostRecentStateIfObsolete(*this); +} + size_t State::getRevision() const { return revision_; } diff --git a/ReactCommon/fabric/core/state/State.h b/ReactCommon/fabric/core/state/State.h index e48cf15c3d409e..7e700da7e879d6 100644 --- a/ReactCommon/fabric/core/state/State.h +++ b/ReactCommon/fabric/core/state/State.h @@ -47,6 +47,12 @@ class State { */ State::Shared getMostRecentState() const; + /* + * Returns the most recent state (same as `getMostRecentState()` method) + * if this state is obsolete, otherwise returns `nullptr`. + */ + State::Shared getMostRecentStateIfObsolete() const; + /* * Returns a revision number of the `State` object. * The number is being automatically assigned during the creation of `State` diff --git a/ReactCommon/fabric/mounting/ShadowTree.cpp b/ReactCommon/fabric/mounting/ShadowTree.cpp index 4099d0f1195dce..65ba77f603251b 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.cpp +++ b/ReactCommon/fabric/mounting/ShadowTree.cpp @@ -22,6 +22,141 @@ namespace facebook { namespace react { +/* + * Generates (possibly) a new tree where all nodes with non-obsolete `State` + * objects. If all `State` objects in the tree are not obsolete for the moment + * of calling, the function returns `nullptr` (as an indication that no + * additional work is required). + */ +static ShadowNode::Unshared progressState(ShadowNode const &shadowNode) { + auto isStateChanged = false; + auto areChildrenChanged = false; + + auto newState = shadowNode.getState(); + if (newState) { + newState = newState->getMostRecentStateIfObsolete(); + if (newState) { + isStateChanged = true; + } + } + + auto newChildren = ShadowNode::ListOfShared{}; + if (shadowNode.getChildren().size() > 0) { + auto index = size_t{0}; + for (auto const &childNode : shadowNode.getChildren()) { + auto newChildNode = progressState(*childNode); + if (newChildNode) { + if (!areChildrenChanged) { + // Making a copy before the first mutation. + newChildren = shadowNode.getChildren(); + } + newChildren[index] = newChildNode; + areChildrenChanged = true; + } + index++; + } + } + + if (!areChildrenChanged && !isStateChanged) { + return nullptr; + } + + return shadowNode.clone({ + ShadowNodeFragment::propsPlaceholder(), + areChildrenChanged ? std::make_shared( + std::move(newChildren)) + : ShadowNodeFragment::childrenPlaceholder(), + isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(), + }); +} + +/* + * An optimized version of the previous function (and relies on it). + * The function uses a given base tree to exclude unchanged (equal) parts + * of the three from the traversing. + */ +static ShadowNode::Unshared progressState( + ShadowNode const &shadowNode, + ShadowNode const &baseShadowNode) { + // The intuition behind the complexity: + // - A very few nodes have associated state, therefore it's mostly reading and + // it only writes when state objects were found obsolete; + // - Most before-after trees are aligned, therefore most tree branches will be + // skipped; + // - If trees are significantly different, any other algorithm will have + // close to linear complexity. + + auto isStateChanged = false; + auto areChildrenChanged = false; + + auto newState = shadowNode.getState(); + if (newState) { + newState = newState->getMostRecentStateIfObsolete(); + if (newState) { + isStateChanged = true; + } + } + + auto &children = shadowNode.getChildren(); + auto &baseChildren = baseShadowNode.getChildren(); + auto newChildren = ShadowNode::ListOfShared{}; + + auto childrenSize = children.size(); + auto baseChildrenSize = baseChildren.size(); + auto index = size_t{0}; + + // Stage 1: Aligned part. + for (index = 0; index < childrenSize && index < baseChildrenSize; index++) { + const auto &childNode = *children.at(index); + const auto &baseChildNode = *baseChildren.at(index); + + if (&childNode == &baseChildNode) { + // Nodes are identical, skipping. + continue; + } + + if (!ShadowNode::sameFamily(childNode, baseChildNode)) { + // Totally different nodes, updating is impossible. + break; + } + + auto newChildNode = progressState(childNode, baseChildNode); + if (newChildNode) { + if (!areChildrenChanged) { + // Making a copy before the first mutation. + newChildren = children; + } + newChildren[index] = newChildNode; + areChildrenChanged = true; + } + } + + // Stage 2: Misaligned part. + for (; index < childrenSize; index++) { + auto newChildNode = progressState(*children.at(index)); + if (newChildNode) { + if (!areChildrenChanged) { + // Making a copy before the first mutation. + newChildren = children; + } + newChildren[index] = newChildNode; + areChildrenChanged = true; + } + } + + if (!areChildrenChanged && !isStateChanged) { + return nullptr; + } + + return shadowNode.clone({ + ShadowNodeFragment::propsPlaceholder(), + areChildrenChanged ? std::make_shared( + std::move(newChildren)) + : ShadowNodeFragment::childrenPlaceholder(), + isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(), + }); +} + static void updateMountedFlag( const SharedShadowNodeList &oldChildren, const SharedShadowNodeList &newChildren) { @@ -161,14 +296,23 @@ bool ShadowTree::tryCommit( return false; } - // Compare state revisions of old and new root - // Children of the root node may be mutated in-place if (enableStateReconciliation) { - UnsharedShadowNode reconciledNode = - reconcileStateWithTree(newRootShadowNode.get(), oldRootShadowNode); - if (reconciledNode != nullptr) { - newRootShadowNode = std::make_shared( - *reconciledNode, ShadowNodeFragment{}); + if (useNewApproachToStateReconciliation_) { + auto updatedNewRootShadowNode = + progressState(*newRootShadowNode, *oldRootShadowNode); + if (updatedNewRootShadowNode) { + newRootShadowNode = + std::static_pointer_cast(updatedNewRootShadowNode); + } + } else { + // Compare state revisions of old and new root + // Children of the root node may be mutated in-place + UnsharedShadowNode reconciledNode = + reconcileStateWithTree(newRootShadowNode.get(), oldRootShadowNode); + if (reconciledNode != nullptr) { + newRootShadowNode = std::make_shared( + *reconciledNode, ShadowNodeFragment{}); + } } } diff --git a/ReactCommon/fabric/mounting/ShadowTree.h b/ReactCommon/fabric/mounting/ShadowTree.h index a2e9aaa1742055..eae9749fff631a 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.h +++ b/ReactCommon/fabric/mounting/ShadowTree.h @@ -88,6 +88,7 @@ class ShadowTree final { mutable ShadowTreeRevision::Number revisionNumber_{ 0}; // Protected by `commitMutex_`. MountingCoordinator::Shared mountingCoordinator_; + bool useNewApproachToStateReconciliation_{true}; }; } // namespace react From f746119d62c1cf310ce3f9b4ed1475587adc549d Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 29 Apr 2020 20:53:15 -0700 Subject: [PATCH 155/235] Fabric: Gating for new state reconciliation Summary: The change is gated by two QEs (iOS and Android). Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21317797 fbshipit-source-id: 34bfd9546600d9cb3467bddfc61363a16683f81f --- ReactCommon/fabric/mounting/ShadowTree.cpp | 2 +- ReactCommon/fabric/mounting/ShadowTree.h | 10 +++++++++- ReactCommon/fabric/scheduler/Scheduler.cpp | 10 ++++++++++ ReactCommon/fabric/scheduler/Scheduler.h | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/mounting/ShadowTree.cpp b/ReactCommon/fabric/mounting/ShadowTree.cpp index 65ba77f603251b..654d26fed0558a 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.cpp +++ b/ReactCommon/fabric/mounting/ShadowTree.cpp @@ -297,7 +297,7 @@ bool ShadowTree::tryCommit( } if (enableStateReconciliation) { - if (useNewApproachToStateReconciliation_) { + if (enableNewStateReconciliation_) { auto updatedNewRootShadowNode = progressState(*newRootShadowNode, *oldRootShadowNode); if (updatedNewRootShadowNode) { diff --git a/ReactCommon/fabric/mounting/ShadowTree.h b/ReactCommon/fabric/mounting/ShadowTree.h index eae9749fff631a..f0c904d5159a0c 100644 --- a/ReactCommon/fabric/mounting/ShadowTree.h +++ b/ReactCommon/fabric/mounting/ShadowTree.h @@ -71,6 +71,14 @@ class ShadowTree final { MountingCoordinator::Shared getMountingCoordinator() const; + /* + * Temporary. + * Do not use. + */ + void setEnableNewStateReconciliation(bool value) { + enableNewStateReconciliation_ = value; + } + private: RootShadowNode::Unshared cloneRootShadowNode( RootShadowNode::Shared const &oldRootShadowNode, @@ -88,7 +96,7 @@ class ShadowTree final { mutable ShadowTreeRevision::Number revisionNumber_{ 0}; // Protected by `commitMutex_`. MountingCoordinator::Shared mountingCoordinator_; - bool useNewApproachToStateReconciliation_{true}; + bool enableNewStateReconciliation_{false}; }; } // namespace react diff --git a/ReactCommon/fabric/scheduler/Scheduler.cpp b/ReactCommon/fabric/scheduler/Scheduler.cpp index 671713b4b69a8a..e9db21ae7e7812 100644 --- a/ReactCommon/fabric/scheduler/Scheduler.cpp +++ b/ReactCommon/fabric/scheduler/Scheduler.cpp @@ -80,6 +80,14 @@ Scheduler::Scheduler( delegate_ = delegate; uiManager_ = uiManager; + +#ifdef ANDROID + enableNewStateReconciliation_ = reactNativeConfig_->getBool( + "react_fabric:enable_new_state_reconciliation_android"); +#else + enableNewStateReconciliation_ = reactNativeConfig_->getBool( + "react_fabric:enable_new_state_reconciliation_ios"); +#endif } Scheduler::~Scheduler() { @@ -141,6 +149,8 @@ void Scheduler::startSurface( *rootComponentDescriptor_, *uiManager_); + shadowTree->setEnableNewStateReconciliation(enableNewStateReconciliation_); + auto uiManager = uiManager_; uiManager->getShadowTreeRegistry().add(std::move(shadowTree)); diff --git a/ReactCommon/fabric/scheduler/Scheduler.h b/ReactCommon/fabric/scheduler/Scheduler.h index fe1d9c0980979e..07799c62f1fa46 100644 --- a/ReactCommon/fabric/scheduler/Scheduler.h +++ b/ReactCommon/fabric/scheduler/Scheduler.h @@ -112,6 +112,7 @@ class Scheduler final : public UIManagerDelegate { std::shared_ptr uiManager_; std::shared_ptr reactNativeConfig_; EventDispatcher::Shared eventDispatcher_; + bool enableNewStateReconciliation_{false}; }; } // namespace react From d20ac69fc87ef4f9f5921356c6bbfc0587a9375c Mon Sep 17 00:00:00 2001 From: James Ide Date: Wed, 29 Apr 2020 22:29:33 -0700 Subject: [PATCH 156/235] Replace duplicate code in AndroidInfoModule with call to AndroidInfoHelpers (#28756) Summary: The AndroidInfoModule class defines a `getServerHost()` method that duplicates the logic in `AndroidInfoHelpers.getServerHost(context)`. This commit makes AndroidInfoModule call into AndroidInfoHelpers so that potential future changes to `AndroidInfoHelpers.getServerHost` don't need to be duplicated in `AndroidInfoModule.getServerHost`. ## Changelog [Android] [Changed] - Internal change to make `PlatformConstants` use the same method to determine `ServerHost` as other code paths Pull Request resolved: https://github.com/facebook/react-native/pull/28756 Test Plan: Tested by running the RNTester app and editing the root component to print out `NativeModules.PlatformConstants.getConstants()` and verified one of the properties was: `"ServerHost": "10.0.2.2:8081"`. Differential Revision: D21252158 Pulled By: shergin fbshipit-source-id: b460197e5f1d972a5b91991c32a929294e358d9f --- .../react/modules/systeminfo/AndroidInfoModule.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java index 24c6f4deb4cbfc..acfc5bc5c243b2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java @@ -73,7 +73,7 @@ public String getName() { constants.put("Fingerprint", Build.FINGERPRINT); constants.put("Model", Build.MODEL); if (ReactBuildConfig.DEBUG) { - constants.put("ServerHost", getServerHost()); + constants.put("ServerHost", AndroidInfoHelpers.getServerHost(getReactApplicationContext().getApplicationContext())); } constants.put( "isTesting", "true".equals(System.getProperty(IS_TESTING)) || isRunningScreenshotTest()); @@ -98,12 +98,4 @@ private Boolean isRunningScreenshotTest() { return false; } } - - private String getServerHost() { - Resources resources = getReactApplicationContext().getApplicationContext().getResources(); - - Integer devServerPort = resources.getInteger(R.integer.react_native_dev_server_port); - - return AndroidInfoHelpers.getServerHost(devServerPort); - } } From 673cbb3110855c45beb7e340b61e7daf927d9ade Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Thu, 30 Apr 2020 08:17:11 -0700 Subject: [PATCH 157/235] Daily `arc lint --take GOOGLEJAVAFORMAT` Reviewed By: zertosh Differential Revision: D21325542 fbshipit-source-id: d4c70da59c67c1f7dfcd36f06bbfe0eec5d4e824 --- .../react/modules/systeminfo/AndroidInfoModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java index acfc5bc5c243b2..3c4be024f518c5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java @@ -12,12 +12,10 @@ import android.annotation.SuppressLint; import android.app.UiModeManager; import android.content.res.Configuration; -import android.content.res.Resources; import android.os.Build; import android.provider.Settings.Secure; import androidx.annotation.Nullable; import com.facebook.fbreact.specs.NativePlatformConstantsAndroidSpec; -import com.facebook.react.R; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.common.build.ReactBuildConfig; import com.facebook.react.module.annotations.ReactModule; @@ -73,7 +71,9 @@ public String getName() { constants.put("Fingerprint", Build.FINGERPRINT); constants.put("Model", Build.MODEL); if (ReactBuildConfig.DEBUG) { - constants.put("ServerHost", AndroidInfoHelpers.getServerHost(getReactApplicationContext().getApplicationContext())); + constants.put( + "ServerHost", + AndroidInfoHelpers.getServerHost(getReactApplicationContext().getApplicationContext())); } constants.put( "isTesting", "true".equals(System.getProperty(IS_TESTING)) || isRunningScreenshotTest()); From 0569221af14db5f34f0c63f0bd887084473e5004 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 30 Apr 2020 10:25:38 -0700 Subject: [PATCH 158/235] Set contentView's frame in setter Summary: In D20836890 we no longer set `_contentView.frame` inside `layoutSubviews`. This doesn't work well with component views that set their `contentView` after `updateLayoutMetrics` is called. For Example legacy interop which sets its contentView in the `finalizeUpdates` method. Other component views that set their contentView during initialisation are fine. Changelog: [Internal] Reviewed By: shergin Differential Revision: D21302108 fbshipit-source-id: 5adcf489e4e650ac04b84c836a8f8d6f55a77267 --- .../Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 2fba022371ee5a..a0f8d7af169061 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -48,6 +48,7 @@ - (void)setContentView:(UIView *)contentView if (_contentView) { [self addSubview:_contentView]; + _contentView.frame = RCTCGRectFromRect(_layoutMetrics.getContentFrame()); } } From f0dfd35108dd3f092d46b65e77560c35477bf6ba Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Thu, 30 Apr 2020 19:37:04 -0700 Subject: [PATCH 159/235] Smaller loading bar based on feedback Summary: This diff removes the hostname from the loading bar and shrinks it down so it's inside the margins of the safe area view, never blocking app content inside the safe area. Changelog: [General] [iOS] Shrink loading bar down to not cover safe area. Reviewed By: shergin Differential Revision: D21339480 fbshipit-source-id: e8416af63b7e06bcc21c7b6277d5d01d61eb3f73 --- React/CoreModules/RCTDevLoadingView.mm | 31 +++++++------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/React/CoreModules/RCTDevLoadingView.mm b/React/CoreModules/RCTDevLoadingView.mm index 9d91d62863bac2..7646a5de064559 100644 --- a/React/CoreModules/RCTDevLoadingView.mm +++ b/React/CoreModules/RCTDevLoadingView.mm @@ -29,7 +29,6 @@ @interface RCTDevLoadingView () @implementation RCTDevLoadingView { UIWindow *_window; UILabel *_label; - UILabel *_host; NSDate *_showDate; BOOL _hiding; dispatch_block_t _initialMessageBlock; @@ -120,23 +119,14 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( if (@available(iOS 11.0, *)) { UIWindow *window = RCTSharedApplication().keyWindow; self->_window = - [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 52)]; - self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top, screenSize.width, 22)]; - self->_host = - [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top + 20, screenSize.width, 22)]; - self->_host.font = [UIFont monospacedDigitSystemFontOfSize:10.0 weight:UIFontWeightRegular]; - self->_host.textAlignment = NSTextAlignmentCenter; - - [self->_window addSubview:self->_label]; - [self->_window addSubview:self->_host]; - + [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 10)]; + self->_label = + [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top - 10, screenSize.width, 20)]; } else { - self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, 22)]; + self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, 20)]; self->_label = [[UILabel alloc] initWithFrame:self->_window.bounds]; - - [self->_window addSubview:self->_label]; - // TODO: Add host to iOS < 11.0 } + [self->_window addSubview:self->_label]; self->_window.windowLevel = UIWindowLevelStatusBar + 1; // set a root VC so rotation is supported @@ -149,11 +139,6 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( self->_label.text = message; self->_label.textColor = color; - if (self->_host != nil) { - self->_host.text = [self getTextForHost]; - self->_host.textColor = [self dimColor:color]; - } - self->_window.backgroundColor = backgroundColor; self->_window.hidden = NO; @@ -186,11 +171,11 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( dispatch_async(dispatch_get_main_queue(), ^{ self->_hiding = true; - const NSTimeInterval MIN_PRESENTED_TIME = 0.5; + const NSTimeInterval MIN_PRESENTED_TIME = 0.6; NSTimeInterval presentedTime = [[NSDate date] timeIntervalSinceDate:self->_showDate]; NSTimeInterval delay = MAX(0, MIN_PRESENTED_TIME - presentedTime); CGRect windowFrame = self->_window.frame; - [UIView animateWithDuration:0.1 + [UIView animateWithDuration:0.25 delay:delay options:0 animations:^{ @@ -216,7 +201,7 @@ - (void)showWithURL:(NSURL *)URL return; #endif color = [UIColor whiteColor]; - backgroundColor = [UIColor colorWithHue:105 saturation:0 brightness:.25 alpha:1]; + backgroundColor = [UIColor blackColor]; message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME]; [self showMessage:message color:color backgroundColor:backgroundColor]; } else { From f82a6d78c9acc10f46402492075fe6bd7f6f8095 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 00:17:38 -0700 Subject: [PATCH 160/235] Reduce exposure of UIManagerModule in the NativeAnimatedNodesManager class Summary: This diff reduces exposure of UIManagerModule in the NativeAnimatedNodesManager class, this is necessary to enable NativeDriverAnimations in Venice changelog: [Internal][Android] Internal change to enable native driver animations in RN bridgless mode Reviewed By: ejanzer Differential Revision: D21317629 fbshipit-source-id: 81cd4ade296de4757acefe566e1466154d6b4e4b --- .../react/animated/NativeAnimatedNodesManager.java | 12 ++++++++---- .../facebook/react/uimanager/UIManagerModule.java | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java index 9ce9e66470ccfb..2c99f40d655a5f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java @@ -15,12 +15,14 @@ import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.UIManager; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.bridge.WritableMap; import com.facebook.react.common.ReactConstants; import com.facebook.react.uimanager.IllegalViewOperationException; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.events.Event; +import com.facebook.react.uimanager.events.EventDispatcher; import com.facebook.react.uimanager.events.EventDispatcherListener; import java.util.ArrayDeque; import java.util.ArrayList; @@ -53,14 +55,16 @@ // there will be only one driver per mapping so all code code should be optimized around that. private final Map> mEventDrivers = new HashMap<>(); private final UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver; - private final UIManagerModule mUIManagerModule; + private final UIManager mUIManager; private int mAnimatedGraphBFSColor = 0; // Used to avoid allocating a new array on every frame in `runUpdates` and `onEventDispatch`. private final List mRunUpdateNodeList = new LinkedList<>(); public NativeAnimatedNodesManager(UIManagerModule uiManager) { - mUIManagerModule = uiManager; - uiManager.getEventDispatcher().addListener(this); + mUIManager = uiManager; + mUIManager.getEventDispatcher().addListener(this); + // TODO T64216139 Remove dependency of UIManagerModule when the Constants are not in Native + // anymore mCustomEventNamesResolver = uiManager.getDirectEventNamesResolver(); } @@ -85,7 +89,7 @@ public void createAnimatedNode(int tag, ReadableMap config) { } else if ("value".equals(type)) { node = new ValueAnimatedNode(config); } else if ("props".equals(type)) { - node = new PropsAnimatedNode(config, this, mUIManagerModule); + node = new PropsAnimatedNode(config, this, mUIManager); } else if ("interpolation".equals(type)) { node = new InterpolationAnimatedNode(config); } else if ("addition".equals(type)) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 9d7879d425d2ae..a6ce7ff71152af 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -807,6 +807,7 @@ public void setViewHierarchyUpdateDebugListener( mUIImplementation.setViewHierarchyUpdateDebugListener(listener); } + @Override public EventDispatcher getEventDispatcher() { return mEventDispatcher; } From 919554f2c6160d5f2b9aeed02d6486c4d7aba5af Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 00:17:38 -0700 Subject: [PATCH 161/235] Cleanup scheduleMountItem method Summary: scheduleMountItem supports multi threading now, cleanning up TODO changelog: [Internal][Android] Internal cleanup Reviewed By: JoshuaGross Differential Revision: D21318108 fbshipit-source-id: dffac4d541bc2d0f781ddcb8f17f5d1b7e44b79b --- .../src/main/java/com/facebook/react/fabric/FabricUIManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index a661c1c48d7d07..f16b08a41790d2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -522,7 +522,6 @@ private void scheduleMountItem( long layoutEndTime, long finishTransactionStartTime, long finishTransactionEndTime) { - // TODO T31905686: support multithreading // When Binding.cpp calls scheduleMountItems during a commit phase, it always calls with // a BatchMountItem. No other sites call into this with a BatchMountItem, and Binding.cpp only // calls scheduleMountItems with a BatchMountItem. From 09487e4e95a88da7d9fa8b0b6a09f4ea5fe8c25e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 00:17:38 -0700 Subject: [PATCH 162/235] Cleanup ReactRootView Summary: This diff removes the variable 'useSurface' which wasn't beeing used in ReactRootView anymore changelog: [Internal][Android] Internal cleanup of ReactRootView Reviewed By: JoshuaGross Differential Revision: D21318109 fbshipit-source-id: f850b27811608d16b22b6a3964455b172705c4c7 --- .../com/facebook/react/ReactRootView.java | 54 +++++-------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 26c39f9df01ae3..6dedbf620f2219 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -94,29 +94,19 @@ public interface ReactRootViewEventListener { private int mLastWidth = 0; private int mLastHeight = 0; private @UIManagerType int mUIManagerType = DEFAULT; - private final boolean mUseSurface; public ReactRootView(Context context) { super(context); - mUseSurface = false; - init(); - } - - public ReactRootView(Context context, boolean useSurface) { - super(context); - mUseSurface = useSurface; init(); } public ReactRootView(Context context, AttributeSet attrs) { super(context, attrs); - mUseSurface = false; init(); } public ReactRootView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - mUseSurface = false; init(); } @@ -126,13 +116,6 @@ private void init() { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - // TODO: T60453649 - Add test automation to verify behavior of onMeasure - - if (mUseSurface) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - return; - } - Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactRootView.onMeasure"); try { boolean measureSpecsUpdated = @@ -307,9 +290,6 @@ public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - if (mUseSurface) { - super.onLayout(changed, left, top, right, bottom); - } // No-op since UIManagerModule handles actually laying out children. } @@ -393,10 +373,6 @@ public void startReactApplication( mAppProperties = initialProperties; mInitialUITemplate = initialUITemplate; - if (mUseSurface) { - // TODO initialize surface here - } - mReactInstanceManager.createReactContextInBackground(); attachToReactInstanceManager(); @@ -534,26 +510,22 @@ public void runApplication() { CatalystInstance catalystInstance = reactContext.getCatalystInstance(); String jsAppModuleName = getJSModuleName(); - if (mUseSurface) { - // TODO call surface's runApplication - } else { - if (mWasMeasured) { - updateRootLayoutSpecs(mWidthMeasureSpec, mHeightMeasureSpec); - } + if (mWasMeasured) { + updateRootLayoutSpecs(mWidthMeasureSpec, mHeightMeasureSpec); + } - WritableNativeMap appParams = new WritableNativeMap(); - appParams.putDouble("rootTag", getRootViewTag()); - @Nullable Bundle appProperties = getAppProperties(); - if (appProperties != null) { - appParams.putMap("initialProps", Arguments.fromBundle(appProperties)); - } + WritableNativeMap appParams = new WritableNativeMap(); + appParams.putDouble("rootTag", getRootViewTag()); + @Nullable Bundle appProperties = getAppProperties(); + if (appProperties != null) { + appParams.putMap("initialProps", Arguments.fromBundle(appProperties)); + } - mShouldLogContentAppeared = true; + mShouldLogContentAppeared = true; - // TODO T62192299: remove this - FLog.e(TAG, "runApplication: call AppRegistry.runApplication"); - catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams); - } + // TODO T62192299: remove this + FLog.e(TAG, "runApplication: call AppRegistry.runApplication"); + catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams); } finally { Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); } From 65d52a59b044b2e8f7712af5542c4649689363fa Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 00:17:38 -0700 Subject: [PATCH 163/235] Set layout metrics during initial render of Fabric Summary: This diff refactors the initial render of Fabric in order to set the layout metrics as we start the surface. This prevents to create an additional fabric commit during initial render. Also this migth help fixing T63495589 (I wasn't able to repro T63495589 again when using this diff) changelog: [Internal][Android] Internal change to reduce the amount of commits during initial render of Fabric Reviewed By: JoshuaGross Differential Revision: D21330072 fbshipit-source-id: 758c49b52ea4c12d5623b7c7d68c7318f4a6cd83 --- .../facebook/react/ReactInstanceManager.java | 32 ++++++++++++------- .../com/facebook/react/bridge/UIManager.java | 10 ++++++ .../react/fabric/FabricUIManager.java | 9 ++++-- .../facebook/react/uimanager/ReactRoot.java | 3 +- .../react/uimanager/UIManagerModule.java | 10 ++++++ 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 12f0c9e3f47f8f..59ccbbedefb4b8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1150,21 +1150,29 @@ private void attachRootViewToInstance(final ReactRoot reactRoot) { @Nullable Bundle initialProperties = reactRoot.getAppProperties(); - final int rootTag = - uiManager.addRootView( - reactRoot.getRootViewGroup(), - initialProperties == null - ? new WritableNativeMap() - : Arguments.fromBundle(initialProperties), - reactRoot.getInitialUITemplate()); - reactRoot.setRootViewTag(rootTag); + final int rootTag; + if (reactRoot.getUIManagerType() == FABRIC) { - // Fabric requires to call updateRootLayoutSpecs before starting JS Application, - // this ensures the root will hace the correct pointScaleFactor. - uiManager.updateRootLayoutSpecs( - rootTag, reactRoot.getWidthMeasureSpec(), reactRoot.getHeightMeasureSpec()); + rootTag = + uiManager.startSurface( + reactRoot.getRootViewGroup(), + reactRoot.getJSModuleName(), + initialProperties == null + ? new WritableNativeMap() + : Arguments.fromBundle(initialProperties), + reactRoot.getWidthMeasureSpec(), + reactRoot.getHeightMeasureSpec()); + reactRoot.setRootViewTag(rootTag); reactRoot.setShouldLogContentAppeared(true); } else { + rootTag = + uiManager.addRootView( + reactRoot.getRootViewGroup(), + initialProperties == null + ? new WritableNativeMap() + : Arguments.fromBundle(initialProperties), + reactRoot.getInitialUITemplate()); + reactRoot.setRootViewTag(rootTag); reactRoot.runApplication(); } Systrace.beginAsyncSection( diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java index 89ef6a717209d1..170fc7fcd3f25e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java @@ -10,6 +10,7 @@ import static com.facebook.infer.annotation.ThreadConfined.UI; import android.view.View; +import androidx.annotation.AnyThread; import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.facebook.infer.annotation.ThreadConfined; @@ -22,6 +23,15 @@ public interface UIManager extends JSIModule, PerformanceCounter { int addRootView( final T rootView, WritableMap initialProps, @Nullable String initialUITemplate); + /** Registers a new root view with width and height. */ + @AnyThread + int startSurface( + final T rootView, + final String moduleName, + final WritableMap initialProps, + int widthMeasureSpec, + int heightMeasureSpec); + /** * Updates the layout specs of the RootShadowNode based on the Measure specs received by * parameters. diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index f16b08a41790d2..e5239c8db9835d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -17,6 +17,7 @@ import static com.facebook.react.uimanager.common.UIManagerType.FABRIC; import android.annotation.SuppressLint; +import android.content.Context; import android.os.SystemClock; import android.view.View; import androidx.annotation.AnyThread; @@ -195,6 +196,7 @@ public int addRootView( return rootTag; } + @Override @AnyThread @ThreadConfined(ANY) public int startSurface( @@ -204,8 +206,9 @@ public int startSurface( int widthMeasureSpec, int heightMeasureSpec) { final int rootTag = ReactRootViewTagGenerator.getNextRootViewTag(); + Context context = rootView.getContext(); ThemedReactContext reactContext = - new ThemedReactContext(mReactApplicationContext, rootView.getContext(), moduleName); + new ThemedReactContext(mReactApplicationContext, context, moduleName); if (ENABLE_FABRIC_LOGS) { FLog.d(TAG, "Starting surface for module: %s and reactTag: %d", moduleName, rootTag); } @@ -219,8 +222,8 @@ public int startSurface( getMaxSize(widthMeasureSpec), getMinSize(heightMeasureSpec), getMaxSize(heightMeasureSpec), - I18nUtil.getInstance().isRTL(rootView.getContext()), - I18nUtil.getInstance().doLeftAndRightSwapInRTL(rootView.getContext())); + I18nUtil.getInstance().isRTL(context), + I18nUtil.getInstance().doLeftAndRightSwapInRTL(context)); return rootTag; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java index a97220763e4621..2fba8c52164c75 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java @@ -41,9 +41,10 @@ public interface ReactRoot { /** Return native view for root */ ViewGroup getRootViewGroup(); - /** @return Cached values for widthMeasureSpec and heightMeasureSpec */ + /** @return Cached values for widthMeasureSpec. */ int getWidthMeasureSpec(); + /** @return Cached values for and heightMeasureSpec. */ int getHeightMeasureSpec(); /** Sets a flag that determines whether to log that content appeared on next view added. */ diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index a6ce7ff71152af..d753e252a567c4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -425,6 +425,16 @@ public int addRootView( return tag; } + @Override + public int startSurface( + final T rootView, + final String moduleName, + final WritableMap initialProps, + int widthMeasureSpec, + int heightMeasureSpec) { + throw new UnsupportedOperationException(); + } + /** Unregisters a new root view. */ @ReactMethod public void removeRootView(int rootViewTag) { From 2047041c530d8d9af1fecfd80a35f9ed5a1e7649 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 1 May 2020 03:44:51 -0700 Subject: [PATCH 164/235] Use InteropLayer for ReactART Summary: Changelog: [Internal] Use InteropLayer to bridge ReactART into Fabric. Reviewed By: shergin Differential Revision: D21302151 fbshipit-source-id: 46deb381389c6fa87ecad296f616fbaccb29fe30 --- Libraries/ART/ARTGroup.m | 12 ++++-- Libraries/ART/ARTNode.m | 6 ++- Libraries/ART/ARTSurfaceView.m | 11 ++++- .../ART/RCTARTSurfaceShadowNode.cpp | 14 ------- .../ART/RCTARTSurfaceShadowNode.h | 27 ------------ .../RCTARTSurfaceViewComponentDescriptor.h | 20 --------- .../ART/RCTARTSurfaceViewComponentView.h | 15 ------- .../ART/RCTARTSurfaceViewComponentView.mm | 41 ------------------- .../ART/RCTARTSurfaceViewProps.cpp | 21 ---------- .../ART/RCTARTSurfaceViewProps.h | 26 ------------ ...CTLegacyViewManagerInteropComponentView.mm | 12 +++++- .../RCTFabricComponentsPlugins.h | 1 - .../RCTFabricComponentsPlugins.mm | 1 - ...cyViewManagerInteropComponentDescriptor.mm | 6 +++ 14 files changed, 38 insertions(+), 175 deletions(-) delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp delete mode 100644 React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h diff --git a/Libraries/ART/ARTGroup.m b/Libraries/ART/ARTGroup.m index 692d03035bcfcb..8315a39678cd26 100644 --- a/Libraries/ART/ARTGroup.m +++ b/Libraries/ART/ARTGroup.m @@ -11,13 +11,19 @@ @implementation ARTGroup - (void)renderLayerTo:(CGContextRef)context { - if (!CGRectIsEmpty(self.clipping)) { CGContextClipToRect(context, self.clipping); } - for (ARTNode *node in self.subviews) { - [node renderTo:context]; + for (UIView *subview in self.subviews) { + if ([subview respondsToSelector:@selector(renderTo:)]) { + [(ARTNode *)subview renderTo:context]; + } else { + // This is needed for legacy interop layer. Legacy interop layer + // is superview of the view that it is bridging, that's why we need + // to grab its first subview. + [(ARTNode *)subview.subviews.firstObject renderTo:context]; + } } } diff --git a/Libraries/ART/ARTNode.m b/Libraries/ART/ARTNode.m index 8cd3c551b9484b..dc6e46a9bad5ad 100644 --- a/Libraries/ART/ARTNode.m +++ b/Libraries/ART/ARTNode.m @@ -43,8 +43,10 @@ - (void)setTransform:(CGAffineTransform)transform - (void)invalidate { - id container = (id)self.superview; - [container invalidate]; + if ([self.superview respondsToSelector:@selector(invalidate)]) { + id container = (id)self.superview; + [container invalidate]; + } } - (void)renderTo:(CGContextRef)context diff --git a/Libraries/ART/ARTSurfaceView.m b/Libraries/ART/ARTSurfaceView.m index 99cb1275933345..22503910bec60f 100644 --- a/Libraries/ART/ARTSurfaceView.m +++ b/Libraries/ART/ARTSurfaceView.m @@ -49,8 +49,15 @@ - (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); - for (ARTNode *node in self.subviews) { - [node renderTo:context]; + for (UIView *subview in self.subviews) { + if ([subview respondsToSelector:@selector(renderTo:)]) { + [(ARTNode *)subview renderTo:context]; + } else { + // This is needed for legacy interop layer. Legacy interop layer + // is superview of the view that it is bridging, that's why we need + // to grab its first subview. + [(ARTNode *)subview.subviews.firstObject renderTo:context]; + } } } diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp deleted file mode 100644 index cbb3c1998abae5..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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. - */ - -namespace facebook { -namespace react { - -extern const char RCTARTSurfaceViewComponentName[] = "ARTSurfaceView"; - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h deleted file mode 100644 index 3a26257acc5f7a..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceShadowNode.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include "RCTARTSurfaceViewProps.h" - -namespace facebook { -namespace react { - -extern const char RCTARTSurfaceViewComponentName[]; - -/* - * `ShadowNode` for component. - */ -using RCTARTSurfaceShadowNode = ConcreteViewShadowNode< - RCTARTSurfaceViewComponentName, - RCTARTSurfaceViewProps, - ViewEventEmitter>; - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h deleted file mode 100644 index 4cd2480ad5050a..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentDescriptor.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include -#include "RCTARTSurfaceShadowNode.h" - -namespace facebook { -namespace react { - -using RCTARTSurfaceComponentDescriptor = - ConcreteComponentDescriptor; - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h deleted file mode 100644 index 30a6ab992fa7b8..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - */ - -#import - -/** - * UIView class for root component. - */ -@interface RCTARTSurfaceViewComponentView : RCTViewComponentView - -@end diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm deleted file mode 100644 index f8a26d871f6bf8..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewComponentView.mm +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -#import "RCTARTSurfaceViewComponentView.h" -#import -#import "RCTARTSurfaceViewComponentDescriptor.h" - -#import "FBRCTFabricComponentsPlugins.h" - -using namespace facebook::react; - -@implementation RCTARTSurfaceViewComponentView { -} - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - static const auto defaultProps = std::make_shared(); - _props = defaultProps; - } - - return self; -} - -#pragma mark - RCTComponentViewProtocol - -+ (ComponentDescriptorProvider)componentDescriptorProvider -{ - return concreteComponentDescriptorProvider(); -} - -@end - -Class RCTARTSurfaceViewCls(void) -{ - return RCTARTSurfaceViewComponentView.class; -} diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp deleted file mode 100644 index fd94a7c0d8f73d..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -#include "RCTARTSurfaceViewProps.h" - -#include - -namespace facebook { -namespace react { - -RCTARTSurfaceViewProps::RCTARTSurfaceViewProps( - const RCTARTSurfaceViewProps &sourceProps, - const RawProps &rawProps) - : ViewProps(sourceProps, rawProps) {} - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h b/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h deleted file mode 100644 index cbebf7c4de82d5..00000000000000 --- a/React/Fabric/Mounting/ComponentViews/ART/RCTARTSurfaceViewProps.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include - -namespace facebook { -namespace react { - -class RCTARTSurfaceViewProps final : public ViewProps { - public: - RCTARTSurfaceViewProps() = default; - RCTARTSurfaceViewProps( - const RCTARTSurfaceViewProps &sourceProps, - const RawProps &rawProps); - -#pragma mark - Props -}; - -} // namespace react -} // namespace facebook diff --git a/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm b/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm index fc689ca35c324e..9da0483fad089a 100644 --- a/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm @@ -36,8 +36,16 @@ - (instancetype)initWithFrame:(CGRect)frame + (NSMutableSet *)supportedViewManagers { - static NSMutableSet *supported = - [NSMutableSet setWithObjects:@"Picker", @"DatePicker", @"ProgressView", @"SegmentedControl", @"MaskedView", nil]; + static NSMutableSet *supported = [NSMutableSet setWithObjects:@"Picker", + @"DatePicker", + @"ProgressView", + @"SegmentedControl", + @"MaskedView", + @"ARTSurfaceView", + @"ARTText", + @"ARTShape", + @"ARTGroup", + nil]; return supported; } diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h index 3bf14b7394b3c7..60f9dca7efafd3 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h @@ -37,7 +37,6 @@ Class RCTSliderCls(void) __attribute__((used)); Class RCTSwitchCls(void) __attribute__((used)); Class RCTUnimplementedNativeViewCls(void) __attribute__((used)); Class RCTModalHostViewCls(void) __attribute__((used)); -Class RCTARTSurfaceViewCls(void) __attribute__((used)); Class RCTImageCls(void) __attribute__((used)); #ifdef __cplusplus diff --git a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm index ccb07bcbb8e28a..f56ec907d8467a 100644 --- a/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +++ b/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm @@ -26,7 +26,6 @@ {"Switch", RCTSwitchCls}, {"UnimplementedNativeView", RCTUnimplementedNativeViewCls}, {"ModalHostView", RCTModalHostViewCls}, - {"ARTSurfaceView", RCTARTSurfaceViewCls}, {"Image", RCTImageCls}, }; diff --git a/ReactCommon/fabric/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm b/ReactCommon/fabric/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm index dec8a569783662..7e2c3813676cf0 100644 --- a/ReactCommon/fabric/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +++ b/ReactCommon/fabric/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm @@ -29,6 +29,12 @@ // If `moduleName` has "FB" prefix. return componentName + "Manager"; } + + std::string artPrefix("ART"); + if (std::mismatch(artPrefix.begin(), artPrefix.end(), componentName.begin()).first == artPrefix.end()) { + return componentName + "Manager"; + } + return "RCT" + componentName + "Manager"; } From 12f8b2598fa46533ea59834a0225cc9e36b20111 Mon Sep 17 00:00:00 2001 From: Boyang Yu Date: Fri, 1 May 2020 12:37:58 -0700 Subject: [PATCH 165/235] fix duration calculation for RCTUIImageViewAnimated Summary: ## Changelog: [iOS] [Fixed] - Fix duration calculation for RCTUIImageViewAnimated Reviewed By: p-sun, shergin Differential Revision: D21321089 fbshipit-source-id: 7464231bbc3b90e70d3ba95288fd90707d3d24af --- Libraries/Image/RCTUIImageViewAnimated.m | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Libraries/Image/RCTUIImageViewAnimated.m b/Libraries/Image/RCTUIImageViewAnimated.m index 979b9aff3a4336..8402d0e28bb958 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.m +++ b/Libraries/Image/RCTUIImageViewAnimated.m @@ -183,7 +183,21 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink // TODO: `displayLink.frameInterval` is not available on UIKitForMac NSTimeInterval duration = displayLink.duration; #else - NSTimeInterval duration = displayLink.duration * displayLink.preferredFramesPerSecond; + NSTimeInterval duration = displayLink.duration; + if (@available(iOS 10.0, *)) { + // Per https://developer.apple.com/documentation/quartzcore/cadisplaylink + // displayLink.duration provides the amount of time between frames at the maximumFramesPerSecond + // Thus we need to calculate true duration based on preferredFramesPerSecond + if (displayLink.preferredFramesPerSecond != 0) { + double maxFrameRate = 60.0; // default to 60 fps + if (@available(iOS 10.3, tvOS 10.3, *)) { + maxFrameRate = self.window.screen.maximumFramesPerSecond; + } + duration = duration * displayLink.preferredFramesPerSecond / maxFrameRate; + } // else respect maximumFramesPerSecond + } else { // version < (ios 10) + duration = duration * displayLink.frameInterval; + } #endif NSUInteger totalFrameCount = self.totalFrameCount; NSUInteger currentFrameIndex = self.currentFrameIndex; From c25911bea8ed36617175588198bfb3aa147d7e58 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Fri, 1 May 2020 13:49:27 -0700 Subject: [PATCH 166/235] Update cocoapods, fix RNTester Summary: Updating pods and fixing an issue in the RN podfile. Changelog: [iOS][Fixed] Update podfile for RNTester Reviewed By: PeteTheHeat Differential Revision: D21336180 fbshipit-source-id: 4d51f53466ec2d432cf7a5775cb4d69d47423077 --- RNTester/Podfile | 2 +- RNTester/Podfile.lock | 2 +- .../RNTesterPods.xcodeproj/project.pbxproj | 80 +++++++++---------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/RNTester/Podfile b/RNTester/Podfile index deb6b77c5b61f2..28dcd6e80d89a9 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -51,7 +51,7 @@ if ENV['USE_FRAMEWORKS'] == '1' installer.pod_targets.each do |pod| if static_frameworks.include?(pod.name) def pod.build_type - Pod::Target::BuildType.static_library + Pod::BuildType.static_library end end end diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index e5124ddbd7c54e..a183f5ffbbd3a1 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -510,6 +510,6 @@ SPEC CHECKSUMS: Yoga: f7fa200d8c49f97b54c9421079e781fb900b5cae YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d +PODFILE CHECKSUM: ea07262e83c5b48d35bb3bfd5efe205794425c97 COCOAPODS: 1.9.1 diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index 5d598deb0534a9..09998dd7531241 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -8,17 +8,17 @@ /* Begin PBXBuildFile section */ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 24EAD605675D8ABA2B64823A /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */; }; 272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; }; 27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; 2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */; }; 383889DA23A7398900D06C3E /* RCTConvert_UIColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */; }; 3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; }; + 4D55E71C4DD3105584EF88FF /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */; }; 5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; }; 5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; }; - 6766440649168A1FAD1DB4A4 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */; }; - 6ABAB5205C9B8E0726E12033 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */; }; 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; }; - 85C7978AB28C149170A56955 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */; }; + 9DEC469CDBEB62F890D5E5A2 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 016F26780ADDDB6693E37088 /* libPods-RNTester.a */; }; E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; }; E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; }; E7DB20D222B2BAA6005AC45F /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20AA22B2BAA3005AC45F /* RCTModuleInitNotificationRaceTests.m */; }; @@ -70,7 +70,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 016F26780ADDDB6693E37088 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; @@ -80,6 +80,7 @@ 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = ""; }; 27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = ""; }; 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = ""; }; + 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 34028D6B10F47E490042EB27 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = ""; }; 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIColorTests.m; sourceTree = ""; }; 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "RNTester/legacy_image@2x.png"; sourceTree = ""; }; @@ -87,12 +88,11 @@ 5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = ""; }; 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = ""; }; 5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = ""; }; - 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7D51F73F0DA20287418D98BD /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = ""; }; 972A459EE6CF8CC63531A088 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = ""; }; 98233960D1D6A1977D1C7EAF /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = ""; }; - B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E771AEEA22B44E3100EA1189 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = ""; }; E7DB209F22B2BA84005AC45F /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -173,7 +173,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6ABAB5205C9B8E0726E12033 /* libPods-RNTester.a in Frameworks */, + 9DEC469CDBEB62F890D5E5A2 /* libPods-RNTester.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -183,7 +183,7 @@ files = ( E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */, E7DB213222B2C67D005AC45F /* libOCMock.a in Frameworks */, - 85C7978AB28C149170A56955 /* libPods-RNTesterUnitTests.a in Frameworks */, + 4D55E71C4DD3105584EF88FF /* libPods-RNTesterUnitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -193,7 +193,7 @@ files = ( E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */, E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */, - 6766440649168A1FAD1DB4A4 /* libPods-RNTesterIntegrationTests.a in Frameworks */, + 24EAD605675D8ABA2B64823A /* libPods-RNTesterIntegrationTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -263,9 +263,9 @@ E7DB211822B2BD53005AC45F /* libReact-RCTText.a */, E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */, E7DB212222B2BD53005AC45F /* libyoga.a */, - B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */, - 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */, - 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */, + 016F26780ADDDB6693E37088 /* libPods-RNTester.a */, + 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */, + CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -398,7 +398,7 @@ 13B07F8E1A680F5B00A75B9A /* Resources */, 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, - 33D41129F73FA216240D6A8E /* [CP] Copy Pods Resources */, + EF2E405905E7906EE3359DDE /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -417,7 +417,7 @@ E7DB209B22B2BA84005AC45F /* Sources */, E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, - 82168A981B1591BFD3DFCF51 /* [CP] Copy Pods Resources */, + 4B23EBE19DBB8A3ECC0D2F6A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -436,7 +436,7 @@ E7DB214F22B2F332005AC45F /* Sources */, E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, - 28D6EF6C8ED1C5CEB67629BA /* [CP] Copy Pods Resources */, + C235B64D0917CDD748838189 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -515,38 +515,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 28D6EF6C8ED1C5CEB67629BA /* [CP] Copy Pods Resources */ = { + 4B23EBE19DBB8A3ECC0D2F6A /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 33D41129F73FA216240D6A8E /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; 56D84768A7BBB2750D674CF3 /* [CP] Check Pods Manifest.lock */ = { @@ -622,21 +605,38 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\nPROJECT_ROOT=$SRCROOT/.. $SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n"; }; - 82168A981B1591BFD3DFCF51 /* [CP] Copy Pods Resources */ = { + C235B64D0917CDD748838189 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + EF2E405905E7906EE3359DDE /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources.sh\"\n"; showEnvVarsInLog = 0; }; F9CB97B0D9633939D43E75E0 /* [CP] Check Pods Manifest.lock */ = { From 780f06cd477f34da48646a949bd25dd3f883a9a2 Mon Sep 17 00:00:00 2001 From: Eli White Date: Fri, 1 May 2020 14:19:22 -0700 Subject: [PATCH 167/235] Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 --- template/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/package.json b/template/package.json index fea2169725758e..fbf551b6d9aaa0 100644 --- a/template/package.json +++ b/template/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", - "@react-native-community/eslint-config": "^1.0.0", + "@react-native-community/eslint-config": "^1.1.0", "babel-jest": "^25.1.0", "eslint": "^6.5.1", "jest": "^25.1.0", From 56592c500f73677fcaa005a8281c9ea1318fe9b8 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 1 May 2020 14:53:07 -0700 Subject: [PATCH 168/235] Fabric: Fixing `executeSynchronouslyOnSameThread_CAN_DEADLOCK` Summary: In D20551411 we (I) replaced `std::mutex` with `std::recursive_mutex` in `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in order to support synchronous `RuntimeExecutor`. It turned out that the idea was cool but totally incorrect. Quite obviously, double locking recursive mutex on the same thread does nothing, so the whole setup does not work at all. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21328072 fbshipit-source-id: 7f1f81de61c36adb167fe624ada3bd71913bdf7c --- ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h b/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h index bdde3603e610f9..e01e2df41c1da8 100644 --- a/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +++ b/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h @@ -78,12 +78,10 @@ inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK( std::function &&callback) noexcept { // Note: We need the third mutex to get back to the main thread before // the lambda is finished (because all mutexes are allocated on the stack). - // We use `recursive_mutex` here to not deadlock in case if a - // `RuntimeExecutor` executes the callback synchronously. - std::recursive_mutex mutex1; - std::recursive_mutex mutex2; - std::recursive_mutex mutex3; + std::mutex mutex1; + std::mutex mutex2; + std::mutex mutex3; mutex1.lock(); mutex2.lock(); From bf0539fb51aa7dd0f9ad2b6587a047379e43fbe4 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Fri, 1 May 2020 15:09:09 -0700 Subject: [PATCH 169/235] Revert D21336180: Update cocoapods, fix RNTester Differential Revision: D21336180 Original commit changeset: 4d51f53466ec fbshipit-source-id: 5519bc0457f14060e793d2da454489b77fce923f --- RNTester/Podfile | 2 +- RNTester/Podfile.lock | 2 +- .../RNTesterPods.xcodeproj/project.pbxproj | 80 +++++++++---------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/RNTester/Podfile b/RNTester/Podfile index 28dcd6e80d89a9..deb6b77c5b61f2 100644 --- a/RNTester/Podfile +++ b/RNTester/Podfile @@ -51,7 +51,7 @@ if ENV['USE_FRAMEWORKS'] == '1' installer.pod_targets.each do |pod| if static_frameworks.include?(pod.name) def pod.build_type - Pod::BuildType.static_library + Pod::Target::BuildType.static_library end end end diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index a183f5ffbbd3a1..e5124ddbd7c54e 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -510,6 +510,6 @@ SPEC CHECKSUMS: Yoga: f7fa200d8c49f97b54c9421079e781fb900b5cae YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: ea07262e83c5b48d35bb3bfd5efe205794425c97 +PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d COCOAPODS: 1.9.1 diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index 09998dd7531241..5d598deb0534a9 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -8,17 +8,17 @@ /* Begin PBXBuildFile section */ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 24EAD605675D8ABA2B64823A /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */; }; 272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; }; 27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; 2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */; }; 383889DA23A7398900D06C3E /* RCTConvert_UIColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */; }; 3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; }; - 4D55E71C4DD3105584EF88FF /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */; }; 5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; }; 5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; }; + 6766440649168A1FAD1DB4A4 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */; }; + 6ABAB5205C9B8E0726E12033 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */; }; 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; }; - 9DEC469CDBEB62F890D5E5A2 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 016F26780ADDDB6693E37088 /* libPods-RNTester.a */; }; + 85C7978AB28C149170A56955 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */; }; E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; }; E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; }; E7DB20D222B2BAA6005AC45F /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20AA22B2BAA3005AC45F /* RCTModuleInitNotificationRaceTests.m */; }; @@ -70,7 +70,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 016F26780ADDDB6693E37088 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; @@ -80,7 +80,6 @@ 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = ""; }; 27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = ""; }; 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = ""; }; - 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 34028D6B10F47E490042EB27 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = ""; }; 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIColorTests.m; sourceTree = ""; }; 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "RNTester/legacy_image@2x.png"; sourceTree = ""; }; @@ -88,11 +87,12 @@ 5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = ""; }; 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = ""; }; 5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = ""; }; + 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7D51F73F0DA20287418D98BD /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = ""; }; 972A459EE6CF8CC63531A088 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = ""; }; 98233960D1D6A1977D1C7EAF /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = ""; }; - CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E771AEEA22B44E3100EA1189 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = ""; }; E7DB209F22B2BA84005AC45F /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -173,7 +173,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9DEC469CDBEB62F890D5E5A2 /* libPods-RNTester.a in Frameworks */, + 6ABAB5205C9B8E0726E12033 /* libPods-RNTester.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -183,7 +183,7 @@ files = ( E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */, E7DB213222B2C67D005AC45F /* libOCMock.a in Frameworks */, - 4D55E71C4DD3105584EF88FF /* libPods-RNTesterUnitTests.a in Frameworks */, + 85C7978AB28C149170A56955 /* libPods-RNTesterUnitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -193,7 +193,7 @@ files = ( E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */, E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */, - 24EAD605675D8ABA2B64823A /* libPods-RNTesterIntegrationTests.a in Frameworks */, + 6766440649168A1FAD1DB4A4 /* libPods-RNTesterIntegrationTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -263,9 +263,9 @@ E7DB211822B2BD53005AC45F /* libReact-RCTText.a */, E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */, E7DB212222B2BD53005AC45F /* libyoga.a */, - 016F26780ADDDB6693E37088 /* libPods-RNTester.a */, - 32FBB7182B91B9B63BE5B2E5 /* libPods-RNTesterIntegrationTests.a */, - CD2B3E80D03F084E29A91AE0 /* libPods-RNTesterUnitTests.a */, + B5C8E567A4E6281113811CB1 /* libPods-RNTester.a */, + 5F836A7C97EC1BA121BA5A2A /* libPods-RNTesterIntegrationTests.a */, + 11941849F77C552FDC3EED77 /* libPods-RNTesterUnitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -398,7 +398,7 @@ 13B07F8E1A680F5B00A75B9A /* Resources */, 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, - EF2E405905E7906EE3359DDE /* [CP] Copy Pods Resources */, + 33D41129F73FA216240D6A8E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -417,7 +417,7 @@ E7DB209B22B2BA84005AC45F /* Sources */, E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, - 4B23EBE19DBB8A3ECC0D2F6A /* [CP] Copy Pods Resources */, + 82168A981B1591BFD3DFCF51 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -436,7 +436,7 @@ E7DB214F22B2F332005AC45F /* Sources */, E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, - C235B64D0917CDD748838189 /* [CP] Copy Pods Resources */, + 28D6EF6C8ED1C5CEB67629BA /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -515,21 +515,38 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 4B23EBE19DBB8A3ECC0D2F6A /* [CP] Copy Pods Resources */ = { + 28D6EF6C8ED1C5CEB67629BA /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 33D41129F73FA216240D6A8E /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources.sh\"\n"; showEnvVarsInLog = 0; }; 56D84768A7BBB2750D674CF3 /* [CP] Check Pods Manifest.lock */ = { @@ -605,38 +622,21 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\nPROJECT_ROOT=$SRCROOT/.. $SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n"; }; - C235B64D0917CDD748838189 /* [CP] Copy Pods Resources */ = { + 82168A981B1591BFD3DFCF51 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - EF2E405905E7906EE3359DDE /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; F9CB97B0D9633939D43E75E0 /* [CP] Check Pods Manifest.lock */ = { From 8c45255fa57f4d30b4733fbe9199febec8b9bc53 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 17:17:06 -0700 Subject: [PATCH 170/235] Refactor ReactCallerContextFactory to recive surfaceID as a parameter Summary: This diff refactors the ReactCallerContextFactory class to recive surfaceID as a parameter instead of ThemedReactContext This is necessary for the next diff of the stack changelog: [Internal][Android] Reviewed By: fkgozali Differential Revision: D21362265 fbshipit-source-id: d0079788049fe86d2873eb6aa4bf1115b33457af --- .../react/views/image/ReactCallerContextFactory.java | 8 +++++--- .../com/facebook/react/views/image/ReactImageManager.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactCallerContextFactory.java b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactCallerContextFactory.java index 7ccc594b946a18..46e9573fdb0ca1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactCallerContextFactory.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactCallerContextFactory.java @@ -1,3 +1,5 @@ +// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + /* * Copyright (c) Facebook, Inc. and its affiliates. * @@ -8,7 +10,6 @@ package com.facebook.react.views.image; import androidx.annotation.Nullable; -import com.facebook.react.uimanager.ThemedReactContext; /** * This interface is used from {@link ReactImageManager} to customize the CallerContext object @@ -19,8 +20,9 @@ public interface ReactCallerContextFactory { /** * This method will be called at the time {@link ReactImageManager} creates {@link ReactImageView} * - * @param reactContext {@link ThemedReactContext} used to create the {@link ReactImageView} + * @param surfaceID {@link String} used to log the name of the surface * @return an {@link Object} that represents the CallerContext. */ - Object getOrCreateCallerContext(ThemedReactContext reactContext, @Nullable String analyticTag); + @Nullable + Object getOrCreateCallerContext(@Nullable String surfaceID, @Nullable String analyticTag); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java index e90301b6acea0b..7077ceb7ad9030 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java @@ -107,7 +107,7 @@ public Object getCallerContext() { public ReactImageView createViewInstance(ThemedReactContext context) { Object callerContext = mCallerContextFactory != null - ? mCallerContextFactory.getOrCreateCallerContext(context, null) + ? mCallerContextFactory.getOrCreateCallerContext(context.getSurfaceID(), null) : getCallerContext(); return new ReactImageView( context, getDraweeControllerBuilder(), mGlobalImageLoadListener, callerContext); @@ -129,7 +129,7 @@ public void setInternal_AnalyticsTag(ReactImageView view, @Nullable String analy if (mCallerContextFactory != null) { view.updateCallerContext( mCallerContextFactory.getOrCreateCallerContext( - (ThemedReactContext) view.getContext(), analyticTag)); + ((ThemedReactContext) view.getContext()).getSurfaceID(), analyticTag)); } } From 3da8103679b62d1f4c073fcd75d4ce21090b1ef9 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 17:17:06 -0700 Subject: [PATCH 171/235] Inject Fresco.ImagePipeline into ImageLoaderModule Summary: This diff injects Fresco.ImagePipeline into ImageLoaderModule in order to ensure prefetching uses the same ImagePipeline than ReactImageView changelog: [internal][Android] Reviewed By: fkgozali Differential Revision: D21362267 fbshipit-source-id: d6f55cffb6be6a012c2afb4ad5db2072bc7100ec --- .../react/modules/image/ImageLoaderModule.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java index aec08eea1f76b3..e3aa67d8070092 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java @@ -44,18 +44,25 @@ public class ImageLoaderModule extends NativeImageLoaderAndroidSpec private static final String ERROR_GET_SIZE_FAILURE = "E_GET_SIZE_FAILURE"; public static final String NAME = "ImageLoader"; - private final Object mCallerContext; + private @Nullable final Object mCallerContext; private final Object mEnqueuedRequestMonitor = new Object(); private final SparseArray> mEnqueuedRequests = new SparseArray<>(); + private ImagePipeline mImagePipeline; public ImageLoaderModule(ReactApplicationContext reactContext) { + this(reactContext, null); + } + + public ImageLoaderModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline) { super(reactContext); - mCallerContext = this; + mCallerContext = Fresco.getImagePipeline(); + mImagePipeline = imagePipeline; } public ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext) { super(reactContext); mCallerContext = callerContext; + mImagePipeline = Fresco.getImagePipeline(); } @Override From eb6001998be697f6e956eec6eb2385ce7572aa39 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 1 May 2020 17:17:06 -0700 Subject: [PATCH 172/235] Extend logging of image prefetching to include react_native contextChain Summary: This diff extends the logging of image prefetching to include react_native ID in the ContextChain of the Fresco logger. This is necesary to properly assign pre-fetching of RN Android images to the react_native ID changelog: [Internal][Android] Reviewed By: fkgozali Differential Revision: D21362266 fbshipit-source-id: ff64f0ebd12f61b713996558eb2d962f96ad8d94 --- .../com/facebook/react/modules/image/BUCK | 1 + .../modules/image/ImageLoaderModule.java | 37 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK index 519a07adcba933..1116925eee2954 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK @@ -20,6 +20,7 @@ rn_android_library( react_native_target("java/com/facebook/react/modules/fresco:fresco"), react_native_target("java/com/facebook/react/module/annotations:annotations"), react_native_target("java/com/facebook/react/views/imagehelper:imagehelper"), + react_native_target("java/com/facebook/react/views/image:image"), ], exported_deps = [ react_native_target("java/com/facebook/fbreact/specs:FBReactNativeSpec"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java index e3aa67d8070092..6ee149cb8956d5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java @@ -33,6 +33,7 @@ import com.facebook.react.bridge.WritableMap; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.modules.fresco.ReactNetworkImageRequest; +import com.facebook.react.views.image.ReactCallerContextFactory; import com.facebook.react.views.imagehelper.ImageSource; @ReactModule(name = ImageLoaderModule.NAME) @@ -43,20 +44,16 @@ public class ImageLoaderModule extends NativeImageLoaderAndroidSpec private static final String ERROR_PREFETCH_FAILURE = "E_PREFETCH_FAILURE"; private static final String ERROR_GET_SIZE_FAILURE = "E_GET_SIZE_FAILURE"; public static final String NAME = "ImageLoader"; + private static final Object DEFAULT_CALLER_CONTEXT = new Object(); private @Nullable final Object mCallerContext; private final Object mEnqueuedRequestMonitor = new Object(); private final SparseArray> mEnqueuedRequests = new SparseArray<>(); - private ImagePipeline mImagePipeline; + private final ImagePipeline mImagePipeline; + private @Nullable ReactCallerContextFactory mCallerContextFactory; public ImageLoaderModule(ReactApplicationContext reactContext) { - this(reactContext, null); - } - - public ImageLoaderModule(ReactApplicationContext reactContext, ImagePipeline imagePipeline) { - super(reactContext); - mCallerContext = Fresco.getImagePipeline(); - mImagePipeline = imagePipeline; + this(reactContext, DEFAULT_CALLER_CONTEXT); } public ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext) { @@ -65,6 +62,22 @@ public ImageLoaderModule(ReactApplicationContext reactContext, Object callerCont mImagePipeline = Fresco.getImagePipeline(); } + public ImageLoaderModule( + ReactApplicationContext reactContext, + ImagePipeline imagePipeline, + ReactCallerContextFactory callerContextFactory) { + super(reactContext); + mCallerContextFactory = callerContextFactory; + mImagePipeline = imagePipeline; + mCallerContext = null; + } + + private @Nullable Object getCallerContext() { + return mCallerContextFactory != null + ? mCallerContextFactory.getOrCreateCallerContext("", "") + : mCallerContext; + } + @Override @NonNull public String getName() { @@ -89,7 +102,7 @@ public void getSize(final String uriString, final Promise promise) { ImageRequest request = ImageRequestBuilder.newBuilderWithSource(source.getUri()).build(); DataSource> dataSource = - Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext); + mImagePipeline.fetchDecodedImage(request, getCallerContext()); DataSubscriber> dataSubscriber = new BaseDataSubscriber>() { @@ -150,7 +163,7 @@ public void getSizeWithHeaders( ReactNetworkImageRequest.fromBuilderWithHeaders(imageRequestBuilder, headers); DataSource> dataSource = - Fresco.getImagePipeline().fetchDecodedImage(request, mCallerContext); + mImagePipeline.fetchDecodedImage(request, getCallerContext()); DataSubscriber> dataSubscriber = new BaseDataSubscriber>() { @@ -210,7 +223,7 @@ public void prefetchImage( ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build(); DataSource prefetchSource = - Fresco.getImagePipeline().prefetchToDiskCache(request, mCallerContext); + mImagePipeline.prefetchToDiskCache(request, getCallerContext()); DataSubscriber prefetchSubscriber = new BaseDataSubscriber() { @Override @@ -257,7 +270,7 @@ public void queryCache(final ReadableArray uris, final Promise promise) { @Override protected void doInBackgroundGuarded(Void... params) { WritableMap result = Arguments.createMap(); - ImagePipeline imagePipeline = Fresco.getImagePipeline(); + ImagePipeline imagePipeline = mImagePipeline; for (int i = 0; i < uris.size(); i++) { String uriString = uris.getString(i); final Uri uri = Uri.parse(uriString); From 03385ac1d6582de87ef7f78286c9358b324de462 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Sat, 2 May 2020 11:04:22 -0700 Subject: [PATCH 173/235] Fix Fb4aReactPackageTest.testGetNativeModulesByName test Summary: This diff refactors the ImageLoaderModule class in order to prevent early execution of Fresco.getImagePipeline method when prefetching MC is disabled (see stack D21362266) changelog: [Internal][Android] Reviewed By: shergin Differential Revision: D21368516 fbshipit-source-id: 53f99cd3c3f4848364182cb954a8d34821cb6d9e --- .../modules/image/ImageLoaderModule.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java index 6ee149cb8956d5..71fb0a809c816f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.java @@ -44,22 +44,21 @@ public class ImageLoaderModule extends NativeImageLoaderAndroidSpec private static final String ERROR_PREFETCH_FAILURE = "E_PREFETCH_FAILURE"; private static final String ERROR_GET_SIZE_FAILURE = "E_GET_SIZE_FAILURE"; public static final String NAME = "ImageLoader"; - private static final Object DEFAULT_CALLER_CONTEXT = new Object(); private @Nullable final Object mCallerContext; private final Object mEnqueuedRequestMonitor = new Object(); private final SparseArray> mEnqueuedRequests = new SparseArray<>(); - private final ImagePipeline mImagePipeline; + private @Nullable ImagePipeline mImagePipeline = null; private @Nullable ReactCallerContextFactory mCallerContextFactory; public ImageLoaderModule(ReactApplicationContext reactContext) { - this(reactContext, DEFAULT_CALLER_CONTEXT); + super(reactContext); + mCallerContext = this; } public ImageLoaderModule(ReactApplicationContext reactContext, Object callerContext) { super(reactContext); mCallerContext = callerContext; - mImagePipeline = Fresco.getImagePipeline(); } public ImageLoaderModule( @@ -84,6 +83,10 @@ public String getName() { return NAME; } + private ImagePipeline getImagePipeline() { + return mImagePipeline != null ? mImagePipeline : Fresco.getImagePipeline(); + } + /** * Fetch the width and height of the given image. * @@ -102,7 +105,7 @@ public void getSize(final String uriString, final Promise promise) { ImageRequest request = ImageRequestBuilder.newBuilderWithSource(source.getUri()).build(); DataSource> dataSource = - mImagePipeline.fetchDecodedImage(request, getCallerContext()); + getImagePipeline().fetchDecodedImage(request, getCallerContext()); DataSubscriber> dataSubscriber = new BaseDataSubscriber>() { @@ -163,7 +166,7 @@ public void getSizeWithHeaders( ReactNetworkImageRequest.fromBuilderWithHeaders(imageRequestBuilder, headers); DataSource> dataSource = - mImagePipeline.fetchDecodedImage(request, getCallerContext()); + getImagePipeline().fetchDecodedImage(request, getCallerContext()); DataSubscriber> dataSubscriber = new BaseDataSubscriber>() { @@ -223,7 +226,7 @@ public void prefetchImage( ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build(); DataSource prefetchSource = - mImagePipeline.prefetchToDiskCache(request, getCallerContext()); + getImagePipeline().prefetchToDiskCache(request, getCallerContext()); DataSubscriber prefetchSubscriber = new BaseDataSubscriber() { @Override @@ -270,7 +273,7 @@ public void queryCache(final ReadableArray uris, final Promise promise) { @Override protected void doInBackgroundGuarded(Void... params) { WritableMap result = Arguments.createMap(); - ImagePipeline imagePipeline = mImagePipeline; + ImagePipeline imagePipeline = getImagePipeline(); for (int i = 0; i < uris.size(); i++) { String uriString = uris.getString(i); final Uri uri = Uri.parse(uriString); From 1787c161a95bcb33c60d4d86b36e7d184dc1b7cb Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Sun, 3 May 2020 02:08:27 -0700 Subject: [PATCH 174/235] Remove `docs` from `jscodeshift` Summary: I removed 1 MiB from `jscodeshift` as it was shipping with docs: https://github.com/facebook/jscodeshift/commit/5885662920ed7a3077da22beed4a8f76743dd19c Changelog: [Internal] Reviewed By: yungsters Differential Revision: D21368889 fbshipit-source-id: 452fd4cedcc749d972adbb69df5c95117dd55b15 --- package.json | 2 +- packages/react-native-codegen/package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 786395213ae8e6..fc31865c6fbf5e 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "flow-remove-types": "1.2.3", "jest": "^25.4.0", "jest-junit": "^10.0.0", - "jscodeshift": "^0.7.0", + "jscodeshift": "^0.7.1", "mkdirp": "^0.5.1", "prettier": "1.19.1", "react": "16.13.1", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index b8a12ed0fb941e..82e6d5d7b4cb55 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -13,7 +13,7 @@ ], "dependencies": { "flow-parser": "^0.121.0", - "jscodeshift": "^0.7.0", + "jscodeshift": "^0.7.1", "nullthrows": "^1.1.1" } } diff --git a/yarn.lock b/yarn.lock index f2efeddb18115f..40d8252af3dfc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4843,10 +4843,10 @@ jsc-android@^245459.0.0: resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-245459.0.0.tgz#e584258dd0b04c9159a27fb104cd5d491fd202c9" integrity sha512-wkjURqwaB1daNkDi2OYYbsLnIdC/lUM2nPXQKRs5pqEU9chDg435bjvo+LSaHotDENygHQDHe+ntUkkw2gwMtg== -jscodeshift@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.7.0.tgz#4eee7506fd4fdacbd80340287d61575af991fdab" - integrity sha512-Kt6rpTa1HVhAWagD6J0y6qxxqRmDgkFvczerLgOsDNSGoUZSmq2CO1vFRcda9OV1BaZKSHCIh+VREPts5tB/Ig== +jscodeshift@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.7.1.tgz#0236ad475d6f0770ca998a0160925d62b57d2507" + integrity sha512-YMkZSyoc8zg5woZL23cmWlnFLPH/mHilonGA7Qbzs7H6M4v4PH0Qsn4jeDyw+CHhVoAnm9UxQyB0Yw1OT+mktA== dependencies: "@babel/core" "^7.1.6" "@babel/parser" "^7.1.6" From 8ad810717ee1769aa5ff6c73e0c9bfa8c43a3bac Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Sun, 3 May 2020 09:30:31 -0700 Subject: [PATCH 175/235] iOS: when the bridge has been invalidated, NativeModule lookup should just return nil Summary: There's a corner case where: * The bridge gets invalidated, and native modules are cleaning up themselves (but not done yet) * Something asks for a NativeModule instance - ideally it should just get nil at this point * If TM Manager is invalidating, we get nil correctly, but we continue thru the old NativeModule lookup logic * The latter will fail anyway, and would throw a redbox (RCTLogError). So, if the bridge is invalidated, if TM Manager returns nil, we should just return nil for old NativeModule lookup. The module of interest is RCTImageLoader, which was requested by RCTImageView on deallocation. The problem is RCTImageView got dealloc'ed **after** the bridge has been invalidated, so the lookup would always fail... Bonus: RCTImageView should just keep a weak ref to the RCTImageLoader, so that: * if the imageLoader is still alive on image dealloc, it can still access them (last minute "meaningless" cleanup) * if the imageLoader is gone, then the image deallocation doesn't do anything Changelog: [iOS] [Fixed] - Fix module lookup race condition on bridge invalidation. Reviewed By: p-sun, sammy-SC Differential Revision: D21371845 fbshipit-source-id: 862dc07de18ddbfb90e87e24b8dbd001147ddce4 --- Libraries/Image/RCTImageView.mm | 19 +++++++++++-------- React/CxxBridge/RCTCxxBridge.mm | 5 +++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Libraries/Image/RCTImageView.mm b/Libraries/Image/RCTImageView.mm index 6dac02d5ea8014..ad2f97592b5989 100644 --- a/Libraries/Image/RCTImageView.mm +++ b/Libraries/Image/RCTImageView.mm @@ -64,6 +64,9 @@ @implementation RCTImageView // Weak reference back to the bridge, for image loading __weak RCTBridge *_bridge; + // Weak reference back to the active image loader. + __weak id _imageLoader; + // The image source that's currently displayed RCTImageSource *_imageSource; @@ -327,11 +330,13 @@ - (void)reloadImage [weakSelf imageLoaderLoadedImage:loadedImage error:error forImageSource:source partial:NO]; }; - id imageLoader = [_bridge moduleForName:@"ImageLoader" - lazilyLoadIfNecessary:YES]; - RCTImageURLLoaderRequest *loaderRequest = [imageLoader loadImageWithURLRequest:source.request - size:imageSize - scale:imageScale + if (!_imageLoader) { + _imageLoader = [_bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES]; + } + + RCTImageURLLoaderRequest *loaderRequest = [_imageLoader loadImageWithURLRequest:source.request + size:imageSize + scale:imageScale clipped:NO resizeMode:_resizeMode attribution:{ @@ -470,9 +475,7 @@ - (void)didMoveToWindow } - (void)dealloc { - id imageLoader = [_bridge moduleForName:@"ImageLoader" - lazilyLoadIfNecessary:YES]; - [imageLoader trackURLImageDidDestroy:_loaderRequest]; + [_imageLoader trackURLImageDidDestroy:_loaderRequest]; } @end diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index d8938d7033a24e..ec4090a862c3d1 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -488,6 +488,11 @@ - (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoa } // Module may not be loaded yet, so attempt to force load it here. + // Do this only if the bridge is still valid. + if (_didInvalidate) { + return nil; + } + const BOOL result = [self.delegate respondsToSelector:@selector(bridge:didNotFindModule:)] && [self.delegate bridge:self didNotFindModule:moduleName]; if (result) { From 87d000f890c364730f6e18b904e06762a04f9332 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Sun, 3 May 2020 12:07:34 -0700 Subject: [PATCH 176/235] Fix invalid type annotations Summary: Our parsers accept these but they are invalid. This fixes them. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D21373812 fbshipit-source-id: 6084757b9f842644fe629ae5e6d85baec611588d --- .../examples/PushNotificationIOS/PushNotificationIOSExample.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNTester/js/examples/PushNotificationIOS/PushNotificationIOSExample.js b/RNTester/js/examples/PushNotificationIOS/PushNotificationIOSExample.js index 93127afb755999..c32bacefef2cc8 100644 --- a/RNTester/js/examples/PushNotificationIOS/PushNotificationIOSExample.js +++ b/RNTester/js/examples/PushNotificationIOS/PushNotificationIOSExample.js @@ -196,7 +196,7 @@ class NotificationPermissionExample extends React.Component< ); this._checkPermissions(); }, - (onReject?) => { + () => { this._showAlert('Error requesting permissions'); this._checkPermissions(); }, From 9cdc19a93669b37c0518bd32263e156ffc9193c7 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Mon, 4 May 2020 00:26:50 -0700 Subject: [PATCH 177/235] Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 --- Libraries/Text/TextInput/Multiline/RCTUITextView.m | 4 ++++ Libraries/Text/TextInput/Singleline/RCTUITextField.m | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Libraries/Text/TextInput/Multiline/RCTUITextView.m b/Libraries/Text/TextInput/Multiline/RCTUITextView.m index 11f3ec291ad863..88d3183f4df345 100644 --- a/Libraries/Text/TextInput/Multiline/RCTUITextView.m +++ b/Libraries/Text/TextInput/Multiline/RCTUITextView.m @@ -104,6 +104,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor - (void)setDefaultTextAttributes:(NSDictionary *)defaultTextAttributes { + if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) { + return; + } + _defaultTextAttributes = defaultTextAttributes; self.typingAttributes = defaultTextAttributes; [self _updatePlaceholder]; diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index de8f6efe844971..1dae92a3096bb9 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -68,6 +68,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor - (void)setDefaultTextAttributes:(NSDictionary *)defaultTextAttributes { + if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) { + return; + } + _defaultTextAttributes = defaultTextAttributes; [super setDefaultTextAttributes:defaultTextAttributes]; [self _updatePlaceholder]; From 7bd694fc6f4bb027b6d7ee04034cad41a43e5695 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 4 May 2020 00:57:01 -0700 Subject: [PATCH 178/235] VirtualizedList: Migrate to React.Context Summary: Migrates `VirtualizedList` off legacy context by creating `VirtualizedListContext`. Changelog: [General][Changed] - Migrated `virtualizedList` legacy context to `React.Context`. Reviewed By: TheSavior Differential Revision: D21370882 fbshipit-source-id: 2fa99ee0bc0e6b747a2d3fe7c66ee402c6b9c5af --- Libraries/Lists/VirtualizedList.js | 274 +++++----------------- Libraries/Lists/VirtualizedListContext.js | 152 ++++++++++++ Libraries/Modal/Modal.js | 30 +-- 3 files changed, 226 insertions(+), 230 deletions(-) create mode 100644 Libraries/Lists/VirtualizedListContext.js diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 5a7205b765228b..bf65fbdd107183 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -13,7 +13,6 @@ const Batchinator = require('../Interaction/Batchinator'); const FillRateHelper = require('./FillRateHelper'); const PropTypes = require('prop-types'); -const React = require('react'); const ReactNative = require('../Renderer/shims/ReactNative'); const RefreshControl = require('../Components/RefreshControl/RefreshControl'); const ScrollView = require('../Components/ScrollView/ScrollView'); @@ -28,6 +27,7 @@ const warning = require('fbjs/lib/warning'); const {computeWindowedRenderLimits} = require('./VirtualizeUtils'); +import * as React from 'react'; import type {ScrollResponderType} from '../Components/ScrollView/ScrollView'; import type {ViewStyleProp} from '../StyleSheet/StyleSheet'; import type { @@ -35,6 +35,13 @@ import type { ViewToken, ViewabilityConfigCallbackPair, } from './ViewabilityHelper'; +import { + VirtualizedListCellContextProvider, + VirtualizedListContext, + VirtualizedListContextProvider, + type ChildListState, + type ListDebugInfo, +} from './VirtualizedListContext.js'; type Item = any; @@ -315,37 +322,9 @@ type DefaultProps = {| let _usedIndexForKey = false; let _keylessItemComponentName: string = ''; -type Frame = { - offset: number, - length: number, - index: number, - inLayout: boolean, - ... -}; - -type ChildListState = { - first: number, - last: number, - frames: {[key: number]: Frame, ...}, - ... -}; - type State = { first: number, last: number, - ... -}; - -// Data propagated through nested lists (regardless of orientation) that is -// useful for producing diagnostics for usage errors involving nesting (e.g -// missing/duplicate keys). -type ListDebugInfo = { - cellKey: string, - listKey: string, - parent: ?ListDebugInfo, - // We include all ancestors regardless of orientation, so this is not always - // identical to the child's orientation. - horizontal: boolean, }; /** @@ -377,7 +356,7 @@ type ListDebugInfo = { * */ class VirtualizedList extends React.PureComponent { - props: Props; + static contextType: typeof VirtualizedListContext = VirtualizedListContext; // scrollToEnd may be janky without getItemLayout prop scrollToEnd(params?: ?{animated?: ?boolean, ...}) { @@ -582,111 +561,8 @@ class VirtualizedList extends React.PureComponent { windowSize: 21, // multiples of length }; - static contextTypes: - | any - | {| - virtualizedCell: {| - cellKey: React$PropType$Primitive, - |}, - virtualizedList: {| - getScrollMetrics: React$PropType$Primitive, - horizontal: React$PropType$Primitive, - getOutermostParentListRef: React$PropType$Primitive, - getNestedChildState: React$PropType$Primitive, - registerAsNestedChild: React$PropType$Primitive, - unregisterAsNestedChild: React$PropType$Primitive, - debugInfo: {| - listKey: React$PropType$Primitive, - cellKey: React$PropType$Primitive, - |}, - |}, - |} = { - virtualizedCell: PropTypes.shape({ - cellKey: PropTypes.string, - }), - virtualizedList: PropTypes.shape({ - getScrollMetrics: PropTypes.func, - horizontal: PropTypes.bool, - getOutermostParentListRef: PropTypes.func, - getNestedChildState: PropTypes.func, - registerAsNestedChild: PropTypes.func, - unregisterAsNestedChild: PropTypes.func, - debugInfo: PropTypes.shape({ - listKey: PropTypes.string, - cellKey: PropTypes.string, - }), - }), - }; - - static childContextTypes: - | any - | {| - getScrollMetrics: React$PropType$Primitive, - horizontal: React$PropType$Primitive, - getOutermostParentListRef: React$PropType$Primitive, - getNestedChildState: React$PropType$Primitive, - registerAsNestedChild: React$PropType$Primitive, - unregisterAsNestedChild: React$PropType$Primitive, - |} = { - virtualizedList: PropTypes.shape({ - getScrollMetrics: PropTypes.func, - horizontal: PropTypes.bool, - getOutermostParentListRef: PropTypes.func, - getNestedChildState: PropTypes.func, - registerAsNestedChild: PropTypes.func, - unregisterAsNestedChild: PropTypes.func, - }), - }; - - getChildContext(): {| - virtualizedList: { - getScrollMetrics: () => { - contentLength: number, - dOffset: number, - dt: number, - offset: number, - timestamp: number, - velocity: number, - visibleLength: number, - ... - }, - horizontal: ?boolean, - getOutermostParentListRef: Function, - getNestedChildState: string => ?ChildListState, - registerAsNestedChild: ({ - cellKey: string, - key: string, - ref: VirtualizedList, - parentDebugInfo: ListDebugInfo, - ... - }) => ?ChildListState, - unregisterAsNestedChild: ({ - key: string, - state: ChildListState, - ... - }) => void, - debugInfo: ListDebugInfo, - ... - }, - |} { - return { - virtualizedList: { - getScrollMetrics: this._getScrollMetrics, - horizontal: this.props.horizontal, - getOutermostParentListRef: this._getOutermostParentListRef, - getNestedChildState: this._getNestedChildState, - registerAsNestedChild: this._registerAsNestedChild, - unregisterAsNestedChild: this._unregisterAsNestedChild, - debugInfo: this._getDebugInfo(), - }, - }; - } - _getCellKey(): string { - return ( - (this.context.virtualizedCell && this.context.virtualizedCell.cellKey) || - 'rootList' - ); + return this.context?.cellKey || 'rootList'; } _getListKey(): string { @@ -698,9 +574,7 @@ class VirtualizedList extends React.PureComponent { listKey: this._getListKey(), cellKey: this._getCellKey(), horizontal: !!this.props.horizontal, - parent: this.context.virtualizedList - ? this.context.virtualizedList.debugInfo - : null, + parent: this.context?.debugInfo, }; } @@ -714,7 +588,7 @@ class VirtualizedList extends React.PureComponent { _getOutermostParentListRef = () => { if (this._isNestedWithSameOrientation()) { - return this.context.virtualizedList.getOutermostParentListRef(); + return this.context.getOutermostParentListRef(); } else { return this; } @@ -774,8 +648,8 @@ class VirtualizedList extends React.PureComponent { state: State; - constructor(props: Props, context: Object) { - super(props, context); + constructor(props: Props) { + super(props); invariant( // $FlowFixMe !props.onScroll || !props.onScroll.__isNative, @@ -818,9 +692,7 @@ class VirtualizedList extends React.PureComponent { }; if (this._isNestedWithSameOrientation()) { - const storedState = this.context.virtualizedList.getNestedChildState( - this._getListKey(), - ); + const storedState = this.context.getNestedChildState(this._getListKey()); if (storedState) { initialState = storedState; this.state = storedState; @@ -833,7 +705,7 @@ class VirtualizedList extends React.PureComponent { componentDidMount() { if (this._isNestedWithSameOrientation()) { - this.context.virtualizedList.registerAsNestedChild({ + this.context.registerAsNestedChild({ cellKey: this._getCellKey(), key: this._getListKey(), ref: this, @@ -841,14 +713,14 @@ class VirtualizedList extends React.PureComponent { // the parent's props. This is why we explicitly propagate debugInfo // "down" via context and "up" again via this method call on the // parent. - parentDebugInfo: this.context.virtualizedList.debugInfo, + parentDebugInfo: this.context.debugInfo, }); } } componentWillUnmount() { if (this._isNestedWithSameOrientation()) { - this.context.virtualizedList.unregisterAsNestedChild({ + this.context.unregisterAsNestedChild({ key: this._getListKey(), state: { first: this.state.first, @@ -943,7 +815,7 @@ class VirtualizedList extends React.PureComponent { } _isNestedWithSameOrientation(): boolean { - const nestedContext = this.context.virtualizedList; + const nestedContext = this.context; return !!( nestedContext && !!nestedContext.horizontal === !!this.props.horizontal ); @@ -984,7 +856,7 @@ class VirtualizedList extends React.PureComponent { ); cells.push( - { element } - , + , ); } const itemCount = this.props.getItemCount(data); @@ -1139,7 +1011,7 @@ class VirtualizedList extends React.PureComponent { ); cells.push( - { element } - , + , ); } const scrollProps = { @@ -1178,14 +1050,29 @@ class VirtualizedList extends React.PureComponent { this._hasMore = this.state.last < this.props.getItemCount(this.props.data) - 1; - const innerRet = React.cloneElement( - (this.props.renderScrollComponent || this._defaultRenderScrollComponent)( - scrollProps, - ), - { - ref: this._captureScrollRef, - }, - cells, + const innerRet = ( + + {React.cloneElement( + ( + this.props.renderScrollComponent || + this._defaultRenderScrollComponent + )(scrollProps), + { + ref: this._captureScrollRef, + }, + cells, + )} + ); let ret = innerRet; if (__DEV__) { @@ -1196,7 +1083,7 @@ class VirtualizedList extends React.PureComponent { scrollContext != null && !scrollContext.horizontal === !this.props.horizontal && !this._hasWarned.nesting && - this.context.virtualizedList == null + this.context == null ) { // TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170 console.warn( @@ -1401,7 +1288,7 @@ class VirtualizedList extends React.PureComponent { // We are assuming that getOutermostParentListRef().getScrollRef() // is a non-null reference to a ScrollView this._scrollRef.measureLayout( - this.context.virtualizedList.getOutermostParentListRef().getScrollRef(), + this.context.getOutermostParentListRef().getScrollRef(), (x, y, width, height) => { this._offsetFromParentVirtualizedList = this._selectOffset({x, y}); this._scrollMetrics.contentLength = this._selectLength({ @@ -1409,7 +1296,7 @@ class VirtualizedList extends React.PureComponent { height, }); const scrollMetrics = this._convertParentScrollMetrics( - this.context.virtualizedList.getScrollMetrics(), + this.context.getScrollMetrics(), ); this._scrollMetrics.visibleLength = scrollMetrics.visibleLength; this._scrollMetrics.offset = scrollMetrics.offset; @@ -1988,12 +1875,6 @@ class CellRenderer extends React.Component< }, }; - static childContextTypes = { - virtualizedCell: PropTypes.shape({ - cellKey: PropTypes.string, - }), - }; - static getDerivedStateFromProps( props: CellRendererProps, prevState: CellRendererState, @@ -2006,14 +1887,6 @@ class CellRenderer extends React.Component< }; } - getChildContext() { - return { - virtualizedCell: { - cellKey: this.props.cellKey, - }, - }; - } - // TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not // reused by SectionList and we can keep VirtualizedList simpler. _separators = { @@ -2119,18 +1992,15 @@ class CellRenderer extends React.Component< : horizontal ? [styles.row, inversionStyle] : inversionStyle; - if (!CellRendererComponent) { - return ( - /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an - * error found when Flow v0.89 was deployed. To see the error, delete - * this comment and run Flow. */ - - {element} - {itemSeparator} - - ); - } - return ( + const result = !CellRendererComponent ? ( + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ + + {element} + {itemSeparator} + + ) : ( ); - } -} - -class VirtualizedCellWrapper extends React.Component<{ - cellKey: string, - children: React.Node, - ... -}> { - static childContextTypes = { - virtualizedCell: PropTypes.shape({ - cellKey: PropTypes.string, - }), - }; - getChildContext() { - return { - virtualizedCell: { - cellKey: this.props.cellKey, - }, - }; - } - - render() { - return this.props.children; + return ( + + {result} + + ); } } diff --git a/Libraries/Lists/VirtualizedListContext.js b/Libraries/Lists/VirtualizedListContext.js new file mode 100644 index 00000000000000..130315a1b08d57 --- /dev/null +++ b/Libraries/Lists/VirtualizedListContext.js @@ -0,0 +1,152 @@ +/** + * 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. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type VirtualizedList from './VirtualizedList.js'; +import * as React from 'react'; +import {useMemo, useContext} from 'react'; + +type Frame = $ReadOnly<{ + offset: number, + length: number, + index: number, + inLayout: boolean, +}>; + +export type ChildListState = $ReadOnly<{ + first: number, + last: number, + frames: {[key: number]: Frame}, +}>; + +// Data propagated through nested lists (regardless of orientation) that is +// useful for producing diagnostics for usage errors involving nesting (e.g +// missing/duplicate keys). +export type ListDebugInfo = $ReadOnly<{ + cellKey: string, + listKey: string, + parent: ?ListDebugInfo, + // We include all ancestors regardless of orientation, so this is not always + // identical to the child's orientation. + horizontal: boolean, +}>; + +type Context = $ReadOnly<{ + cellKey: ?string, + getScrollMetrics: () => { + contentLength: number, + dOffset: number, + dt: number, + offset: number, + timestamp: number, + velocity: number, + visibleLength: number, + }, + horizontal: ?boolean, + getOutermostParentListRef: () => VirtualizedList, + getNestedChildState: string => ?ChildListState, + registerAsNestedChild: ({ + cellKey: string, + key: string, + ref: VirtualizedList, + parentDebugInfo: ListDebugInfo, + }) => ?ChildListState, + unregisterAsNestedChild: ({ + key: string, + state: ChildListState, + }) => void, + debugInfo: ListDebugInfo, +}>; + +export const VirtualizedListContext: React.Context = React.createContext( + null, +); + +/** + * Resets the context. Intended for use by portal-like components (e.g. Modal). + */ +export function VirtualizedListContextResetter({ + children, +}: { + children: React.Node, +}): React.Node { + return ( + + {children} + + ); +} + +/** + * Sets the context with memoization. Intended to be used by `VirtualizedList`. + */ +export function VirtualizedListContextProvider({ + children, + value, +}: { + children: React.Node, + value: Context, +}): React.Node { + // Avoid setting a newly created context object if the values are identical. + const context = useMemo( + () => ({ + cellKey: null, + getScrollMetrics: value.getScrollMetrics, + horizontal: value.horizontal, + getOutermostParentListRef: value.getOutermostParentListRef, + getNestedChildState: value.getNestedChildState, + registerAsNestedChild: value.registerAsNestedChild, + unregisterAsNestedChild: value.unregisterAsNestedChild, + debugInfo: { + cellKey: value.debugInfo.cellKey, + horizontal: value.debugInfo.horizontal, + listKey: value.debugInfo.listKey, + parent: value.debugInfo.parent, + }, + }), + [ + value.getScrollMetrics, + value.horizontal, + value.getOutermostParentListRef, + value.getNestedChildState, + value.registerAsNestedChild, + value.unregisterAsNestedChild, + value.debugInfo.cellKey, + value.debugInfo.horizontal, + value.debugInfo.listKey, + value.debugInfo.parent, + ], + ); + return ( + + {children} + + ); +} + +/** + * Sets the `cellKey`. Intended to be used by `VirtualizedList` for each cell. + */ +export function VirtualizedListCellContextProvider({ + cellKey, + children, +}: { + cellKey: string, + children: React.Node, +}): React.Node { + const context = useContext(VirtualizedListContext); + return ( + + {children} + + ); +} diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 17885714dd0340..b81334c91db525 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -22,6 +22,8 @@ import type {ViewProps} from '../Components/View/ViewPropTypes'; import type {DirectEventHandler} from '../Types/CodegenTypes'; import type EmitterSubscription from '../vendor/emitter/EmitterSubscription'; import RCTModalHostView from './RCTModalHostViewNativeComponent'; +import {VirtualizedListContextResetter} from '../Lists/VirtualizedListContext.js'; + /** * The Modal component is a simple way to present content above an enclosing view. * @@ -159,20 +161,6 @@ class Modal extends React.Component { this._identifier = uniqueModalIdentifier++; } - static childContextTypes: - | any - | {|virtualizedList: React$PropType$Primitive|} = { - virtualizedList: PropTypes.object, - }; - - getChildContext(): {|virtualizedList: null|} { - // Reset the context so VirtualizedList doesn't get confused by nesting - // in the React tree that doesn't reflect the native component hierarchy. - return { - virtualizedList: null, - }; - } - componentWillUnmount() { if (this.props.onDismiss != null) { this.props.onDismiss(); @@ -236,11 +224,15 @@ class Modal extends React.Component { onStartShouldSetResponder={this._shouldSetResponder} supportedOrientations={this.props.supportedOrientations} onOrientationChange={this.props.onOrientationChange}> - - - {innerChildren} - - + + + + {innerChildren} + + + ); } From ddea7c76b38321e192a29ddf11d794de2796a1d2 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 4 May 2020 00:57:01 -0700 Subject: [PATCH 179/235] VirtualizedList: Remove `PropTypes` Dependency Summary: Removes `PropTypes` as a dependency of `VirtualizedList` by no longer validating the return value of `getItemLayout`. Changelog: [Internal] Reviewed By: TheSavior, cpojer Differential Revision: D21370890 fbshipit-source-id: 966db3557b714987aa91179c7654a5ebf27818ad --- Libraries/Lists/VirtualizedList.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index bf65fbdd107183..36e5f3640671fe 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -12,7 +12,6 @@ const Batchinator = require('../Interaction/Batchinator'); const FillRateHelper = require('./FillRateHelper'); -const PropTypes = require('prop-types'); const ReactNative = require('../Renderer/shims/ReactNative'); const RefreshControl = require('../Components/RefreshControl/RefreshControl'); const ScrollView = require('../Components/ScrollView/ScrollView'); @@ -1786,19 +1785,6 @@ class VirtualizedList extends React.PureComponent { if (!frame || frame.index !== index) { if (getItemLayout) { frame = getItemLayout(data, index); - if (__DEV__) { - const frameType = PropTypes.shape({ - length: PropTypes.number.isRequired, - offset: PropTypes.number.isRequired, - index: PropTypes.number.isRequired, - }).isRequired; - PropTypes.checkPropTypes( - {frame: frameType}, - {frame}, - 'frame', - 'VirtualizedList.getItemLayout', - ); - } } } /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an From 8acb2b3a3e97fb176a66d44d26d7d351fac36f62 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Mon, 4 May 2020 01:09:47 -0700 Subject: [PATCH 180/235] Remove `@babel/preset-env` Summary: `babel/preset-env` pulls in a number of unused deps, like `caniuse-lite` (3 MiB) that knows about which browsers support certain features. We do not ship to browsers and always know which version of node we are using, so we don't need to pull this in. I changed `jscodeshift` to optionally depend on `babel/preset-env` instead of always pulling it in. This reduces node_modules by 7 MiB. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D21374475 fbshipit-source-id: 6f55e96e990ec0ca12f17bb3657bfa5429796b93 --- package.json | 2 +- packages/react-native-codegen/package.json | 2 +- yarn.lock | 396 +++------------------ 3 files changed, 55 insertions(+), 345 deletions(-) diff --git a/package.json b/package.json index fc31865c6fbf5e..1ad2666b23e0fb 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "flow-remove-types": "1.2.3", "jest": "^25.4.0", "jest-junit": "^10.0.0", - "jscodeshift": "^0.7.1", + "jscodeshift": "^0.9.0", "mkdirp": "^0.5.1", "prettier": "1.19.1", "react": "16.13.1", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 82e6d5d7b4cb55..3c77e91f8bce28 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -13,7 +13,7 @@ ], "dependencies": { "flow-parser": "^0.121.0", - "jscodeshift": "^0.7.1", + "jscodeshift": "^0.9.0", "nullthrows": "^1.1.1" } } diff --git a/yarn.lock b/yarn.lock index 40d8252af3dfc8..81581ab16aa625 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,15 +9,6 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/compat-data@^7.8.6", "@babel/compat-data@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" - integrity sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g== - dependencies: - browserslist "^4.9.1" - invariant "^2.2.4" - semver "^5.5.0" - "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.1.6", "@babel/core@^7.4.5", "@babel/core@^7.7.5": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.9.0.tgz#ac977b538b77e132ff706f3b8a4dbad09c03c56e" @@ -92,17 +83,6 @@ "@babel/helper-annotate-as-pure" "^7.8.3" "@babel/types" "^7.9.0" -"@babel/helper-compilation-targets@^7.8.7": - version "7.8.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz#dac1eea159c0e4bd46e309b5a1b04a66b53c1dde" - integrity sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw== - dependencies: - "@babel/compat-data" "^7.8.6" - browserslist "^4.9.1" - invariant "^2.2.4" - levenary "^1.1.1" - semver "^5.5.0" - "@babel/helper-create-class-features-plugin@^7.8.3": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz#243a5b46e2f8f0f674dc1387631eb6b28b851de0" @@ -115,7 +95,7 @@ "@babel/helper-replace-supers" "^7.8.6" "@babel/helper-split-export-declaration" "^7.8.3" -"@babel/helper-create-regexp-features-plugin@^7.8.3", "@babel/helper-create-regexp-features-plugin@^7.8.8": +"@babel/helper-create-regexp-features-plugin@^7.8.3": version "7.8.8" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz#5d84180b588f560b7864efaeea89243e58312087" integrity sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg== @@ -166,13 +146,6 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-hoist-variables@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz#1dbe9b6b55d78c9b4183fc8cdc6e30ceb83b7134" - integrity sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg== - dependencies: - "@babel/types" "^7.8.3" - "@babel/helper-member-expression-to-functions@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz#659b710498ea6c1d9907e0c73f206eee7dadc24c" @@ -310,15 +283,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-proposal-async-generator-functions@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz#bad329c670b382589721b27540c7d288601c6e6f" - integrity sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-remap-async-to-generator" "^7.8.3" - "@babel/plugin-syntax-async-generators" "^7.8.0" - "@babel/plugin-proposal-class-properties@^7.0.0", "@babel/plugin-proposal-class-properties@^7.1.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e" @@ -327,14 +291,6 @@ "@babel/helper-create-class-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-proposal-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz#38c4fe555744826e97e2ae930b0fb4cc07e66054" - integrity sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" - "@babel/plugin-proposal-export-default-from@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz#4cb7c2fdeaed490b60d9bfd3dc8a20f81f9c2e7c" @@ -343,15 +299,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-export-default-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz#da5216b238a98b58a1e05d6852104b10f9a70d6b" - integrity sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.0" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0", "@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": +"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0", "@babel/plugin-proposal-nullish-coalescing-operator@^7.1.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz#e4572253fdeed65cddeecfdab3f928afeb2fd5d2" integrity sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw== @@ -359,15 +307,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-numeric-separator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz#5d6769409699ec9b3b68684cd8116cedff93bad8" - integrity sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.9.0": +"@babel/plugin-proposal-object-rest-spread@^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.0.tgz#a28993699fc13df165995362693962ba6b061d6f" integrity sha512-UgqBv6bjq4fDb8uku9f+wcm1J7YxJ5nT7WO/jBr0cl0PLKb7t1O6RNR1kZbjgx2LQtsDI9hwoQVmn0yhXeQyow== @@ -375,7 +315,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" -"@babel/plugin-proposal-optional-catch-binding@^7.0.0", "@babel/plugin-proposal-optional-catch-binding@^7.8.3": +"@babel/plugin-proposal-optional-catch-binding@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz#9dee96ab1650eed88646ae9734ca167ac4a9c5c9" integrity sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw== @@ -383,7 +323,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.0.0", "@babel/plugin-proposal-optional-chaining@^7.9.0": +"@babel/plugin-proposal-optional-chaining@^7.0.0", "@babel/plugin-proposal-optional-chaining@^7.1.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz#31db16b154c39d6b8a645292472b98394c292a58" integrity sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w== @@ -391,15 +331,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.8.3": - version "7.8.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz#ee3a95e90cdc04fe8cd92ec3279fa017d68a0d1d" - integrity sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.8" - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-async-generators@^7.8.0", "@babel/plugin-syntax-async-generators@^7.8.4": +"@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== @@ -420,7 +352,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-dynamic-import@^7.0.0", "@babel/plugin-syntax-dynamic-import@^7.8.0": +"@babel/plugin-syntax-dynamic-import@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== @@ -441,7 +373,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-json-strings@^7.8.0", "@babel/plugin-syntax-json-strings@^7.8.3": +"@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== @@ -469,7 +401,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.0", "@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz#0e3fb63e09bea1b11e96467271c8308007e7c41f" integrity sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw== @@ -497,13 +429,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz#3acdece695e6b13aaf57fc291d1a800950c71391" - integrity sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-typescript@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.8.3.tgz#c1f659dda97711a569cef75275f7e15dcaa6cabc" @@ -511,14 +436,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.8.3": +"@babel/plugin-transform-arrow-functions@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz#82776c2ed0cd9e1a49956daeb896024c9473b8b6" integrity sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-async-to-generator@^7.0.0", "@babel/plugin-transform-async-to-generator@^7.8.3": +"@babel/plugin-transform-async-to-generator@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz#4308fad0d9409d71eafb9b1a6ee35f9d64b64086" integrity sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ== @@ -527,14 +452,14 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-remap-async-to-generator" "^7.8.3" -"@babel/plugin-transform-block-scoped-functions@^7.0.0", "@babel/plugin-transform-block-scoped-functions@^7.8.3": +"@babel/plugin-transform-block-scoped-functions@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz#437eec5b799b5852072084b3ae5ef66e8349e8a3" integrity sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-block-scoping@^7.0.0", "@babel/plugin-transform-block-scoping@^7.8.3": +"@babel/plugin-transform-block-scoping@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz#97d35dab66857a437c166358b91d09050c868f3a" integrity sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w== @@ -542,7 +467,7 @@ "@babel/helper-plugin-utils" "^7.8.3" lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.0.0", "@babel/plugin-transform-classes@^7.9.0": +"@babel/plugin-transform-classes@^7.0.0": version "7.9.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.2.tgz#8603fc3cc449e31fdbdbc257f67717536a11af8d" integrity sha512-TC2p3bPzsfvSsqBZo0kJnuelnoK9O3welkUpqSqBQuBF6R5MN2rysopri8kNvtlGIb2jmUO7i15IooAZJjZuMQ== @@ -556,36 +481,21 @@ "@babel/helper-split-export-declaration" "^7.8.3" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.0.0", "@babel/plugin-transform-computed-properties@^7.8.3": +"@babel/plugin-transform-computed-properties@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz#96d0d28b7f7ce4eb5b120bb2e0e943343c86f81b" integrity sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-destructuring@^7.0.0", "@babel/plugin-transform-destructuring@^7.8.3": +"@babel/plugin-transform-destructuring@^7.0.0": version "7.8.8" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.8.tgz#fadb2bc8e90ccaf5658de6f8d4d22ff6272a2f4b" integrity sha512-eRJu4Vs2rmttFCdhPUM3bV0Yo/xPSdPw6ML9KHs/bjB4bLA5HXlbvYXPOD5yASodGod+krjYx21xm1QmL8dCJQ== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz#c3c6ec5ee6125c6993c5cbca20dc8621a9ea7a6e" - integrity sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-transform-duplicate-keys@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz#8d12df309aa537f272899c565ea1768e286e21f1" - integrity sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-transform-exponentiation-operator@^7.0.0", "@babel/plugin-transform-exponentiation-operator@^7.8.3": +"@babel/plugin-transform-exponentiation-operator@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz#581a6d7f56970e06bf51560cd64f5e947b70d7b7" integrity sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ== @@ -601,14 +511,14 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-flow" "^7.8.3" -"@babel/plugin-transform-for-of@^7.0.0", "@babel/plugin-transform-for-of@^7.9.0": +"@babel/plugin-transform-for-of@^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz#0f260e27d3e29cd1bb3128da5e76c761aa6c108e" integrity sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-function-name@^7.0.0", "@babel/plugin-transform-function-name@^7.8.3": +"@babel/plugin-transform-function-name@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz#279373cb27322aaad67c2683e776dfc47196ed8b" integrity sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ== @@ -616,30 +526,21 @@ "@babel/helper-function-name" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-literals@^7.0.0", "@babel/plugin-transform-literals@^7.8.3": +"@babel/plugin-transform-literals@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz#aef239823d91994ec7b68e55193525d76dbd5dc1" integrity sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-member-expression-literals@^7.0.0", "@babel/plugin-transform-member-expression-literals@^7.8.3": +"@babel/plugin-transform-member-expression-literals@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz#963fed4b620ac7cbf6029c755424029fa3a40410" integrity sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-modules-amd@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz#19755ee721912cf5bb04c07d50280af3484efef4" - integrity sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q== - dependencies: - "@babel/helper-module-transforms" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" - -"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.9.0": +"@babel/plugin-transform-modules-commonjs@^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz#e3e72f4cbc9b4a260e30be0ea59bdf5a39748940" integrity sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g== @@ -649,37 +550,15 @@ "@babel/helper-simple-access" "^7.8.3" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz#e9fd46a296fc91e009b64e07ddaa86d6f0edeb90" - integrity sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ== - dependencies: - "@babel/helper-hoist-variables" "^7.8.3" - "@babel/helper-module-transforms" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" - -"@babel/plugin-transform-modules-umd@^7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz#e909acae276fec280f9b821a5f38e1f08b480697" - integrity sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ== +"@babel/plugin-transform-modules-commonjs@^7.1.0": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz#64b7474a4279ee588cacd1906695ca721687c277" + integrity sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ== dependencies: "@babel/helper-module-transforms" "^7.9.0" "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz#a2a72bffa202ac0e2d0506afd0939c5ecbc48c6c" - integrity sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.3" - -"@babel/plugin-transform-new-target@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz#60cc2ae66d85c95ab540eb34babb6434d4c70c43" - integrity sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-simple-access" "^7.8.3" + babel-plugin-dynamic-import-node "^2.3.3" "@babel/plugin-transform-object-assign@^7.0.0": version "7.8.3" @@ -688,7 +567,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.8.3": +"@babel/plugin-transform-object-super@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz#ebb6a1e7a86ffa96858bd6ac0102d65944261725" integrity sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ== @@ -696,7 +575,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-replace-supers" "^7.8.3" -"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.8.7": +"@babel/plugin-transform-parameters@^7.0.0": version "7.9.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.3.tgz#3028d0cc20ddc733166c6e9c8534559cee09f54a" integrity sha512-fzrQFQhp7mIhOzmOtPiKffvCYQSK10NR8t6BBz2yPbeUHb9OLW8RZGtgDRBn8z2hGcwvKDL3vC7ojPTLNxmqEg== @@ -704,7 +583,7 @@ "@babel/helper-get-function-arity" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-property-literals@^7.0.0", "@babel/plugin-transform-property-literals@^7.8.3": +"@babel/plugin-transform-property-literals@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz#33194300d8539c1ed28c62ad5087ba3807b98263" integrity sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg== @@ -744,20 +623,13 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-jsx" "^7.8.3" -"@babel/plugin-transform-regenerator@^7.0.0", "@babel/plugin-transform-regenerator@^7.8.7": +"@babel/plugin-transform-regenerator@^7.0.0": version "7.8.7" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz#5e46a0dca2bee1ad8285eb0527e6abc9c37672f8" integrity sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz#9a0635ac4e665d29b162837dd3cc50745dfdf1f5" - integrity sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-transform-runtime@^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.0.tgz#45468c0ae74cc13204e1d3b1f4ce6ee83258af0b" @@ -768,21 +640,21 @@ resolve "^1.8.1" semver "^5.5.1" -"@babel/plugin-transform-shorthand-properties@^7.0.0", "@babel/plugin-transform-shorthand-properties@^7.8.3": +"@babel/plugin-transform-shorthand-properties@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz#28545216e023a832d4d3a1185ed492bcfeac08c8" integrity sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-spread@^7.0.0", "@babel/plugin-transform-spread@^7.8.3": +"@babel/plugin-transform-spread@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz#9c8ffe8170fdfb88b114ecb920b82fb6e95fe5e8" integrity sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g== dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-sticky-regex@^7.0.0", "@babel/plugin-transform-sticky-regex@^7.8.3": +"@babel/plugin-transform-sticky-regex@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz#be7a1290f81dae767475452199e1f76d6175b100" integrity sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw== @@ -790,7 +662,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-regex" "^7.8.3" -"@babel/plugin-transform-template-literals@^7.0.0", "@babel/plugin-transform-template-literals@^7.8.3": +"@babel/plugin-transform-template-literals@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz#7bfa4732b455ea6a43130adc0ba767ec0e402a80" integrity sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ== @@ -798,13 +670,6 @@ "@babel/helper-annotate-as-pure" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-typeof-symbol@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz#ede4062315ce0aaf8a657a920858f1a2f35fc412" - integrity sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-transform-typescript@^7.5.0", "@babel/plugin-transform-typescript@^7.9.0": version "7.9.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.4.tgz#4bb4dde4f10bbf2d787fce9707fb09b483e33359" @@ -814,7 +679,7 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-typescript" "^7.8.3" -"@babel/plugin-transform-unicode-regex@^7.0.0", "@babel/plugin-transform-unicode-regex@^7.8.3": +"@babel/plugin-transform-unicode-regex@^7.0.0": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz#0cef36e3ba73e5c57273effb182f46b91a1ecaad" integrity sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw== @@ -822,72 +687,6 @@ "@babel/helper-create-regexp-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/preset-env@^7.1.6": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.9.0.tgz#a5fc42480e950ae8f5d9f8f2bbc03f52722df3a8" - integrity sha512-712DeRXT6dyKAM/FMbQTV/FvRCms2hPCx+3weRjZ8iQVQWZejWWk1wwG6ViWMyqb/ouBbGOl5b6aCk0+j1NmsQ== - dependencies: - "@babel/compat-data" "^7.9.0" - "@babel/helper-compilation-targets" "^7.8.7" - "@babel/helper-module-imports" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-proposal-async-generator-functions" "^7.8.3" - "@babel/plugin-proposal-dynamic-import" "^7.8.3" - "@babel/plugin-proposal-json-strings" "^7.8.3" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-proposal-numeric-separator" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.9.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.8.3" - "@babel/plugin-proposal-optional-chaining" "^7.9.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.8.3" - "@babel/plugin-syntax-async-generators" "^7.8.0" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" - "@babel/plugin-syntax-json-strings" "^7.8.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" - "@babel/plugin-syntax-numeric-separator" "^7.8.0" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.0" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.8.3" - "@babel/plugin-transform-async-to-generator" "^7.8.3" - "@babel/plugin-transform-block-scoped-functions" "^7.8.3" - "@babel/plugin-transform-block-scoping" "^7.8.3" - "@babel/plugin-transform-classes" "^7.9.0" - "@babel/plugin-transform-computed-properties" "^7.8.3" - "@babel/plugin-transform-destructuring" "^7.8.3" - "@babel/plugin-transform-dotall-regex" "^7.8.3" - "@babel/plugin-transform-duplicate-keys" "^7.8.3" - "@babel/plugin-transform-exponentiation-operator" "^7.8.3" - "@babel/plugin-transform-for-of" "^7.9.0" - "@babel/plugin-transform-function-name" "^7.8.3" - "@babel/plugin-transform-literals" "^7.8.3" - "@babel/plugin-transform-member-expression-literals" "^7.8.3" - "@babel/plugin-transform-modules-amd" "^7.9.0" - "@babel/plugin-transform-modules-commonjs" "^7.9.0" - "@babel/plugin-transform-modules-systemjs" "^7.9.0" - "@babel/plugin-transform-modules-umd" "^7.9.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" - "@babel/plugin-transform-new-target" "^7.8.3" - "@babel/plugin-transform-object-super" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.8.7" - "@babel/plugin-transform-property-literals" "^7.8.3" - "@babel/plugin-transform-regenerator" "^7.8.7" - "@babel/plugin-transform-reserved-words" "^7.8.3" - "@babel/plugin-transform-shorthand-properties" "^7.8.3" - "@babel/plugin-transform-spread" "^7.8.3" - "@babel/plugin-transform-sticky-regex" "^7.8.3" - "@babel/plugin-transform-template-literals" "^7.8.3" - "@babel/plugin-transform-typeof-symbol" "^7.8.4" - "@babel/plugin-transform-unicode-regex" "^7.8.3" - "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.9.0" - browserslist "^4.9.1" - core-js-compat "^3.6.2" - invariant "^2.2.2" - levenary "^1.1.1" - semver "^5.5.0" - "@babel/preset-flow@^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.9.0.tgz#fee847c3e090b0b2d9227c1949e4da1d1379280d" @@ -896,17 +695,6 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-flow-strip-types" "^7.9.0" -"@babel/preset-modules@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.3.tgz#13242b53b5ef8c883c3cf7dddd55b36ce80fbc72" - integrity sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - "@babel/preset-typescript@^7.1.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz#87705a72b1f0d59df21c179f7c3d2ef4b16ce192" @@ -972,7 +760,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0": +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.0.tgz#00b064c3df83ad32b2dbf5ff07312b15c7f1efb5" integrity sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng== @@ -1934,6 +1722,13 @@ babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" +babel-plugin-dynamic-import-node@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== + dependencies: + object.assign "^4.1.0" + babel-plugin-istanbul@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" @@ -2150,16 +1945,6 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browserslist@^4.8.3, browserslist@^4.9.1: - version "4.11.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.11.1.tgz#92f855ee88d6e050e7e7311d987992014f1a1f1b" - integrity sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g== - dependencies: - caniuse-lite "^1.0.30001038" - electron-to-chromium "^1.3.390" - node-releases "^1.1.53" - pkg-up "^2.0.0" - bser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" @@ -2261,11 +2046,6 @@ camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30001038: - version "1.0.30001038" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz#44da3cbca2ab6cb6aa83d1be5d324e17f141caff" - integrity sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ== - capture-exit@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" @@ -2575,14 +2355,6 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.6.2: - version "3.6.4" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.4.tgz#938476569ebb6cda80d339bcf199fae4f16fff17" - integrity sha512-zAa3IZPvsJ0slViBQ2z+vgyyTuhd3MFn1rBQjZSKVEgB0UMYhUkCj9jJUVPgGTGqWvsBVmfnruXgTcNyTlEiSA== - dependencies: - browserslist "^4.8.3" - semver "7.0.0" - core-js@^2.2.2, core-js@^2.4.1: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -2899,11 +2671,6 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.390: - version "1.3.392" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.392.tgz#280ab4f7a3ae47419cfabb15dbfc1567be7f1111" - integrity sha512-/hsgeVdReDsyTBE0aU9FRdh1wnNPrX3xlz3t61F+CJPOT+Umfi9DXHsCX85TEgWZQqlow0Rw44/4/jbU2Sqgkg== - emoji-regex@^7.0.1, emoji-regex@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -3512,13 +3279,6 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -4046,7 +3806,7 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -4843,16 +4603,17 @@ jsc-android@^245459.0.0: resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-245459.0.0.tgz#e584258dd0b04c9159a27fb104cd5d491fd202c9" integrity sha512-wkjURqwaB1daNkDi2OYYbsLnIdC/lUM2nPXQKRs5pqEU9chDg435bjvo+LSaHotDENygHQDHe+ntUkkw2gwMtg== -jscodeshift@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.7.1.tgz#0236ad475d6f0770ca998a0160925d62b57d2507" - integrity sha512-YMkZSyoc8zg5woZL23cmWlnFLPH/mHilonGA7Qbzs7H6M4v4PH0Qsn4jeDyw+CHhVoAnm9UxQyB0Yw1OT+mktA== +jscodeshift@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.9.0.tgz#672025658e868a63e24d6a6f4c44af9edb6e55f3" + integrity sha512-SUeXq8dJzj5LR8uy71axgG3bmiHoC0IdHy7n89SqKzkzBWpAds5F9IIGE+lqUSZX9J0ZfEzN8fXWIqQV0dIp2w== dependencies: "@babel/core" "^7.1.6" "@babel/parser" "^7.1.6" "@babel/plugin-proposal-class-properties" "^7.1.0" - "@babel/plugin-proposal-object-rest-spread" "^7.0.0" - "@babel/preset-env" "^7.1.6" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.1.0" + "@babel/plugin-proposal-optional-chaining" "^7.1.0" + "@babel/plugin-transform-modules-commonjs" "^7.1.0" "@babel/preset-flow" "^7.0.0" "@babel/preset-typescript" "^7.1.0" "@babel/register" "^7.0.0" @@ -5052,13 +4813,6 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -levenary@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/levenary/-/levenary-1.1.1.tgz#842a9ee98d2075aa7faeedbe32679e9205f46f77" - integrity sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ== - dependencies: - leven "^3.1.0" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -5072,14 +4826,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -5812,11 +5558,6 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.53: - version "1.1.53" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" - integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== - node-stream-zip@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/node-stream-zip/-/node-stream-zip-1.9.1.tgz#66d210204da7c60e2d6d685eb21a11d016981fd0" @@ -6112,13 +5853,6 @@ p-is-promise@^1.1.0: resolved "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - p-limit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" @@ -6133,13 +5867,6 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -6154,11 +5881,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - p-try@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" @@ -6287,13 +6009,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - plist@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c" @@ -6977,11 +6692,6 @@ scheduler@0.19.1, scheduler@^0.19.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" From 577fdeaa621ac865b9fbbe6f648c6fab05d0abab Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 4 May 2020 02:56:54 -0700 Subject: [PATCH 181/235] Add prepareForReuse to RCTSafeAreaViewComponentView Summary: Changelog: [internal] As part of recycle, we should delete state. This is a common pattern used in other components as well. Reviewed By: shergin Differential Revision: D21348782 fbshipit-source-id: a5dee2f4ccee9b19498db31dab1983d8879dca71 --- .../SafeAreaView/RCTSafeAreaViewComponentView.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm index 00a1cb35a02ef8..982f63d5037a1a 100644 --- a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm @@ -86,6 +86,12 @@ - (void)updateState:(facebook::react::State::Shared const &)state [self _updateStateIfNecessary]; } +- (void)prepareForRecycle +{ + [super prepareForRecycle]; + _state.reset(); +} + + (ComponentDescriptorProvider)componentDescriptorProvider { return concreteComponentDescriptorProvider(); From ced959bb3d6abdab30c5e64af9bff6059b111cdd Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 4 May 2020 14:38:39 -0700 Subject: [PATCH 182/235] chore: remove Kotlin version from the default template (#28626) Summary: The default application requires Kotlin version that is not supported by the Gradle plugin (should be at least `1.3.10`). However, instead of upgrading, we should remove it entirely. Here's why. This commit https://github.com/facebook/react-native/commit/29d3dfbd196176af98c9727c82ff2668e697d78e introduced Detox for RNTester Android application. Since the commit doesn't mention Detox for the default application and there are no Detox tests present by default in the default application, I believe that this addition was performed by a mistake. The best way is to remove Kotlin from the default template. This step is described in the Detox documentation and all users that are integrating Detox will be asked to perform it anyway. No need to do it for them. ## Changelog [ANDROID] [INTERNAL] - remove Kotlin from the default template Pull Request resolved: https://github.com/facebook/react-native/pull/28626 Test Plan: Building a brand new project with `master` should work Differential Revision: D21388961 Pulled By: shergin fbshipit-source-id: 92666aa67f92b29f4e7f9c036b332bd058cdd49e --- template/android/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/template/android/build.gradle b/template/android/build.gradle index 3dad13374278d6..ed5a5684245790 100644 --- a/template/android/build.gradle +++ b/template/android/build.gradle @@ -11,11 +11,8 @@ buildscript { google() jcenter() } - ext.kotlinVersion = '1.3.0' dependencies { classpath("com.android.tools.build:gradle:3.5.3") - // for Detox - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } From d815be1c99e12a512f0ab6ad3cef13fce29e6b4b Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 4 May 2020 16:01:24 -0700 Subject: [PATCH 183/235] Fix Optimized Differ (was generating extraneous Create mutations) Summary: When we call `.erase` on the TinyMap, it sets the key of the element to 0. When we call `.begin()` later, TinyMap will sometimes, but not always, clean up the underlying Vector. This means that *most* of the time, underlying erased elements will be removed from the Vector; but sometimes erased elements will still be there when iterating over it. This was causing us to generate extra "Create" mutations. To fix this, for now we just check for zeroed-out elements when iterating over the vector. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21389371 fbshipit-source-id: 1e641050987d40a3f3e31499dcb373cfb28ae6f8 --- ReactCommon/fabric/mounting/Differentiator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index 919a7364de18ae..9f9f60207dc6b8 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -655,6 +655,12 @@ static void calculateShadowViewMutationsOptimizedMoves( // Final step: generate Create instructions for new nodes for (auto it = newInsertedPairs.begin(); it != newInsertedPairs.end(); it++) { + // Erased elements of a TinyMap will have a Tag/key of 0 - skip those + // These *should* be removed by the map, but are not always. + if (it->first == 0) { + continue; + } + auto const &newChildPair = *it->second; createMutations.push_back( ShadowViewMutation::CreateMutation(newChildPair.shadowView)); From 7f2515ece8833f7a8adba025ef544013f89ae26f Mon Sep 17 00:00:00 2001 From: Kacie Bawiec Date: Mon, 4 May 2020 16:39:28 -0700 Subject: [PATCH 184/235] Add warning when scrollRef does not have a scrollTo method Summary: Add a `console.warn()` call when calling `_scrollRef.scrollTo`, because `scrollTo` is not guaranteed to exist on `_scrollRef`. Context: `VirtualizedList` holds `_scrollRef`, which is usually a reference to a `ScrollView` component. However, there are several cases where it holds a `View` or other type of component instead. A custom component can be passed in to `renderScrollComponent`, and then `_scrollRef` will point to that custom component. Additionally, if two VirtualizedLists are nested with the same orientation, `_defaultRenderScrollComponent` will return a View instead of a ScrollView. Due to these possibilities, `_scrollRef` is not guaranteed to have a `scrollTo` method. Changelog: [General] [Added] - Add warning when scrollRef does not have a scrollTo method Reviewed By: JoshuaGross, TheSavior Differential Revision: D21386842 fbshipit-source-id: 01e167e0ae0edea8f29853e8b242ce88a5103b49 --- Libraries/Lists/VirtualizedList.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 36e5f3640671fe..ec03040dc8b88a 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -374,6 +374,15 @@ class VirtualizedList extends React.PureComponent { return; } + if (this._scrollRef.scrollTo == null) { + console.warn( + 'No scrollTo method provided. This may be because you have two nested ' + + 'VirtualizedLists with the same orientation, or because you are ' + + 'using a custom component that does not implement scrollTo.', + ); + return; + } + this._scrollRef.scrollTo( this.props.horizontal ? {x: offset, animated} : {y: offset, animated}, ); @@ -437,6 +446,15 @@ class VirtualizedList extends React.PureComponent { return; } + if (this._scrollRef.scrollTo == null) { + console.warn( + 'No scrollTo method provided. This may be because you have two nested ' + + 'VirtualizedLists with the same orientation, or because you are ' + + 'using a custom component that does not implement scrollTo.', + ); + return; + } + this._scrollRef.scrollTo( horizontal ? {x: offset, animated} : {y: offset, animated}, ); @@ -478,6 +496,15 @@ class VirtualizedList extends React.PureComponent { return; } + if (this._scrollRef.scrollTo == null) { + console.warn( + 'No scrollTo method provided. This may be because you have two nested ' + + 'VirtualizedLists with the same orientation, or because you are ' + + 'using a custom component that does not implement scrollTo.', + ); + return; + } + this._scrollRef.scrollTo( this.props.horizontal ? {x: offset, animated} : {y: offset, animated}, ); From 30a89f30c62e61a6f3144bb6d60f5cde0d75aab4 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 4 May 2020 16:50:14 -0700 Subject: [PATCH 185/235] Don't use #import in C++ Code (#28825) Summary: While #import is common in Objective C, it's a vendor specific extension in C++, only supported by GCC/Clang, and only when -pedantic is off. Its use causes build breaks with MSVC. Replace it with the standard #include. ## Changelog [Internal] [Fixed] - Don't use #import in C++ Code Pull Request resolved: https://github.com/facebook/react-native/pull/28825 Test Plan: We've ben running this change within react-native-windows for some time. Differential Revision: D21391233 Pulled By: shergin fbshipit-source-id: c0f94f314c46d6ac24067bbdcd5aaaeec9da283f --- ReactCommon/turbomodule/samples/SampleTurboCxxModule.cpp | 4 ++-- ReactCommon/turbomodule/samples/SampleTurboCxxModule.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactCommon/turbomodule/samples/SampleTurboCxxModule.cpp b/ReactCommon/turbomodule/samples/SampleTurboCxxModule.cpp index b970b2b72623d6..5d56c59d7ece20 100644 --- a/ReactCommon/turbomodule/samples/SampleTurboCxxModule.cpp +++ b/ReactCommon/turbomodule/samples/SampleTurboCxxModule.cpp @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -#import "SampleTurboCxxModule.h" +#include "SampleTurboCxxModule.h" -#import +#include using namespace facebook; diff --git a/ReactCommon/turbomodule/samples/SampleTurboCxxModule.h b/ReactCommon/turbomodule/samples/SampleTurboCxxModule.h index 7f1bd07bb1a789..c1ebb682362c64 100644 --- a/ReactCommon/turbomodule/samples/SampleTurboCxxModule.h +++ b/ReactCommon/turbomodule/samples/SampleTurboCxxModule.h @@ -7,9 +7,9 @@ #pragma once -#import +#include -#import "NativeSampleTurboCxxModuleSpecJSI.h" +#include "NativeSampleTurboCxxModuleSpecJSI.h" namespace facebook { namespace react { From ca144fca3fb365571e05263aea4261f916e38c47 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 4 May 2020 21:25:56 -0700 Subject: [PATCH 186/235] Fix unit test compilation on Android Summary: Before, compilation fails with P130281113. After fixing BUCK target, fails with P130281201. After all changes, the tests succeed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21390996 fbshipit-source-id: c85aa43b3ef7fc9642d226ae706c937b2a5a408d --- ReactCommon/fabric/mounting/BUCK | 1 + ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index 9d6ad218c1d131..ba11be7771bc31 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -76,6 +76,7 @@ fb_xplat_cxx_test( "-Wall", ], contacts = ["oncall+react_native@xmail.facebook.com"], + fbandroid_use_instrumentation_test = True, platforms = (ANDROID, APPLE, CXX), deps = [ ":mounting", diff --git a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp index 5eb9c6aa0c8583..d065a69666327f 100644 --- a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -114,6 +114,9 @@ static void testShadowNodeTreeLifeCycle( LOG(ERROR) << "Entropy seed: " << entropy.getSeed() << "\n"; + // There are some issues getting `getDebugDescription` to compile + // under test on Android for now. +#ifndef ANDROID LOG(ERROR) << "Shadow Tree before: \n" << currentRootNode->getDebugDescription(); LOG(ERROR) << "Shadow Tree after: \n" @@ -128,6 +131,7 @@ static void testShadowNodeTreeLifeCycle( LOG(ERROR) << "Mutations:" << "\n" << getDebugDescription(mutations, {}); +#endif FAIL(); } From aae38c3dfe6914d6fe04d3896d7c05cf1e3dac05 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 4 May 2020 21:25:56 -0700 Subject: [PATCH 187/235] Support calling LayoutAnimation APIs in Fabric from JS Summary: Call Fabric's LayoutAnimation APIs from JS. Changelog: [Internal] A step towards supporting LayoutAnimations on Fabric Reviewed By: shergin, mdvacca Differential Revision: D21297975 fbshipit-source-id: 6d530b01d8152e7c803a7c0299b918a32fb39dc0 --- Libraries/LayoutAnimation/LayoutAnimation.js | 57 ++++++++----------- Libraries/ReactNative/FabricUIManager.js | 10 +++- Libraries/Renderer/shims/ReactNativeTypes.js | 33 +++++++++++ ReactCommon/fabric/uimanager/UIManager.cpp | 4 ++ ReactCommon/fabric/uimanager/UIManager.h | 8 +++ .../fabric/uimanager/UIManagerBinding.cpp | 21 +++++++ 6 files changed, 100 insertions(+), 33 deletions(-) diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index ba4632eb712404..159b2b96c785ad 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -11,52 +11,45 @@ 'use strict'; const UIManager = require('../ReactNative/UIManager'); +import type {Spec as FabricUIManagerSpec} from '../ReactNative/FabricUIManager'; +import type { + LayoutAnimationConfig as LayoutAnimationConfig_, + LayoutAnimationType, + LayoutAnimationProperty, +} from '../Renderer/shims/ReactNativeTypes'; import Platform from '../Utilities/Platform'; -type Type = - | 'spring' - | 'linear' - | 'easeInEaseOut' - | 'easeIn' - | 'easeOut' - | 'keyboard'; - -type Property = 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY'; - -type AnimationConfig = $ReadOnly<{| - duration?: number, - delay?: number, - springDamping?: number, - initialVelocity?: number, - type?: Type, - property?: Property, -|}>; - -export type LayoutAnimationConfig = $ReadOnly<{| - duration: number, - create?: AnimationConfig, - update?: AnimationConfig, - delete?: AnimationConfig, -|}>; +// Reexport type +export type LayoutAnimationConfig = LayoutAnimationConfig_; function configureNext( config: LayoutAnimationConfig, onAnimationDidEnd?: Function, ) { if (!Platform.isTesting) { - UIManager.configureNextLayoutAnimation( - config, - onAnimationDidEnd ?? function() {}, - function() {} /* unused onError */, - ); + if (UIManager?.configureNextLayoutAnimation) { + UIManager.configureNextLayoutAnimation( + config, + onAnimationDidEnd ?? function() {}, + function() {} /* unused onError */, + ); + } + const FabricUIManager: FabricUIManagerSpec = global?.nativeFabricUIManager; + if (FabricUIManager?.configureNextLayoutAnimation) { + global?.nativeFabricUIManager?.configureNextLayoutAnimation( + config, + onAnimationDidEnd ?? function() {}, + function() {} /* unused onError */, + ); + } } } function create( duration: number, - type: Type, - property: Property, + type: LayoutAnimationType, + property: LayoutAnimationProperty, ): LayoutAnimationConfig { return { duration, diff --git a/Libraries/ReactNative/FabricUIManager.js b/Libraries/ReactNative/FabricUIManager.js index 0aeecb4b8c9948..2b88069742229e 100644 --- a/Libraries/ReactNative/FabricUIManager.js +++ b/Libraries/ReactNative/FabricUIManager.js @@ -14,6 +14,7 @@ import type { MeasureOnSuccessCallback, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, + LayoutAnimationConfig, } from '../Renderer/shims/ReactNativeTypes'; // TODO: type these properly. @@ -21,7 +22,7 @@ type Node = {...}; type NodeSet = Array; type NodeProps = {...}; type InstanceHandle = {...}; -type Spec = {| +export type Spec = {| +createNode: ( reactTag: number, viewName: string, @@ -49,6 +50,13 @@ type Spec = {| onFail: () => void, onSuccess: MeasureLayoutOnSuccessCallback, ) => void, + +configureNextLayoutAnimation: ( + config: LayoutAnimationConfig, + callback: () => void, // check what is returned here + // This error isn't currently called anywhere, so the `error` object is really not defined + // $FlowFixMe + errorCallback: (error: Object) => void, + ) => void, |}; const FabricUIManager: ?Spec = global.nativeFabricUIManager; diff --git a/Libraries/Renderer/shims/ReactNativeTypes.js b/Libraries/Renderer/shims/ReactNativeTypes.js index 10244570b65354..41d220ab71a936 100644 --- a/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/Libraries/Renderer/shims/ReactNativeTypes.js @@ -211,3 +211,36 @@ export type ReactFaricEvent = { target: number, ... }; + +// +// Imperative LayoutAnimation API types +// +export type LayoutAnimationType = + | 'spring' + | 'linear' + | 'easeInEaseOut' + | 'easeIn' + | 'easeOut' + | 'keyboard'; + +export type LayoutAnimationProperty = + | 'opacity' + | 'scaleX' + | 'scaleY' + | 'scaleXY'; + +export type LayoutAnimationAnimationConfig = $ReadOnly<{| + duration?: number, + delay?: number, + springDamping?: number, + initialVelocity?: number, + type?: LayoutAnimationType, + property?: LayoutAnimationProperty, +|}>; + +export type LayoutAnimationConfig = $ReadOnly<{| + duration: number, + create?: LayoutAnimationAnimationConfig, + update?: LayoutAnimationAnimationConfig, + delete?: LayoutAnimationAnimationConfig, +|}>; diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index f203535c6d6d1f..e87280c58cd28a 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -259,6 +259,10 @@ void UIManager::dispatchCommand( } } +void UIManager::configureNextLayoutAnimation( + const folly::dynamic config, + SharedEventTarget successCallback, + SharedEventTarget errorCallback) const {} void UIManager::setComponentDescriptorRegistry( const SharedComponentDescriptorRegistry &componentDescriptorRegistry) { componentDescriptorRegistry_ = componentDescriptorRegistry; diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index ca42ad6dbb3a35..956f459f935cee 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -116,6 +116,14 @@ class UIManager final : public ShadowTreeDelegate { std::string const &commandName, folly::dynamic const args) const; + /** + * Configure a LayoutAnimation to happen on the next commit. + * This API configures a global LayoutAnimation starting from the root node. + */ + void configureNextLayoutAnimation( + const folly::dynamic config, + SharedEventTarget successCallback, + SharedEventTarget errorCallback) const; ShadowTreeRegistry const &getShadowTreeRegistry() const; SharedComponentDescriptorRegistry componentDescriptorRegistry_; diff --git a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp index 981a165bc669f9..f29a202e4ece99 100644 --- a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp +++ b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp @@ -598,6 +598,27 @@ jsi::Value UIManagerBinding::get( }); } + if (methodName == "configureNextLayoutAnimation") { + return jsi::Function::createFromHostFunction( + runtime, + name, + 3, + [uiManager]( + jsi::Runtime &runtime, + const jsi::Value &thisValue, + const jsi::Value *arguments, + size_t count) -> jsi::Value { + uiManager->configureNextLayoutAnimation( + commandArgsFromValue( + runtime, + arguments[0]), // TODO T66507273: do a better job of parsing + // these arguments into a real struct / use a + // C++ typed object instead of folly::dynamic + eventTargetFromValue(runtime, arguments[1], -1), + eventTargetFromValue(runtime, arguments[2], -1)); + return jsi::Value::undefined(); + }); + } return jsi::Value::undefined(); } From bb5d04366ad66273fd908586a9f4bc7513b4276c Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 4 May 2020 21:25:56 -0700 Subject: [PATCH 188/235] Differ: fix TinyMap to prevent possible crashes in `find()` and `begin()`, and prevent erased elements from being iterated over Summary: The core issue solved in D21389371 was that erased elements of a TinyMap were being iterated over, because TinyMap has somewhat-complicated logic around cleaning out the underlying vector. In some very marginal cases, vectors were not being cleaned and an iterator pointing at erased elements was being returned. The diff prevents some possible crashes in `begin()` and `find()` while making it much less likely to iterate over erased elements. We also add a unit test to catch the case fixed in D21389371, in particular. We also are keeping the code added in D21389371 (for now) since it's a cheap check, and will be a safeguard until we have rigorous testing around TinyMap. To be clear that logic should noop currently, but will prevent crashes in case guarantees around TinyMap change in the future. Currently there is only one line of code that actually uses the TinyMap iterator, so this should be safe. Reviewed By: shergin Differential Revision: D21392762 fbshipit-source-id: 36dc998958c230fad01af93338974f8889cbcf55 --- .../fabric/mounting/Differentiator.cpp | 22 ++++++++--- .../fabric/mounting/tests/MountingTest.cpp | 38 +++++++++++++++++++ .../tests/ShadowTreeLifeCycleTest.cpp | 4 +- 3 files changed, 57 insertions(+), 7 deletions(-) diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index 9f9f60207dc6b8..6661d5424407b2 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -54,7 +54,13 @@ class TinyMap final { // then we don't need to clean. cleanVector(erasedAtFront_ != numErased_); - return begin_(); + Iterator it = begin_(); + + if (it != nullptr) { + return it + erasedAtFront_; + } + + return nullptr; } inline Iterator end() { @@ -71,6 +77,10 @@ class TinyMap final { assert(key != 0); + if (begin_() == nullptr) { + return end(); + } + for (auto it = begin_() + erasedAtFront_; it != end(); it++) { if (it->first == key) { return it; @@ -86,14 +96,14 @@ class TinyMap final { } inline void erase(Iterator iterator) { - numErased_++; - // Invalidate tag. iterator->first = 0; if (iterator == begin_() + erasedAtFront_) { erasedAtFront_++; } + + numErased_++; } private: @@ -643,7 +653,7 @@ static void calculateShadowViewMutationsOptimizedMoves( } // At this point, oldTag is -1 or is in the new list, and hasn't been - // inserted or matched yet We're not sure yet if the new node is in the + // inserted or matched yet. We're not sure yet if the new node is in the // old list - generate an insert instruction for the new node. auto const &newChildPair = newChildPairs[newIndex]; insertMutations.push_back(ShadowViewMutation::InsertMutation( @@ -656,7 +666,9 @@ static void calculateShadowViewMutationsOptimizedMoves( for (auto it = newInsertedPairs.begin(); it != newInsertedPairs.end(); it++) { // Erased elements of a TinyMap will have a Tag/key of 0 - skip those - // These *should* be removed by the map, but are not always. + // These *should* be removed by the map; there are currently no KNOWN + // cases where TinyMap will do the wrong thing, but there are not yet + // any unit tests explicitly for TinyMap, so this is safer for now. if (it->first == 0) { continue; } diff --git a/ReactCommon/fabric/mounting/tests/MountingTest.cpp b/ReactCommon/fabric/mounting/tests/MountingTest.cpp index 4783516bf1c4a5..52361e23dc5ab3 100644 --- a/ReactCommon/fabric/mounting/tests/MountingTest.cpp +++ b/ReactCommon/fabric/mounting/tests/MountingTest.cpp @@ -77,6 +77,11 @@ TEST(MountingTest, testMinimalInstructionGeneration) { auto childD = makeNode(viewComponentDescriptor, 103, {}); auto childE = makeNode(viewComponentDescriptor, 104, {}); auto childF = makeNode(viewComponentDescriptor, 105, {}); + auto childG = makeNode(viewComponentDescriptor, 106, {}); + auto childH = makeNode(viewComponentDescriptor, 107, {}); + auto childI = makeNode(viewComponentDescriptor, 108, {}); + auto childJ = makeNode(viewComponentDescriptor, 109, {}); + auto childK = makeNode(viewComponentDescriptor, 110, {}); auto family = viewComponentDescriptor.createFamily( {10, SurfaceId(1), nullptr}, nullptr); @@ -107,6 +112,17 @@ TEST(MountingTest, testMinimalInstructionGeneration) { generateDefaultProps(viewComponentDescriptor), std::make_shared(SharedShadowNodeList{ childB, childA, childD, childF, childE, childC})}); + auto shadowNodeV7 = shadowNodeV6->clone(ShadowNodeFragment{ + generateDefaultProps(viewComponentDescriptor), + std::make_shared(SharedShadowNodeList{childF, + childE, + childC, + childD, + childG, + childH, + childI, + childJ, + childK})}); // Injecting a tree into the root node. auto rootNodeV1 = std::static_pointer_cast( @@ -139,6 +155,11 @@ TEST(MountingTest, testMinimalInstructionGeneration) { ShadowNodeFragment{ShadowNodeFragment::propsPlaceholder(), std::make_shared( SharedShadowNodeList{shadowNodeV6})})); + auto rootNodeV7 = std::static_pointer_cast( + rootNodeV6->ShadowNode::clone( + ShadowNodeFragment{ShadowNodeFragment::propsPlaceholder(), + std::make_shared( + SharedShadowNodeList{shadowNodeV7})})); // Layout and diff std::vector affectedLayoutableNodesV1{}; @@ -307,6 +328,23 @@ TEST(MountingTest, testMinimalInstructionGeneration) { assert(mutations5[3].type == ShadowViewMutation::Insert); assert(mutations5[3].newChildShadowView.tag == 105); assert(mutations5[3].index == 3); + + auto mutations6 = calculateShadowViewMutations( + DifferentiatorMode::OptimizedMoves, *rootNodeV6, *rootNodeV7); + + // The order and exact mutation instructions here may change at any time. + // This test just ensures that any changes are intentional. + // This test, in particular, ensures that a bug has been fixed: that with + // a particular sequence of inserts/removes/moves, we don't unintentionally + // create more "CREATE" mutations than necessary. + // The actual nodes that should be created in this transaction have a tag > + // 105. + assert(mutations6.size() == 25); + for (int i = 0; i < mutations6.size(); i++) { + if (mutations6[i].type == ShadowViewMutation::Create) { + assert(mutations6[i].newChildShadowView.tag > 105); + } + } } } // namespace react diff --git a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp index d065a69666327f..ab2ad89b990449 100644 --- a/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/ReactCommon/fabric/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -169,7 +169,7 @@ TEST(MountingTest, stableSmallerTreeMoreIterationsClassic) { TEST(MountingTest, stableBiggerTreeFewerIterationsOptimizedMoves) { testShadowNodeTreeLifeCycle( DifferentiatorMode::OptimizedMoves, - /* seed */ 1, + /* seed */ 0, /* size */ 512, /* repeats */ 32, /* stages */ 32); @@ -178,7 +178,7 @@ TEST(MountingTest, stableBiggerTreeFewerIterationsOptimizedMoves) { TEST(MountingTest, stableSmallerTreeMoreIterationsOptimizedMoves) { testShadowNodeTreeLifeCycle( DifferentiatorMode::OptimizedMoves, - /* seed */ 1, + /* seed */ 0, /* size */ 16, /* repeats */ 512, /* stages */ 32); From 03489539146556ec5ba6ba07ac338ce200f5b0f4 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 4 May 2020 21:52:35 -0700 Subject: [PATCH 189/235] Allow passing partial contentOffset to ScrollView on Android (#28817) Summary: Since support for contentOffset was added to horizontal ScrollView on android (30cc158a875a0414cf53d4d5155410eea5d5aeea) I'm seeing a crash in my app because of a library. What happens is that it passes a partial object for contentOffset so something like `{x: 1}` which causes a crash on Android. According to the flow types the object should always contain both x and y but I think we should preserve the runtime behaviour and just use 0 like iOS does. ## Changelog [Android] [Fixed] - Allow passing partial contentOffset to ScrollView on Android Pull Request resolved: https://github.com/facebook/react-native/pull/28817 Test Plan: Tested that passing partial object for contentOffset does not crash. Reviewed By: JoshuaGross Differential Revision: D21396319 Pulled By: shergin fbshipit-source-id: 4b52c868e3bfe183ff7f68a76ac34d1abd5e1069 --- .../react/views/scroll/ReactHorizontalScrollViewManager.java | 4 ++-- .../facebook/react/views/scroll/ReactScrollViewManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java index ecb72fff78746f..7f11c77abf3a22 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java @@ -304,8 +304,8 @@ public void setFadingEdgeLength(ReactHorizontalScrollView view, int value) { @ReactProp(name = "contentOffset") public void setContentOffset(ReactHorizontalScrollView view, ReadableMap value) { if (value != null) { - double x = value.getDouble("x"); - double y = value.getDouble("y"); + double x = value.hasKey("x") ? value.getDouble("x") : 0; + double y = value.hasKey("y") ? value.getDouble("y") : 0; view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); } } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java index ed7cd05778836e..adf04118c3f437 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java @@ -308,8 +308,8 @@ public void setFadingEdgeLength(ReactScrollView view, int value) { @ReactProp(name = "contentOffset") public void setContentOffset(ReactScrollView view, ReadableMap value) { if (value != null) { - double x = value.getDouble("x"); - double y = value.getDouble("y"); + double x = value.hasKey("x") ? value.getDouble("x") : 0; + double y = value.hasKey("y") ? value.getDouble("y") : 0; view.reactScrollTo((int) PixelUtil.toPixelFromDIP(x), (int) PixelUtil.toPixelFromDIP(y)); } } From 4f5a092bf68a0cd825328ce4a1e6bb41a8fad2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 5 May 2020 04:52:13 -0700 Subject: [PATCH 190/235] Pass initial props to WrapperComponent Summary: `renderApplication` receives the root component that we need to render and an optional wrapper component. There are cases where we want to use the initial props passed to the root component in the wrapper component as well (e.g.: to provide a specific context to the root component), so this adds modifies `AppContainer` to accept the initial props and inject them into the wrapper component. Changelog: [General] [Added] - Modified `renderApplication` to forward `initialProps` to `WrapperComponent` Reviewed By: fkgozali Differential Revision: D21347486 fbshipit-source-id: 1c4f702a3875077630de1a44d3ac9ef2c80bc10c --- Libraries/ReactNative/AppContainer.js | 2 ++ Libraries/ReactNative/renderApplication.js | 1 + 2 files changed, 3 insertions(+) diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index 93c83fba66350b..2c2b0fc157fd94 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -24,6 +24,7 @@ type Props = $ReadOnly<{| children?: React.Node, fabric?: boolean, rootTag: number, + initialProps?: {...}, showArchitectureIndicator?: boolean, WrapperComponent?: ?React.ComponentType, internal_excludeLogBox?: ?boolean, @@ -119,6 +120,7 @@ class AppContainer extends React.Component { if (Wrapper != null) { innerView = ( ( fabric={fabric} showArchitectureIndicator={showArchitectureIndicator} WrapperComponent={WrapperComponent} + initialProps={initialProps} internal_excludeLogBox={isLogBox}> From 1740233f3812c4b702b4ca3127ae1e10037d16a0 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Tue, 5 May 2020 08:30:50 -0700 Subject: [PATCH 191/235] Upgrade to Jest 26 Summary: * Brings performance improvements from 25.5.x * Reduces node_modules by 3 MiB, see https://github.com/facebook/jest/pull/9950/files?short_path=63580dd#diff-63580dd1e7078ce037f10f2fee7553b9 * Breaking changes: https://github.com/facebook/jest/blob/master/CHANGELOG.md Changelog: [Internal] Reviewed By: rubennorte Differential Revision: D21369069 fbshipit-source-id: 81a9d50f8e541293a85ce3957cb962930ca05b11 --- package.json | 4 +- yarn.lock | 1211 ++++++++++++++++++++++++++------------------------ 2 files changed, 641 insertions(+), 574 deletions(-) diff --git a/package.json b/package.json index 1ad2666b23e0fb..2bcf52e03b4cba 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "metro-react-native-babel-transformer": "0.59.0", "metro-source-map": "0.59.0", "nullthrows": "^1.1.1", - "pretty-format": "^25.4.0", + "pretty-format": "^26.0.1", "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.6.0", @@ -140,7 +140,7 @@ "eslint-plugin-relay": "1.7.0", "flow-bin": "^0.123.0", "flow-remove-types": "1.2.3", - "jest": "^25.4.0", + "jest": "^26.0.1", "jest-junit": "^10.0.0", "jscodeshift": "^0.9.0", "mkdirp": "^0.5.1", diff --git a/yarn.lock b/yarn.lock index 81581ab16aa625..adb5e4a32d980e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -721,7 +721,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.0.0", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": +"@babel/template@^7.0.0", "@babel/template@^7.3.3", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== @@ -769,6 +769,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.3.3": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.6.tgz#2c5502b427251e9de1bd2dff95add646d95cc9f7" + integrity sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA== + dependencies: + "@babel/helper-validator-identifier" "^7.9.5" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@babel/types@^7.7.0", "@babel/types@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" @@ -852,59 +861,58 @@ chalk "^2.0.1" slash "^2.0.0" -"@jest/console@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.4.0.tgz#e2760b532701137801ba824dcff6bc822c961bac" - integrity sha512-CfE0erx4hdJ6t7RzAcE1wLG6ZzsHSmybvIBQDoCkDM1QaSeWL9wJMzID/2BbHHa7ll9SsbbK43HjbERbBaFX2A== +"@jest/console@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.0.1.tgz#62b3b2fa8990f3cbffbef695c42ae9ddbc8f4b39" + integrity sha512-9t1KUe/93coV1rBSxMmBAOIK3/HVpwxArCA1CxskKyRiv6o8J70V8C/V3OJminVCTa2M0hQI9AWRd5wxu2dAHw== dependencies: - "@jest/types" "^25.4.0" - chalk "^3.0.0" - jest-message-util "^25.4.0" - jest-util "^25.4.0" + "@jest/types" "^26.0.1" + chalk "^4.0.0" + jest-message-util "^26.0.1" + jest-util "^26.0.1" slash "^3.0.0" -"@jest/core@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.4.0.tgz#cc1fe078df69b8f0fbb023bb0bcee23ef3b89411" - integrity sha512-h1x9WSVV0+TKVtATGjyQIMJENs8aF6eUjnCoi4jyRemYZmekLr8EJOGQqTWEX8W6SbZ6Skesy9pGXrKeAolUJw== +"@jest/core@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.0.1.tgz#aa538d52497dfab56735efb00e506be83d841fae" + integrity sha512-Xq3eqYnxsG9SjDC+WLeIgf7/8KU6rddBxH+SCt18gEpOhAGYC/Mq+YbtlNcIdwjnnT+wDseXSbU0e5X84Y4jTQ== dependencies: - "@jest/console" "^25.4.0" - "@jest/reporters" "^25.4.0" - "@jest/test-result" "^25.4.0" - "@jest/transform" "^25.4.0" - "@jest/types" "^25.4.0" + "@jest/console" "^26.0.1" + "@jest/reporters" "^26.0.1" + "@jest/test-result" "^26.0.1" + "@jest/transform" "^26.0.1" + "@jest/types" "^26.0.1" ansi-escapes "^4.2.1" - chalk "^3.0.0" + chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.2.3" - jest-changed-files "^25.4.0" - jest-config "^25.4.0" - jest-haste-map "^25.4.0" - jest-message-util "^25.4.0" - jest-regex-util "^25.2.6" - jest-resolve "^25.4.0" - jest-resolve-dependencies "^25.4.0" - jest-runner "^25.4.0" - jest-runtime "^25.4.0" - jest-snapshot "^25.4.0" - jest-util "^25.4.0" - jest-validate "^25.4.0" - jest-watcher "^25.4.0" + graceful-fs "^4.2.4" + jest-changed-files "^26.0.1" + jest-config "^26.0.1" + jest-haste-map "^26.0.1" + jest-message-util "^26.0.1" + jest-regex-util "^26.0.0" + jest-resolve "^26.0.1" + jest-resolve-dependencies "^26.0.1" + jest-runner "^26.0.1" + jest-runtime "^26.0.1" + jest-snapshot "^26.0.1" + jest-util "^26.0.1" + jest-validate "^26.0.1" + jest-watcher "^26.0.1" micromatch "^4.0.2" p-each-series "^2.1.0" - realpath-native "^2.0.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.4.0.tgz#45071f525f0d8c5a51ed2b04fd42b55a8f0c7cb3" - integrity sha512-KDctiak4mu7b4J6BIoN/+LUL3pscBzoUCP+EtSPd2tK9fqyDY5OF+CmkBywkFWezS9tyH5ACOQNtpjtueEDH6Q== +"@jest/environment@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.0.1.tgz#82f519bba71959be9b483675ee89de8c8f72a5c8" + integrity sha512-xBDxPe8/nx251u0VJ2dFAFz2H23Y98qdIaNwnMK6dFQr05jc+Ne/2np73lOAx+5mSBO/yuQldRrQOf6hP1h92g== dependencies: - "@jest/fake-timers" "^25.4.0" - "@jest/types" "^25.4.0" - jest-mock "^25.4.0" + "@jest/fake-timers" "^26.0.1" + "@jest/types" "^26.0.1" + jest-mock "^26.0.1" "@jest/fake-timers@^24.8.0": version "24.8.0" @@ -915,47 +923,57 @@ jest-message-util "^24.8.0" jest-mock "^24.8.0" -"@jest/fake-timers@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.4.0.tgz#3a9a4289ba836abd084953dca406389a57e00fbd" - integrity sha512-lI9z+VOmVX4dPPFzyj0vm+UtaB8dCJJ852lcDnY0uCPRvZAaVGnMwBBc1wxtf+h7Vz6KszoOvKAt4QijDnHDkg== +"@jest/fake-timers@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.0.1.tgz#f7aeff13b9f387e9d0cac9a8de3bba538d19d796" + integrity sha512-Oj/kCBnTKhm7CR+OJSjZty6N1bRDr9pgiYQr4wY221azLz5PHi08x/U+9+QpceAYOWheauLP8MhtSVFrqXQfhg== dependencies: - "@jest/types" "^25.4.0" - jest-message-util "^25.4.0" - jest-mock "^25.4.0" - jest-util "^25.4.0" - lolex "^5.0.0" + "@jest/types" "^26.0.1" + "@sinonjs/fake-timers" "^6.0.1" + jest-message-util "^26.0.1" + jest-mock "^26.0.1" + jest-util "^26.0.1" -"@jest/reporters@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.4.0.tgz#836093433b32ce4e866298af2d6fcf6ed351b0b0" - integrity sha512-bhx/buYbZgLZm4JWLcRJ/q9Gvmd3oUh7k2V7gA4ZYBx6J28pIuykIouclRdiAC6eGVX1uRZT+GK4CQJLd/PwPg== +"@jest/globals@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.0.1.tgz#3f67b508a7ce62b6e6efc536f3d18ec9deb19a9c" + integrity sha512-iuucxOYB7BRCvT+TYBzUqUNuxFX1hqaR6G6IcGgEqkJ5x4htNKo1r7jk1ji9Zj8ZMiMw0oB5NaA7k5Tx6MVssA== + dependencies: + "@jest/environment" "^26.0.1" + "@jest/types" "^26.0.1" + expect "^26.0.1" + +"@jest/reporters@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.0.1.tgz#14ae00e7a93e498cec35b0c00ab21c375d9b078f" + integrity sha512-NWWy9KwRtE1iyG/m7huiFVF9YsYv/e+mbflKRV84WDoJfBqUrNRyDbL/vFxQcYLl8IRqI4P3MgPn386x76Gf2g== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^25.4.0" - "@jest/test-result" "^25.4.0" - "@jest/transform" "^25.4.0" - "@jest/types" "^25.4.0" - chalk "^3.0.0" + "@jest/console" "^26.0.1" + "@jest/test-result" "^26.0.1" + "@jest/transform" "^26.0.1" + "@jest/types" "^26.0.1" + chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.2" + graceful-fs "^4.2.4" istanbul-lib-coverage "^3.0.0" istanbul-lib-instrument "^4.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^25.4.0" - jest-resolve "^25.4.0" - jest-util "^25.4.0" - jest-worker "^25.4.0" + jest-haste-map "^26.0.1" + jest-resolve "^26.0.1" + jest-util "^26.0.1" + jest-worker "^26.0.0" slash "^3.0.0" source-map "^0.6.0" - string-length "^3.1.0" + string-length "^4.0.1" terminal-link "^2.0.0" v8-to-istanbul "^4.1.3" optionalDependencies: - node-notifier "^6.0.0" + node-notifier "^7.0.0" "@jest/source-map@^24.3.0": version "24.3.0" @@ -966,13 +984,13 @@ graceful-fs "^4.1.15" source-map "^0.6.0" -"@jest/source-map@^25.2.6": - version "25.2.6" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.2.6.tgz#0ef2209514c6d445ebccea1438c55647f22abb4c" - integrity sha512-VuIRZF8M2zxYFGTEhkNSvQkUKafQro4y+mwUxy5ewRqs5N/ynSFUODYp3fy1zCnbCMy1pz3k+u57uCqx8QRSQQ== +"@jest/source-map@^26.0.0": + version "26.0.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.0.0.tgz#fd7706484a7d3faf7792ae29783933bbf48a4749" + integrity sha512-S2Z+Aj/7KOSU2TfW0dyzBze7xr95bkm5YXNUqqCek+HE0VbNNSNzrRwfIi5lf7wvzDTSS0/ib8XQ1krFNyYgbQ== dependencies: callsites "^3.0.0" - graceful-fs "^4.2.3" + graceful-fs "^4.2.4" source-map "^0.6.0" "@jest/test-result@^24.8.0": @@ -984,44 +1002,44 @@ "@jest/types" "^24.8.0" "@types/istanbul-lib-coverage" "^2.0.0" -"@jest/test-result@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.4.0.tgz#6f2ec2c8da9981ef013ad8651c1c6f0cb20c6324" - integrity sha512-8BAKPaMCHlL941eyfqhWbmp3MebtzywlxzV+qtngQ3FH+RBqnoSAhNEPj4MG7d2NVUrMOVfrwuzGpVIK+QnMAA== +"@jest/test-result@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.0.1.tgz#1ffdc1ba4bc289919e54b9414b74c9c2f7b2b718" + integrity sha512-oKwHvOI73ICSYRPe8WwyYPTtiuOAkLSbY8/MfWF3qDEd/sa8EDyZzin3BaXTqufir/O/Gzea4E8Zl14XU4Mlyg== dependencies: - "@jest/console" "^25.4.0" - "@jest/types" "^25.4.0" + "@jest/console" "^26.0.1" + "@jest/types" "^26.0.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.4.0.tgz#2b96f9d37f18dc3336b28e3c8070f97f9f55f43b" - integrity sha512-240cI+nsM3attx2bMp9uGjjHrwrpvxxrZi8Tyqp/cfOzl98oZXVakXBgxODGyBYAy/UGXPKXLvNc2GaqItrsJg== +"@jest/test-sequencer@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.0.1.tgz#b0563424728f3fe9e75d1442b9ae4c11da73f090" + integrity sha512-ssga8XlwfP8YjbDcmVhwNlrmblddMfgUeAkWIXts1V22equp2GMIHxm7cyeD5Q/B0ZgKPK/tngt45sH99yLLGg== dependencies: - "@jest/test-result" "^25.4.0" - jest-haste-map "^25.4.0" - jest-runner "^25.4.0" - jest-runtime "^25.4.0" + "@jest/test-result" "^26.0.1" + graceful-fs "^4.2.4" + jest-haste-map "^26.0.1" + jest-runner "^26.0.1" + jest-runtime "^26.0.1" -"@jest/transform@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.4.0.tgz#eef36f0367d639e2fd93dccd758550377fbb9962" - integrity sha512-t1w2S6V1sk++1HHsxboWxPEuSpN8pxEvNrZN+Ud/knkROWtf8LeUmz73A4ezE8476a5AM00IZr9a8FO9x1+j3g== +"@jest/transform@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.0.1.tgz#0e3ecbb34a11cd4b2080ed0a9c4856cf0ceb0639" + integrity sha512-pPRkVkAQ91drKGbzCfDOoHN838+FSbYaEAvBXvKuWeeRRUD8FjwXkqfUNUZL6Ke48aA/1cqq/Ni7kVMCoqagWA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" babel-plugin-istanbul "^6.0.0" - chalk "^3.0.0" + chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.2.3" - jest-haste-map "^25.4.0" - jest-regex-util "^25.2.6" - jest-util "^25.4.0" + graceful-fs "^4.2.4" + jest-haste-map "^26.0.1" + jest-regex-util "^26.0.0" + jest-util "^26.0.1" micromatch "^4.0.2" pirates "^4.0.1" - realpath-native "^2.0.0" slash "^3.0.0" source-map "^0.6.1" write-file-atomic "^3.0.0" @@ -1062,15 +1080,15 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" -"@jest/types@^25.4.0": - version "25.4.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.4.0.tgz#5afeb8f7e1cba153a28e5ac3c9fe3eede7206d59" - integrity sha512-XBeaWNzw2PPnGW5aXvZt3+VO60M+34RY3XDsCK5tW7kyj3RK0XClRutCfjqcBuaR2aBQTbluEDME9b5MB9UAPw== +"@jest/types@^26.0.1": + version "26.0.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.0.1.tgz#b78333fbd113fa7aec8d39de24f88de8686dac67" + integrity sha512-IbtjvqI9+eS1qFnOIEL7ggWmT+iK/U+Vde9cGWtYb/b6XgKb3X44ZAe/z9YZzoAAZ/E92m0DqrilF934IGNnQA== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^15.0.0" - chalk "^3.0.0" + chalk "^4.0.0" "@react-native-community/cli-debugger-ui@^4.7.0": version "4.7.0" @@ -1181,6 +1199,13 @@ dependencies: type-detect "4.0.8" +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@types/babel__core@^7.1.7": version "7.1.7" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.7.tgz#1dacad8840364a57c98d0dd4855c6dd3752c6b89" @@ -1219,6 +1244,13 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/graceful-fs@^4.1.2": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f" + integrity sha512-AiHRaEB50LQg0pZmm659vNBb9f4SJ0qrAnteuzhSeAUcJKxoYgEnprg/83kppCnc2zvtCKbdZry1a5pVY3lOTQ== + dependencies: + "@types/node" "*" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -1244,15 +1276,20 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" +"@types/node@*": + version "13.13.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.4.tgz#1581d6c16e3d4803eb079c87d4ac893ee7501c2c" + integrity sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/prettier@^1.19.0": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" - integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== +"@types/prettier@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.0.0.tgz#dc85454b953178cc6043df5208b9e949b54a3bc4" + integrity sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -1283,10 +1320,10 @@ dependencies: "@types/yargs-parser" "*" -abab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" - integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== +abab@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" + integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== abbrev@1: version "1.1.1" @@ -1313,35 +1350,30 @@ accepts@~1.3.3, accepts@~1.3.5: mime-types "~2.1.18" negotiator "0.6.1" -acorn-globals@^4.3.2: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== +acorn-globals@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" + integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" + acorn "^7.1.1" + acorn-walk "^7.1.1" acorn-jsx@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== -acorn-walk@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.0.tgz#c957f4a1460da46af4a0388ce28b4c99355b0cbc" - integrity sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg== - -acorn@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.2.tgz#6a459041c320ab17592c6317abbfdf4bbaa98ca4" - integrity sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg== +acorn-walk@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" + integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== acorn@^6.0.2: version "6.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== -acorn@^7.1.0: +acorn@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== @@ -1557,11 +1589,6 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - array-filter@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" @@ -1702,17 +1729,18 @@ babel-eslint@^10.1.0: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.4.0.tgz#409eb3e2ddc2ad9a92afdbb00991f1633f8018d0" - integrity sha512-p+epx4K0ypmHuCnd8BapfyOwWwosNCYhedetQey1awddtfmEX0MmdxctGl956uwUmjwXR5VSS5xJcGX9DvdIog== +babel-jest@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.0.1.tgz#450139ce4b6c17174b136425bda91885c397bc46" + integrity sha512-Z4GGmSNQ8pX3WS1O+6v3fo41YItJJZsVxG5gIQ+HuB/iuAQBJxMTHTwz292vuYws1LnHfwSRgoqI+nxdy/pcvw== dependencies: - "@jest/transform" "^25.4.0" - "@jest/types" "^25.4.0" + "@jest/transform" "^26.0.1" + "@jest/types" "^26.0.1" "@types/babel__core" "^7.1.7" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^25.4.0" - chalk "^3.0.0" + babel-preset-jest "^26.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" slash "^3.0.0" babel-plugin-dynamic-import-node@^2.3.0: @@ -1740,11 +1768,13 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.4.0.tgz#0c122c1b93fb76f52d2465be2e8069e798e9d442" - integrity sha512-M3a10JCtTyKevb0MjuH6tU+cP/NVQZ82QPADqI1RQYY1OphztsCeIeQmTsHmF/NS6m0E51Zl4QNsI3odXSQF5w== +babel-plugin-jest-hoist@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.0.0.tgz#fd1d35f95cf8849fc65cb01b5e58aedd710b34a8" + integrity sha512-+AuoehOrjt9irZL7DOt2+4ZaTM6dlu1s5TTS46JBa0/qem4dy7VNW3tMb96qeEqcIh20LD73TVNtmVEeymTG7w== dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" "@types/babel__traverse" "^7.0.6" babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: @@ -1835,12 +1865,12 @@ babel-preset-fbjs@^3.3.0: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.4.0.tgz#10037cc32b751b994b260964629e49dc479abf4c" - integrity sha512-PwFiEWflHdu3JCeTr0Pb9NcHHE34qWFnPQRVPvqQITx4CsDCzs6o05923I10XvLvn9nNsRHuiVgB72wG/90ZHQ== +babel-preset-jest@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.0.0.tgz#1eac82f513ad36c4db2e9263d7c485c825b1faa6" + integrity sha512-9ce+DatAa31DpR4Uir8g4Ahxs5K4W4L8refzt+qHWQANb6LhGcAEfIFgLUwk67oya2cCUd6t4eUMtO/z64ocNw== dependencies: - babel-plugin-jest-hoist "^25.4.0" + babel-plugin-jest-hoist "^26.0.0" babel-preset-current-node-syntax "^0.1.2" babylon@^6.15.0: @@ -1933,17 +1963,10 @@ braces@^3.0.1: dependencies: fill-range "^7.0.1" -browser-process-hrtime@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" - integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" +browser-process-hrtime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" + integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== bser@^2.0.0: version "2.0.0" @@ -2046,6 +2069,11 @@ camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.0.0.tgz#5259f7c30e35e278f1bdc2a4d91230b37cad981e" + integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w== + capture-exit@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" @@ -2095,6 +2123,19 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" + integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -2433,7 +2474,7 @@ cross-spawn@^7.0.0: shebang-command "^2.0.0" which "^2.0.1" -cssom@^0.4.1: +cssom@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== @@ -2443,10 +2484,10 @@ cssom@~0.3.6: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -cssstyle@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992" - integrity sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA== +cssstyle@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== dependencies: cssom "~0.3.6" @@ -2462,14 +2503,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== +data-urls@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" + integrity sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ== dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" + abab "^2.0.3" + whatwg-mimetype "^2.3.0" + whatwg-url "^8.0.0" dayjs@^1.8.15: version "1.8.15" @@ -2509,6 +2550,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decimal.js@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.0.tgz#39466113a9e036111d02f82489b5fd6b0b5ed231" + integrity sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw== + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -2632,10 +2678,10 @@ detox@15.4.4: yargs "^13.0.0" yargs-parser "^13.0.0" -diff-sequences@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" - integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== +diff-sequences@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.0.0.tgz#0760059a5c287637b842bd7085311db7060e88a6" + integrity sha512-JC/eHYEC3aSS0vZGjuoc4vHA0yAQTzhQQldXMeMF+JlxLGJlCO38Gma82NV9gk1jGFz8mDzUMeaKXvjRRdJ2dg== doctrine@^2.1.0: version "2.1.0" @@ -2644,12 +2690,12 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== +domexception@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" + integrity sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg== dependencies: - webidl-conversions "^4.0.2" + webidl-conversions "^5.0.0" dtrace-provider@~0.8: version "0.8.7" @@ -2762,7 +2808,12 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.11.1: +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457" integrity sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ== @@ -3043,10 +3094,10 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^3.2.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" - integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== +execa@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf" + integrity sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA== dependencies: cross-spawn "^7.0.0" get-stream "^5.0.0" @@ -3055,7 +3106,6 @@ execa@^3.2.0: merge-stream "^2.0.0" npm-run-path "^4.0.0" onetime "^5.1.0" - p-finally "^2.0.0" signal-exit "^3.0.2" strip-final-newline "^2.0.0" @@ -3077,17 +3127,17 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-25.4.0.tgz#0b16c17401906d1679d173e59f0d4580b22f8dc8" - integrity sha512-7BDIX99BTi12/sNGJXA9KMRcby4iAmu1xccBOhyKCyEhjcVKS3hPmHdA/4nSI9QGIOkUropKqr3vv7WMDM5lvQ== +expect@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.0.1.tgz#18697b9611a7e2725e20ba3ceadda49bc9865421" + integrity sha512-QcCy4nygHeqmbw564YxNbHTJlXh47dVID2BUP52cZFpLU9zHViMFK6h07cC1wf7GYCTIigTdAXhVua8Yl1FkKg== dependencies: - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" ansi-styles "^4.0.0" - jest-get-type "^25.2.6" - jest-matcher-utils "^25.4.0" - jest-message-util "^25.4.0" - jest-regex-util "^25.2.6" + jest-get-type "^26.0.0" + jest-matcher-utils "^26.0.1" + jest-message-util "^26.0.1" + jest-regex-util "^26.0.0" extend-shallow@^1.1.2: version "1.1.4" @@ -3542,11 +3592,16 @@ graceful-fs@^4.1.15: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== -graceful-fs@^4.2.0, graceful-fs@^4.2.3: +graceful-fs@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== +graceful-fs@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + "graphql@^14.0.0 | ^15.0.0-rc.1": version "15.0.0-rc.2" resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.0.0-rc.2.tgz#6549e52e5415ac08900c432b22d34500c0c3635f" @@ -3658,12 +3713,12 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== +html-encoding-sniffer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3" + integrity sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ== dependencies: - whatwg-encoding "^1.0.1" + whatwg-encoding "^1.0.5" html-escaper@^2.0.0: version "2.0.0" @@ -3954,6 +4009,11 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-potential-custom-element-name@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" + integrity sha1-DFLlS8yjkbssSUsh6GJtczbG45c= + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -4087,114 +4147,113 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.4.0.tgz#e573db32c2fd47d2b90357ea2eda0622c5c5cbd6" - integrity sha512-VR/rfJsEs4BVMkwOTuStRyS630fidFVekdw/lBaBQjx9KK3VZFOZ2c0fsom2fRp8pMCrCTP6LGna00o/DXGlqA== +jest-changed-files@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.0.1.tgz#1334630c6a1ad75784120f39c3aa9278e59f349f" + integrity sha512-q8LP9Sint17HaE2LjxQXL+oYWW/WeeXMPE2+Op9X3mY8IEGFVc14xRxFjUuXUbcPAlDLhtWdIEt59GdQbn76Hw== dependencies: - "@jest/types" "^25.4.0" - execa "^3.2.0" + "@jest/types" "^26.0.1" + execa "^4.0.0" throat "^5.0.0" -jest-cli@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.4.0.tgz#5dac8be0fece6ce39f0d671395a61d1357322bab" - integrity sha512-usyrj1lzCJZMRN1r3QEdnn8e6E6yCx/QN7+B1sLoA68V7f3WlsxSSQfy0+BAwRiF4Hz2eHauf11GZG3PIfWTXQ== +jest-cli@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.0.1.tgz#3a42399a4cbc96a519b99ad069a117d955570cac" + integrity sha512-pFLfSOBcbG9iOZWaMK4Een+tTxi/Wcm34geqZEqrst9cZDkTQ1LZ2CnBrTlHWuYAiTMFr0EQeK52ScyFU8wK+w== dependencies: - "@jest/core" "^25.4.0" - "@jest/test-result" "^25.4.0" - "@jest/types" "^25.4.0" - chalk "^3.0.0" + "@jest/core" "^26.0.1" + "@jest/test-result" "^26.0.1" + "@jest/types" "^26.0.1" + chalk "^4.0.0" exit "^0.1.2" + graceful-fs "^4.2.4" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^25.4.0" - jest-util "^25.4.0" - jest-validate "^25.4.0" + jest-config "^26.0.1" + jest-util "^26.0.1" + jest-validate "^26.0.1" prompts "^2.0.1" - realpath-native "^2.0.0" yargs "^15.3.1" -jest-config@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.4.0.tgz#56e5df3679a96ff132114b44fb147389c8c0a774" - integrity sha512-egT9aKYxMyMSQV1aqTgam0SkI5/I2P9qrKexN5r2uuM2+68ypnc+zPGmfUxK7p1UhE7dYH9SLBS7yb+TtmT1AA== +jest-config@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.0.1.tgz#096a3d4150afadf719d1fab00e9a6fb2d6d67507" + integrity sha512-9mWKx2L1LFgOXlDsC4YSeavnblN6A4CPfXFiobq+YYLaBMymA/SczN7xYTSmLaEYHZOcB98UdoN4m5uNt6tztg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^25.4.0" - "@jest/types" "^25.4.0" - babel-jest "^25.4.0" - chalk "^3.0.0" + "@jest/test-sequencer" "^26.0.1" + "@jest/types" "^26.0.1" + babel-jest "^26.0.1" + chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" - jest-environment-jsdom "^25.4.0" - jest-environment-node "^25.4.0" - jest-get-type "^25.2.6" - jest-jasmine2 "^25.4.0" - jest-regex-util "^25.2.6" - jest-resolve "^25.4.0" - jest-util "^25.4.0" - jest-validate "^25.4.0" + graceful-fs "^4.2.4" + jest-environment-jsdom "^26.0.1" + jest-environment-node "^26.0.1" + jest-get-type "^26.0.0" + jest-jasmine2 "^26.0.1" + jest-regex-util "^26.0.0" + jest-resolve "^26.0.1" + jest-util "^26.0.1" + jest-validate "^26.0.1" micromatch "^4.0.2" - pretty-format "^25.4.0" - realpath-native "^2.0.0" + pretty-format "^26.0.1" -jest-diff@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634" - integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug== +jest-diff@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.0.1.tgz#c44ab3cdd5977d466de69c46929e0e57f89aa1de" + integrity sha512-odTcHyl5X+U+QsczJmOjWw5tPvww+y9Yim5xzqxVl/R1j4z71+fHW4g8qu1ugMmKdFdxw+AtQgs5mupPnzcIBQ== dependencies: - chalk "^3.0.0" - diff-sequences "^25.2.6" - jest-get-type "^25.2.6" - pretty-format "^25.4.0" + chalk "^4.0.0" + diff-sequences "^26.0.0" + jest-get-type "^26.0.0" + pretty-format "^26.0.1" jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== -jest-docblock@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.3.0.tgz#8b777a27e3477cd77a168c05290c471a575623ef" - integrity sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg== +jest-docblock@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" + integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== dependencies: detect-newline "^3.0.0" -jest-each@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.4.0.tgz#ad4e46164764e8e77058f169a0076a7f86f6b7d4" - integrity sha512-lwRIJ8/vQU/6vq3nnSSUw1Y3nz5tkYSFIywGCZpUBd6WcRgpn8NmJoQICojbpZmsJOJNHm0BKdyuJ6Xdx+eDQQ== - dependencies: - "@jest/types" "^25.4.0" - chalk "^3.0.0" - jest-get-type "^25.2.6" - jest-util "^25.4.0" - pretty-format "^25.4.0" - -jest-environment-jsdom@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.4.0.tgz#bbfc7f85bb6ade99089062a830c79cb454565cf0" - integrity sha512-KTitVGMDrn2+pt7aZ8/yUTuS333w3pWt1Mf88vMntw7ZSBNDkRS6/4XLbFpWXYfWfp1FjcjQTOKzbK20oIehWQ== - dependencies: - "@jest/environment" "^25.4.0" - "@jest/fake-timers" "^25.4.0" - "@jest/types" "^25.4.0" - jest-mock "^25.4.0" - jest-util "^25.4.0" - jsdom "^15.2.1" - -jest-environment-node@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.4.0.tgz#188aef01ae6418e001c03fdd1c299961e1439082" - integrity sha512-wryZ18vsxEAKFH7Z74zi/y/SyI1j6UkVZ6QsllBuT/bWlahNfQjLNwFsgh/5u7O957dYFoXj4yfma4n4X6kU9A== - dependencies: - "@jest/environment" "^25.4.0" - "@jest/fake-timers" "^25.4.0" - "@jest/types" "^25.4.0" - jest-mock "^25.4.0" - jest-util "^25.4.0" - semver "^6.3.0" +jest-each@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.0.1.tgz#633083061619302fc90dd8f58350f9d77d67be04" + integrity sha512-OTgJlwXCAR8NIWaXFL5DBbeS4QIYPuNASkzSwMCJO+ywo9BEa6TqkaSWsfR7VdbMLdgYJqSfQcIyjJCNwl5n4Q== + dependencies: + "@jest/types" "^26.0.1" + chalk "^4.0.0" + jest-get-type "^26.0.0" + jest-util "^26.0.1" + pretty-format "^26.0.1" + +jest-environment-jsdom@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.0.1.tgz#217690852e5bdd7c846a4e3b50c8ffd441dfd249" + integrity sha512-u88NJa3aptz2Xix2pFhihRBAatwZHWwSiRLBDBQE1cdJvDjPvv7ZGA0NQBxWwDDn7D0g1uHqxM8aGgfA9Bx49g== + dependencies: + "@jest/environment" "^26.0.1" + "@jest/fake-timers" "^26.0.1" + "@jest/types" "^26.0.1" + jest-mock "^26.0.1" + jest-util "^26.0.1" + jsdom "^16.2.2" + +jest-environment-node@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.0.1.tgz#584a9ff623124ff6eeb49e0131b5f7612b310b13" + integrity sha512-4FRBWcSn5yVo0KtNav7+5NH5Z/tEgDLp7VRQVS5tCouWORxj+nI+1tOLutM07Zb2Qi7ja+HEDoOUkjBSWZg/IQ== + dependencies: + "@jest/environment" "^26.0.1" + "@jest/fake-timers" "^26.0.1" + "@jest/types" "^26.0.1" + jest-mock "^26.0.1" + jest-util "^26.0.1" jest-get-type@^24.3.0: version "24.3.0" @@ -4206,10 +4265,10 @@ jest-get-type@^24.9.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== -jest-get-type@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" - integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== +jest-get-type@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.0.0.tgz#381e986a718998dbfafcd5ec05934be538db4039" + integrity sha512-zRc1OAPnnws1EVfykXOj19zo2EMw5Hi6HLbFCSjpuJiXtOWAYIjNsHVSbpQ8bDX7L5BGYGI8m+HmKdjHYFF0kg== jest-haste-map@^24.7.1: version "24.8.1" @@ -4230,18 +4289,19 @@ jest-haste-map@^24.7.1: optionalDependencies: fsevents "^1.2.7" -jest-haste-map@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.4.0.tgz#da7c309dd7071e0a80c953ba10a0ec397efb1ae2" - integrity sha512-5EoCe1gXfGC7jmXbKzqxESrgRcaO3SzWXGCnvp9BcT0CFMyrB1Q6LIsjl9RmvmJGQgW297TCfrdgiy574Rl9HQ== +jest-haste-map@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.0.1.tgz#40dcc03c43ac94d25b8618075804d09cd5d49de7" + integrity sha512-J9kBl/EdjmDsvyv7CiyKY5+DsTvVOScenprz/fGqfLg/pm1gdjbwwQ98nW0t+OIt+f+5nAVaElvn/6wP5KO7KA== dependencies: - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" + "@types/graceful-fs" "^4.1.2" anymatch "^3.0.3" fb-watchman "^2.0.0" - graceful-fs "^4.2.3" - jest-serializer "^25.2.6" - jest-util "^25.4.0" - jest-worker "^25.4.0" + graceful-fs "^4.2.4" + jest-serializer "^26.0.0" + jest-util "^26.0.1" + jest-worker "^26.0.0" micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" @@ -4249,27 +4309,27 @@ jest-haste-map@^25.4.0: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.4.0.tgz#3d3d19514022e2326e836c2b66d68b4cb63c5861" - integrity sha512-QccxnozujVKYNEhMQ1vREiz859fPN/XklOzfQjm2j9IGytAkUbSwjFRBtQbHaNZ88cItMpw02JnHGsIdfdpwxQ== +jest-jasmine2@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.0.1.tgz#947c40ee816636ba23112af3206d6fa7b23c1c1c" + integrity sha512-ILaRyiWxiXOJ+RWTKupzQWwnPaeXPIoLS5uW41h18varJzd9/7I0QJGqg69fhTT1ev9JpSSo9QtalriUN0oqOg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^25.4.0" - "@jest/source-map" "^25.2.6" - "@jest/test-result" "^25.4.0" - "@jest/types" "^25.4.0" - chalk "^3.0.0" + "@jest/environment" "^26.0.1" + "@jest/source-map" "^26.0.0" + "@jest/test-result" "^26.0.1" + "@jest/types" "^26.0.1" + chalk "^4.0.0" co "^4.6.0" - expect "^25.4.0" + expect "^26.0.1" is-generator-fn "^2.0.0" - jest-each "^25.4.0" - jest-matcher-utils "^25.4.0" - jest-message-util "^25.4.0" - jest-runtime "^25.4.0" - jest-snapshot "^25.4.0" - jest-util "^25.4.0" - pretty-format "^25.4.0" + jest-each "^26.0.1" + jest-matcher-utils "^26.0.1" + jest-message-util "^26.0.1" + jest-runtime "^26.0.1" + jest-snapshot "^26.0.1" + jest-util "^26.0.1" + pretty-format "^26.0.1" throat "^5.0.0" jest-junit@^10.0.0: @@ -4283,23 +4343,23 @@ jest-junit@^10.0.0: uuid "^3.3.3" xml "^1.0.1" -jest-leak-detector@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.4.0.tgz#cf94a160c78e53d810e7b2f40b5fd7ee263375b3" - integrity sha512-7Y6Bqfv2xWsB+7w44dvZuLs5SQ//fzhETgOGG7Gq3TTGFdYvAgXGwV8z159RFZ6fXiCPm/szQ90CyfVos9JIFQ== +jest-leak-detector@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.0.1.tgz#79b19ab3f41170e0a78eb8fa754a116d3447fb8c" + integrity sha512-93FR8tJhaYIWrWsbmVN1pQ9ZNlbgRpfvrnw5LmgLRX0ckOJ8ut/I35CL7awi2ecq6Ca4lL59bEK9hr7nqoHWPA== dependencies: - jest-get-type "^25.2.6" - pretty-format "^25.4.0" + jest-get-type "^26.0.0" + pretty-format "^26.0.1" -jest-matcher-utils@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.4.0.tgz#dc3e7aec402a1e567ed80b572b9ad285878895e6" - integrity sha512-yPMdtj7YDgXhnGbc66bowk8AkQ0YwClbbwk3Kzhn5GVDrciiCr27U4NJRbrqXbTdtxjImONITg2LiRIw650k5A== +jest-matcher-utils@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.0.1.tgz#12e1fc386fe4f14678f4cc8dbd5ba75a58092911" + integrity sha512-PUMlsLth0Azen8Q2WFTwnSkGh2JZ8FYuwijC8NR47vXKpsrKmA1wWvgcj1CquuVfcYiDEdj985u5Wmg7COEARw== dependencies: - chalk "^3.0.0" - jest-diff "^25.4.0" - jest-get-type "^25.2.6" - pretty-format "^25.4.0" + chalk "^4.0.0" + jest-diff "^26.0.1" + jest-get-type "^26.0.0" + pretty-format "^26.0.1" jest-message-util@^24.8.0: version "24.8.0" @@ -4315,18 +4375,19 @@ jest-message-util@^24.8.0: slash "^2.0.0" stack-utils "^1.0.1" -jest-message-util@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.4.0.tgz#2899e8bc43f5317acf8dfdfe89ea237d354fcdab" - integrity sha512-LYY9hRcVGgMeMwmdfh9tTjeux1OjZHMusq/E5f3tJN+dAoVVkJtq5ZUEPIcB7bpxDUt2zjUsrwg0EGgPQ+OhXQ== +jest-message-util@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.0.1.tgz#07af1b42fc450b4cc8e90e4c9cef11b33ce9b0ac" + integrity sha512-CbK8uQREZ8umUfo8+zgIfEt+W7HAHjQCoRaNs4WxKGhAYBGwEyvxuK81FXa7VeB9pwDEXeeKOB2qcsNVCAvB7Q== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" "@types/stack-utils" "^1.0.1" - chalk "^3.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" micromatch "^4.0.2" slash "^3.0.0" - stack-utils "^1.0.1" + stack-utils "^2.0.2" jest-mock@^24.8.0: version "24.8.0" @@ -4335,98 +4396,99 @@ jest-mock@^24.8.0: dependencies: "@jest/types" "^24.8.0" -jest-mock@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.4.0.tgz#ded7d64b5328d81d78d2138c825d3a45e30ec8ca" - integrity sha512-MdazSfcYAUjJjuVTTnusLPzE0pE4VXpOUzWdj8sbM+q6abUjm3bATVPXFqTXrxSieR8ocpvQ9v/QaQCftioQFg== +jest-mock@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.0.1.tgz#7fd1517ed4955397cf1620a771dc2d61fad8fd40" + integrity sha512-MpYTBqycuPYSY6xKJognV7Ja46/TeRbAZept987Zp+tuJvMN0YBWyyhG9mXyYQaU3SBI0TUlSaO5L3p49agw7Q== dependencies: - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" jest-pnp-resolver@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" - integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== +jest-regex-util@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" + integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== -jest-resolve-dependencies@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.4.0.tgz#783937544cfc40afcc7c569aa54748c4b3f83f5a" - integrity sha512-A0eoZXx6kLiuG1Ui7wITQPl04HwjLErKIJTt8GR3c7UoDAtzW84JtCrgrJ6Tkw6c6MwHEyAaLk7dEPml5pf48A== +jest-resolve-dependencies@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.0.1.tgz#607ba7ccc32151d185a477cff45bf33bce417f0b" + integrity sha512-9d5/RS/ft0vB/qy7jct/qAhzJsr6fRQJyGAFigK3XD4hf9kIbEH5gks4t4Z7kyMRhowU6HWm/o8ILqhaHdSqLw== dependencies: - "@jest/types" "^25.4.0" - jest-regex-util "^25.2.6" - jest-snapshot "^25.4.0" + "@jest/types" "^26.0.1" + jest-regex-util "^26.0.0" + jest-snapshot "^26.0.1" -jest-resolve@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.4.0.tgz#6f4540ce0d419c4c720e791e871da32ba4da7a60" - integrity sha512-wOsKqVDFWUiv8BtLMCC6uAJ/pHZkfFgoBTgPtmYlsprAjkxrr2U++ZnB3l5ykBMd2O24lXvf30SMAjJIW6k2aA== +jest-resolve@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.0.1.tgz#21d1ee06f9ea270a343a8893051aeed940cde736" + integrity sha512-6jWxk0IKZkPIVTvq6s72RH735P8f9eCJW3IM5CX/SJFeKq1p2cZx0U49wf/SdMlhaB/anann5J2nCJj6HrbezQ== dependencies: - "@jest/types" "^25.4.0" - browser-resolve "^1.11.3" - chalk "^3.0.0" + "@jest/types" "^26.0.1" + chalk "^4.0.0" + graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.1" + jest-util "^26.0.1" read-pkg-up "^7.0.1" - realpath-native "^2.0.0" - resolve "^1.15.1" + resolve "^1.17.0" slash "^3.0.0" -jest-runner@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.4.0.tgz#6ca4a3d52e692bbc081228fa68f750012f1f29e5" - integrity sha512-wWQSbVgj2e/1chFdMRKZdvlmA6p1IPujhpLT7TKNtCSl1B0PGBGvJjCaiBal/twaU2yfk8VKezHWexM8IliBfA== +jest-runner@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.0.1.tgz#ea03584b7ae4bacfb7e533d680a575a49ae35d50" + integrity sha512-CApm0g81b49Znm4cZekYQK67zY7kkB4umOlI2Dx5CwKAzdgw75EN+ozBHRvxBzwo1ZLYZ07TFxkaPm+1t4d8jA== dependencies: - "@jest/console" "^25.4.0" - "@jest/environment" "^25.4.0" - "@jest/test-result" "^25.4.0" - "@jest/types" "^25.4.0" - chalk "^3.0.0" + "@jest/console" "^26.0.1" + "@jest/environment" "^26.0.1" + "@jest/test-result" "^26.0.1" + "@jest/types" "^26.0.1" + chalk "^4.0.0" exit "^0.1.2" - graceful-fs "^4.2.3" - jest-config "^25.4.0" - jest-docblock "^25.3.0" - jest-haste-map "^25.4.0" - jest-jasmine2 "^25.4.0" - jest-leak-detector "^25.4.0" - jest-message-util "^25.4.0" - jest-resolve "^25.4.0" - jest-runtime "^25.4.0" - jest-util "^25.4.0" - jest-worker "^25.4.0" + graceful-fs "^4.2.4" + jest-config "^26.0.1" + jest-docblock "^26.0.0" + jest-haste-map "^26.0.1" + jest-jasmine2 "^26.0.1" + jest-leak-detector "^26.0.1" + jest-message-util "^26.0.1" + jest-resolve "^26.0.1" + jest-runtime "^26.0.1" + jest-util "^26.0.1" + jest-worker "^26.0.0" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.4.0.tgz#1e5227a9e2159d26ae27dcd426ca6bc041983439" - integrity sha512-lgNJlCDULtXu9FumnwCyWlOub8iytijwsPNa30BKrSNtgoT6NUMXOPrZvsH06U6v0wgD/Igwz13nKA2wEKU2VA== - dependencies: - "@jest/console" "^25.4.0" - "@jest/environment" "^25.4.0" - "@jest/source-map" "^25.2.6" - "@jest/test-result" "^25.4.0" - "@jest/transform" "^25.4.0" - "@jest/types" "^25.4.0" +jest-runtime@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.0.1.tgz#a121a6321235987d294168e282d52b364d7d3f89" + integrity sha512-Ci2QhYFmANg5qaXWf78T2Pfo6GtmIBn2rRaLnklRyEucmPccmCKvS9JPljcmtVamsdMmkyNkVFb9pBTD6si9Lw== + dependencies: + "@jest/console" "^26.0.1" + "@jest/environment" "^26.0.1" + "@jest/fake-timers" "^26.0.1" + "@jest/globals" "^26.0.1" + "@jest/source-map" "^26.0.0" + "@jest/test-result" "^26.0.1" + "@jest/transform" "^26.0.1" + "@jest/types" "^26.0.1" "@types/yargs" "^15.0.0" - chalk "^3.0.0" + chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" - graceful-fs "^4.2.3" - jest-config "^25.4.0" - jest-haste-map "^25.4.0" - jest-message-util "^25.4.0" - jest-mock "^25.4.0" - jest-regex-util "^25.2.6" - jest-resolve "^25.4.0" - jest-snapshot "^25.4.0" - jest-util "^25.4.0" - jest-validate "^25.4.0" - realpath-native "^2.0.0" + graceful-fs "^4.2.4" + jest-config "^26.0.1" + jest-haste-map "^26.0.1" + jest-message-util "^26.0.1" + jest-mock "^26.0.1" + jest-regex-util "^26.0.0" + jest-resolve "^26.0.1" + jest-snapshot "^26.0.1" + jest-util "^26.0.1" + jest-validate "^26.0.1" slash "^3.0.0" strip-bom "^4.0.0" yargs "^15.3.1" @@ -4436,30 +4498,33 @@ jest-serializer@^24.4.0: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== -jest-serializer@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.2.6.tgz#3bb4cc14fe0d8358489dbbefbb8a4e708ce039b7" - integrity sha512-RMVCfZsezQS2Ww4kB5HJTMaMJ0asmC0BHlnobQC6yEtxiFKIxohFA4QSXSabKwSggaNkqxn6Z2VwdFCjhUWuiQ== +jest-serializer@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.0.0.tgz#f6c521ddb976943b93e662c0d4d79245abec72a3" + integrity sha512-sQGXLdEGWFAE4wIJ2ZaIDb+ikETlUirEOBsLXdoBbeLhTHkZUJwgk3+M8eyFizhM6le43PDCCKPA1hzkSDo4cQ== + dependencies: + graceful-fs "^4.2.4" -jest-snapshot@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.4.0.tgz#e0b26375e2101413fd2ccb4278a5711b1922545c" - integrity sha512-J4CJ0X2SaGheYRZdLz9CRHn9jUknVmlks4UBeu270hPAvdsauFXOhx9SQP2JtRzhnR3cvro/9N9KP83/uvFfRg== +jest-snapshot@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.0.1.tgz#1baa942bd83d47b837a84af7fcf5fd4a236da399" + integrity sha512-jxd+cF7+LL+a80qh6TAnTLUZHyQoWwEHSUFJjkw35u3Gx+BZUNuXhYvDqHXr62UQPnWo2P6fvQlLjsU93UKyxA== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^25.4.0" - "@types/prettier" "^1.19.0" - chalk "^3.0.0" - expect "^25.4.0" - jest-diff "^25.4.0" - jest-get-type "^25.2.6" - jest-matcher-utils "^25.4.0" - jest-message-util "^25.4.0" - jest-resolve "^25.4.0" + "@jest/types" "^26.0.1" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.0.1" + graceful-fs "^4.2.4" + jest-diff "^26.0.1" + jest-get-type "^26.0.0" + jest-matcher-utils "^26.0.1" + jest-message-util "^26.0.1" + jest-resolve "^26.0.1" make-dir "^3.0.0" natural-compare "^1.4.0" - pretty-format "^25.4.0" - semver "^6.3.0" + pretty-format "^26.0.1" + semver "^7.3.2" jest-util@^24.8.0: version "24.8.0" @@ -4479,13 +4544,14 @@ jest-util@^24.8.0: slash "^2.0.0" source-map "^0.6.0" -jest-util@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.4.0.tgz#6a093d09d86d2b41ef583e5fe7dd3976346e1acd" - integrity sha512-WSZD59sBtAUjLv1hMeKbNZXmMcrLRWcYqpO8Dz8b4CeCTZpfNQw2q9uwrYAD+BbJoLJlu4ezVPwtAmM/9/SlZA== +jest-util@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.0.1.tgz#72c4c51177b695fdd795ca072a6f94e3d7cef00a" + integrity sha512-byQ3n7ad1BO/WyFkYvlWQHTsomB6GIewBh8tlGtusiylAlaxQ1UpS0XYH0ngOyhZuHVLN79Qvl6/pMiDMSSG1g== dependencies: - "@jest/types" "^25.4.0" - chalk "^3.0.0" + "@jest/types" "^26.0.1" + chalk "^4.0.0" + graceful-fs "^4.2.4" is-ci "^2.0.0" make-dir "^3.0.0" @@ -4513,29 +4579,29 @@ jest-validate@^24.9.0: leven "^3.1.0" pretty-format "^24.9.0" -jest-validate@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.4.0.tgz#2e177a93b716a137110eaf2768f3d9095abd3f38" - integrity sha512-hvjmes/EFVJSoeP1yOl8qR8mAtMR3ToBkZeXrD/ZS9VxRyWDqQ/E1C5ucMTeSmEOGLipvdlyipiGbHJ+R1MQ0g== +jest-validate@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.0.1.tgz#a62987e1da5b7f724130f904725e22f4e5b2e23c" + integrity sha512-u0xRc+rbmov/VqXnX3DlkxD74rHI/CfS5xaV2VpeaVySjbb1JioNVOyly5b56q2l9ZKe7bVG5qWmjfctkQb0bA== dependencies: - "@jest/types" "^25.4.0" - camelcase "^5.3.1" - chalk "^3.0.0" - jest-get-type "^25.2.6" + "@jest/types" "^26.0.1" + camelcase "^6.0.0" + chalk "^4.0.0" + jest-get-type "^26.0.0" leven "^3.1.0" - pretty-format "^25.4.0" + pretty-format "^26.0.1" -jest-watcher@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.4.0.tgz#63ec0cd5c83bb9c9d1ac95be7558dd61c995ff05" - integrity sha512-36IUfOSRELsKLB7k25j/wutx0aVuHFN6wO94gPNjQtQqFPa2rkOymmx9rM5EzbF3XBZZ2oqD9xbRVoYa2w86gw== +jest-watcher@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.0.1.tgz#5b5e3ebbdf10c240e22a98af66d645631afda770" + integrity sha512-pdZPydsS8475f89kGswaNsN3rhP6lnC3/QDCppP7bg1L9JQz7oU9Mb/5xPETk1RHDCWeqmVC47M4K5RR7ejxFw== dependencies: - "@jest/test-result" "^25.4.0" - "@jest/types" "^25.4.0" + "@jest/test-result" "^26.0.1" + "@jest/types" "^26.0.1" ansi-escapes "^4.2.1" - chalk "^3.0.0" - jest-util "^25.4.0" - string-length "^3.1.0" + chalk "^4.0.0" + jest-util "^26.0.1" + string-length "^4.0.1" jest-worker@^24.6.0: version "24.6.0" @@ -4545,22 +4611,22 @@ jest-worker@^24.6.0: merge-stream "^1.0.1" supports-color "^6.1.0" -jest-worker@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.4.0.tgz#ee0e2ceee5a36ecddf5172d6d7e0ab00df157384" - integrity sha512-ghAs/1FtfYpMmYQ0AHqxV62XPvKdUDIBBApMZfly+E9JEmYh2K45G0R5dWxx986RN12pRCxsViwQVtGl+N4whw== +jest-worker@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.0.0.tgz#4920c7714f0a96c6412464718d0c58a3df3fb066" + integrity sha512-pPaYa2+JnwmiZjK9x7p9BoZht+47ecFCDFA/CJxspHzeDvQcfVBLWzCiWyo+EGrSiQMWZtCFo9iSvMZnAAo8vw== dependencies: merge-stream "^2.0.0" supports-color "^7.0.0" -jest@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-25.4.0.tgz#fb96892c5c4e4a6b9bcb12068849cddf4c5f8cc7" - integrity sha512-XWipOheGB4wai5JfCYXd6vwsWNwM/dirjRoZgAa7H2wd8ODWbli2AiKjqG8AYhyx+8+5FBEdpO92VhGlBydzbw== +jest@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.0.1.tgz#5c51a2e58dff7525b65f169721767173bf832694" + integrity sha512-29Q54kn5Bm7ZGKIuH2JRmnKl85YRigp0o0asTc6Sb6l2ch1DCXIeZTLLFy9ultJvhkTqbswF5DEx4+RlkmCxWg== dependencies: - "@jest/core" "^25.4.0" + "@jest/core" "^26.0.1" import-local "^3.0.2" - jest-cli "^25.4.0" + jest-cli "^26.0.1" jetifier@^1.6.2: version "1.6.4" @@ -4628,36 +4694,36 @@ jscodeshift@^0.9.0: temp "^0.8.1" write-file-atomic "^2.3.0" -jsdom@^15.2.1: - version "15.2.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5" - integrity sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g== - dependencies: - abab "^2.0.0" - acorn "^7.1.0" - acorn-globals "^4.3.2" - array-equal "^1.0.0" - cssom "^0.4.1" - cssstyle "^2.0.0" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.1" - html-encoding-sniffer "^1.0.2" +jsdom@^16.2.2: + version "16.2.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.2.2.tgz#76f2f7541646beb46a938f5dc476b88705bedf2b" + integrity sha512-pDFQbcYtKBHxRaP55zGXCJWgFHkDAYbKcsXEK/3Icu9nKYZkutUXfLBwbD+09XDutkYSHcgfQLZ0qvpAAm9mvg== + dependencies: + abab "^2.0.3" + acorn "^7.1.1" + acorn-globals "^6.0.0" + cssom "^0.4.4" + cssstyle "^2.2.0" + data-urls "^2.0.0" + decimal.js "^10.2.0" + domexception "^2.0.1" + escodegen "^1.14.1" + html-encoding-sniffer "^2.0.1" + is-potential-custom-element-name "^1.0.0" nwsapi "^2.2.0" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.7" - saxes "^3.1.9" - symbol-tree "^3.2.2" + parse5 "5.1.1" + request "^2.88.2" + request-promise-native "^1.0.8" + saxes "^5.0.0" + symbol-tree "^3.2.4" tough-cookie "^3.0.1" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" + w3c-hr-time "^1.0.2" + w3c-xmlserializer "^2.0.0" + webidl-conversions "^6.0.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^7.0.0" + whatwg-url "^8.0.0" + ws "^7.2.3" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -4882,13 +4948,6 @@ logkitty@^0.6.0: dayjs "^1.8.15" yargs "^12.0.5" -lolex@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" - integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== - dependencies: - "@sinonjs/commons" "^1.7.0" - loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -5531,16 +5590,17 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" - integrity sha512-SVfQ/wMw+DesunOm5cKqr6yDcvUTDl/yc97ybGHMrteNEY6oekXpNpS3lZwgLlwz0FLgHoiW28ZpmBHUDg37cw== +node-notifier@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-7.0.0.tgz#513bc42f2aa3a49fce1980a7ff375957c71f718a" + integrity sha512-y8ThJESxsHcak81PGpzWwQKxzk+5YtP3IxR8AYdpXQ1IB6FmcVzFdZXrkPin49F/DKUCfeeiziB8ptY9npzGuA== dependencies: growly "^1.3.0" is-wsl "^2.1.1" - semver "^6.3.0" + semver "^7.2.1" shellwords "^0.1.1" - which "^1.3.1" + uuid "^7.0.3" + which "^2.0.2" node-pre-gyp@^0.10.0: version "0.10.3" @@ -5843,11 +5903,6 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-finally@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" - integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== - p-is-promise@^1.1.0: version "1.1.0" resolved "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" @@ -5904,10 +5959,10 @@ parse-json@^5.0.0: json-parse-better-errors "^1.0.1" lines-and-columns "^1.1.6" -parse5@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== +parse5@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" + integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== parseurl@~1.3.2: version "1.3.2" @@ -6034,11 +6089,6 @@ pluralize@^7.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -6084,12 +6134,12 @@ pretty-format@^25.2.0: ansi-styles "^4.0.0" react-is "^16.12.0" -pretty-format@^25.4.0: - version "25.4.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830" - integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ== +pretty-format@^26.0.1: + version "26.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.0.1.tgz#a4fe54fe428ad2fd3413ca6bbd1ec8c2e277e197" + integrity sha512-SWxz6MbupT3ZSlL0Po4WF/KujhQaVehijR2blyRDCzk9e45EaYMVhMBn49fnRuHxtkSpXTes1GxNpVmH86Bxfw== dependencies: - "@jest/types" "^25.4.0" + "@jest/types" "^26.0.1" ansi-regex "^5.0.0" ansi-styles "^4.0.0" react-is "^16.12.0" @@ -6293,11 +6343,6 @@ readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" -realpath-native@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" - integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== - recast@^0.18.1: version "0.18.7" resolved "https://registry.yarnpkg.com/recast/-/recast-0.18.7.tgz#56338a6d803c8c3b9113344440dc70d13c8a1ef7" @@ -6411,7 +6456,7 @@ request-promise-core@1.1.3: dependencies: lodash "^4.17.15" -request-promise-native@^1.0.7: +request-promise-native@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== @@ -6446,7 +6491,7 @@ request@^2.85.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -request@^2.88.0: +request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -6522,12 +6567,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.15.1, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: version "1.15.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== @@ -6541,6 +6581,13 @@ resolve@^1.12.0: dependencies: path-parse "^1.0.6" +resolve@^1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -6672,12 +6719,12 @@ sax@^1.2.1, sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -saxes@^3.1.9: - version "3.1.11" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b" - integrity sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g== +saxes@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" + integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== dependencies: - xmlchars "^2.1.1" + xmlchars "^2.2.0" scheduler@0.19.1, scheduler@^0.19.1: version "0.19.1" @@ -6702,6 +6749,11 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.2.1, semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + send@0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" @@ -7016,6 +7068,13 @@ stack-utils@^1.0.1: resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" integrity sha1-1PM6tU6OOHeLDKXP07OvsS22hiA= +stack-utils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.2.tgz#5cf48b4557becb4638d0bc4f21d23f5d19586593" + integrity sha512-0H7QK2ECz3fyZMzQ8rH0j2ykpfbnd20BFtfg/SqVC2+sCTtcw0aDTGB7dk+de4U4uUeuz6nOtJcrkFFLG1B0Rg== + dependencies: + escape-string-regexp "^2.0.0" + stacktrace-parser@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.4.tgz#01397922e5f62ecf30845522c95c4fe1d25e7d4e" @@ -7054,13 +7113,13 @@ stream-buffers@~2.2.0: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ= -string-length@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" - integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== +string-length@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" + integrity sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw== dependencies: - astral-regex "^1.0.0" - strip-ansi "^5.2.0" + char-regex "^1.0.2" + strip-ansi "^6.0.0" string-width@^1.0.1: version "1.0.2" @@ -7214,10 +7273,10 @@ symbol-observable@1.0.1: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" integrity sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ= -symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^4.0.3: version "4.0.3" @@ -7409,12 +7468,12 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= +tr46@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479" + integrity sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg== dependencies: - punycode "^2.1.0" + punycode "^2.1.1" truncate-utf8-bytes@^1.0.0: version "1.0.2" @@ -7595,6 +7654,11 @@ uuid@^3.3.3: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" + integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== + v8-to-istanbul@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz#22fe35709a64955f49a08a7c7c959f6520ad6f20" @@ -7636,20 +7700,18 @@ vlq@^1.0.0: resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== -w3c-hr-time@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" - integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= +w3c-hr-time@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" + integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== dependencies: - browser-process-hrtime "^0.1.2" + browser-process-hrtime "^1.0.0" -w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== +w3c-xmlserializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a" + integrity sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA== dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" xml-name-validator "^3.0.0" walker@^1.0.7, walker@~1.0.5: @@ -7666,12 +7728,17 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +webidl-conversions@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" + integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5: +webidl-conversions@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" + integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== + +whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== @@ -7683,19 +7750,19 @@ whatwg-fetch@>=0.10.0, whatwg-fetch@^3.0.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== -whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: +whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== +whatwg-url@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.0.0.tgz#37f256cb746398e19b107bd6ef820b4ae2d15871" + integrity sha512-41ou2Dugpij8/LPO5Pq64K5q++MnRCBpEHvQr26/mArEKTkCV5aoXIqyhuYtE0pkqScXwhf2JP57rkRTYM29lQ== dependencies: lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" + tr46 "^2.0.0" + webidl-conversions "^5.0.0" which-module@^2.0.0: version "2.0.0" @@ -7825,10 +7892,10 @@ ws@^7: dependencies: async-limiter "^1.0.0" -ws@^7.0.0: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== +ws@^7.2.3: + version "7.2.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.5.tgz#abb1370d4626a5a9cd79d8de404aa18b3465d10d" + integrity sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA== xcode@^2.0.0: version "2.0.0" @@ -7853,7 +7920,7 @@ xmlbuilder@^9.0.7: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= -xmlchars@^2.1.1: +xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== From 4459c08219dc43849205e14dc35f9fcacf966b84 Mon Sep 17 00:00:00 2001 From: Will Holen Date: Tue, 5 May 2020 12:00:43 -0700 Subject: [PATCH 192/235] Make column match fuzzy Summary: We are currently very strict about breakpoint location matching. This diff allows some fuzz in the column, but not in the line. Changelog: [Internal] Setting Hermes breakpoints no longer requires exact column match Reviewed By: avp Differential Revision: D21343198 fbshipit-source-id: a59786a9d63f9fe1ed576835ed660ba3343affe1 --- .../chrome/tests/ConnectionTests.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp b/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp index 18208192f67009..2f7a4003a4fb29 100644 --- a/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp +++ b/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp @@ -748,6 +748,46 @@ TEST(ConnectionTests, testSetBreakpointById) { expectNotification(conn); } +TEST(ConnectionTests, testSetBreakpointByIdWithColumnInIndenting) { + TestContext context; + AsyncHermesRuntime &asyncRuntime = context.runtime(); + SyncConnection &conn = context.conn(); + int msgId = 1; + + asyncRuntime.executeScriptAsync(R"( + debugger; // line 1 + Math.random(); // 2 + )"); + + send(conn, ++msgId); + expectExecutionContextCreated(conn); + auto script = expectNotification(conn); + + expectPaused(conn, "other", {{"global", 1, 1}}); + + m::debugger::SetBreakpointRequest req; + req.id = ++msgId; + req.location.scriptId = script.scriptId; + req.location.lineNumber = 2; + // Specify a column location *before* rather than *on* the actual location + req.location.columnNumber = 0; + + conn.send(req.toJson()); + auto resp = expectResponse(conn, req.id); + EXPECT_EQ(resp.actualLocation.scriptId, script.scriptId); + EXPECT_EQ(resp.actualLocation.lineNumber, 2); + // Check that we resolved the column to the first available location + EXPECT_EQ(resp.actualLocation.columnNumber.value(), 4); + + send(conn, ++msgId); + expectNotification(conn); + + expectPaused(conn, "other", {{"global", 2, 1}}); + + send(conn, ++msgId); + expectNotification(conn); +} + TEST(ConnectionTests, testSetLazyBreakpoint) { TestContext context; AsyncHermesRuntime &asyncRuntime = context.runtime(); From de7f69a58ed4e18887f4b9d4d853293fb136afb7 Mon Sep 17 00:00:00 2001 From: Mats Byrkjeland Date: Tue, 5 May 2020 12:42:16 -0700 Subject: [PATCH 193/235] Fix type of exported Touchables: ComponentType -> AbstractComponent (#28737) Summary: Fixes https://github.com/facebook/react-native/issues/28726 When importing TouchableOpacity, it is treated as any by Flow. Replacing ComponentType with AbstractComponent works. The [Flow documentation](https://flow.org/en/docs/react/types/#toc-react-componenttype) says the following about ComponentType: > Note: In 0.89.0+, React.ComponentType is an alias for React.AbstractComponent, which represents a component with config type Config and any instance type. So I'm thinking that since the instance type is treated as any with ComponentType, Flow treats TouchableOpacity as any as well. ## Changelog [General] [Fixed] - Fix Touchable{Opacity,Bounce,Highlight} being exported as `any` (Flow) Pull Request resolved: https://github.com/facebook/react-native/pull/28737 Test Plan: I have done the same changes to react-native in my project's node_modules and seen that the components TouchableOpacity went from any to AbstractComponent with some props. Now I have a bunch of errors because I'm sending in wrong props to some touchables, which is good! Reviewed By: cpojer Differential Revision: D21362601 Pulled By: TheSavior fbshipit-source-id: 5b98cc79eaef034eccdb7f47242f9f44be2ef2b8 --- Libraries/Components/Touchable/TouchableBounce.js | 2 +- Libraries/Components/Touchable/TouchableHighlight.js | 2 +- Libraries/Components/Touchable/TouchableOpacity.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index c47129dd392aa0..b03aaf1e364639 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -214,4 +214,4 @@ class TouchableBounce extends React.Component { module.exports = (React.forwardRef((props, hostRef) => ( -)): React.ComponentType<$ReadOnly<$Diff>>); +)): React.AbstractComponent<$ReadOnly<$Diff>>); diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index a29159e9f585f2..7eaa510c0327ca 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -380,4 +380,4 @@ class TouchableHighlight extends React.Component { module.exports = (React.forwardRef((props, hostRef) => ( -)): React.ComponentType<$ReadOnly<$Diff>>); +)): React.AbstractComponent<$ReadOnly<$Diff>>); diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index aa5239fddafe88..ae27775ba72fd9 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -299,4 +299,4 @@ class TouchableOpacity extends React.Component { module.exports = (React.forwardRef((props, hostRef) => ( -)): React.ComponentType<$ReadOnly<$Diff>>); +)): React.AbstractComponent<$ReadOnly<$Diff>>); From e8060ae10382b59c4ebe41f8414bc081dd8cbbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Tue, 5 May 2020 15:58:52 -0700 Subject: [PATCH 194/235] Import folly and adjust whitespace to match old codegen Summary: Import folly to handle optionals (`folly::Optional<__type__>`) Sort modules and indent generated code to match output from the old codegen. While not strictly necessary as these are generated files that should not be edited by hand, I found that matching the old codegen in this regard made it less of a chore when it came to comparing the output of both codebases. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D21395231 fbshipit-source-id: 289d617d7a2d93724456c80afea57a49c108cb9b --- .../modules/GenerateModuleHObjCpp.js | 37 ++- .../generators/modules/GenerateModuleMm.js | 39 +-- .../GenerateModuleHObjCpp-test.js.snap | 191 +++++++------ .../GenerateModuleMm-test.js.snap | 251 ++++++++++-------- 4 files changed, 296 insertions(+), 222 deletions(-) diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js index 87e9367bae09dd..474927f779940e 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleHObjCpp.js @@ -24,14 +24,15 @@ const { type FilesOutput = Map; -const moduleTemplate = ` -class JSI_EXPORT Native::_MODULE_NAME_::SpecJSI : public ObjCTurboModule { -public: - Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms); -};`; +const moduleTemplate = ` /** + * ObjC++ class for module '::_MODULE_NAME_::' + */ + class JSI_EXPORT Native::_MODULE_NAME_::SpecJSI : public ObjCTurboModule { + public: + Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms); + };`; -const protocolTemplate = ` -::_STRUCTS_:: +const protocolTemplate = `::_STRUCTS_:: @protocol Native::_MODULE_NAME_::Spec ::_MODULE_PROPERTIES_:: @@ -53,30 +54,36 @@ const template = ` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * ${'@'}generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import + +#import ::_PROTOCOLS_:: namespace facebook { -namespace react { + namespace react { ::_MODULES_:: - -} // namespace react + } // namespace react } // namespace facebook `; @@ -184,6 +191,7 @@ module.exports = { moduleSpecName: string, ): FilesOutput { const nativeModules = Object.keys(schema.modules) + .sort() .map(moduleName => { const modules = schema.modules[moduleName].nativeModules; if (modules == null) { @@ -200,6 +208,7 @@ module.exports = { .join('\n'); const protocols = Object.keys(nativeModules) + .sort() .map(name => { const objectForGeneratingStructs: Array = []; const {properties} = nativeModules[name]; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js index a0807282399c0f..448541cd995e96 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleMm.js @@ -18,38 +18,38 @@ const {flatObjects} = require('./ObjCppUtils/Utils'); type FilesOutput = Map; const propertyHeaderTemplate = - 'static facebook::jsi::Value __hostFunction_Native::_MODULE_NAME_::SpecJSI_::_PROPERTY_NAME_::(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {'; + ' static facebook::jsi::Value __hostFunction_Native::_MODULE_NAME_::SpecJSI_::_PROPERTY_NAME_::(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {'; const propertyCastTemplate = `static_cast(turboModule) .invokeObjCMethod(rt, ::_KIND_::, "::_PROPERTY_NAME_::", @selector(::_PROPERTY_NAME_::::_ARGS_::), args, count);`; const propertyTemplate = ` ${propertyHeaderTemplate} - return ${propertyCastTemplate} -}`.trim(); + return ${propertyCastTemplate} + }`; -const proprertyDefTemplate = - ' methodMap_["::_PROPERTY_NAME_::"] = MethodMetadata {::_ARGS_COUNT_::, __hostFunction_Native::_MODULE_NAME_::SpecJSI_::_PROPERTY_NAME_::};'; +const propertyDefTemplate = + ' methodMap_["::_PROPERTY_NAME_::"] = MethodMetadata {::_ARGS_COUNT_::, __hostFunction_Native::_MODULE_NAME_::SpecJSI_::_PROPERTY_NAME_::};'; const moduleTemplate = ` -::_TURBOMODULE_METHOD_INVOKERS_:: + ::_TURBOMODULE_METHOD_INVOKERS_:: -Native::_MODULE_NAME_::SpecJSI::Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { -::_PROPERTIES_MAP_::::_CONVERSION_SELECTORS_:: -}`.trim(); + Native::_MODULE_NAME_::SpecJSI::Native::_MODULE_NAME_::SpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + ::_PROPERTIES_MAP_::::_CONVERSION_SELECTORS_:: + }`.trim(); const getterTemplate = ` - @implementation RCTCxxConvert (Native::_MODULE_NAME_::_Spec::_GETTER_NAME_::) +@implementation RCTCxxConvert (Native::_MODULE_NAME_::_Spec::_GETTER_NAME_::) + (RCTManagedPointer *)JS_Native::_MODULE_NAME_::_Spec::_GETTER_NAME_:::(id)json { return facebook::react::managedPointer(json); } @end -`.trim(); +`; const argConvertionTemplate = - '\n setMethodArgConversionSelector(@"::_ARG_NAME_::", ::_ARG_NUMBER_::, @"JS_Native::_MODULE_NAME_::_Spec::_SELECTOR_NAME_:::");'; + '\n setMethodArgConversionSelector(@"::_ARG_NAME_::", ::_ARG_NUMBER_::, @"JS_Native::_MODULE_NAME_::_Spec::_SELECTOR_NAME_:::");'; const template = ` /** @@ -57,17 +57,18 @@ const template = ` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * ${'@'}generated by codegen project: GenerateModuleMm.js */ #include <::_INCLUDE_::> +#import + ::_GETTERS_:: namespace facebook { -namespace react { - + namespace react { ::_MODULES_:: - - -} // namespace react + } // namespace react } // namespace facebook `; @@ -242,7 +243,7 @@ module.exports = { returnTypeAnnotation.properties && returnTypeAnnotation.properties.length === 0 ? '' - : proprertyDefTemplate + : propertyDefTemplate .replace(/::_PROPERTY_NAME_::/g, propertyName) .replace(/::_ARGS_COUNT_::/g, params.length.toString()), ) diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index 948c86afc4f0e8..3a9fa5676a0f62 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -8,23 +8,29 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import +#import @@ -154,14 +160,15 @@ inline NSString *JS::NativeSampleTurboModule::SpecDifficultAE::F() const namespace facebook { -namespace react { - -class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -} // namespace react + namespace react { + /** + * ObjC++ class for module 'SampleTurboModule' + */ + class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react } // namespace facebook ", } @@ -175,23 +182,29 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import +#import @@ -203,14 +216,15 @@ Map { namespace facebook { -namespace react { - -class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -} // namespace react + namespace react { + /** + * ObjC++ class for module 'SampleTurboModule' + */ + class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react } // namespace facebook ", } @@ -224,23 +238,29 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import +#import @@ -310,14 +330,15 @@ inline JS::NativeSampleTurboModule::Constants::Builder::Builder(Constants i) : _ namespace facebook { -namespace react { - -class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -} // namespace react + namespace react { + /** + * ObjC++ class for module 'SampleTurboModule' + */ + class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react } // namespace facebook ", } @@ -331,29 +352,36 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import +#import -@protocol NativeSampleTurboModuleSpec +@protocol NativeSample2TurboModuleSpec + - (void) voidFunc; @end @@ -361,27 +389,28 @@ Map { - -@protocol NativeSample2TurboModuleSpec - +@protocol NativeSampleTurboModuleSpec - (void) voidFunc; @end namespace facebook { -namespace react { - -class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -} // namespace react + namespace react { + /** + * ObjC++ class for module 'SampleTurboModule' + */ + class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + /** + * ObjC++ class for module 'Sample2TurboModule' + */ + class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react } // namespace facebook ", } @@ -395,29 +424,35 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleHObjCpp.js */ -// NOTE: This entire file should be codegen'ed. +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif #import #import -#import +#import -#import #import +#import #import + +#import #import #import -#import +#import -@protocol NativeSampleTurboModuleSpec +@protocol NativeSample2TurboModuleSpec - (void) voidFunc; @end @@ -425,26 +460,28 @@ Map { - -@protocol NativeSample2TurboModuleSpec +@protocol NativeSampleTurboModuleSpec - (void) voidFunc; @end namespace facebook { -namespace react { - -class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { -public: - NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); -}; - -} // namespace react + namespace react { + /** + * ObjC++ class for module 'SampleTurboModule' + */ + class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + /** + * ObjC++ class for module 'Sample2TurboModule' + */ + class JSI_EXPORT NativeSample2TurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react } // namespace facebook ", } diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap index 7b9ffc955e1b8d..bfa9d42b6cc132 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap @@ -8,43 +8,51 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleMm.js */ #include +#import + + @implementation RCTCxxConvert (NativeSampleTurboModule_SpecDifficultReturnType) + (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecDifficultReturnType:(id)json { return facebook::react::managedPointer(json); } @end + + @implementation RCTCxxConvert (NativeSampleTurboModule_SpecDifficultA) + (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecDifficultA:(id)json { return facebook::react::managedPointer(json); } @end + + @implementation RCTCxxConvert (NativeSampleTurboModule_SpecDifficultAE) + (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecDifficultAE:(id)json { return facebook::react::managedPointer(json); } @end + namespace facebook { -namespace react { + namespace react { -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_difficult(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_difficult(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, ObjectKind, \\"difficult\\", @selector(difficult:), args, count); -} - -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - methodMap_[\\"difficult\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_difficult}; - setMethodArgConversionSelector(@\\"difficult\\", 0, @\\"JS_NativeSampleTurboModule_SpecDifficultA:\\"); -} - - -} // namespace react + } + + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + methodMap_[\\"difficult\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_difficult}; + setMethodArgConversionSelector(@\\"difficult\\", 0, @\\"JS_NativeSampleTurboModule_SpecDifficultA:\\"); + } + } // namespace react } // namespace facebook ", } @@ -58,22 +66,23 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleMm.js */ #include - -namespace facebook { -namespace react { - +#import -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - -} +namespace facebook { + namespace react { -} // namespace react + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + + } + } // namespace react } // namespace facebook ", } @@ -87,75 +96,87 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleMm.js */ #include +#import + namespace facebook { -namespace react { + namespace react { -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, ObjectKind, \\"getConstants\\", @selector(getConstants), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getBool(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getBool(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, BooleanKind, \\"getBool\\", @selector(getBool:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, NumberKind, \\"getNumber\\", @selector(getNumber:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getString(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getString(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, StringKind, \\"getString\\", @selector(getString:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getArray(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getArray(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, ArrayKind, \\"getArray\\", @selector(getArray:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getObject(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getObject(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, ObjectKind, \\"getObject\\", @selector(getObject:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, NumberKind, \\"getRootTag\\", @selector(getRootTag:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) - .invokeObjCMethod(rt, ObjectKind, \\"getValue\\", @selector(getValue:y:z:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) - .invokeObjCMethod(rt, VoidKind, \\"getValueWithCallback\\", @selector(getValueWithCallback:), args, count); -} -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithPromise(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) - .invokeObjCMethod(rt, PromiseKind, \\"getValueWithPromise\\", @selector(getValueWithPromise:resolve:reject:), args, count); -} + } -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_getConstants}; - methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; - methodMap_[\\"getBool\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getBool}; - methodMap_[\\"getNumber\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getNumber}; - methodMap_[\\"getString\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getString}; - methodMap_[\\"getArray\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getArray}; - methodMap_[\\"getObject\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getObject}; - methodMap_[\\"getRootTag\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag}; - methodMap_[\\"getValue\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleSpecJSI_getValue}; - methodMap_[\\"getValueWithCallback\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback}; - methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithPromise}; -} + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValue(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, ObjectKind, \\"getValue\\", @selector(getValue:y:z:), args, count); + } + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, VoidKind, \\"getValueWithCallback\\", @selector(getValueWithCallback:), args, count); + } -} // namespace react + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithPromise(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, PromiseKind, \\"getValueWithPromise\\", @selector(getValueWithPromise:resolve:reject:), args, count); + } + + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + methodMap_[\\"getConstants\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_getConstants}; + methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; + methodMap_[\\"getBool\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getBool}; + methodMap_[\\"getNumber\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getNumber}; + methodMap_[\\"getString\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getString}; + methodMap_[\\"getArray\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getArray}; + methodMap_[\\"getObject\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getObject}; + methodMap_[\\"getRootTag\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getRootTag}; + methodMap_[\\"getValue\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleSpecJSI_getValue}; + methodMap_[\\"getValueWithCallback\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithCallback}; + methodMap_[\\"getValueWithPromise\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_getValueWithPromise}; + } + } // namespace react } // namespace facebook ", } @@ -169,37 +190,40 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleMm.js */ #include +#import -namespace facebook { -namespace react { -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) - .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); -} - -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; -} +namespace facebook { + namespace react { -static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); -} + } -NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; -} + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; + } -} // namespace react + static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); + } + + NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + + methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; + } + } // namespace react } // namespace facebook ", } @@ -213,35 +237,38 @@ Map { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleMm.js */ #include +#import -namespace facebook { -namespace react { -static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) - .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); -} +namespace facebook { + namespace react { -NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; -} -static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule) + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); -} + } -NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; -} + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSampleTurboModuleSpecJSI_voidFunc}; + } + static facebook::jsi::Value __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, VoidKind, \\"voidFunc\\", @selector(voidFunc), args, count); + } -} // namespace react + NativeSample2TurboModuleSpecJSI::NativeSample2TurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) + : ObjCTurboModule(params) { + methodMap_[\\"voidFunc\\"] = MethodMetadata {0, __hostFunction_NativeSample2TurboModuleSpecJSI_voidFunc}; + } + } // namespace react } // namespace facebook ", } From edfd965c4654333edc55688b673a968fad2ddfc2 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Tue, 5 May 2020 19:34:43 -0700 Subject: [PATCH 195/235] Update native module specs Summary: As titled. Reviewed By: fkgozali Differential Revision: D21417307 fbshipit-source-id: 7c6b0179f9f1a5108da241d181a24f707a083deb --- .../FBReactNativeSpec-generated.mm | 6 ++--- .../FBReactNativeSpec/FBReactNativeSpec.h | 26 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm index fec8d3b70b9ba9..1eb1960df40305 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm @@ -737,10 +737,10 @@ + (RCTManagedPointer *)JS_NativeCameraRollManager_GetPhotosParams:(id)json } // namespace react } // namespace facebook -@implementation RCTCxxConvert (NativeCameraRollManager_PhotoIdentifierNodeImage) -+ (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifierNodeImage:(id)json +@implementation RCTCxxConvert (NativeCameraRollManager_PhotoIdentifierImage) ++ (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifierImage:(id)json { - return facebook::react::managedPointer(json); + return facebook::react::managedPointer(json); } @end @implementation RCTCxxConvert (NativeCameraRollManager_PhotoIdentifierNodeLocation) diff --git a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h index 4323cd25040c21..072e730b0aa638 100644 --- a/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +++ b/Libraries/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h @@ -698,7 +698,7 @@ namespace facebook { namespace JS { namespace NativeCameraRollManager { - struct PhotoIdentifierNodeImage { + struct PhotoIdentifierImage { NSString *uri() const; double playableDuration() const; double width() const; @@ -706,15 +706,15 @@ namespace JS { folly::Optional isStored() const; NSString *filename() const; - PhotoIdentifierNodeImage(NSDictionary *const v) : _v(v) {} + PhotoIdentifierImage(NSDictionary *const v) : _v(v) {} private: NSDictionary *_v; }; } } -@interface RCTCxxConvert (NativeCameraRollManager_PhotoIdentifierNodeImage) -+ (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifierNodeImage:(id)json; +@interface RCTCxxConvert (NativeCameraRollManager_PhotoIdentifierImage) ++ (RCTManagedPointer *)JS_NativeCameraRollManager_PhotoIdentifierImage:(id)json; @end namespace JS { @@ -740,7 +740,7 @@ namespace JS { namespace JS { namespace NativeCameraRollManager { struct PhotoIdentifierNode { - JS::NativeCameraRollManager::PhotoIdentifierNodeImage image() const; + JS::NativeCameraRollManager::PhotoIdentifierImage image() const; NSString *type() const; NSString *group_name() const; double timestamp() const; @@ -3147,32 +3147,32 @@ inline folly::Optional> JS::NativeCamera id const p = _v[@"mimeTypes"]; return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); } -inline NSString *JS::NativeCameraRollManager::PhotoIdentifierNodeImage::uri() const +inline NSString *JS::NativeCameraRollManager::PhotoIdentifierImage::uri() const { id const p = _v[@"uri"]; return RCTBridgingToString(p); } -inline double JS::NativeCameraRollManager::PhotoIdentifierNodeImage::playableDuration() const +inline double JS::NativeCameraRollManager::PhotoIdentifierImage::playableDuration() const { id const p = _v[@"playableDuration"]; return RCTBridgingToDouble(p); } -inline double JS::NativeCameraRollManager::PhotoIdentifierNodeImage::width() const +inline double JS::NativeCameraRollManager::PhotoIdentifierImage::width() const { id const p = _v[@"width"]; return RCTBridgingToDouble(p); } -inline double JS::NativeCameraRollManager::PhotoIdentifierNodeImage::height() const +inline double JS::NativeCameraRollManager::PhotoIdentifierImage::height() const { id const p = _v[@"height"]; return RCTBridgingToDouble(p); } -inline folly::Optional JS::NativeCameraRollManager::PhotoIdentifierNodeImage::isStored() const +inline folly::Optional JS::NativeCameraRollManager::PhotoIdentifierImage::isStored() const { id const p = _v[@"isStored"]; return RCTBridgingToOptionalBool(p); } -inline NSString *JS::NativeCameraRollManager::PhotoIdentifierNodeImage::filename() const +inline NSString *JS::NativeCameraRollManager::PhotoIdentifierImage::filename() const { id const p = _v[@"filename"]; return RCTBridgingToString(p); @@ -3202,10 +3202,10 @@ inline folly::Optional JS::NativeCameraRollManager::PhotoIdentifierNodeL id const p = _v[@"speed"]; return RCTBridgingToOptionalDouble(p); } -inline JS::NativeCameraRollManager::PhotoIdentifierNodeImage JS::NativeCameraRollManager::PhotoIdentifierNode::image() const +inline JS::NativeCameraRollManager::PhotoIdentifierImage JS::NativeCameraRollManager::PhotoIdentifierNode::image() const { id const p = _v[@"image"]; - return JS::NativeCameraRollManager::PhotoIdentifierNodeImage(p); + return JS::NativeCameraRollManager::PhotoIdentifierImage(p); } inline NSString *JS::NativeCameraRollManager::PhotoIdentifierNode::type() const { From 10314fe621e1649654e83df197adf657e0ca8363 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Tue, 5 May 2020 22:24:23 -0700 Subject: [PATCH 196/235] Smoother scrolling in ScrollView, HorizontalScrollView Summary: Android ScrollView/HorizontalScrollView `smoothScrollTo` contains some logic that, if called multiple times in a short amount of time, will treat all calls as part of the same animation and will not lengthen the duration of the animation. This means that, for example, if the user is scrolling rapidly, multiple pages could be considered part of one animation, causing some page animations to be animated very rapidly - looking like they're not animated at all. We use a custom animation to perform `smoothScrollTo` to improve the UX. This resolves a longstanding issue in non-Fabric RN, as well as Fabric, since this code is shared between the platforms. Changelog: [Update] Android ScrollView/HorizontalScrollView scrolls using custom animations instead of default Android `smoothScrollTo` implementation, leading to smoother scrolls for paginated ScrollViews Reviewed By: mdvacca Differential Revision: D21416520 fbshipit-source-id: 6ebe63cb054a98336b6e81253d35623fe5522f89 --- .../scroll/ReactHorizontalScrollView.java | 80 +++++++++++++++++-- .../react/views/scroll/ReactScrollView.java | 78 +++++++++++++++++- .../views/scroll/ReactScrollViewHelper.java | 47 +++++++++++ 3 files changed, 196 insertions(+), 9 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index c905c5dc9a4f37..1b2c5312381c47 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -7,12 +7,17 @@ package com.facebook.react.views.scroll; +import android.animation.Animator; +import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; +import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; +import android.os.Build; import android.view.FocusFinder; import android.view.KeyEvent; import android.view.MotionEvent; @@ -82,6 +87,10 @@ public class ReactHorizontalScrollView extends HorizontalScrollView private int pendingContentOffsetY = UNSET_CONTENT_OFFSET; private @Nullable StateWrapper mStateWrapper; + private @Nullable ValueAnimator mScrollAnimator; + private int mFinalAnimatedPositionScrollX = 0; + private int mFinalAnimatedPositionScrollY = 0; + private final Rect mTempRect = new Rect(); public ReactHorizontalScrollView(Context context) { @@ -648,6 +657,20 @@ public void run() { ReactHorizontalScrollView.this, mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY); } + /** Get current X position or position after current animation finishes, if any. */ + private int getPostAnimationScrollX() { + return mScrollAnimator != null && mScrollAnimator.isRunning() + ? mFinalAnimatedPositionScrollX + : getScrollX(); + } + + /** Get current X position or position after current animation finishes, if any. */ + private int getPostAnimationScrollY() { + return mScrollAnimator != null && mScrollAnimator.isRunning() + ? mFinalAnimatedPositionScrollY + : getScrollY(); + } + private int predictFinalScrollPosition(int velocityX) { // ScrollView can *only* scroll for 250ms when using smoothScrollTo and there's // no way to customize the scroll duration. So, we create a temporary OverScroller @@ -659,8 +682,8 @@ private int predictFinalScrollPosition(int velocityX) { int maximumOffset = Math.max(0, computeHorizontalScrollRange() - getWidth()); int width = getWidth() - ViewCompat.getPaddingStart(this) - ViewCompat.getPaddingEnd(this); scroller.fling( - getScrollX(), // startX - getScrollY(), // startY + getPostAnimationScrollX(), // startX + getPostAnimationScrollY(), // startY velocityX, // velocityX 0, // velocityY 0, // minX @@ -674,13 +697,13 @@ private int predictFinalScrollPosition(int velocityX) { } /** - * This will smooth scroll us to the nearest snap offset point It currently just looks at where + * This will smooth scroll us to the nearest snap offset point. It currently just looks at where * the content is and slides to the nearest point. It is intended to be run after we are done * scrolling, and handling any momentum scrolling. */ private void smoothScrollAndSnap(int velocity) { double interval = (double) getSnapInterval(); - double currentOffset = (double) getScrollX(); + double currentOffset = (double) (getPostAnimationScrollX()); double targetOffset = (double) predictFinalScrollPosition(velocity); int previousPage = (int) Math.floor(currentOffset / interval); @@ -914,7 +937,54 @@ public void setBorderStyle(@Nullable String style) { * scroll view and state. Calling raw `smoothScrollTo` doesn't update state. */ public void reactSmoothScrollTo(int x, int y) { - smoothScrollTo(x, y); + // `smoothScrollTo` contains some logic that, if called multiple times in a short amount of + // time, will treat all calls as part of the same animation and will not lengthen the duration + // of the animation. This means that, for example, if the user is scrolling rapidly, multiple + // pages could be considered part of one animation, causing some page animations to be animated + // very rapidly - looking like they're not animated at all. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + if (mScrollAnimator != null) { + mScrollAnimator.cancel(); + } + + mFinalAnimatedPositionScrollX = x; + mFinalAnimatedPositionScrollY = y; + PropertyValuesHolder scrollX = PropertyValuesHolder.ofInt("scrollX", getScrollX(), x); + PropertyValuesHolder scrollY = PropertyValuesHolder.ofInt("scrollY", getScrollY(), y); + mScrollAnimator = ObjectAnimator.ofPropertyValuesHolder(scrollX, scrollY); + mScrollAnimator.setDuration( + ReactScrollViewHelper.getDefaultScrollAnimationDuration(getContext())); + mScrollAnimator.addUpdateListener( + new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator valueAnimator) { + int scrollValueX = (Integer) valueAnimator.getAnimatedValue("scrollX"); + int scrollValueY = (Integer) valueAnimator.getAnimatedValue("scrollY"); + ReactHorizontalScrollView.this.scrollTo(scrollValueX, scrollValueY); + } + }); + mScrollAnimator.addListener( + new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) {} + + @Override + public void onAnimationEnd(Animator animator) { + mFinalAnimatedPositionScrollX = -1; + mFinalAnimatedPositionScrollY = -1; + mScrollAnimator = null; + } + + @Override + public void onAnimationCancel(Animator animator) {} + + @Override + public void onAnimationRepeat(Animator animator) {} + }); + mScrollAnimator.start(); + } else { + smoothScrollTo(x, y); + } updateStateOnScroll(x, y); setPendingContentOffsets(x, y); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index f0d4e99658553a..7a77b954415cda 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -7,11 +7,16 @@ package com.facebook.react.views.scroll; +import android.animation.Animator; +import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; +import android.animation.ValueAnimator; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; +import android.os.Build; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; @@ -87,6 +92,10 @@ public class ReactScrollView extends ScrollView private int pendingContentOffsetY = UNSET_CONTENT_OFFSET; private @Nullable StateWrapper mStateWrapper; + private @Nullable ValueAnimator mScrollAnimator; + private int mFinalAnimatedPositionScrollX; + private int mFinalAnimatedPositionScrollY; + public ReactScrollView(ReactContext context) { this(context, null); } @@ -536,6 +545,20 @@ public void run() { ReactScrollView.this, mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY); } + /** Get current X position or position after current animation finishes, if any. */ + private int getPostAnimationScrollX() { + return mScrollAnimator != null && mScrollAnimator.isRunning() + ? mFinalAnimatedPositionScrollX + : getScrollX(); + } + + /** Get current X position or position after current animation finishes, if any. */ + private int getPostAnimationScrollY() { + return mScrollAnimator != null && mScrollAnimator.isRunning() + ? mFinalAnimatedPositionScrollY + : getScrollY(); + } + private int predictFinalScrollPosition(int velocityY) { // ScrollView can *only* scroll for 250ms when using smoothScrollTo and there's // no way to customize the scroll duration. So, we create a temporary OverScroller @@ -547,8 +570,8 @@ private int predictFinalScrollPosition(int velocityY) { int maximumOffset = getMaxScrollY(); int height = getHeight() - getPaddingBottom() - getPaddingTop(); scroller.fling( - getScrollX(), // startX - getScrollY(), // startY + getPostAnimationScrollX(), // startX + getPostAnimationScrollY(), // startY 0, // velocityX velocityY, // velocityY 0, // minX @@ -568,7 +591,7 @@ private int predictFinalScrollPosition(int velocityY) { */ private void smoothScrollAndSnap(int velocity) { double interval = (double) getSnapInterval(); - double currentOffset = (double) getScrollY(); + double currentOffset = (double) getPostAnimationScrollY(); double targetOffset = (double) predictFinalScrollPosition(velocity); int previousPage = (int) Math.floor(currentOffset / interval); @@ -785,7 +808,54 @@ public void onChildViewRemoved(View parent, View child) { * scroll view and state. Calling raw `smoothScrollTo` doesn't update state. */ public void reactSmoothScrollTo(int x, int y) { - smoothScrollTo(x, y); + // `smoothScrollTo` contains some logic that, if called multiple times in a short amount of + // time, will treat all calls as part of the same animation and will not lengthen the duration + // of the animation. This means that, for example, if the user is scrolling rapidly, multiple + // pages could be considered part of one animation, causing some page animations to be animated + // very rapidly - looking like they're not animated at all. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + if (mScrollAnimator != null) { + mScrollAnimator.cancel(); + } + + mFinalAnimatedPositionScrollX = x; + mFinalAnimatedPositionScrollY = y; + PropertyValuesHolder scrollX = PropertyValuesHolder.ofInt("scrollX", getScrollX(), x); + PropertyValuesHolder scrollY = PropertyValuesHolder.ofInt("scrollY", getScrollY(), y); + mScrollAnimator = ObjectAnimator.ofPropertyValuesHolder(scrollX, scrollY); + mScrollAnimator.setDuration( + ReactScrollViewHelper.getDefaultScrollAnimationDuration(getContext())); + mScrollAnimator.addUpdateListener( + new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator valueAnimator) { + int scrollValueX = (Integer) valueAnimator.getAnimatedValue("scrollX"); + int scrollValueY = (Integer) valueAnimator.getAnimatedValue("scrollY"); + ReactScrollView.this.scrollTo(scrollValueX, scrollValueY); + } + }); + mScrollAnimator.addListener( + new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) {} + + @Override + public void onAnimationEnd(Animator animator) { + mFinalAnimatedPositionScrollX = -1; + mFinalAnimatedPositionScrollY = -1; + mScrollAnimator = null; + } + + @Override + public void onAnimationCancel(Animator animator) {} + + @Override + public void onAnimationRepeat(Animator animator) {} + }); + mScrollAnimator.start(); + } else { + smoothScrollTo(x, y); + } updateStateOnScroll(x, y); setPendingContentOffsets(x, y); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java index 3f7b829d4eea08..5183f24c44bd80 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.java @@ -7,8 +7,10 @@ package com.facebook.react.views.scroll; +import android.content.Context; import android.view.View; import android.view.ViewGroup; +import android.widget.OverScroller; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.ReactContext; import com.facebook.react.uimanager.UIManagerHelper; @@ -21,6 +23,12 @@ public class ReactScrollViewHelper { public static final String AUTO = "auto"; public static final String OVER_SCROLL_NEVER = "never"; + // If all else fails, this is the hardcoded value in OverScroller.java, in AOSP. + // The default is defined here (as of this diff): + // https://android.googlesource.com/platform/frameworks/base/+/ae5bcf23b5f0875e455790d6af387184dbd009c1/core/java/android/widget/OverScroller.java#44 + private static int SMOOTH_SCROLL_DURATION = 250; + private static boolean mSmoothScrollDurationInitialized = false; + /** Shared by {@link ReactScrollView} and {@link ReactHorizontalScrollView}. */ public static void emitScrollEvent(ViewGroup scrollView, float xVelocity, float yVelocity) { emitScrollEvent(scrollView, ScrollEventType.SCROLL, xVelocity, yVelocity); @@ -83,4 +91,43 @@ public static int parseOverScrollMode(String jsOverScrollMode) { throw new JSApplicationIllegalArgumentException("wrong overScrollMode: " + jsOverScrollMode); } } + + public static int getDefaultScrollAnimationDuration(Context context) { + if (!mSmoothScrollDurationInitialized) { + mSmoothScrollDurationInitialized = true; + + try { + OverScrollerDurationGetter overScrollerDurationGetter = + new OverScrollerDurationGetter(context); + SMOOTH_SCROLL_DURATION = overScrollerDurationGetter.getScrollAnimationDuration(); + } catch (Throwable e) { + } + } + + return SMOOTH_SCROLL_DURATION; + } + + private static class OverScrollerDurationGetter extends OverScroller { + // This is the default in AOSP, hardcoded in OverScroller.java. + private int mScrollAnimationDuration = 250; + + OverScrollerDurationGetter(Context context) { + // We call with a null context because OverScroller does not use the context + // in the execution path we're interested in, unless heavily modified in an AOSP fork. + super(context); + } + + public int getScrollAnimationDuration() { + // If startScroll is called without a duration, OverScroller will call `startScroll(x, y, dx, + // dy, duration)` with the default duration. + super.startScroll(0, 0, 0, 0); + + return mScrollAnimationDuration; + } + + @Override + public void startScroll(int startX, int startY, int dx, int dy, int duration) { + mScrollAnimationDuration = duration; + } + } } From 530dffa342ee56e80cf8aa2d41a195b49c992b91 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Wed, 6 May 2020 04:32:03 -0700 Subject: [PATCH 197/235] Cleanup unused dependencies Reviewed By: kassens Differential Revision: D21281288 fbshipit-source-id: cf566ad0628dc179b3753f2f25a11637c33dee24 --- package.json | 3 +-- yarn.lock | 36 +++++++++--------------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 2bcf52e03b4cba..cb87aa323395bd 100644 --- a/package.json +++ b/package.json @@ -137,9 +137,8 @@ "eslint-plugin-react": "7.12.4", "eslint-plugin-react-hooks": "^3.0.0", "eslint-plugin-react-native": "3.8.1", - "eslint-plugin-relay": "1.7.0", + "eslint-plugin-relay": "1.7.1", "flow-bin": "^0.123.0", - "flow-remove-types": "1.2.3", "jest": "^26.0.1", "jest-junit": "^10.0.0", "jscodeshift": "^0.9.0", diff --git a/yarn.lock b/yarn.lock index adb5e4a32d980e..c8b89201fb3681 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1873,11 +1873,6 @@ babel-preset-jest@^26.0.0: babel-plugin-jest-hoist "^26.0.0" babel-preset-current-node-syntax "^0.1.2" -babylon@^6.15.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -2928,12 +2923,12 @@ eslint-plugin-react@7.12.4: prop-types "^15.6.2" resolve "^1.9.0" -eslint-plugin-relay@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-1.7.0.tgz#f6cfae681381dc96db9bd700d8c33fbe9783143e" - integrity sha512-JmAMQFr9CxXFLo5BppdN/sleofrE1J/cERIgkFqnYdTq0KAeUNGnz3jO41cqcp1y92/D+KJdmEKFsPfnqnDByQ== +eslint-plugin-relay@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-1.7.1.tgz#70f479becb06320e57dd86ebc0d38938cb8a5e6e" + integrity sha512-K7j5BF8raseLfgA97udZMGKEtWan+y5BLrBYlApy952saStF0ghYzU9WElIwoVIkcBO8QP+pT4AOuNFFNRzcUw== dependencies: - graphql "^14.0.0 | ^15.0.0-rc.1" + graphql "^14.0.0 || ^15.0.0-rc.1" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -3364,14 +3359,6 @@ flow-parser@0.*: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.89.0.tgz#c87bf45831644733dd576983ab12e75a3546573b" integrity sha512-vC8YuwhAPE+tbkz49DA/TjtFyfhcqM48occMdRQiZ/HL+Wg97IcuebMZUGVB4oBq7aHw0iJJtnvmlnmOQF7Ydg== -flow-remove-types@1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-1.2.3.tgz#6131aefc7da43364bb8b479758c9dec7735d1a18" - integrity sha512-ypq/U3V+t9atYiOuSJd40tekCra03EHKoRsiK/wXGrsZimuum0kdwVY7Yv0HTaoXgHW1WiayomYd+Q3kkvPl9Q== - dependencies: - babylon "^6.15.0" - vlq "^0.2.1" - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -3602,10 +3589,10 @@ graceful-fs@^4.2.4: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== -"graphql@^14.0.0 | ^15.0.0-rc.1": - version "15.0.0-rc.2" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.0.0-rc.2.tgz#6549e52e5415ac08900c432b22d34500c0c3635f" - integrity sha512-X9ZybETBiZ5zndyXm/Yn3dd0nJqiCNZ7w06lnd0zMiCtBR/KQGgxJmnf47Y/P/Fy7JXM4QDF+MeeoH724yc3DQ== +"graphql@^14.0.0 || ^15.0.0-rc.1": + version "15.0.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.0.0.tgz#042a5eb5e2506a2e2111ce41eb446a8e570b8be9" + integrity sha512-ZyVO1xIF9F+4cxfkdhOJINM+51B06Friuv4M66W7HzUOeFd+vNzUn4vtswYINPi6sysjf1M2Ri/rwZALqgwbaQ== "growl@~> 1.10.0": version "1.10.5" @@ -7690,11 +7677,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vlq@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" - integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== - vlq@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468" From b0d0e51a7724dcefe3ce1c2dfb334a731b2a385c Mon Sep 17 00:00:00 2001 From: Paige Sun Date: Wed, 6 May 2020 10:35:19 -0700 Subject: [PATCH 198/235] iOS: Animated image should animate at the same speed regardless of framerate Summary: In iOS 11, [CADisplayLink](https://developer.apple.com/documentation/quartzcore/cadisplaylink)'s frameInterval was deprecated in favor of preferredFramesPerSecond, but these two properties have different underlying assumptions. - set frameInterval to 2 for 30fps - set preferredFramesPerSecond to 30 for 30fps. When you use preferredFramesPerSecond, assume frameInterval is 1. This fix ensures gifs in component will animate at same speed regardless of framerate. Reviewed By: shergin Differential Revision: D21414014 fbshipit-source-id: 40ab23bab1990cf65d2802830b6835f350999537 --- Libraries/Image/RCTUIImageViewAnimated.m | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Libraries/Image/RCTUIImageViewAnimated.m b/Libraries/Image/RCTUIImageViewAnimated.m index 8402d0e28bb958..c55ece0f82954d 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.m +++ b/Libraries/Image/RCTUIImageViewAnimated.m @@ -181,22 +181,17 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink { #if TARGET_OS_UIKITFORMAC // TODO: `displayLink.frameInterval` is not available on UIKitForMac - NSTimeInterval duration = displayLink.duration; + NSTimeInterval durationToNextRefresh = displayLink.duration; #else - NSTimeInterval duration = displayLink.duration; + // displaylink.duration -- time interval between frames, assuming maximumFramesPerSecond + // displayLink.preferredFramesPerSecond (>= iOS 10) -- Set to 30 for displayDidRefresh to be called at 30 fps + // displayLink.frameInterval (< iOS 10) -- # of frames that must pass before each displayDidRefresh. After iOS 10, when this is set to 2, preferredFramesPerSecond becomes 30 fps. + // durationToNextRefresh -- Time interval to the next time displayDidRefresh is called + NSTimeInterval durationToNextRefresh; if (@available(iOS 10.0, *)) { - // Per https://developer.apple.com/documentation/quartzcore/cadisplaylink - // displayLink.duration provides the amount of time between frames at the maximumFramesPerSecond - // Thus we need to calculate true duration based on preferredFramesPerSecond - if (displayLink.preferredFramesPerSecond != 0) { - double maxFrameRate = 60.0; // default to 60 fps - if (@available(iOS 10.3, tvOS 10.3, *)) { - maxFrameRate = self.window.screen.maximumFramesPerSecond; - } - duration = duration * displayLink.preferredFramesPerSecond / maxFrameRate; - } // else respect maximumFramesPerSecond - } else { // version < (ios 10) - duration = duration * displayLink.frameInterval; + durationToNextRefresh = displayLink.targetTimestamp - displayLink.timestamp; + } else { + durationToNextRefresh = displayLink.duration * displayLink.frameInterval; } #endif NSUInteger totalFrameCount = self.totalFrameCount; @@ -206,13 +201,14 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink // Check if we have the frame buffer firstly to improve performance if (!self.bufferMiss) { // Then check if timestamp is reached - self.currentTime += duration; + self.currentTime += durationToNextRefresh; NSTimeInterval currentDuration = [self.animatedImage animatedImageDurationAtIndex:currentFrameIndex]; if (self.currentTime < currentDuration) { // Current frame timestamp not reached, return return; } self.currentTime -= currentDuration; + // nextDuration - duration to wait before displaying next image NSTimeInterval nextDuration = [self.animatedImage animatedImageDurationAtIndex:nextFrameIndex]; if (self.currentTime > nextDuration) { // Do not skip frame From 5066b662f2f0cc4d43575777a47c77fcc97a979c Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 6 May 2020 11:37:05 -0700 Subject: [PATCH 199/235] LogBox - Always display the first fatal error Summary: This diff fixes an off-by-one error probably caused by my font ligatures where when exactly two exceptions are thrown at the same time we would show the second exception instead of the first. If three or more were thrown, we would show the second. I also fixed some tests that had the wrong descriptions and wrong behavior enforced. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21413186 fbshipit-source-id: 8e2940c89251dc042b10c6a2a2186089b6e7b53d --- Libraries/LogBox/Data/LogBoxData.js | 12 +++++------- .../LogBox/Data/__tests__/LogBoxData-test.js | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Libraries/LogBox/Data/LogBoxData.js b/Libraries/LogBox/Data/LogBoxData.js index 1076d26661f448..9d35132a490f3a 100644 --- a/Libraries/LogBox/Data/LogBoxData.js +++ b/Libraries/LogBox/Data/LogBoxData.js @@ -135,17 +135,15 @@ function handleUpdate(): void { } function appendNewLog(newLog) { - // We don't want to store these logs because they trigger a - // state update whenever we add them to the store, which is - // expensive to noisy logs. If we later want to display these - // we will store them in a different state object. + // Don't want store these logs because they trigger a + // state update when we add them to the store. if (isMessageIgnored(newLog.message.content)) { return; } // If the next log has the same category as the previous one - // then we want to roll it up into the last log in the list - // by incrementing the count (simar to how Chrome does it). + // then roll it up into the last log in the list by incrementing + // the count (similar to how Chrome does it). const lastLog = Array.from(logs).pop(); if (lastLog && lastLog.category === newLog.category) { lastLog.incrementCount(); @@ -161,7 +159,7 @@ function appendNewLog(newLog) { let addPendingLog = () => { logs.add(newLog); - if (_selectedIndex <= 0) { + if (_selectedIndex < 0) { setSelectedLog(logs.size - 1); } else { handleUpdate(); diff --git a/Libraries/LogBox/Data/__tests__/LogBoxData-test.js b/Libraries/LogBox/Data/__tests__/LogBoxData-test.js index bd5e0c99056177..b0dfc3074aa079 100644 --- a/Libraries/LogBox/Data/__tests__/LogBoxData-test.js +++ b/Libraries/LogBox/Data/__tests__/LogBoxData-test.js @@ -275,7 +275,7 @@ describe('LogBoxData', () => { expect(selectedLogIndex()).toBe(-1); }); - it('sets the selectedLogIndex to the last fatal error (after symbolication)', () => { + it('sets the selectedLogIndex to the first fatal error (after symbolication)', () => { addFatalErrors(['A']); // Order maters for symbolication before timeout. @@ -291,10 +291,14 @@ describe('LogBoxData', () => { flushLogs(); jest.runAllTimers(); - expect(selectedLogIndex()).toBe(2); + // This should still be 0 (the first fatal exception) + // becuase it is the most likely source of the error. + // If there are more exceptions after this, they + // are likely caused by this original exception. + expect(selectedLogIndex()).toBe(0); }); - it('sets the selectedLogIndex to the last fatal error (hitting timeout limit)', () => { + it('sets the selectedLogIndex to the first fatal error (hitting timeout limit)', () => { addFatalErrors(['A']); // Order maters for timeout before symbolication. @@ -310,7 +314,11 @@ describe('LogBoxData', () => { jest.runAllTimers(); flushLogs(); - expect(selectedLogIndex()).toBe(2); + // This should still be 0 (the first fatal exception) + // becuase it is the most likely source of the error. + // If there are more exceptions after this, they + // are likely caused by this original exception. + expect(selectedLogIndex()).toBe(0); }); it('sets the selectedLogIndex to the last syntax error', () => { From 41f0d9ba8f46e08e5e01b7834bdb4a58e0c29dcf Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 6 May 2020 11:37:05 -0700 Subject: [PATCH 200/235] Rename error titles Summary: Based on feedback we're updating these titles to be more clear for their source. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21413486 fbshipit-source-id: c144e7f759a4ff263b7ec80fa643eeb8ffac741b --- Libraries/LogBox/UI/LogBoxInspector.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LogBox/UI/LogBoxInspector.js b/Libraries/LogBox/UI/LogBoxInspector.js index 9c2983264b04b7..68c591f11e37de 100644 --- a/Libraries/LogBox/UI/LogBoxInspector.js +++ b/Libraries/LogBox/UI/LogBoxInspector.js @@ -87,11 +87,11 @@ function LogBoxInspector(props: Props): React.Node { } const headerTitleMap = { - warn: 'Warning', - error: 'Error', - fatal: 'Exception', + warn: 'Console Warning', + error: 'Console Error', + fatal: 'Uncaught Error', syntax: 'Syntax Error', - component: 'Component Exception', + component: 'Render Error', }; function LogBoxInspectorBody(props) { From de667fffa4589766b5b4cb3dcf148c7f10267a5d Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Wed, 6 May 2020 12:05:31 -0700 Subject: [PATCH 201/235] Moved some NativeModule JS specs to OSS Summary: For some reason the specs were internal, but the native impl is still in github. So let's move these to github for consistency. Changelog: [Internal] Reviewed By: hramos Differential Revision: D21419934 fbshipit-source-id: f2c4486edca43c4348f3a3c6ce98f76a322bab0b --- .../CameraRoll/NativeCameraRollManager.js | 71 +++++++++++++++++++ Libraries/Image/NativeImageEditor.js | 51 +++++++++++++ Libraries/Image/NativeImageStore.js | 41 +++++++++++ .../NativeTimePickerAndroid.js | 31 ++++++++ 4 files changed, 194 insertions(+) create mode 100644 Libraries/CameraRoll/NativeCameraRollManager.js create mode 100644 Libraries/Image/NativeImageEditor.js create mode 100644 Libraries/Image/NativeImageStore.js create mode 100644 Libraries/TimePickerAndroid/NativeTimePickerAndroid.js diff --git a/Libraries/CameraRoll/NativeCameraRollManager.js b/Libraries/CameraRoll/NativeCameraRollManager.js new file mode 100644 index 00000000000000..8fe058da893e56 --- /dev/null +++ b/Libraries/CameraRoll/NativeCameraRollManager.js @@ -0,0 +1,71 @@ +/** + * (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {TurboModule} from '../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; + +export type PhotoIdentifier = {| + node: {| + image: PhotoIdentifierImage, + type: string, + group_name: string, + timestamp: number, + location: {| + longitude: number, + latitude: number, + + // iOS Only + altitude: ?number, + heading: ?number, + speed: ?number, + |}, + |}, +|}; + +export type PhotoIdentifierImage = {| + uri: string, + playableDuration: number, + width: number, + height: number, + isStored: ?boolean, + filename: ?string, +|}; + +export type PhotoIdentifiersPage = {| + edges: Array, + page_info: {| + has_next_page: boolean, + start_cursor?: ?string, + end_cursor?: ?string, + |}, +|}; + +export type GetPhotosParams = {| + first: number, + after?: ?string, + groupName?: ?string, + groupTypes?: ?string, + assetType?: ?string, + maxSize?: ?number, + mimeTypes?: ?Array, +|}; + +export interface Spec extends TurboModule { + +getConstants: () => {||}; + // eslint-disable-next-line lint/react-native-modules + +getPhotos: (params: GetPhotosParams) => Promise; + +saveToCameraRoll: (uri: string, type: string) => Promise; + + // iOS Only + +deletePhotos: (assets: Array) => Promise; +} + +export default (TurboModuleRegistry.getEnforcing( + 'CameraRollManager', +): Spec); diff --git a/Libraries/Image/NativeImageEditor.js b/Libraries/Image/NativeImageEditor.js new file mode 100644 index 00000000000000..ff334b897771a2 --- /dev/null +++ b/Libraries/Image/NativeImageEditor.js @@ -0,0 +1,51 @@ +/** + * (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {TurboModule} from '../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; + +type Options = {| + +offset: {| + +x: number, + +y: number, + |}, + +size: {| + +width: number, + +height: number, + |}, + +displaySize?: ?{| + +width: number, + +height: number, + |}, + /** + * Enum with potential values: + * - cover + * - contain + * - stretch + * - center + * - repeat + */ + +resizeMode?: ?string, + +allowExternalStorage?: boolean, +|}; + +export interface Spec extends TurboModule { + +getConstants: () => {||}; + +cropImage: ( + uri: string, + // eslint-disable-next-line lint/react-native-modules + cropData: Options, + successCallback: (uri: string) => void, + errorCallback: (error: string) => void, + ) => void; +} + +export default (TurboModuleRegistry.getEnforcing( + 'ImageEditingManager', +): Spec); diff --git a/Libraries/Image/NativeImageStore.js b/Libraries/Image/NativeImageStore.js new file mode 100644 index 00000000000000..196b328f7464e6 --- /dev/null +++ b/Libraries/Image/NativeImageStore.js @@ -0,0 +1,41 @@ +/** + * (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {TurboModule} from '../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; + +export interface Spec extends TurboModule { + +getConstants: () => {||}; + // Common + +getBase64ForTag: ( + uri: string, + successCallback: (base64ImageData: string) => void, + + /** + * On Android, the failure callback is called with a string. + * On iOS, the failure callback is called with an error object. + * + * TODO(T47527939) Unify this inconsistency + */ + errorCallback: (error: {|message: string|} | string) => void, + ) => void; + + // iOS-only + +hasImageForTag: (uri: string, callback: (hasImage: boolean) => void) => void; + +removeImageForTag: (uri: string) => void; + +addImageFromBase64: ( + base64ImageData: string, + successCallback: (uri: string) => void, + errorCallback: (error: {|message: string|}) => void, + ) => void; +} + +export default (TurboModuleRegistry.getEnforcing( + 'ImageStoreManager', +): Spec); diff --git a/Libraries/TimePickerAndroid/NativeTimePickerAndroid.js b/Libraries/TimePickerAndroid/NativeTimePickerAndroid.js new file mode 100644 index 00000000000000..46594ffdc3196e --- /dev/null +++ b/Libraries/TimePickerAndroid/NativeTimePickerAndroid.js @@ -0,0 +1,31 @@ +/** + * (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {TurboModule} from '../TurboModule/RCTExport'; +import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; + +export type TimePickerOptions = {| + hour?: number, + minute?: number, + is24Hour?: boolean, + mode?: string, +|}; + +export type TimePickerResult = {| + action: string, + hour: number, + minute: number, +|}; + +export interface Spec extends TurboModule { + // eslint-disable-next-line lint/react-native-modules + +open: (options: TimePickerOptions) => Promise; +} + +export default (TurboModuleRegistry.get('TimePickerAndroid'): ?Spec); From 0c2c4bf33c1425fe1b64cc7d731a1eff065714e0 Mon Sep 17 00:00:00 2001 From: Nat Mote Date: Wed, 6 May 2020 12:08:20 -0700 Subject: [PATCH 202/235] Deploy Flow v0.124.0 to xplat/js Summary: Changelog: [Internal] allow-large-files Reviewed By: samwgoldman, cpojer Differential Revision: D21413059 fbshipit-source-id: f3d111b40bfb88c182eab022925f7ae2dc47bc6b --- .flowconfig | 2 +- .flowconfig.android | 2 +- package.json | 2 +- template/_flowconfig | 2 +- yarn.lock | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.flowconfig b/.flowconfig index e991466446c86d..9ae50846be92e0 100644 --- a/.flowconfig +++ b/.flowconfig @@ -85,4 +85,4 @@ untyped-import untyped-type-import [version] -^0.123.0 +^0.124.0 diff --git a/.flowconfig.android b/.flowconfig.android index fb3eff119655a2..c3a0e9efa2e727 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -85,4 +85,4 @@ untyped-import untyped-type-import [version] -^0.123.0 +^0.124.0 diff --git a/package.json b/package.json index cb87aa323395bd..7f8caabcfda52c 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "eslint-plugin-react-hooks": "^3.0.0", "eslint-plugin-react-native": "3.8.1", "eslint-plugin-relay": "1.7.1", - "flow-bin": "^0.123.0", + "flow-bin": "^0.124.0", "jest": "^26.0.1", "jest-junit": "^10.0.0", "jscodeshift": "^0.9.0", diff --git a/template/_flowconfig b/template/_flowconfig index 68af1e70c5fb83..d597be9eb185af 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -70,4 +70,4 @@ untyped-import untyped-type-import [version] -^0.123.0 +^0.124.0 diff --git a/yarn.lock b/yarn.lock index c8b89201fb3681..4892523373aa63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3349,10 +3349,10 @@ flat-cache@^1.2.1: rimraf "~2.6.2" write "^0.2.1" -flow-bin@^0.123.0: - version "0.123.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.123.0.tgz#7ba61a0b8775928cf4943ccf78eed2b1b05f7b3a" - integrity sha512-Ylcf8YDIM/KrqtxkPuq+f8O+6sdYA2Nuz5f+sWHlp539DatZz3YMcsO1EiXaf1C11HJgpT/3YGYe7xZ9/UZmvQ== +flow-bin@^0.124.0: + version "0.124.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.124.0.tgz#24b2e55874e1e2041f9247f42473b3db2ef32758" + integrity sha512-KEtDJ7CFUjcuhw6N52FTZshDd1krf1fxpp4APSIrwhVm+IrlcKJ+EMXpeXKM1kKNSZ347dYGh8wEvXQl4pHZEA== flow-parser@0.*: version "0.89.0" From d14b89bd8ad971a7a7cdaa92633a78b7ca1004c5 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Wed, 6 May 2020 14:19:28 -0700 Subject: [PATCH 203/235] RN: Workaround Fabric + Virtual Text Press Bug Summary: Workaround for a bug with Fabric when pressing on virtual text. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: JoshuaGross Differential Revision: D21432793 fbshipit-source-id: fe20eeadd5365707fb71edae7a76d374e26b4c86 --- Libraries/Components/Touchable/Touchable.js | 2 +- Libraries/Pressability/Pressability.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index a55164413f4bba..c9c8532867ec03 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -701,7 +701,7 @@ const TouchableMixin = { globalY: number, ) { //don't do anything UIManager failed to measure node - if (!l && !t && !w && !h && !globalX && !globalY) { + if (!(l > 0 || t > 0 || w > 0 || h > 0 || globalX > 0 || globalY > 0)) { return; } this.state.touchable.positionOnActivate && diff --git a/Libraries/Pressability/Pressability.js b/Libraries/Pressability/Pressability.js index 6a078eda8495cf..284e17392948b1 100644 --- a/Libraries/Pressability/Pressability.js +++ b/Libraries/Pressability/Pressability.js @@ -734,7 +734,16 @@ export default class Pressability { } _measureCallback = (left, top, width, height, pageX, pageY) => { - if (!left && !top && !width && !height && !pageX && !pageY) { + if ( + !( + left > 0 || + top > 0 || + width > 0 || + height > 0 || + pageX > 0 || + pageY > 0 + ) + ) { return; } this._responderRegion = { From fa5b4c9e0cb609594336c6537bbcd53a867dbb32 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 6 May 2020 15:14:02 -0700 Subject: [PATCH 204/235] Fabric: Backward-compatible behaviour of `measureInWindow` and `measure` Summary: Before this change, in case of incorrect measurements, Fabric's implementation of `measure` and `measureInWindow` incorrectly returned negative height and width. Now it returns zeros (as classic React Native does). Fabric: This does not fix `measureLayout` called for virtual nodes. This is not so trivially to fix and it will be done separately. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross, yungsters, mdvacca Differential Revision: D21433239 fbshipit-source-id: fbaf5ee35c690506822c634daac4426542c2cdcf --- ReactCommon/fabric/uimanager/UIManagerBinding.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp index f29a202e4ece99..4c50095e4416a8 100644 --- a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp +++ b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp @@ -535,10 +535,15 @@ jsi::Value UIManagerBinding::get( *shadowNodeFromValue(runtime, arguments[0]), nullptr, {/* .includeTransform = */ true}); - auto frame = layoutMetrics.frame; auto onSuccessFunction = arguments[1].getObject(runtime).getFunction(runtime); + if (layoutMetrics == EmptyLayoutMetrics) { + onSuccessFunction.call(runtime, {0, 0, 0, 0, 0, 0}); + return jsi::Value::undefined(); + } + + auto frame = layoutMetrics.frame; onSuccessFunction.call( runtime, {0, @@ -568,8 +573,13 @@ jsi::Value UIManagerBinding::get( auto onSuccessFunction = arguments[1].getObject(runtime).getFunction(runtime); - auto frame = layoutMetrics.frame; + if (layoutMetrics == EmptyLayoutMetrics) { + onSuccessFunction.call(runtime, {0, 0, 0, 0}); + return jsi::Value::undefined(); + } + + auto frame = layoutMetrics.frame; onSuccessFunction.call( runtime, {jsi::Value{runtime, (double)frame.origin.x}, From 21d7a357f66d277a6168bab009c99932c9a20cd6 Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Wed, 6 May 2020 15:34:12 -0700 Subject: [PATCH 205/235] Upgrade to Yargs 15 Summary: Only breaking changes appear to be dropped Node 6 support: https://github.com/yargs/yargs/blob/master/CHANGELOG.md. Deduplicates quite a few copies of Yargs, yay! Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: motiz88 Differential Revision: D21426137 fbshipit-source-id: b091e29ac2d9464d6ce9a716a99f7ae156a91a01 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f8caabcfda52c..838e7e718f79df 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "shelljs": "^0.7.8", "signedsource": "^1.0.0", "ws": "^6.1.4", - "yargs": "^14.2.0" + "yargs": "^15.3.1" }, "detox": { "test-runner": "jest", From ff0c62504b35ffc753a11aa586779fbc4b2adc4d Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 6 May 2020 16:33:23 -0700 Subject: [PATCH 206/235] Ez Extend logging of Fabric Summary: Quick diff to log of content of UpdateState mount item. This is useful for debugging. Note this will ONLY be logged when the constant FabricUIManager.IS_DEVELOPMENT_ENVIRONMENT is set to true changelog: [Internal][Android] internal log for fabric android Reviewed By: JoshuaGross Differential Revision: D21428345 fbshipit-source-id: d000eb6dbdd39d15935fa2102072790e17372682 --- .../react/fabric/mounting/mountitems/UpdateStateMountItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/UpdateStateMountItem.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/UpdateStateMountItem.java index 2eae18797061a9..4544e8f935e23e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/UpdateStateMountItem.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/UpdateStateMountItem.java @@ -35,7 +35,7 @@ public String toString() { new StringBuilder("UpdateStateMountItem [").append(mReactTag).append("]"); if (IS_DEVELOPMENT_ENVIRONMENT) { - result.append(" state: ").append(mStateWrapper != null ? mStateWrapper : ""); + result.append(" state: ").append(mStateWrapper != null ? mStateWrapper.getState() : ""); } return result.toString(); From 5c48c94f8c0441bc78a007f0ea0c5b2763ff6875 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 6 May 2020 16:33:23 -0700 Subject: [PATCH 207/235] Fix measureLayout function for Virtual Nodes Summary: This diff fixes a NullPointerException thrown when calling measureLayout function on a virtual node. changelog: [Android] Fix measureLayout function for VirtualTexts Reviewed By: JoshuaGross Differential Revision: D21435030 fbshipit-source-id: aba6d81f333464e49d2d769b111842e7ae8ce769 --- .../java/com/facebook/react/uimanager/UIImplementation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java index 8fdf52866ca7c1..0a5d5bb83a1345 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java @@ -805,7 +805,7 @@ private void measureLayoutRelativeToVerifiedAncestor( ReactShadowNode node, ReactShadowNode ancestor, int[] outputBuffer) { int offsetX = 0; int offsetY = 0; - if (node != ancestor) { + if (node != ancestor && !node.isVirtual()) { offsetX = Math.round(node.getLayoutX()); offsetY = Math.round(node.getLayoutY()); ReactShadowNode current = node.getParent(); From ca105f8b069e42a62b7d212e1d94c9fa8123d69a Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Wed, 6 May 2020 16:58:03 -0700 Subject: [PATCH 208/235] Update cocoapods (#28833) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28833 The checked-in RNTester podfile was generated using Cocoapods version 1.9.1. This doesn't match the version currently used in CircleCI, which is 1.8.4. In order to update the offline mirrors and land them without breaking CircleCI, it seems we need to switch back to 1.8.4. This diff updates the podfile back to 1.8.4 and updates the offline mirrors. Reviewed By: fkgozali Differential Revision: D21392989 fbshipit-source-id: b14aa6e2798175534e9416410ba9d6877fb718c0 --- RNTester/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index e5124ddbd7c54e..85013c176d71b7 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -512,4 +512,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5f0be4be03d6934478b9dd621bfbab4383b8c85d -COCOAPODS: 1.9.1 +COCOAPODS: 1.8.4 From d76e03f85a78fb4be30714ea11e96ab1f204a53d Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 6 May 2020 18:25:58 -0700 Subject: [PATCH 209/235] Fabric: Introducing `RunLoopObserver` Summary: `RunLoopObserver` is one of the core interfaces that bridge intrinsically platform-specific functionality to cross-platform React Native core. `RunLoopObserver` allows subscribing for notifications about changes in a run loop life cycle. Primarily it supposed to be used for observing UI (aka main) and JavaScript execution thread/run-loop. Having a `RunLoopObserver` implemented in a platform-specific manner allows building these components in a cross-platform manner: * Sync and async UI event delivery pipeline; * Timing for some animation engine; * Timers (probably additional features are required). Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21341997 fbshipit-source-id: 7ef61fb51f550dd0f2e89c64af657e0f0de029aa --- ReactCommon/utils/RunLoopObserver.cpp | 62 +++++++++++++ ReactCommon/utils/RunLoopObserver.h | 129 ++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 ReactCommon/utils/RunLoopObserver.cpp create mode 100644 ReactCommon/utils/RunLoopObserver.h diff --git a/ReactCommon/utils/RunLoopObserver.cpp b/ReactCommon/utils/RunLoopObserver.cpp new file mode 100644 index 00000000000000..bca81b6664d7b5 --- /dev/null +++ b/ReactCommon/utils/RunLoopObserver.cpp @@ -0,0 +1,62 @@ +/* + * 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. + */ + +#include "RunLoopObserver.h" + +#include + +namespace facebook { +namespace react { + +RunLoopObserver::RunLoopObserver( + Activity activities, + WeakOwner const &owner) noexcept + : activities_(activities), owner_(owner) {} + +void RunLoopObserver::setDelegate(Delegate const *delegate) const noexcept { + // We need these constraints to ensure basic thread-safety. + assert(delegate && "A delegate must not be `nullptr`."); + assert(!delegate_ && "`RunLoopObserver::setDelegate` must be called once."); + delegate_ = delegate; +} + +void RunLoopObserver::enable() const noexcept { + if (enabled_) { + return; + } + enabled_ = true; + + startObserving(); +} + +void RunLoopObserver::disable() const noexcept { + if (!enabled_) { + return; + } + enabled_ = false; + + stopObserving(); +} + +void RunLoopObserver::activityDidChange(Activity activity) const noexcept { + if (!enabled_) { + return; + } + + assert( + !owner_.expired() && + "`owner_` is null. The caller must `lock` the owner and check it for being not null."); + + delegate_->activityDidChange(delegate_, activity); +} + +RunLoopObserver::WeakOwner RunLoopObserver::getOwner() const noexcept { + return owner_; +} + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/utils/RunLoopObserver.h b/ReactCommon/utils/RunLoopObserver.h new file mode 100644 index 00000000000000..5bd7bd7a4c84c8 --- /dev/null +++ b/ReactCommon/utils/RunLoopObserver.h @@ -0,0 +1,129 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/* + * A cross-platform abstraction for observing a run loop life cycle. + */ +class RunLoopObserver { + public: + using Unique = std::unique_ptr; + + /* + * The concept of an owner. + * A run loop observer normally observes a run loop running on a different + * thread. That implies that this other thread (the run loop thread) will call + * methods of this class owned by some other thread. To make it safe, we need + * to ensure that at the moment of the calling the observer still exists. To + * do so, we use an owner object (a weak pointer) that must retain (possibly + * indirectly) the observer. The platform-specific code should convert the + * weak pointer (owner) to a strong one right before calling the observer, + * ensuring the safety of calling; right after the call, the strong pointer + * should be safely released. + * + * Note, in the case when the pointer to the actual owner will be available + * later, only after calling the constructor of the class, the caller can + * create a dummy pointer beforehand and then merge it (using + * `shared_ptr(shared_ptr const &, X *)`) with the actual one (sharing + * the control block). + */ + using Owner = std::shared_ptr; + using WeakOwner = std::weak_ptr; + + /* + * Run loop activity stages which run loop observers can be observe. + */ + enum Activity : int32_t { + None = 0, + BeforeWaiting = 1 << 0, + AfterWaiting = 1 << 1, + }; + + /* + * A delegate interface. + */ + class Delegate { + public: + /* + * Called on every run loop tick at moments corresponding to requested + * activities. + * + * A platform-specific implementation guarantees that the owner pointer + * is retained during this call. + * Will be called on the thread associated with the run loop. + */ + virtual void activityDidChange(Delegate const *delegate, Activity activity) + const noexcept = 0; + + virtual ~Delegate() noexcept = default; + }; + + using Factory = std::function( + Activity activities, + WeakOwner const &owner)>; + + /* + * Constructs a run loop observer. + */ + RunLoopObserver(Activity activities, WeakOwner const &owner) noexcept; + virtual ~RunLoopObserver() noexcept = default; + + /* + * Sets the delegate. + * Must be called just once. + */ + void setDelegate(Delegate const *delegate) const noexcept; + + /* + * Enables or disables run loop observing. + * It can be used to save CPU cycles during periods of time when observing + * is not required. + * A newly constructed run time observer is initially disabled. + */ + void enable() const noexcept; + void disable() const noexcept; + + /* + * Returns true if called on a thread associated with the run loop. + * Must be implemented in subclasses. + */ + virtual bool isOnRunLoopThread() const noexcept = 0; + + /* + * Returns an owner associated with the observer. + * It might be useful to ensure the safety of consequent asynchronous calls. + */ + WeakOwner getOwner() const noexcept; + + protected: + /* + * Must be implemented in subclasses. + */ + virtual void startObserving() const noexcept = 0; + virtual void stopObserving() const noexcept = 0; + + /* + * Called by subclasses to generate a call on a delegate. + */ + void activityDidChange(Activity activity) const noexcept; + + Activity const activities_{}; + WeakOwner const owner_; + mutable Delegate const *delegate_{nullptr}; + mutable std::atomic enabled_{false}; +}; + +} // namespace react +} // namespace facebook From 025b6a74c8bcdb2c71222a370aa6281e342b0862 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 6 May 2020 18:25:58 -0700 Subject: [PATCH 210/235] Fabric: Cross-platform implementation of `SynchronousEventBeat` and `AsynchronousEventBeat` Summary: `SynchronousEventBeat` and `AsynchronousEventBeat` are a cross-platform re-implementation of run loop related parts of `MainRunLoopEventBeat` and `RuntimeEventBeat` (iOS specific classes for now). In the future, they will replace iOS- and Android-specifc event beat classes. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21341996 fbshipit-source-id: 8eda9a5df537cd666b7728e32212a8bb5ddb3ab7 --- .../scheduler/AsynchronousEventBeat.cpp | 55 +++++++++++++++++++ .../fabric/scheduler/AsynchronousEventBeat.h | 41 ++++++++++++++ .../fabric/scheduler/SynchronousEventBeat.cpp | 50 +++++++++++++++++ .../fabric/scheduler/SynchronousEventBeat.h | 44 +++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 ReactCommon/fabric/scheduler/AsynchronousEventBeat.cpp create mode 100644 ReactCommon/fabric/scheduler/AsynchronousEventBeat.h create mode 100644 ReactCommon/fabric/scheduler/SynchronousEventBeat.cpp create mode 100644 ReactCommon/fabric/scheduler/SynchronousEventBeat.h diff --git a/ReactCommon/fabric/scheduler/AsynchronousEventBeat.cpp b/ReactCommon/fabric/scheduler/AsynchronousEventBeat.cpp new file mode 100644 index 00000000000000..2649227d327ffd --- /dev/null +++ b/ReactCommon/fabric/scheduler/AsynchronousEventBeat.cpp @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#include "AsynchronousEventBeat.h" + +namespace facebook { +namespace react { + +AsynchronousEventBeat::AsynchronousEventBeat( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor) + : EventBeat({}), + uiRunLoopObserver_(std::move(uiRunLoopObserver)), + runtimeExecutor_(std::move(runtimeExecutor)) { + uiRunLoopObserver_->setDelegate(this); + uiRunLoopObserver_->enable(); +} + +void AsynchronousEventBeat::activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity activity) const noexcept { + assert(delegate == this); + induce(); +} + +void AsynchronousEventBeat::induce() const { + if (!isRequested_) { + return; + } + + // Here we know that `this` object exists because the caller has a strong + // pointer to `owner`. To ensure the object will exist inside + // `runtimeExecutor_` callback, we need to copy the pointer there. + auto weakOwner = uiRunLoopObserver_->getOwner(); + + runtimeExecutor_([this, weakOwner](jsi::Runtime &runtime) mutable { + auto owner = weakOwner.lock(); + if (!owner) { + return; + } + + if (!isRequested_) { + return; + } + + this->beat(runtime); + }); +} + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/fabric/scheduler/AsynchronousEventBeat.h b/ReactCommon/fabric/scheduler/AsynchronousEventBeat.h new file mode 100644 index 00000000000000..6e95c9b8f7918d --- /dev/null +++ b/ReactCommon/fabric/scheduler/AsynchronousEventBeat.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#include +#include +#include + +namespace facebook { +namespace react { + +/* + * Event beat associated with JavaScript runtime. + * The beat is called on `RuntimeExecutor`'s thread induced by the UI thread + * event loop. + */ +class AsynchronousEventBeat : public EventBeat, + public RunLoopObserver::Delegate { + public: + AsynchronousEventBeat( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor); + + void induce() const override; + +#pragma mark - RunLoopObserver::Delegate + + void activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity activity) const noexcept override; + + private: + RunLoopObserver::Unique uiRunLoopObserver_; + RuntimeExecutor runtimeExecutor_; +}; + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/fabric/scheduler/SynchronousEventBeat.cpp b/ReactCommon/fabric/scheduler/SynchronousEventBeat.cpp new file mode 100644 index 00000000000000..a30552eb51c29e --- /dev/null +++ b/ReactCommon/fabric/scheduler/SynchronousEventBeat.cpp @@ -0,0 +1,50 @@ +/* + * 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. + */ + +#import "SynchronousEventBeat.h" + +namespace facebook { +namespace react { + +SynchronousEventBeat::SynchronousEventBeat( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor) + : EventBeat({}), + uiRunLoopObserver_(std::move(uiRunLoopObserver)), + runtimeExecutor_(std::move(runtimeExecutor)) { + uiRunLoopObserver_->setDelegate(this); + uiRunLoopObserver_->enable(); +} + +void SynchronousEventBeat::activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity activity) const noexcept { + assert(delegate == this); + lockExecutorAndBeat(); +} + +void SynchronousEventBeat::induce() const { + if (!this->isRequested_) { + return; + } + + if (uiRunLoopObserver_->isOnRunLoopThread()) { + this->lockExecutorAndBeat(); + } +} + +void SynchronousEventBeat::lockExecutorAndBeat() const { + if (!this->isRequested_) { + return; + } + + executeSynchronouslyOnSameThread_CAN_DEADLOCK( + runtimeExecutor_, [this](jsi::Runtime &runtime) { beat(runtime); }); +} + +} // namespace react +} // namespace facebook diff --git a/ReactCommon/fabric/scheduler/SynchronousEventBeat.h b/ReactCommon/fabric/scheduler/SynchronousEventBeat.h new file mode 100644 index 00000000000000..bf192e9078aff5 --- /dev/null +++ b/ReactCommon/fabric/scheduler/SynchronousEventBeat.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/* + * Event beat associated with main run loop. + * The callback is always called on the main thread. + */ +class SynchronousEventBeat final : public EventBeat, + public RunLoopObserver::Delegate { + public: + SynchronousEventBeat( + RunLoopObserver::Unique uiRunLoopObserver, + RuntimeExecutor runtimeExecutor); + + void induce() const override; + +#pragma mark - RunLoopObserver::Delegate + + void activityDidChange( + RunLoopObserver::Delegate const *delegate, + RunLoopObserver::Activity activity) const noexcept override; + + private: + void lockExecutorAndBeat() const; + + RunLoopObserver::Unique uiRunLoopObserver_; + RuntimeExecutor runtimeExecutor_; +}; + +} // namespace react +} // namespace facebook From f4815fbad3da368bead34c3b1c1391a83c983aae Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Wed, 6 May 2020 18:58:45 -0700 Subject: [PATCH 211/235] third-party | Move glog from xplat/third-party to third-party and create temporary redirect. Summary: Move and create an empty rule that redirects as well, to handle //arvr rules Need to do this way, since ovrsource sync rules are in different repo. allow_many_files allow-large-files Steps: - [X] Move glog from xplat/third-party to /third-party - [ ] Update references in ovrsource to translate to //third-party instead of //xplat/third-party - [ ] Get rid of temporary rule - [ ] Update fbsource/third-party/glog to 0.3.5 (what we have in ovrsource) Changelog: [Internal] Update reference for glog from xplat/third-party to /third-party. Reviewed By: yfeldblum Differential Revision: D21363584 fbshipit-source-id: c1ffe2dd615077170b03d98dcfb77121537793c9 --- ReactAndroid/src/main/jni/react/jni/BUCK | 2 +- ReactCommon/better/BUCK | 2 +- ReactCommon/config/BUCK | 2 +- ReactCommon/cxxreact/BUCK | 4 ++-- ReactCommon/fabric/attributedstring/BUCK | 2 +- ReactCommon/fabric/componentregistry/BUCK | 2 +- ReactCommon/fabric/components/activityindicator/BUCK | 2 +- ReactCommon/fabric/components/image/BUCK | 2 +- ReactCommon/fabric/components/modal/BUCK | 2 +- ReactCommon/fabric/components/picker/BUCK | 2 +- ReactCommon/fabric/components/root/BUCK | 2 +- ReactCommon/fabric/components/scrollview/BUCK | 2 +- ReactCommon/fabric/components/slider/BUCK | 2 +- ReactCommon/fabric/components/switch/BUCK | 2 +- ReactCommon/fabric/components/text/BUCK | 2 +- ReactCommon/fabric/components/textinput/BUCK | 2 +- ReactCommon/fabric/components/textinput/iostextinput/BUCK | 2 +- ReactCommon/fabric/components/unimplementedview/BUCK | 2 +- ReactCommon/fabric/components/view/BUCK | 2 +- ReactCommon/fabric/core/BUCK | 2 +- ReactCommon/fabric/graphics/BUCK | 2 +- ReactCommon/fabric/imagemanager/BUCK | 2 +- ReactCommon/fabric/mapbuffer/BUCK | 2 +- ReactCommon/fabric/mounting/BUCK | 2 +- ReactCommon/fabric/scheduler/BUCK | 2 +- ReactCommon/fabric/templateprocessor/BUCK | 2 +- ReactCommon/fabric/textlayoutmanager/BUCK | 2 +- ReactCommon/fabric/uimanager/BUCK | 2 +- ReactCommon/hermes/inspector/BUCK | 4 ++-- ReactCommon/jsiexecutor/BUCK | 2 +- ReactCommon/turbomodule/core/BUCK | 2 +- packages/react-native-codegen/DEFS.bzl | 2 +- 32 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ReactAndroid/src/main/jni/react/jni/BUCK b/ReactAndroid/src/main/jni/react/jni/BUCK index 780d8baee0d83b..2d294604819b1c 100644 --- a/ReactAndroid/src/main/jni/react/jni/BUCK +++ b/ReactAndroid/src/main/jni/react/jni/BUCK @@ -56,7 +56,7 @@ rn_xplat_cxx_library( deps = ([ "//xplat/third-party/linker_lib:android", "//xplat/third-party/linker_lib:atomic", - "//xplat/third-party/glog:glog", + "//third-party/glog:glog", "//xplat/folly:molly", "//fbandroid/xplat/fbgloginit:fbgloginit", "//xplat/fbsystrace:fbsystrace", diff --git a/ReactCommon/better/BUCK b/ReactCommon/better/BUCK index bff98453e7633a..e0e9d716c02dea 100644 --- a/ReactCommon/better/BUCK +++ b/ReactCommon/better/BUCK @@ -48,10 +48,10 @@ rn_xplat_cxx_library( tests = [], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", ], ) diff --git a/ReactCommon/config/BUCK b/ReactCommon/config/BUCK index 361f317ba0e042..ac2d066f6465fb 100644 --- a/ReactCommon/config/BUCK +++ b/ReactCommon/config/BUCK @@ -37,10 +37,10 @@ rn_xplat_cxx_library( "PUBLIC", ], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", ], ) diff --git a/ReactCommon/cxxreact/BUCK b/ReactCommon/cxxreact/BUCK index 8ef91ae51b020b..ef23abe0562aa1 100644 --- a/ReactCommon/cxxreact/BUCK +++ b/ReactCommon/cxxreact/BUCK @@ -75,9 +75,9 @@ rn_xplat_cxx_library( ], deps = [ ":module", + "//third-party/glog:glog", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", ], ) @@ -151,7 +151,7 @@ rn_xplat_cxx_library( react_native_xplat_target("callinvoker:callinvoker"), react_native_xplat_target("jsinspector:jsinspector"), react_native_xplat_target("microprofiler:microprofiler"), + "//third-party/glog:glog", "//xplat/folly:optional", - "//xplat/third-party/glog:glog", ], ) diff --git a/ReactCommon/fabric/attributedstring/BUCK b/ReactCommon/fabric/attributedstring/BUCK index 0f7c23e1a08bec..612c5a9ae5c062 100644 --- a/ReactCommon/fabric/attributedstring/BUCK +++ b/ReactCommon/fabric/attributedstring/BUCK @@ -50,11 +50,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", react_native_xplat_target("utils:utils"), react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/componentregistry/BUCK b/ReactCommon/fabric/componentregistry/BUCK index b5be24c533470c..5cf1eb19c64013 100644 --- a/ReactCommon/fabric/componentregistry/BUCK +++ b/ReactCommon/fabric/componentregistry/BUCK @@ -48,13 +48,13 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("utils:utils"), diff --git a/ReactCommon/fabric/components/activityindicator/BUCK b/ReactCommon/fabric/components/activityindicator/BUCK index 310b4fe07f8f8a..a10ed8fa723d9e 100644 --- a/ReactCommon/fabric/components/activityindicator/BUCK +++ b/ReactCommon/fabric/components/activityindicator/BUCK @@ -47,11 +47,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/image/BUCK b/ReactCommon/fabric/components/image/BUCK index 73d56d2ac01d47..b6a5e50a38f7de 100644 --- a/ReactCommon/fabric/components/image/BUCK +++ b/ReactCommon/fabric/components/image/BUCK @@ -47,11 +47,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/modal/BUCK b/ReactCommon/fabric/components/modal/BUCK index 070a02cb8494fa..24c2dbf0920470 100644 --- a/ReactCommon/fabric/components/modal/BUCK +++ b/ReactCommon/fabric/components/modal/BUCK @@ -71,11 +71,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/picker/BUCK b/ReactCommon/fabric/components/picker/BUCK index 829f5adec8fd0c..68bce53ffa9bb3 100644 --- a/ReactCommon/fabric/components/picker/BUCK +++ b/ReactCommon/fabric/components/picker/BUCK @@ -54,11 +54,11 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/root/BUCK b/ReactCommon/fabric/components/root/BUCK index f67ca8fc8a852d..d7256d80cc82e5 100644 --- a/ReactCommon/fabric/components/root/BUCK +++ b/ReactCommon/fabric/components/root/BUCK @@ -47,11 +47,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/scrollview/BUCK b/ReactCommon/fabric/components/scrollview/BUCK index 492edfc0f93f11..ac7e1848ed2085 100644 --- a/ReactCommon/fabric/components/scrollview/BUCK +++ b/ReactCommon/fabric/components/scrollview/BUCK @@ -51,11 +51,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/slider/BUCK b/ReactCommon/fabric/components/slider/BUCK index 52f567d985a99e..9f5c683501af4c 100644 --- a/ReactCommon/fabric/components/slider/BUCK +++ b/ReactCommon/fabric/components/slider/BUCK @@ -80,11 +80,11 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/switch/BUCK b/ReactCommon/fabric/components/switch/BUCK index f5b4493c5de37b..373e40d111e5fb 100644 --- a/ReactCommon/fabric/components/switch/BUCK +++ b/ReactCommon/fabric/components/switch/BUCK @@ -55,11 +55,11 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/text/BUCK b/ReactCommon/fabric/components/text/BUCK index c32ad04dfc4509..16221beea0658a 100644 --- a/ReactCommon/fabric/components/text/BUCK +++ b/ReactCommon/fabric/components/text/BUCK @@ -54,12 +54,12 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:container_evicting_cache_map", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("utils:utils"), react_native_xplat_target("fabric/attributedstring:attributedstring"), diff --git a/ReactCommon/fabric/components/textinput/BUCK b/ReactCommon/fabric/components/textinput/BUCK index aa630a15ac7383..5624b19a7aff66 100644 --- a/ReactCommon/fabric/components/textinput/BUCK +++ b/ReactCommon/fabric/components/textinput/BUCK @@ -51,12 +51,12 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:container_evicting_cache_map", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("utils:utils"), react_native_xplat_target("fabric/attributedstring:attributedstring"), diff --git a/ReactCommon/fabric/components/textinput/iostextinput/BUCK b/ReactCommon/fabric/components/textinput/iostextinput/BUCK index d6baec266ab94e..dfe4ccdf3df86e 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/BUCK +++ b/ReactCommon/fabric/components/textinput/iostextinput/BUCK @@ -51,12 +51,12 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:container_evicting_cache_map", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("utils:utils"), react_native_xplat_target("fabric/attributedstring:attributedstring"), diff --git a/ReactCommon/fabric/components/unimplementedview/BUCK b/ReactCommon/fabric/components/unimplementedview/BUCK index 1c8377d7daca60..aae773953d7f69 100644 --- a/ReactCommon/fabric/components/unimplementedview/BUCK +++ b/ReactCommon/fabric/components/unimplementedview/BUCK @@ -47,11 +47,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/components/view/BUCK b/ReactCommon/fabric/components/view/BUCK index 62aada6cf495ea..268e404748a235 100644 --- a/ReactCommon/fabric/components/view/BUCK +++ b/ReactCommon/fabric/components/view/BUCK @@ -54,11 +54,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/debug:debug"), diff --git a/ReactCommon/fabric/core/BUCK b/ReactCommon/fabric/core/BUCK index ecd7afa9203aba..1cd25344e2b68e 100644 --- a/ReactCommon/fabric/core/BUCK +++ b/ReactCommon/fabric/core/BUCK @@ -57,13 +57,13 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", react_native_xplat_target("utils:utils"), react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/graphics:graphics"), diff --git a/ReactCommon/fabric/graphics/BUCK b/ReactCommon/fabric/graphics/BUCK index b7a097079de887..2920275606ffc8 100644 --- a/ReactCommon/fabric/graphics/BUCK +++ b/ReactCommon/fabric/graphics/BUCK @@ -95,11 +95,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", ], ) diff --git a/ReactCommon/fabric/imagemanager/BUCK b/ReactCommon/fabric/imagemanager/BUCK index a5458f5071a0b6..d3f5436412cb5a 100644 --- a/ReactCommon/fabric/imagemanager/BUCK +++ b/ReactCommon/fabric/imagemanager/BUCK @@ -96,11 +96,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/mounting:mounting"), diff --git a/ReactCommon/fabric/mapbuffer/BUCK b/ReactCommon/fabric/mapbuffer/BUCK index cd4eee387d7357..89acfd5f302c30 100644 --- a/ReactCommon/fabric/mapbuffer/BUCK +++ b/ReactCommon/fabric/mapbuffer/BUCK @@ -40,10 +40,10 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", - "//xplat/third-party/glog:glog", react_native_xplat_target("utils:utils"), ], ) diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index ba11be7771bc31..57e0218b4ca794 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -51,11 +51,11 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", react_native_xplat_target("better:better"), react_native_xplat_target("fabric/components/root:root"), react_native_xplat_target("fabric/components/view:view"), diff --git a/ReactCommon/fabric/scheduler/BUCK b/ReactCommon/fabric/scheduler/BUCK index 527e6756d5f96d..c5dc8406e2dcd0 100644 --- a/ReactCommon/fabric/scheduler/BUCK +++ b/ReactCommon/fabric/scheduler/BUCK @@ -48,13 +48,13 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/mounting:mounting"), react_native_xplat_target("fabric/uimanager:uimanager"), diff --git a/ReactCommon/fabric/templateprocessor/BUCK b/ReactCommon/fabric/templateprocessor/BUCK index 4a35935675458a..5e99f4c3b9783f 100644 --- a/ReactCommon/fabric/templateprocessor/BUCK +++ b/ReactCommon/fabric/templateprocessor/BUCK @@ -50,13 +50,13 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", react_native_xplat_target("fabric/core:core"), react_native_xplat_target("fabric/uimanager:uimanager"), react_native_xplat_target("fabric/componentregistry:componentregistry"), diff --git a/ReactCommon/fabric/textlayoutmanager/BUCK b/ReactCommon/fabric/textlayoutmanager/BUCK index ba629ee394966b..7f63e0cbfc710e 100644 --- a/ReactCommon/fabric/textlayoutmanager/BUCK +++ b/ReactCommon/fabric/textlayoutmanager/BUCK @@ -117,11 +117,11 @@ rn_xplat_cxx_library( ], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/attributedstring:attributedstring"), react_native_xplat_target("fabric/core:core"), diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index 837f71a35ce542..ed49ba95cc6133 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -50,13 +50,13 @@ rn_xplat_cxx_library( tests = [":tests"], visibility = ["PUBLIC"], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", react_native_xplat_target("config:config"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/mounting:mounting"), diff --git a/ReactCommon/hermes/inspector/BUCK b/ReactCommon/hermes/inspector/BUCK index 5b5356b799794b..54faba2ded4882 100644 --- a/ReactCommon/hermes/inspector/BUCK +++ b/ReactCommon/hermes/inspector/BUCK @@ -61,12 +61,12 @@ fb_xplat_cxx_library( react_native_xplat_target("jsinspector:jsinspector"), ":detail", ":inspectorlib", + "//third-party/glog:glog", "//xplat/folly:futures", "//xplat/folly:molly", "//xplat/hermes/API:HermesAPI", "//xplat/jsi:JSIDynamic", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", ], ) @@ -196,11 +196,11 @@ fb_xplat_cxx_library( xcode_public_headers_symlinks = True, deps = [ ":detail", + "//third-party/glog:glog", "//xplat/folly:futures", "//xplat/folly:molly", "//xplat/hermes/API:HermesAPI", "//xplat/jsi:jsi", - "//xplat/third-party/glog:glog", ], ) diff --git a/ReactCommon/jsiexecutor/BUCK b/ReactCommon/jsiexecutor/BUCK index 5eeaf7638fa369..b376d26f28d754 100644 --- a/ReactCommon/jsiexecutor/BUCK +++ b/ReactCommon/jsiexecutor/BUCK @@ -16,8 +16,8 @@ cxx_library( "-frtti", ], fbandroid_deps = [ + "//third-party/glog:glog", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", "//xplat/third-party/linker_lib:atomic", ], fbobjc_force_static = True, diff --git a/ReactCommon/turbomodule/core/BUCK b/ReactCommon/turbomodule/core/BUCK index f3389ae5ad9c14..7a429af31525a3 100644 --- a/ReactCommon/turbomodule/core/BUCK +++ b/ReactCommon/turbomodule/core/BUCK @@ -70,12 +70,12 @@ rn_xplat_cxx_library( "PUBLIC", ], deps = [ + "//third-party/glog:glog", "//xplat/fbsystrace:fbsystrace", "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", "//xplat/jsi:JSIDynamic", - "//xplat/third-party/glog:glog", react_native_xplat_target("cxxreact:bridge"), react_native_xplat_target("cxxreact:module"), react_native_xplat_target("callinvoker:callinvoker"), diff --git a/packages/react-native-codegen/DEFS.bzl b/packages/react-native-codegen/DEFS.bzl index 9099034da04ca9..f54615a0494941 100644 --- a/packages/react-native-codegen/DEFS.bzl +++ b/packages/react-native-codegen/DEFS.bzl @@ -231,7 +231,7 @@ def rn_codegen_components( "//xplat/folly:headers_only", "//xplat/folly:memory", "//xplat/folly:molly", - "//xplat/third-party/glog:glog", + "//third-party/glog:glog", YOGA_CXX_TARGET, react_native_xplat_target("fabric/debug:debug"), react_native_xplat_target("fabric/core:core"), From 851644cfc23728f72fe638b57f03c596803fef7c Mon Sep 17 00:00:00 2001 From: Yuanzhe Bian Date: Thu, 7 May 2020 00:03:33 -0700 Subject: [PATCH 212/235] Fix Animated type Summary: - Fixed typing of Animated and fixed the callsites Changelog: [Internal] Reviewed By: kacieb Differential Revision: D21311870 fbshipit-source-id: 386fb496ab00ef7917273dc3eb65e1ed76a8dd33 --- Libraries/Animated/src/Animated.js | 24 +++++++++---------- .../js/examples/FlatList/FlatListExample.js | 8 +++---- .../SectionList/SectionListExample.js | 5 ++-- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Libraries/Animated/src/Animated.js b/Libraries/Animated/src/Animated.js index 9e6e2b54d8aa03..580b40f0ef92df 100644 --- a/Libraries/Animated/src/Animated.js +++ b/Libraries/Animated/src/Animated.js @@ -11,9 +11,12 @@ 'use strict'; import Platform from '../../Utilities/Platform'; -const View = require('../../Components/View/View'); -const React = require('react'); -import type {AnimatedComponentType} from './createAnimatedComponent'; +import typeof AnimatedFlatList from './components/AnimatedFlatList'; +import typeof AnimatedImage from './components/AnimatedImage'; +import typeof AnimatedScrollView from './components/AnimatedScrollView'; +import typeof AnimatedSectionList from './components/AnimatedSectionList'; +import typeof AnimatedText from './components/AnimatedText'; +import typeof AnimatedView from './components/AnimatedView'; const AnimatedMock = require('./AnimatedMock'); const AnimatedImplementation = require('./AnimatedImplementation'); @@ -25,25 +28,22 @@ const Animated = ((Platform.isTesting || : AnimatedImplementation): typeof AnimatedMock); module.exports = { - get FlatList(): any { + get FlatList(): AnimatedFlatList { return require('./components/AnimatedFlatList'); }, - get Image(): any { + get Image(): AnimatedImage { return require('./components/AnimatedImage'); }, - get ScrollView(): any { + get ScrollView(): AnimatedScrollView { return require('./components/AnimatedScrollView'); }, - get SectionList(): any { + get SectionList(): AnimatedSectionList { return require('./components/AnimatedSectionList'); }, - get Text(): any { + get Text(): AnimatedText { return require('./components/AnimatedText'); }, - get View(): AnimatedComponentType< - React.ElementConfig, - React.ElementRef, - > { + get View(): AnimatedView { return require('./components/AnimatedView'); }, ...Animated, diff --git a/RNTester/js/examples/FlatList/FlatListExample.js b/RNTester/js/examples/FlatList/FlatListExample.js index c452ace6040161..ce2650f66a3f62 100644 --- a/RNTester/js/examples/FlatList/FlatListExample.js +++ b/RNTester/js/examples/FlatList/FlatListExample.js @@ -81,9 +81,7 @@ class FlatListExample extends React.PureComponent { }; _onChangeScrollToIndex = text => { - this._listRef - .getNode() - .scrollToIndex({viewPosition: 0.5, index: Number(text)}); + this._listRef.scrollToIndex({viewPosition: 0.5, index: Number(text)}); }; _scrollPos = new Animated.Value(0); @@ -97,7 +95,7 @@ class FlatListExample extends React.PureComponent { ); componentDidUpdate() { - this._listRef.getNode().recordInteraction(); // e.g. flipping logViewable switch + this._listRef.recordInteraction(); // e.g. flipping logViewable switch } render(): React.Node { @@ -249,7 +247,7 @@ class FlatListExample extends React.PureComponent { } }; _pressItem = (key: string) => { - this._listRef.getNode().recordInteraction(); + this._listRef && this._listRef.recordInteraction(); pressItem(this, key); }; _listRef: React.ElementRef; diff --git a/RNTester/js/examples/SectionList/SectionListExample.js b/RNTester/js/examples/SectionList/SectionListExample.js index d3b895e6362950..56d7067550c1ff 100644 --- a/RNTester/js/examples/SectionList/SectionListExample.js +++ b/RNTester/js/examples/SectionList/SectionListExample.js @@ -92,13 +92,14 @@ class SectionListExample extends React.PureComponent<{...}, $FlowFixMeState> { {useNativeDriver: true}, ); - _sectionListRef: React.ElementRef; + _sectionListRef: ?React.ElementRef = null; _captureRef = ref => { this._sectionListRef = ref; }; _scrollToLocation(sectionIndex: number, itemIndex: number) { - this._sectionListRef.getNode().scrollToLocation({sectionIndex, itemIndex}); + this._sectionListRef && + this._sectionListRef.scrollToLocation({sectionIndex, itemIndex}); } render(): React.Node { From e566c7ec7b0015e4e5e6ad92247a6357eb861d4f Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 7 May 2020 04:12:56 -0700 Subject: [PATCH 213/235] Add virtual destructor to JSError Summary: We consume Hermes through multiple .so's, which means we have multiple (weak) typeinfo definitions of facebook::jsi::JSError. Previously we were using gnustl, which would strcmp typeinfo to decide whether a certain exception handler applies, which meant this didn't cause any major issues. However since this is deprecated, we recently switched to libc++, which does not have this by behaviour (or it does, but behind a flag I'm not sure how to enable). This causes any JS exceptions to fall through from our exception handlers and fatal the app. This problem is actually documented in the common Android NDK problems page: https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md#rtti_exceptions-not-working-across-library-boundaries The suggested solution is to ensure that any exception types have a key function defined (a non-pure, out-of-line virtual function). The simplest one to add is a virtual destructor. This makes the object file that holds the implementation of the destructor export a non-weak typeinfo definition which will at load time override the other weak versions. I'm not sure why we're the first to hit this. RN's JSIExecutor doesn't explicitly reference JSError which probably helps (https://github.com/facebook/react-native/blob/master/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp#L256-L258) and they also don't use unguarded callbacks like we do. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D21426524 fbshipit-source-id: 474284ada1ca2810045dc4402c420879447f9308 --- ReactCommon/jsi/jsi/jsi.cpp | 6 ++++++ ReactCommon/jsi/jsi/jsi.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ReactCommon/jsi/jsi/jsi.cpp b/ReactCommon/jsi/jsi/jsi.cpp index 73a27892580cd4..388f122c178c9e 100644 --- a/ReactCommon/jsi/jsi/jsi.cpp +++ b/ReactCommon/jsi/jsi/jsi.cpp @@ -450,5 +450,11 @@ void JSError::setValue(Runtime& rt, Value&& value) { } } +JSIException::~JSIException() {} + +JSINativeException::~JSINativeException() {} + +JSError::~JSError() {} + } // namespace jsi } // namespace facebook diff --git a/ReactCommon/jsi/jsi/jsi.h b/ReactCommon/jsi/jsi/jsi.h index 677e9049498e18..e48f524a105b1d 100644 --- a/ReactCommon/jsi/jsi/jsi.h +++ b/ReactCommon/jsi/jsi/jsi.h @@ -1212,6 +1212,8 @@ class JSI_EXPORT JSIException : public std::exception { return what_.c_str(); } + virtual ~JSIException(); + protected: std::string what_; }; @@ -1221,6 +1223,8 @@ class JSI_EXPORT JSIException : public std::exception { class JSI_EXPORT JSINativeException : public JSIException { public: JSINativeException(std::string what) : JSIException(std::move(what)) {} + + virtual ~JSINativeException(); }; /// This exception will be thrown by API functions whenever a JS @@ -1249,6 +1253,8 @@ class JSI_EXPORT JSError : public JSIException { /// but necessary to avoid ambiguity with the above. JSError(std::string what, Runtime& rt, Value&& value); + virtual ~JSError(); + const std::string& getStack() const { return stack_; } From 26c120c6329d45e27318d82aaf5a50338bd6fa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 7 May 2020 04:59:44 -0700 Subject: [PATCH 214/235] Handle initialProps as optional in renderApplication Summary: Pass a default empty object to `AppContainer` if no `initialProps` were passed to `renderApplication`. This prevents issues on Android, where we do not pass a default empty `initialProps` from native, as we do on iOS. Changelog: [General] [Fixed] - Handle nullish `initialProps` correctly in `renderApplication` Reviewed By: motiz88 Differential Revision: D21448692 fbshipit-source-id: 9630bdc2414532999abf3bf9da25047f0482fcab --- Libraries/ReactNative/renderApplication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/ReactNative/renderApplication.js b/Libraries/ReactNative/renderApplication.js index ede1d12daf6b59..7d7b3b4409b1f7 100644 --- a/Libraries/ReactNative/renderApplication.js +++ b/Libraries/ReactNative/renderApplication.js @@ -41,7 +41,7 @@ function renderApplication( fabric={fabric} showArchitectureIndicator={showArchitectureIndicator} WrapperComponent={WrapperComponent} - initialProps={initialProps} + initialProps={initialProps ?? Object.freeze({})} internal_excludeLogBox={isLogBox}> From 7bb1c4e1b8715a5c9cb6f9e4e77a6df783481d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 7 May 2020 08:34:07 -0700 Subject: [PATCH 215/235] Enable with CocoaPods `:configuration` (#28796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## Changelog [iOS] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 --- scripts/react_native_pods.rb | 33 ++----------------- .../ios/HelloWorld.xcodeproj/project.pbxproj | 4 --- template/ios/HelloWorld/AppDelegate.m | 4 +-- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 5a2726e0d85354..86afd7ff5a0653 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -58,8 +58,8 @@ def use_react_native! (options={}) end def use_flipper!(versions = {}) - versions['Flipper'] ||= '~> 0.37.0' - versions['DoubleConversion'] ||= '1.1.7' + versions['Flipper'] ||= '~> 0.41.1' + versions['Flipper-DoubleConversion'] ||= '1.1.7' versions['Flipper-Folly'] ||= '~> 2.2' versions['Flipper-Glog'] ||= '0.3.6' versions['Flipper-PeerTalk'] ||= '~> 0.0.4' @@ -72,7 +72,7 @@ def use_flipper!(versions = {}) # 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-DoubleConversion', versions['Flipper-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' @@ -96,31 +96,4 @@ def flipper_post_install(installer) end end end - 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 - if (config.build_settings['OTHER_SWIFT_FLAGS']) - unless config.build_settings['OTHER_SWIFT_FLAGS'].include? '-DFB_SONARKIT_ENABLED' - puts 'Adding -DFB_SONARKIT_ENABLED ...' - swift_flags = config.build_settings['OTHER_SWIFT_FLAGS'] - if swift_flags.split.last != '-Xcc' - config.build_settings['OTHER_SWIFT_FLAGS'] << ' -Xcc' - end - config.build_settings['OTHER_SWIFT_FLAGS'] << ' -DFB_SONARKIT_ENABLED' - end - else - puts 'OTHER_SWIFT_FLAGS does not exist thus assigning it to `$(inherited) -Xcc -DFB_SONARKIT_ENABLED`' - config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -Xcc -DFB_SONARKIT_ENABLED' - end - app_project.save - end - end - installer.pods_project.save end diff --git a/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/ios/HelloWorld.xcodeproj/project.pbxproj index 20ac3c62655dc7..0a340e5af348ee 100644 --- a/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -336,10 +336,6 @@ CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; ENABLE_BITCODE = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "FB_SONARKIT_ENABLED=1", - ); INFOPLIST_FILE = HelloWorld/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( diff --git a/template/ios/HelloWorld/AppDelegate.m b/template/ios/HelloWorld/AppDelegate.m index bea8d2b334b114..59b62377cd4b65 100644 --- a/template/ios/HelloWorld/AppDelegate.m +++ b/template/ios/HelloWorld/AppDelegate.m @@ -4,7 +4,7 @@ #import #import -#if DEBUG +#ifdef FB_SONARKIT_ENABLED #import #import #import @@ -27,7 +27,7 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -#if DEBUG +#ifdef FB_SONARKIT_ENABLED InitializeFlipper(application); #endif From 16ea9ba8133a5340ed6751ec7d49bf03a0d4c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Vieira?= Date: Thu, 7 May 2020 09:40:51 -0700 Subject: [PATCH 216/235] Support excluding multiple platforms. Summary: Currently the schema only allows to exclude a single platform (iOS OR Android). There are cases where we need to exclude multiple. This change converts the previous `excludePlatform` string property into an `excludePlatforms` array. Changelog: [Internal][Changed] - Added support to exclude multiple platforms in Codegen. Reviewed By: sammy-SC Differential Revision: D21426950 fbshipit-source-id: eff36ffa207109274794b4b300bf6313f8286161 --- .../RCTDatePickerNativeComponent.js | 2 +- .../PullToRefreshViewNativeComponent.js | 2 +- .../Switch/SwitchNativeComponent.js | 2 +- Libraries/Utilities/codegenNativeComponent.js | 2 +- .../DatePickerManagerDelegate.java | 62 +++++++++++++++++++ .../DatePickerManagerInterface.java | 25 ++++++++ .../PullToRefreshViewManagerDelegate.java | 51 +++++++++++++++ .../PullToRefreshViewManagerInterface.java | 21 +++++++ .../viewmanagers/SwitchManagerDelegate.java | 22 +++++-- .../react-native-codegen/src/CodegenSchema.js | 6 +- .../components/GenerateComponentHObjCpp.js | 5 +- .../generators/components/GeneratePropsCpp.js | 5 +- .../generators/components/GeneratePropsH.js | 5 +- .../components/GeneratePropsJavaDelegate.js | 5 +- .../components/GeneratePropsJavaInterface.js | 5 +- .../components/__test_fixtures__/fixtures.js | 24 ++++++- .../GenerateComponentDescriptorH-test.js.snap | 26 ++++++++ .../GenerateComponentHObjCpp-test.js.snap | 21 +++++++ .../GenerateEventEmitterCpp-test.js.snap | 23 +++++++ .../GenerateEventEmitterH-test.js.snap | 24 +++++++ .../GeneratePropsCpp-test.js.snap | 24 +++++++ .../__snapshots__/GeneratePropsH-test.js.snap | 24 +++++++ .../GeneratePropsJavaDelegate-test.js.snap | 2 + .../GeneratePropsJavaInterface-test.js.snap | 2 + .../GenerateShadowNodeCpp-test.js.snap | 23 +++++++ .../GenerateShadowNodeH-test.js.snap | 33 ++++++++++ .../__snapshots__/GenerateTests-test.js.snap | 28 +++++++++ .../GenerateViewConfigJs-test.js.snap | 32 ++++++++++ .../components/__test_fixtures__/fixtures.js | 1 + .../component-parser-test.js.snap | 3 + .../src/parsers/flow/components/options.js | 8 ++- 31 files changed, 499 insertions(+), 19 deletions(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerDelegate.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerInterface.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerDelegate.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerInterface.java diff --git a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js index b569ae2bea5515..99e5d92c051e17 100644 --- a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +++ b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js @@ -56,5 +56,5 @@ export const Commands: NativeCommands = codegenNativeCommands({ export default (codegenNativeComponent('DatePicker', { paperComponentName: 'RCTDatePicker', - excludedPlatform: 'android', + excludedPlatforms: ['android'], }): HostComponent); diff --git a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js index adf8ba966db1bf..7f97db35b6120f 100644 --- a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +++ b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js @@ -61,5 +61,5 @@ export const Commands: NativeCommands = codegenNativeCommands({ export default (codegenNativeComponent('PullToRefreshView', { paperComponentName: 'RCTRefreshControl', - excludedPlatform: 'android', + excludedPlatforms: ['android'], }): HostComponent); diff --git a/Libraries/Components/Switch/SwitchNativeComponent.js b/Libraries/Components/Switch/SwitchNativeComponent.js index c9bbe253bf3066..82e3be7dbbdbb7 100644 --- a/Libraries/Components/Switch/SwitchNativeComponent.js +++ b/Libraries/Components/Switch/SwitchNativeComponent.js @@ -54,5 +54,5 @@ export const Commands: NativeCommands = codegenNativeCommands({ export default (codegenNativeComponent('Switch', { paperComponentName: 'RCTSwitch', - excludedPlatform: 'android', + excludedPlatforms: ['android'], }): ComponentType); diff --git a/Libraries/Utilities/codegenNativeComponent.js b/Libraries/Utilities/codegenNativeComponent.js index 3847be3b4db8c1..809cdce19658cc 100644 --- a/Libraries/Utilities/codegenNativeComponent.js +++ b/Libraries/Utilities/codegenNativeComponent.js @@ -21,7 +21,7 @@ type Options = $ReadOnly<{| interfaceOnly?: boolean, paperComponentName?: string, paperComponentNameDeprecated?: string, - excludedPlatform?: 'iOS' | 'android', + excludedPlatforms?: $ReadOnlyArray<'iOS' | 'android'>, |}>; export type NativeComponentType = HostComponent; diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerDelegate.java b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerDelegate.java new file mode 100644 index 00000000000000..29288a63c8911a --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerDelegate.java @@ -0,0 +1,62 @@ +/** +* 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. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.BaseViewManagerInterface; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class DatePickerManagerDelegate & DatePickerManagerInterface> extends BaseViewManagerDelegate { + public DatePickerManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "date": + mViewManager.setDate(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "initialDate": + mViewManager.setInitialDate(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "locale": + mViewManager.setLocale(view, value == null ? null : (String) value); + break; + case "maximumDate": + mViewManager.setMaximumDate(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "minimumDate": + mViewManager.setMinimumDate(view, value == null ? 0f : ((Double) value).floatValue()); + break; + case "minuteInterval": + mViewManager.setMinuteInterval(view, value == null ? 1 : ((Double) value).intValue()); + break; + case "mode": + mViewManager.setMode(view, (String) value); + break; + case "timeZoneOffsetInMinutes": + mViewManager.setTimeZoneOffsetInMinutes(view, value == null ? 0f : ((Double) value).floatValue()); + break; + default: + super.setProperty(view, propName, value); + } + } + + public void receiveCommand(DatePickerManagerInterface viewManager, T view, String commandName, ReadableArray args) { + switch (commandName) { + case "setNativeDate": + viewManager.setNativeDate(view, (float) args.getDouble(0)); + break; + } + } +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerInterface.java b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerInterface.java new file mode 100644 index 00000000000000..9df911c7284d3a --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/DatePickerManagerInterface.java @@ -0,0 +1,25 @@ +/** +* 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. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; + +public interface DatePickerManagerInterface { + void setDate(T view, float value); + void setInitialDate(T view, float value); + void setLocale(T view, @Nullable String value); + void setMaximumDate(T view, float value); + void setMinimumDate(T view, float value); + void setMinuteInterval(T view, @Nullable Integer value); + void setMode(T view, @Nullable String value); + void setTimeZoneOffsetInMinutes(T view, float value); + void setNativeDate(T view, float date); +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerDelegate.java b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerDelegate.java new file mode 100644 index 00000000000000..2d6732ee8d38a2 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerDelegate.java @@ -0,0 +1,51 @@ +/** +* 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. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; +import com.facebook.react.bridge.ColorPropConverter; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.BaseViewManagerInterface; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class PullToRefreshViewManagerDelegate & PullToRefreshViewManagerInterface> extends BaseViewManagerDelegate { + public PullToRefreshViewManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "tintColor": + mViewManager.setTintColor(view, ColorPropConverter.getColor(value, view.getContext())); + break; + case "titleColor": + mViewManager.setTitleColor(view, ColorPropConverter.getColor(value, view.getContext())); + break; + case "title": + mViewManager.setTitle(view, value == null ? null : (String) value); + break; + case "refreshing": + mViewManager.setRefreshing(view, value == null ? false : (boolean) value); + break; + default: + super.setProperty(view, propName, value); + } + } + + public void receiveCommand(PullToRefreshViewManagerInterface viewManager, T view, String commandName, ReadableArray args) { + switch (commandName) { + case "setNativeRefreshing": + viewManager.setNativeRefreshing(view, args.getBoolean(0)); + break; + } + } +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerInterface.java b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerInterface.java new file mode 100644 index 00000000000000..4f40ee89cbba01 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/PullToRefreshViewManagerInterface.java @@ -0,0 +1,21 @@ +/** +* 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. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; +import androidx.annotation.Nullable; + +public interface PullToRefreshViewManagerInterface { + void setTintColor(T view, @Nullable Integer value); + void setTitleColor(T view, @Nullable Integer value); + void setTitle(T view, @Nullable String value); + void setRefreshing(T view, boolean value); + void setNativeRefreshing(T view, boolean refreshing); +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerDelegate.java b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerDelegate.java index bee0b8c54f2065..5e419f8bd3fe91 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerDelegate.java +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/SwitchManagerDelegate.java @@ -11,6 +11,8 @@ import android.view.View; import androidx.annotation.Nullable; +import com.facebook.react.bridge.ColorPropConverter; +import com.facebook.react.bridge.ReadableArray; import com.facebook.react.uimanager.BaseViewManagerDelegate; import com.facebook.react.uimanager.BaseViewManagerInterface; import com.facebook.react.uimanager.LayoutShadowNode; @@ -29,25 +31,33 @@ public void setProperty(T view, String propName, @Nullable Object value) { mViewManager.setValue(view, value == null ? false : (boolean) value); break; case "tintColor": - mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setTintColor(view, ColorPropConverter.getColor(value, view.getContext())); break; case "onTintColor": - mViewManager.setOnTintColor(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setOnTintColor(view, ColorPropConverter.getColor(value, view.getContext())); break; case "thumbTintColor": - mViewManager.setThumbTintColor(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setThumbTintColor(view, ColorPropConverter.getColor(value, view.getContext())); break; case "thumbColor": - mViewManager.setThumbColor(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setThumbColor(view, ColorPropConverter.getColor(value, view.getContext())); break; case "trackColorForFalse": - mViewManager.setTrackColorForFalse(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setTrackColorForFalse(view, ColorPropConverter.getColor(value, view.getContext())); break; case "trackColorForTrue": - mViewManager.setTrackColorForTrue(view, value == null ? null : ((Double) value).intValue()); + mViewManager.setTrackColorForTrue(view, ColorPropConverter.getColor(value, view.getContext())); break; default: super.setProperty(view, propName, value); } } + + public void receiveCommand(SwitchManagerInterface viewManager, T view, String commandName, ReadableArray args) { + switch (commandName) { + case "setValue": + viewManager.setValue(view, args.getBoolean(0)); + break; + } + } } diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index 51d96416ff772e..17fb0d7df9c09d 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -10,6 +10,8 @@ 'use strict'; +export type PlatformType = 'iOS' | 'android'; + export type CommandsFunctionTypeAnnotation = $ReadOnly<{| type: 'FunctionTypeAnnotation', params: $ReadOnlyArray, @@ -309,8 +311,8 @@ export type OptionsShape = $ReadOnly<{| // Does not check for new name paperComponentName?: string, - // Use for components that are not used on one or the other platform. - excludedPlatform?: 'iOS' | 'android', + // Use for components that are not used on other platforms. + excludedPlatforms?: $ReadOnlyArray, // Use for components currently being renamed in paper // Will use new name if it is available and fallback to this name diff --git a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js index 6ecc358b3815f4..af61b2675e78a6 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js +++ b/packages/react-native-codegen/src/generators/components/GenerateComponentHObjCpp.js @@ -337,7 +337,10 @@ module.exports = { return Object.keys(components) .filter(componentName => { const component = components[componentName]; - return component.excludedPlatform !== 'iOS'; + return !( + component.excludedPlatforms && + component.excludedPlatforms.includes('iOS') + ); }) .map(componentName => { return [ diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js index 0cfe41fa8c66ef..b6b03eb7d36979 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsCpp.js @@ -101,7 +101,10 @@ module.exports = { return Object.keys(components) .filter(componentName => { const component = components[componentName]; - return component.excludedPlatform !== 'iOS'; + return !( + component.excludedPlatforms && + component.excludedPlatforms.includes('iOS') + ); }) .map(componentName => { const component = components[componentName]; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js index adb94d16f442f4..a7ff3f9d77cda8 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsH.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsH.js @@ -768,7 +768,10 @@ module.exports = { return Object.keys(components) .filter(componentName => { const component = components[componentName]; - return component.excludedPlatform !== 'iOS'; + return !( + component.excludedPlatforms && + component.excludedPlatforms.includes('iOS') + ); }) .map(componentName => { const component = components[componentName]; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js index 17f587b0145327..08c99a48791373 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js @@ -274,7 +274,10 @@ module.exports = { return Object.keys(components) .filter(componentName => { const component = components[componentName]; - return component.excludedPlatform !== 'android'; + return !( + component.excludedPlatforms && + component.excludedPlatforms.includes('android') + ); }) .forEach(componentName => { const component = components[componentName]; diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js index bf4f42bbfc891d..af41763c82c0e5 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaInterface.js @@ -221,7 +221,10 @@ module.exports = { return Object.keys(components) .filter(componentName => { const component = components[componentName]; - return component.excludedPlatform !== 'android'; + return !( + component.excludedPlatforms && + component.excludedPlatforms.includes('android') + ); }) .forEach(componentName => { const component = components[componentName]; diff --git a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js index 6f3bf1becb890d..31689b483dcaed 100644 --- a/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js @@ -1524,7 +1524,28 @@ const EXCLUDE_ANDROID: SchemaType = { ExcludedAndroid: { components: { ExcludedAndroidComponent: { - excludedPlatform: 'android', + excludedPlatforms: ['android'], + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps', + }, + ], + events: [], + props: [], + commands: [], + }, + }, + }, + }, +}; + +const EXCLUDE_ANDROID_IOS: SchemaType = { + modules: { + ExcludedAndroidIos: { + components: { + ExcludedAndroidIosComponent: { + excludedPlatforms: ['android', 'iOS'], extendsProps: [ { type: 'ReactNativeBuiltInType', @@ -1566,4 +1587,5 @@ module.exports = { COMMANDS, COMMANDS_AND_PROPS, EXCLUDE_ANDROID, + EXCLUDE_ANDROID_IOS, }; diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap index 4c64141b0fbb36..e23ae48953f9ea 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap @@ -286,6 +286,32 @@ using ExcludedAndroidComponentComponentDescriptor = ConcreteComponentDescriptor< } `; +exports[`GenerateComponentDescriptorH can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "ComponentDescriptors.h" => " +/** + * 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. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace react { + +using ExcludedAndroidIosComponentComponentDescriptor = ConcreteComponentDescriptor; + +} // namespace react +} // namespace facebook +", +} +`; + exports[`GenerateComponentDescriptorH can generate fixture FLOAT_PROPS 1`] = ` Map { "ComponentDescriptors.h" => " diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap index 93b0a8b7f0ffe8..a921411cbe03a4 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap @@ -385,6 +385,27 @@ NS_ASSUME_NONNULL_BEGIN @end +NS_ASSUME_NONNULL_END", +} +`; + +exports[`GenerateComponentHObjCpp can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "RCTComponentViewHelpers.h" => "/** +* 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. +*/ + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + + + NS_ASSUME_NONNULL_END", } `; diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap index a13aedb1303c47..c70dc86ce28188 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap @@ -304,6 +304,29 @@ namespace react { +} // namespace react +} // namespace facebook +", +} +`; + +exports[`GenerateEventEmitterCpp can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "EventEmitters.cpp" => " +/** + * 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. + */ + +#include + +namespace facebook { +namespace react { + + + } // namespace react } // namespace facebook ", diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap index 6b0076238052ea..229c08c3f15b42 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap @@ -330,6 +330,30 @@ namespace react { +} // namespace react +} // namespace facebook +", +} +`; + +exports[`GenerateEventEmitterH can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "EventEmitters.h" => " +/** + * 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. + */ +#pragma once + +#include + +namespace facebook { +namespace react { + + + } // namespace react } // namespace facebook ", diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap index 2d17c7496dc886..27ce7d45df9925 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsCpp-test.js.snap @@ -329,6 +329,30 @@ ExcludedAndroidComponentProps::ExcludedAndroidComponentProps( {} +} // namespace react +} // namespace facebook +", +} +`; + +exports[`GeneratePropsCpp can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "Props.cpp" => " +/** + * 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. + */ + +#include +#include + +namespace facebook { +namespace react { + + + } // namespace react } // namespace facebook ", diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap index 687290a402e574..3071e0e70ed107 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsH-test.js.snap @@ -574,6 +574,30 @@ class ExcludedAndroidComponentProps final : public ViewProps { }; +} // namespace react +} // namespace facebook +", +} +`; + +exports[`GeneratePropsH can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "Props.h" => " +/** + * 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. + */ +#pragma once + + + +namespace facebook { +namespace react { + + + } // namespace react } // namespace facebook ", diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap index 6ae0cd6f4f22c8..914f8e56da71a9 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap @@ -442,6 +442,8 @@ public class InterfaceOnlyComponentManagerDelegate "/** diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap index 45873d75b224bc..b064446f35b63a 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaInterface-test.js.snap @@ -247,6 +247,8 @@ public interface InterfaceOnlyComponentManagerInterface { exports[`GeneratePropsJavaInterface can generate fixture EXCLUDE_ANDROID 1`] = `Map {}`; +exports[`GeneratePropsJavaInterface can generate fixture EXCLUDE_ANDROID_IOS 1`] = `Map {}`; + exports[`GeneratePropsJavaInterface can generate fixture FLOAT_PROPS 1`] = ` Map { "FloatPropNativeComponentManagerInterface.java" => "/** diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeCpp-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeCpp-test.js.snap index 053638bd5b0b0e..22043570482540 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeCpp-test.js.snap @@ -253,6 +253,29 @@ extern const char ExcludedAndroidComponentComponentName[] = \\"ExcludedAndroidCo } `; +exports[`GenerateShadowNodeCpp can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "ShadowNodes.cpp" => " +/** + * 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. + */ + +#include + +namespace facebook { +namespace react { + +extern const char ExcludedAndroidIosComponentComponentName[] = \\"ExcludedAndroidIosComponent\\"; + +} // namespace react +} // namespace facebook +", +} +`; + exports[`GenerateShadowNodeCpp can generate fixture FLOAT_PROPS 1`] = ` Map { "ShadowNodes.cpp" => " diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeH-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeH-test.js.snap index 679337e818c9bc..5327702796da7c 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeH-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateShadowNodeH-test.js.snap @@ -360,6 +360,39 @@ using ExcludedAndroidComponentShadowNode = ConcreteViewShadowNode< } `; +exports[`GenerateShadowNodeH can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "ShadowNodes.h" => " +/** + * 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. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace react { + +extern const char ExcludedAndroidIosComponentComponentName[]; + +/* + * \`ShadowNode\` for component. + */ +using ExcludedAndroidIosComponentShadowNode = ConcreteViewShadowNode< + ExcludedAndroidIosComponentComponentName, + ExcludedAndroidIosComponentProps>; + +} // namespace react +} // namespace facebook +", +} +`; + exports[`GenerateShadowNodeH can generate fixture FLOAT_PROPS 1`] = ` Map { "ShadowNodes.h" => " diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateTests-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateTests-test.js.snap index 63141765868042..8f73a0c825023a 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateTests-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateTests-test.js.snap @@ -354,6 +354,34 @@ TEST(ExcludedAndroidComponentProps_DoesNotDie, etc) { } `; +exports[`GenerateTests can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "Tests.cpp" => "/** + * 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. + */ + +#include +#include +#include +#include +#include + +using namespace facebook::react; + +TEST(ExcludedAndroidIosComponentProps_DoesNotDie, etc) { + auto propParser = RawPropsParser(); + propParser.prepare(); + auto const &sourceProps = ExcludedAndroidIosComponentProps(); + auto const &rawProps = RawProps(folly::dynamic::object(\\"xx_invalid_xx\\", \\"xx_invalid_xx\\")); + rawProps.parse(propParser); + ExcludedAndroidIosComponentProps(sourceProps, rawProps); +}", +} +`; + exports[`GenerateTests can generate fixture FLOAT_PROPS 1`] = ` Map { "Tests.cpp" => "/** diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap index f7e1722e545a8e..d92c6470d7cfe8 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap @@ -483,6 +483,38 @@ export default nativeComponentName; } `; +exports[`GenerateViewConfigJs can generate fixture EXCLUDE_ANDROID_IOS 1`] = ` +Map { + "EXCLUDE_ANDROID_IOSNativeViewConfig.js" => " +/** + * 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. + * + * @flow + */ + +'use strict'; + +const registerGeneratedViewConfig = require('registerGeneratedViewConfig'); + +const ExcludedAndroidIosComponentViewConfig = { + uiViewClassName: 'ExcludedAndroidIosComponent', + validAttributes: {}, +}; + +let nativeComponentName = 'ExcludedAndroidIosComponent'; + +registerGeneratedViewConfig(nativeComponentName, ExcludedAndroidIosComponentViewConfig); + +export const __INTERNAL_VIEW_CONFIG = ExcludedAndroidIosComponentViewConfig; + +export default nativeComponentName; +", +} +`; + exports[`GenerateViewConfigJs can generate fixture FLOAT_PROPS 1`] = ` Map { "FLOAT_PROPSNativeViewConfig.js" => " diff --git a/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js index 13e5131953358b..851257da1d052f 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/parsers/flow/components/__test_fixtures__/fixtures.js @@ -144,6 +144,7 @@ type ModuleProps = $ReadOnly<{| export default codegenNativeComponent('Module', { interfaceOnly: true, + excludedPlatforms: ['android'], paperComponentName: 'RCTModule', }); `; diff --git a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap index 8192bb77cdf40a..6437404dd14201 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap +++ b/packages/react-native-codegen/src/parsers/flow/components/__tests__/__snapshots__/component-parser-test.js.snap @@ -5935,6 +5935,9 @@ Object { }, }, ], + "excludedPlatforms": Array [ + "android", + ], "extendsProps": Array [ Object { "knownTypeName": "ReactNativeCoreViewProps", diff --git a/packages/react-native-codegen/src/parsers/flow/components/options.js b/packages/react-native-codegen/src/parsers/flow/components/options.js index f455a5f060a3f2..8044575db15913 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/options.js +++ b/packages/react-native-codegen/src/parsers/flow/components/options.js @@ -54,7 +54,13 @@ function getOptions(optionsExpression: OptionsAST): ?OptionsShape { let foundOptions; try { foundOptions = optionsExpression.properties.reduce((options, prop) => { - options[prop.key.name] = prop.value.value; + if (prop.value.type === 'ArrayExpression') { + options[prop.key.name] = prop.value.elements.map( + element => element.value, + ); + } else { + options[prop.key.name] = prop.value.value; + } return options; }, {}); } catch (e) { From 4e59508a8e96d0db2861e215012df48555ab31ee Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 7 May 2020 17:08:17 -0700 Subject: [PATCH 217/235] Extend ParagraphAttribute to store the includeFontPadding prop Summary: This diff extends the ParagraphAttribute class to store the value of the includeFontPadding prop. Note that this is an Android only prop, I'm not creating android blocks to improve "cleanliness" of the code. changelog: [Internal][Fabric] Internal change in Fabric to support Text.includeFontPadding prop in fabric Reviewed By: shergin Differential Revision: D21446738 fbshipit-source-id: 0543e86aa18ce10f7a56bbaafe111cce0179ea86 --- .../fabric/attributedstring/ParagraphAttributes.cpp | 9 ++++++--- .../fabric/attributedstring/ParagraphAttributes.h | 9 ++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ReactCommon/fabric/attributedstring/ParagraphAttributes.cpp b/ReactCommon/fabric/attributedstring/ParagraphAttributes.cpp index 1cddadf5dc1f89..f33662b81d65a4 100644 --- a/ReactCommon/fabric/attributedstring/ParagraphAttributes.cpp +++ b/ReactCommon/fabric/attributedstring/ParagraphAttributes.cpp @@ -20,12 +20,14 @@ bool ParagraphAttributes::operator==(const ParagraphAttributes &rhs) const { maximumNumberOfLines, ellipsizeMode, textBreakStrategy, - adjustsFontSizeToFit) == + adjustsFontSizeToFit, + includeFontPadding) == std::tie( rhs.maximumNumberOfLines, rhs.ellipsizeMode, rhs.textBreakStrategy, - rhs.adjustsFontSizeToFit) && + rhs.adjustsFontSizeToFit, + rhs.includeFontPadding) && floatEquality(minimumFontSize, rhs.minimumFontSize) && floatEquality(maximumFontSize, rhs.maximumFontSize); } @@ -44,7 +46,8 @@ SharedDebugStringConvertibleList ParagraphAttributes::getDebugProps() const { debugStringConvertibleItem("textBreakStrategy", textBreakStrategy), debugStringConvertibleItem("adjustsFontSizeToFit", adjustsFontSizeToFit), debugStringConvertibleItem("minimumFontSize", minimumFontSize), - debugStringConvertibleItem("maximumFontSize", maximumFontSize)}; + debugStringConvertibleItem("maximumFontSize", maximumFontSize), + debugStringConvertibleItem("includeFontPadding", includeFontPadding)}; } #endif diff --git a/ReactCommon/fabric/attributedstring/ParagraphAttributes.h b/ReactCommon/fabric/attributedstring/ParagraphAttributes.h index acc7636a6552b1..585696033618ce 100644 --- a/ReactCommon/fabric/attributedstring/ParagraphAttributes.h +++ b/ReactCommon/fabric/attributedstring/ParagraphAttributes.h @@ -49,6 +49,12 @@ class ParagraphAttributes : public DebugStringConvertible { */ bool adjustsFontSizeToFit{}; + /* + * (Android only) Leaves enough room for ascenders and descenders instead of + * using the font ascent and descent strictly. + */ + bool includeFontPadding{true}; + /* * In case of font size adjustment enabled, defines minimum and maximum * font sizes. @@ -82,7 +88,8 @@ struct hash { attributes.textBreakStrategy, attributes.adjustsFontSizeToFit, attributes.minimumFontSize, - attributes.maximumFontSize); + attributes.maximumFontSize, + attributes.includeFontPadding); } }; } // namespace std From 561a97f699dc7551c88facdb0efeb9550e037594 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 7 May 2020 17:08:17 -0700 Subject: [PATCH 218/235] Extend Text measurement to support includeFontPadding prop Summary: This diff exposes the Text.includeFontPadding prop to java, then it uses the prop to calculate the height of Text components correctly. changelog: [Internal][Fabric] Internal change in Fabric to support Text.includeFontPadding prop in fabric Reviewed By: shergin Differential Revision: D21446737 fbshipit-source-id: efe73fb6b0d402c3275ac8c012fa8fa06b743bdd --- .../com/facebook/react/views/text/TextLayoutManager.java | 6 +++++- ReactCommon/fabric/attributedstring/conversions.h | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 4b64720d80e51c..76176981b55f7a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -46,6 +46,7 @@ public class TextLayoutManager { private static final String INLINE_VIEW_PLACEHOLDER = "0"; private static final Object sSpannableCacheLock = new Object(); + private static final boolean DEFAULT_INCLUDE_FONT_PADDING = true; private static LruCache sSpannableCache = new LruCache<>(spannableCacheSize); public static boolean isRTL(ReadableMap attributedString) { @@ -221,7 +222,10 @@ public static long measureText( int textBreakStrategy = TextAttributeProps.getTextBreakStrategy(paragraphAttributes.getString("textBreakStrategy")); - boolean includeFontPadding = true; + boolean includeFontPadding = + paragraphAttributes.hasKey("includeFontPadding") + ? paragraphAttributes.getBoolean("includeFontPadding") + : DEFAULT_INCLUDE_FONT_PADDING; if (preparedSpannableText == null) { throw new IllegalStateException("Spannable element has not been prepared in onBeforeLayout"); diff --git a/ReactCommon/fabric/attributedstring/conversions.h b/ReactCommon/fabric/attributedstring/conversions.h index e92f06ace4b5ed..774913dcd326e9 100644 --- a/ReactCommon/fabric/attributedstring/conversions.h +++ b/ReactCommon/fabric/attributedstring/conversions.h @@ -448,6 +448,11 @@ inline ParagraphAttributes convertRawProp( "maximumFontSize", sourceParagraphAttributes.maximumFontSize, defaultParagraphAttributes.maximumFontSize); + paragraphAttributes.includeFontPadding = convertRawProp( + rawProps, + "includeFontPadding", + sourceParagraphAttributes.includeFontPadding, + defaultParagraphAttributes.includeFontPadding); return paragraphAttributes; } @@ -481,6 +486,8 @@ inline folly::dynamic toDynamic( values("ellipsizeMode", toString(paragraphAttributes.ellipsizeMode)); values("textBreakStrategy", toString(paragraphAttributes.textBreakStrategy)); values("adjustsFontSizeToFit", paragraphAttributes.adjustsFontSizeToFit); + values("includeFontPadding", paragraphAttributes.includeFontPadding); + return values; } From 11b9bad5b4839f75026761f71f8c7d57c6628b09 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 7 May 2020 17:08:17 -0700 Subject: [PATCH 219/235] Small refactor on text measure method Summary: Quick refactor of TextLayoutManager class changelog: [Internal] Reviewed By: shergin Differential Revision: D21446736 fbshipit-source-id: a32bdf534b167e128c8c0054cf6a126131fa740a --- .../react/views/text/TextLayoutManager.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 76176981b55f7a..f98035c179bba1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -47,6 +47,9 @@ public class TextLayoutManager { private static final Object sSpannableCacheLock = new Object(); private static final boolean DEFAULT_INCLUDE_FONT_PADDING = true; + private static final String INCLUDE_FONT_PADDING_KEY = "includeFontPadding"; + private static final String TEXT_BREAK_STRATEGY_KEY = "textBreakStrategy"; + private static final String MAXIMUM_NUMBER_OF_LINES_KEY = "maximumNumberOfLines"; private static LruCache sSpannableCache = new LruCache<>(spannableCacheSize); public static boolean isRTL(ReadableMap attributedString) { @@ -217,20 +220,20 @@ public static long measureText( // TODO(5578671): Handle text direction (see View#getTextDirectionHeuristic) TextPaint textPaint = sTextPaintInstance; - Spannable preparedSpannableText = + Spannable text = getOrCreateSpannableForText(context, attributedString, reactTextViewManagerCallback); int textBreakStrategy = - TextAttributeProps.getTextBreakStrategy(paragraphAttributes.getString("textBreakStrategy")); + TextAttributeProps.getTextBreakStrategy( + paragraphAttributes.getString(TEXT_BREAK_STRATEGY_KEY)); boolean includeFontPadding = - paragraphAttributes.hasKey("includeFontPadding") - ? paragraphAttributes.getBoolean("includeFontPadding") + paragraphAttributes.hasKey(INCLUDE_FONT_PADDING_KEY) + ? paragraphAttributes.getBoolean(INCLUDE_FONT_PADDING_KEY) : DEFAULT_INCLUDE_FONT_PADDING; - if (preparedSpannableText == null) { + if (text == null) { throw new IllegalStateException("Spannable element has not been prepared in onBeforeLayout"); } - Spanned text = preparedSpannableText; BoringLayout.Metrics boring = BoringLayout.isBoring(text, textPaint); float desiredWidth = boring == null ? Layout.getDesiredWidth(text, textPaint) : Float.NaN; @@ -306,8 +309,8 @@ public static long measureText( } int maximumNumberOfLines = - paragraphAttributes.hasKey("maximumNumberOfLines") - ? paragraphAttributes.getInt("maximumNumberOfLines") + paragraphAttributes.hasKey(MAXIMUM_NUMBER_OF_LINES_KEY) + ? paragraphAttributes.getInt(MAXIMUM_NUMBER_OF_LINES_KEY) : UNSET; int calculatedLineCount = From 853dc04d23389e4ac983f5c0400135df87b1939d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Thu, 7 May 2020 17:55:20 -0700 Subject: [PATCH 220/235] Handle optional return types/values Summary: Use folly to wrap optional return types and values as needed. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D21395439 fbshipit-source-id: a0e84e20717887e79a8565332a11fef42ebd3487 --- .../modules/ObjCppUtils/GenerateStructs.js | 85 ++++++++++--- .../modules/__test_fixtures__/fixtures.js | 115 ++++++++++++++++++ .../GenerateModuleCpp-test.js.snap | 12 ++ .../GenerateModuleH-test.js.snap | 2 + .../GenerateModuleHObjCpp-test.js.snap | 84 +++++++++++++ .../GenerateModuleMm-test.js.snap | 29 +++++ 6 files changed, 309 insertions(+), 18 deletions(-) diff --git a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js index ae924598b0ee1f..c167e65b3c3918 100644 --- a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js +++ b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js @@ -49,6 +49,12 @@ function getInlineMethodSignature( name: string, ): string { const {typeAnnotation} = property; + function markOptionalTypeIfNecessary(type) { + if (property.optional) { + return `folly::Optional<${type}>`; + } + return type; + } switch (typeAnnotation.type) { case 'ReservedFunctionValueTypeAnnotation': switch (typeAnnotation.name) { @@ -63,18 +69,29 @@ function getInlineMethodSignature( case 'NumberTypeAnnotation': case 'FloatTypeAnnotation': case 'Int32TypeAnnotation': - return `double ${property.name}() const;`; + return `${markOptionalTypeIfNecessary('double')} ${ + property.name + }() const;`; case 'BooleanTypeAnnotation': return `bool ${property.name}() const;`; case 'ObjectTypeAnnotation': - return `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, - )} ${property.name}() const;`; + return ( + markOptionalTypeIfNecessary( + `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( + property.name, + )}`, + ) + ` ${property.name}() const;` + ); case 'GenericObjectTypeAnnotation': case 'AnyTypeAnnotation': + if (property.optional) { + return `id _Nullable ${property.name}() const;`; + } return `id ${property.name}() const;`; case 'ArrayTypeAnnotation': - return `facebook::react::LazyVector> ${property.name}() const;`; + return `${markOptionalTypeIfNecessary( + 'facebook::react::LazyVector>', + )} ${property.name}() const;`; case 'FunctionTypeAnnotation': default: throw new Error(`Unknown prop type, found: ${typeAnnotation.type}"`); @@ -86,6 +103,19 @@ function getInlineMethodImplementation( name: string, ): string { const {typeAnnotation} = property; + function markOptionalTypeIfNecessary(type) { + if (property.optional) { + return `folly::Optional<${type}> `; + } + return `${type} `; + } + function markOptionalValueIfNecessary(value) { + if (property.optional) { + return `RCTBridgingToOptional${capitalizeFirstLetter(value)}`; + } + return `RCTBridgingTo${capitalizeFirstLetter(value)}`; + } + switch (typeAnnotation.type) { case 'ReservedFunctionValueTypeAnnotation': switch (typeAnnotation.name) { @@ -105,40 +135,59 @@ function getInlineMethodImplementation( case 'FloatTypeAnnotation': case 'Int32TypeAnnotation': return inlineTemplate - .replace(/::_RETURN_TYPE_::/, 'double ') - .replace(/::_RETURN_VALUE_::/, 'RCTBridgingToDouble(p)'); + .replace(/::_RETURN_TYPE_::/, markOptionalTypeIfNecessary('double')) + .replace( + /::_RETURN_VALUE_::/, + `${markOptionalValueIfNecessary('double')}(p)`, + ); case 'BooleanTypeAnnotation': return inlineTemplate - .replace(/::_RETURN_TYPE_::/, 'bool ') - .replace(/::_RETURN_VALUE_::/, 'RCTBridgingToBool(p)'); + .replace(/::_RETURN_TYPE_::/, markOptionalTypeIfNecessary('bool')) + .replace( + /::_RETURN_VALUE_::/, + `${markOptionalValueIfNecessary('bool')}(p)`, + ); case 'GenericObjectTypeAnnotation': case 'AnyTypeAnnotation': return inlineTemplate - .replace(/::_RETURN_TYPE_::/, 'id ') + .replace( + /::_RETURN_TYPE_::/, + property.optional ? 'id _Nullable ' : 'id ', + ) .replace(/::_RETURN_VALUE_::/, 'p'); case 'ObjectTypeAnnotation': return inlineTemplate .replace( /::_RETURN_TYPE_::/, - `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, - )} `, + markOptionalTypeIfNecessary( + `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( + property.name, + )}`, + ), ) .replace( /::_RETURN_VALUE_::/, - `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, - )}(p)`, + property.optional + ? `(p == nil ? folly::none : folly::make_optional(JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( + property.name, + )}(p)))` + : `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( + property.name, + )}(p)`, ); case 'ArrayTypeAnnotation': return inlineTemplate .replace( /::_RETURN_TYPE_::/, - 'facebook::react::LazyVector> ', + markOptionalTypeIfNecessary( + 'facebook::react::LazyVector>', + ), ) .replace( /::_RETURN_VALUE_::/, - 'RCTBridgingToVec(p, ^id(id itemValue_0) { return itemValue_0; })', + `${markOptionalValueIfNecessary( + 'vec', + )}(p, ^id(id itemValue_0) { return itemValue_0; })`, ); case 'FunctionTypeAnnotation': default: diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js index 25725ebaa42c26..728d37ce3a85e2 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js @@ -480,6 +480,121 @@ const COMPLEX_OBJECTS: SchemaType = { optional: false, }, }, + { + name: 'optionals', + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'VoidTypeAnnotation', + }, + params: [ + { + nullable: false, + name: 'A', + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + optional: true, + name: 'optionalNumberProperty', + typeAnnotation: { + type: 'NumberTypeAnnotation', + }, + }, + { + optional: true, + name: 'optionalArrayProperty', + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'NumberTypeAnnotation', + }, + }, + }, + { + optional: true, + name: 'optionalObjectProperty', + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: [ + { + optional: false, + name: 'x', + typeAnnotation: { + type: 'NumberTypeAnnotation', + }, + }, + { + optional: false, + name: 'y', + typeAnnotation: { + type: 'NumberTypeAnnotation', + }, + }, + ], + }, + }, + { + optional: true, + name: 'optionalGenericObjectProperty', + typeAnnotation: { + type: 'GenericObjectTypeAnnotation', + }, + }, + ], + }, + }, + ], + optional: false, + }, + }, + { + name: 'optionalMethod', + typeAnnotation: { + type: 'FunctionTypeAnnotation', + returnTypeAnnotation: { + nullable: false, + type: 'VoidTypeAnnotation', + }, + params: [ + { + nullable: false, + name: 'options', + typeAnnotation: { + type: 'GenericObjectTypeAnnotation', + }, + }, + { + name: 'callback', + nullable: false, + typeAnnotation: { + type: 'FunctionTypeAnnotation', + }, + }, + { + name: 'extras', + nullable: true, + typeAnnotation: { + type: 'ArrayTypeAnnotation', + elementType: { + type: 'ObjectTypeAnnotation', + properties: [ + { + optional: false, + name: 'key', + typeAnnotation: { + type: 'StringTypeAnnotation', + }, + }, + ], + }, + }, + }, + ], + optional: true, + }, + }, ], }, }, diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap index f79507df8b3d3a..e3b257ba994b24 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleCpp-test.js.snap @@ -19,9 +19,21 @@ static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_difficult(jsi return static_cast(&turboModule)->difficult(rt, args[0].getObject(rt)); } +static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionals(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_cast(&turboModule)->optionals(rt, args[0].getObject(rt)); + return jsi::Value::undefined(); +} + +static jsi::Value __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionalMethod(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { + static_cast(&turboModule)->optionalMethod(rt, args[0].getObject(rt), std::move(args[1].getObject(rt).getFunction(rt)), args[2].getObject(rt).getArray(rt)); + return jsi::Value::undefined(); +} + NativeSampleTurboModuleCxxSpecJSI::NativeSampleTurboModuleCxxSpecJSI(std::shared_ptr jsInvoker) : TurboModule(\\"SampleTurboModule\\", jsInvoker) { methodMap_[\\"difficult\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_difficult}; + methodMap_[\\"optionals\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionals}; + methodMap_[\\"optionalMethod\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleCxxSpecJSI_optionalMethod}; } diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap index 2fcc8834fa2372..308af3d47cdc32 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap @@ -23,6 +23,8 @@ protected: public: virtual jsi::Object difficult(jsi::Runtime &rt, const jsi::Object &A) = 0; +virtual void optionals(jsi::Runtime &rt, const jsi::Object &A) = 0; +virtual void optionalMethod(jsi::Runtime &rt, const jsi::Object &options, const jsi::Function &callback, const jsi::Array &extras) = 0; }; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index 3a9fa5676a0f62..3bbf6cc05bc73b 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -34,6 +34,24 @@ Map { +namespace JS { + namespace NativeSampleTurboModule { + struct SpecOptionalsAOptionalObjectProperty { + double x() const; + double y() const; + + SpecOptionalsAOptionalObjectProperty(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeSampleTurboModule_SpecOptionalsAOptionalObjectProperty) ++ (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecOptionalsAOptionalObjectProperty:(id)json; +@end + + namespace JS { namespace NativeSampleTurboModule { struct SpecDifficultAE { @@ -53,6 +71,26 @@ namespace JS { @end +namespace JS { + namespace NativeSampleTurboModule { + struct SpecOptionalsA { + folly::Optional optionalNumberProperty() const; + folly::Optional>> optionalArrayProperty() const; + folly::Optional optionalObjectProperty() const; + id _Nullable optionalGenericObjectProperty() const; + + SpecOptionalsA(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeSampleTurboModule_SpecOptionalsA) ++ (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecOptionalsA:(id)json; +@end + + namespace JS { namespace NativeSampleTurboModule { struct SpecDifficultReturnType { @@ -132,6 +170,34 @@ inline NSString *JS::NativeSampleTurboModule::SpecDifficultReturnType::F() const } +inline folly::Optional JS::NativeSampleTurboModule::SpecOptionalsA::optionalNumberProperty() const +{ + id const p = _v[@\\"optionalNumberProperty\\"]; + return RCTBridgingToOptionalDouble(p); +} + + +inline folly::Optional>> JS::NativeSampleTurboModule::SpecOptionalsA::optionalArrayProperty() const +{ + id const p = _v[@\\"optionalArrayProperty\\"]; + return RCTBridgingToOptionalVec(p, ^id(id itemValue_0) { return itemValue_0; }); +} + + +inline folly::Optional JS::NativeSampleTurboModule::SpecOptionalsA::optionalObjectProperty() const +{ + id const p = _v[@\\"optionalObjectProperty\\"]; + return (p == nil ? folly::none : folly::make_optional(JS::NativeSampleTurboModule::SpecOptionalsAOptionalObjectProperty(p))); +} + + +inline id _Nullable JS::NativeSampleTurboModule::SpecOptionalsA::optionalGenericObjectProperty() const +{ + id const p = _v[@\\"optionalGenericObjectProperty\\"]; + return p; +} + + inline bool JS::NativeSampleTurboModule::SpecDifficultAE::D() const { id const p = _v[@\\"D\\"]; @@ -153,9 +219,27 @@ inline NSString *JS::NativeSampleTurboModule::SpecDifficultAE::F() const } +inline double JS::NativeSampleTurboModule::SpecOptionalsAOptionalObjectProperty::x() const +{ + id const p = _v[@\\"x\\"]; + return RCTBridgingToDouble(p); +} + + +inline double JS::NativeSampleTurboModule::SpecOptionalsAOptionalObjectProperty::y() const +{ + id const p = _v[@\\"y\\"]; + return RCTBridgingToDouble(p); +} + + @protocol NativeSampleTurboModuleSpec - (NSDictionary *) difficult:(JS::NativeSampleTurboModule::SpecDifficultA&)A; +- (void) optionals:(JS::NativeSampleTurboModule::SpecOptionalsA&)A; +- (void) optionalMethod:(NSDictionary *)options + callback:(RCTResponseSenderBlock)callback + extras:(NSArray * _Nullable)extras; @end diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap index bfa9d42b6cc132..86abf78460cec5 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleMm-test.js.snap @@ -32,6 +32,14 @@ Map { @end +@implementation RCTCxxConvert (NativeSampleTurboModule_SpecOptionalsA) ++ (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecOptionalsA:(id)json +{ + return facebook::react::managedPointer(json); +} +@end + + @implementation RCTCxxConvert (NativeSampleTurboModule_SpecDifficultAE) + (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecDifficultAE:(id)json { @@ -39,6 +47,14 @@ Map { } @end + +@implementation RCTCxxConvert (NativeSampleTurboModule_SpecOptionalsAOptionalObjectProperty) ++ (RCTManagedPointer *)JS_NativeSampleTurboModule_SpecOptionalsAOptionalObjectProperty:(id)json +{ + return facebook::react::managedPointer(json); +} +@end + namespace facebook { namespace react { @@ -47,10 +63,23 @@ namespace facebook { .invokeObjCMethod(rt, ObjectKind, \\"difficult\\", @selector(difficult:), args, count); } + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_optionals(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, VoidKind, \\"optionals\\", @selector(optionals:), args, count); + } + + static facebook::jsi::Value __hostFunction_NativeSampleTurboModuleSpecJSI_optionalMethod(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { + return static_cast(turboModule) + .invokeObjCMethod(rt, VoidKind, \\"optionalMethod\\", @selector(optionalMethod:callback:extras:), args, count); + } + NativeSampleTurboModuleSpecJSI::NativeSampleTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) : ObjCTurboModule(params) { methodMap_[\\"difficult\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_difficult}; + methodMap_[\\"optionals\\"] = MethodMetadata {1, __hostFunction_NativeSampleTurboModuleSpecJSI_optionals}; + methodMap_[\\"optionalMethod\\"] = MethodMetadata {3, __hostFunction_NativeSampleTurboModuleSpecJSI_optionalMethod}; setMethodArgConversionSelector(@\\"difficult\\", 0, @\\"JS_NativeSampleTurboModule_SpecDifficultA:\\"); + setMethodArgConversionSelector(@\\"optionals\\", 0, @\\"JS_NativeSampleTurboModule_SpecOptionalsA:\\"); } } // namespace react } // namespace facebook From 6e88ab6bb2533a7b13a36ef156cffa7a6d70fad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Thu, 7 May 2020 17:55:20 -0700 Subject: [PATCH 221/235] Avoid redefining id when a property is named 'id' Summary: Handle properties named 'id' as a special case. An example of a native module that ran afoul of this is `ExceptionsManager`. Observe how the ExceptionsManager spec at `Libraries/Core/NativeExceptionsManager.js` defines the ExceptionData type as containing an `id` property: ``` export type ExceptionData = { message: string, originalMessage: ?string, name: ?string, componentStack: ?string, stack: Array, id: number, isFatal: boolean, // flowlint-next-line unclear-type:off extraData?: Object, ... }; ``` Prior to this change, the generated code would redefine id in the SpecReportExceptionData struct... ``` namespace JS { namespace NativeExceptionsManager { struct SpecReportExceptionData { // ...redacted... double id() const; <--- // ...redacted... SpecReportExceptionData(NSDictionary *const v) : _v(v) {} private: NSDictionary *_v; }; } } ``` ...which would result in a build time error: ``` inline double JS::NativeExceptionsManager::SpecReportExceptionData::id() const { id const p = _v[@"id"]; ^--- build time error here return RCTBridgingToDouble(p); } ``` Comparing the above example with the currently checked in `FBReactNativeSpec.h`, I see the expected output should be: ``` namespace JS { namespace NativeExceptionsManager { struct SpecReportExceptionData { // ...redacted... double id_() const; // ...redacted... SpecReportExceptionData(NSDictionary *const v) : _v(v) {} private: NSDictionary *_v; }; } } ``` ...and... ``` inline double JS::NativeExceptionsManager::SpecReportExceptionData::id_() const { id const p = _v[@"id"]; return RCTBridgingToDouble(p); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D21395463 fbshipit-source-id: e412648013ff9f70ebd294b6f5f81f1faccb4604 --- .../modules/ObjCppUtils/GenerateStructs.js | 44 ++++++++++++------- .../modules/__test_fixtures__/fixtures.js | 14 ++++++ .../GenerateModuleHObjCpp-test.js.snap | 16 +++++++ 3 files changed, 59 insertions(+), 15 deletions(-) diff --git a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js index c167e65b3c3918..416e7c549fb03d 100644 --- a/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js +++ b/packages/react-native-codegen/src/generators/modules/ObjCppUtils/GenerateStructs.js @@ -44,6 +44,13 @@ inline ::_RETURN_TYPE_::JS::Native::_MODULE_NAME_::::Spec::_STRUCT_NAME_::::::_P } `; +function getSafePropertyName(name: string) { + if (name === 'id') { + return `${name}_`; + } + return name; +} + function getInlineMethodSignature( property: ObjectParamTypeAnnotation, name: string, @@ -59,39 +66,43 @@ function getInlineMethodSignature( case 'ReservedFunctionValueTypeAnnotation': switch (typeAnnotation.name) { case 'RootTag': - return `double ${property.name}() const;`; + return `double ${getSafePropertyName(property.name)}() const;`; default: (typeAnnotation.name: empty); throw new Error(`Unknown prop type, found: ${typeAnnotation.name}"`); } case 'StringTypeAnnotation': - return `NSString *${property.name}() const;`; + return `NSString *${getSafePropertyName(property.name)}() const;`; case 'NumberTypeAnnotation': case 'FloatTypeAnnotation': case 'Int32TypeAnnotation': - return `${markOptionalTypeIfNecessary('double')} ${ - property.name - }() const;`; + return `${markOptionalTypeIfNecessary('double')} ${getSafePropertyName( + property.name, + )}() const;`; case 'BooleanTypeAnnotation': - return `bool ${property.name}() const;`; + return `${markOptionalTypeIfNecessary('bool')} ${getSafePropertyName( + property.name, + )}() const;`; case 'ObjectTypeAnnotation': return ( markOptionalTypeIfNecessary( `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, + getSafePropertyName(property.name), )}`, - ) + ` ${property.name}() const;` + ) + ` ${getSafePropertyName(property.name)}() const;` ); case 'GenericObjectTypeAnnotation': case 'AnyTypeAnnotation': if (property.optional) { - return `id _Nullable ${property.name}() const;`; + return `id _Nullable ${getSafePropertyName( + property.name, + )}() const;`; } - return `id ${property.name}() const;`; + return `id ${getSafePropertyName(property.name)}() const;`; case 'ArrayTypeAnnotation': return `${markOptionalTypeIfNecessary( 'facebook::react::LazyVector>', - )} ${property.name}() const;`; + )} ${getSafePropertyName(property.name)}() const;`; case 'FunctionTypeAnnotation': default: throw new Error(`Unknown prop type, found: ${typeAnnotation.type}"`); @@ -161,7 +172,7 @@ function getInlineMethodImplementation( /::_RETURN_TYPE_::/, markOptionalTypeIfNecessary( `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, + getSafePropertyName(property.name), )}`, ), ) @@ -169,10 +180,10 @@ function getInlineMethodImplementation( /::_RETURN_VALUE_::/, property.optional ? `(p == nil ? folly::none : folly::make_optional(JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, + getSafePropertyName(property.name), )}(p)))` : `JS::Native::_MODULE_NAME_::::Spec${name}${capitalizeFirstLetter( - property.name, + getSafePropertyName(property.name), )}(p)`, ); case 'ArrayTypeAnnotation': @@ -214,7 +225,10 @@ function translateObjectsForStructs( acc.concat( object.properties.map(property => getInlineMethodImplementation(property, object.name) - .replace(/::_PROPERTY_NAME_::/g, property.name) + .replace( + /::_PROPERTY_NAME_::/g, + getSafePropertyName(property.name), + ) .replace(/::_STRUCT_NAME_::/g, object.name), ), ), diff --git a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js index 728d37ce3a85e2..fd534a9af516fb 100644 --- a/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js +++ b/packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js @@ -463,6 +463,13 @@ const COMPLEX_OBJECTS: SchemaType = { type: 'StringTypeAnnotation', }, }, + { + optional: false, + name: 'id', + typeAnnotation: { + type: 'NumberTypeAnnotation', + }, + }, ], }, }, @@ -542,6 +549,13 @@ const COMPLEX_OBJECTS: SchemaType = { type: 'GenericObjectTypeAnnotation', }, }, + { + optional: true, + name: 'optionalBooleanTypeProperty', + typeAnnotation: { + type: 'BooleanTypeAnnotation', + }, + }, ], }, }, diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap index 3bbf6cc05bc73b..6005fc72f622f0 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap @@ -58,6 +58,7 @@ namespace JS { bool D() const; double E() const; NSString *F() const; + double id_() const; SpecDifficultAE(NSDictionary *const v) : _v(v) {} private: @@ -78,6 +79,7 @@ namespace JS { folly::Optional>> optionalArrayProperty() const; folly::Optional optionalObjectProperty() const; id _Nullable optionalGenericObjectProperty() const; + folly::Optional optionalBooleanTypeProperty() const; SpecOptionalsA(NSDictionary *const v) : _v(v) {} private: @@ -198,6 +200,13 @@ inline id _Nullable JS::NativeSampleTurboModule::SpecOptionalsA::optio } +inline folly::Optional JS::NativeSampleTurboModule::SpecOptionalsA::optionalBooleanTypeProperty() const +{ + id const p = _v[@\\"optionalBooleanTypeProperty\\"]; + return RCTBridgingToOptionalBool(p); +} + + inline bool JS::NativeSampleTurboModule::SpecDifficultAE::D() const { id const p = _v[@\\"D\\"]; @@ -219,6 +228,13 @@ inline NSString *JS::NativeSampleTurboModule::SpecDifficultAE::F() const } +inline double JS::NativeSampleTurboModule::SpecDifficultAE::id_() const +{ + id const p = _v[@\\"id_\\"]; + return RCTBridgingToDouble(p); +} + + inline double JS::NativeSampleTurboModule::SpecOptionalsAOptionalObjectProperty::x() const { id const p = _v[@\\"x\\"]; From 14a0f3fdeacd1463a4cd2be4aea05e7a4059181d Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 7 May 2020 18:02:47 -0700 Subject: [PATCH 222/235] Eager initialize Fabric Android classes Summary: This diff eager initializes Fabric Android classes. This should help load all the Fabric classes at Bridge load time. changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D21460507 fbshipit-source-id: 4b8d5c4e2d19e3a7eb3077027071e64ff16f1cbd --- .../react/fabric/FabricJSIModuleProvider.java | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java index 38b4c39cbfafb2..0caf99934dd9f2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java @@ -20,18 +20,23 @@ import com.facebook.react.fabric.mounting.LayoutMetricsConversions; import com.facebook.react.fabric.mounting.MountingManager; import com.facebook.react.fabric.mounting.mountitems.BatchMountItem; +import com.facebook.react.fabric.mounting.mountitems.CreateMountItem; import com.facebook.react.fabric.mounting.mountitems.DeleteMountItem; +import com.facebook.react.fabric.mounting.mountitems.DispatchCommandMountItem; import com.facebook.react.fabric.mounting.mountitems.DispatchIntCommandMountItem; import com.facebook.react.fabric.mounting.mountitems.DispatchStringCommandMountItem; import com.facebook.react.fabric.mounting.mountitems.InsertMountItem; import com.facebook.react.fabric.mounting.mountitems.MountItem; import com.facebook.react.fabric.mounting.mountitems.PreAllocateViewMountItem; +import com.facebook.react.fabric.mounting.mountitems.RemoveDeleteMultiMountItem; import com.facebook.react.fabric.mounting.mountitems.RemoveMountItem; +import com.facebook.react.fabric.mounting.mountitems.SendAccessibilityEvent; import com.facebook.react.fabric.mounting.mountitems.UpdateEventEmitterMountItem; import com.facebook.react.fabric.mounting.mountitems.UpdateLayoutMountItem; import com.facebook.react.fabric.mounting.mountitems.UpdateLocalDataMountItem; import com.facebook.react.fabric.mounting.mountitems.UpdatePaddingMountItem; import com.facebook.react.fabric.mounting.mountitems.UpdatePropsMountItem; +import com.facebook.react.fabric.mounting.mountitems.UpdateStateMountItem; import com.facebook.react.uimanager.StateWrapper; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.events.BatchEventDispatchedListener; @@ -101,33 +106,38 @@ private FabricUIManager createUIManager(@NonNull EventBeatManager eventBeatManag // TODO T31905686: eager load Fabric classes, this is temporary and it will be removed // in the near future private static void loadClasses() { - BatchEventDispatchedListener.class.getClass(); - ReactNativeConfig.class.getClass(); - FabricComponents.class.getClass(); - StateWrapper.class.getClass(); + EventBeatManager.class.getClass(); + EventEmitterWrapper.class.getClass(); FabricEventEmitter.class.getClass(); - FabricUIManager.class.getClass(); - GuardedFrameCallback.class.getClass(); BatchMountItem.class.getClass(); + CreateMountItem.class.getClass(); DeleteMountItem.class.getClass(); + DispatchCommandMountItem.class.getClass(); DispatchIntCommandMountItem.class.getClass(); DispatchStringCommandMountItem.class.getClass(); InsertMountItem.class.getClass(); MountItem.class.getClass(); + PreAllocateViewMountItem.class.getClass(); + RemoveDeleteMultiMountItem.class.getClass(); RemoveMountItem.class.getClass(); + SendAccessibilityEvent.class.getClass(); UpdateEventEmitterMountItem.class.getClass(); UpdateLayoutMountItem.class.getClass(); UpdateLocalDataMountItem.class.getClass(); UpdatePaddingMountItem.class.getClass(); UpdatePropsMountItem.class.getClass(); + UpdateStateMountItem.class.getClass(); LayoutMetricsConversions.class.getClass(); MountingManager.class.getClass(); Binding.class.getClass(); ComponentFactoryDelegate.class.getClass(); - EventBeatManager.class.getClass(); - EventEmitterWrapper.class.getClass(); - StateWrapperImpl.class.getClass(); + FabricComponents.class.getClass(); FabricSoLoader.class.getClass(); - PreAllocateViewMountItem.class.getClass(); + FabricUIManager.class.getClass(); + GuardedFrameCallback.class.getClass(); + StateWrapper.class.getClass(); + StateWrapperImpl.class.getClass(); + BatchEventDispatchedListener.class.getClass(); + ReactNativeConfig.class.getClass(); } } From 938aa86013f04dcc709e7d0932812f866982ca0e Mon Sep 17 00:00:00 2001 From: Will Holen Date: Thu, 7 May 2020 21:03:00 -0700 Subject: [PATCH 223/235] Remove Hermes.setPauseOnLoad message Summary: This removes the Hermes.setPauseOnLoad. It will be replaced by the more standard Debugger.setInstrumentationBreakpoint's "beforeScriptExecution" event. ChangeLog: [Internal] Remove Hermes.setPauseOnLoad message (to be replaced) Reviewed By: mhorowitz Differential Revision: D21418219 fbshipit-source-id: 93c53801c23487f9336b322c2bd737663ec21b97 --- .../hermes/inspector/chrome/Connection.cpp | 16 ---------- .../hermes/inspector/chrome/MessageTypes.cpp | 30 +------------------ .../hermes/inspector/chrome/MessageTypes.h | 18 +---------- .../hermes/inspector/tools/message_types.txt | 1 - 4 files changed, 2 insertions(+), 63 deletions(-) diff --git a/ReactCommon/hermes/inspector/chrome/Connection.cpp b/ReactCommon/hermes/inspector/chrome/Connection.cpp index 354eede529c9eb..68d1f30b72dea3 100644 --- a/ReactCommon/hermes/inspector/chrome/Connection.cpp +++ b/ReactCommon/hermes/inspector/chrome/Connection.cpp @@ -88,7 +88,6 @@ class Connection::Impl : public inspector::InspectorObserver, const m::heapProfiler::StopTrackingHeapObjectsRequest &req) override; void handle(const m::runtime::EvaluateRequest &req) override; void handle(const m::runtime::GetPropertiesRequest &req) override; - void handle(const m::hermes::SetPauseOnLoadRequest &req) override; private: std::vector makePropsFromScope( @@ -761,21 +760,6 @@ void Connection::Impl::handle(const m::runtime::GetPropertiesRequest &req) { .thenError(sendErrorToClient(req.id)); } -void Connection::Impl::handle(const m::hermes::SetPauseOnLoadRequest &req) { - PauseOnLoadMode mode; - if (req.state == "none") { - mode = PauseOnLoadMode::None; - } else if (req.state == "all") { - mode = PauseOnLoadMode::All; - } else if (req.state == "smart") { - mode = PauseOnLoadMode::Smart; - } else { - sendErrorToClientViaExecutor(req.id, "Unrecognized pause on load mode"); - return; - } - sendResponseToClientViaExecutor(inspector_->setPauseOnLoads(mode), req.id); -} - /* * Send-to-client methods */ diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp index 18ce5ac65a6a60..ae0f77851a1e14 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<0d7691362d081e7bc44d2b7a0ed24371>> +// @generated SignedSource<<4ab81efd6f767bd583d00c806b7d1d9b>> #include "MessageTypes.h" @@ -46,7 +46,6 @@ std::unique_ptr Request::fromJsonThrowOnError(const std::string &str) { makeUnique}, {"HeapProfiler.takeHeapSnapshot", makeUnique}, - {"Hermes.setPauseOnLoad", makeUnique}, {"Runtime.evaluate", makeUnique}, {"Runtime.getProperties", makeUnique}, }; @@ -683,33 +682,6 @@ void heapProfiler::TakeHeapSnapshotRequest::accept( handler.handle(*this); } -hermes::SetPauseOnLoadRequest::SetPauseOnLoadRequest() - : Request("Hermes.setPauseOnLoad") {} - -hermes::SetPauseOnLoadRequest::SetPauseOnLoadRequest(const dynamic &obj) - : Request("Hermes.setPauseOnLoad") { - assign(id, obj, "id"); - assign(method, obj, "method"); - - dynamic params = obj.at("params"); - assign(state, params, "state"); -} - -dynamic hermes::SetPauseOnLoadRequest::toDynamic() const { - dynamic params = dynamic::object; - put(params, "state", state); - - dynamic obj = dynamic::object; - put(obj, "id", id); - put(obj, "method", method); - put(obj, "params", std::move(params)); - return obj; -} - -void hermes::SetPauseOnLoadRequest::accept(RequestHandler &handler) const { - handler.handle(*this); -} - runtime::EvaluateRequest::EvaluateRequest() : Request("Runtime.evaluate") {} runtime::EvaluateRequest::EvaluateRequest(const dynamic &obj) diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.h b/ReactCommon/hermes/inspector/chrome/MessageTypes.h index 3d7222fd6ac65a..503b486743c3a8 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.h +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.h @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<08b66e22784e225b926d36131b9a7693>> +// @generated SignedSource<<0a1a011902fd18d4eebd2fe12fafb8b1>> #pragma once @@ -73,10 +73,6 @@ struct StopTrackingHeapObjectsRequest; struct TakeHeapSnapshotRequest; } // namespace heapProfiler -namespace hermes { -struct SetPauseOnLoadRequest; -} // namespace hermes - /// RequestHandler handles requests via the visitor pattern. struct RequestHandler { virtual ~RequestHandler() = default; @@ -99,7 +95,6 @@ struct RequestHandler { virtual void handle( const heapProfiler::StopTrackingHeapObjectsRequest &req) = 0; virtual void handle(const heapProfiler::TakeHeapSnapshotRequest &req) = 0; - virtual void handle(const hermes::SetPauseOnLoadRequest &req) = 0; virtual void handle(const runtime::EvaluateRequest &req) = 0; virtual void handle(const runtime::GetPropertiesRequest &req) = 0; }; @@ -124,7 +119,6 @@ struct NoopRequestHandler : public RequestHandler { void handle( const heapProfiler::StopTrackingHeapObjectsRequest &req) override {} void handle(const heapProfiler::TakeHeapSnapshotRequest &req) override {} - void handle(const hermes::SetPauseOnLoadRequest &req) override {} void handle(const runtime::EvaluateRequest &req) override {} void handle(const runtime::GetPropertiesRequest &req) override {} }; @@ -417,16 +411,6 @@ struct heapProfiler::TakeHeapSnapshotRequest : public Request { folly::Optional treatGlobalObjectsAsRoots; }; -struct hermes::SetPauseOnLoadRequest : public Request { - SetPauseOnLoadRequest(); - explicit SetPauseOnLoadRequest(const folly::dynamic &obj); - - folly::dynamic toDynamic() const override; - void accept(RequestHandler &handler) const override; - - std::string state; -}; - struct runtime::EvaluateRequest : public Request { EvaluateRequest(); explicit EvaluateRequest(const folly::dynamic &obj); diff --git a/ReactCommon/hermes/inspector/tools/message_types.txt b/ReactCommon/hermes/inspector/tools/message_types.txt index 6d02ed4e754d6e..420fdad15d6d08 100644 --- a/ReactCommon/hermes/inspector/tools/message_types.txt +++ b/ReactCommon/hermes/inspector/tools/message_types.txt @@ -23,4 +23,3 @@ Runtime.consoleAPICalled Runtime.evaluate Runtime.executionContextCreated Runtime.getProperties -Hermes.setPauseOnLoad From bf837d6373f536839c9cb3c93c2c106f44a4abc8 Mon Sep 17 00:00:00 2001 From: Will Holen Date: Thu, 7 May 2020 21:03:00 -0700 Subject: [PATCH 224/235] Add support for Debugger.setInstrumentationBreakpoint Summary: This diff adds support for the "beforeScriptWithSourceMapExecution" instrumentation breakpoint via "Debugger.setInstrumentationBreakpoint". CDP describes it as a breakpoint, but we just set a flag in the inspector. A fake breakpoint ID is synthesized for optional removal later. Changelog: [Internal] Add Debugger.setInstrumentationBreakpoint to Hermes Inspector Reviewed By: mhorowitz Differential Revision: D21418218 fbshipit-source-id: 90fa49c0954980993815322d3a7effee416ed5db --- ReactCommon/hermes/inspector/Inspector.cpp | 3 +- .../hermes/inspector/chrome/Connection.cpp | 127 +++++++++++++++++- .../hermes/inspector/chrome/MessageTypes.cpp | 52 ++++++- .../hermes/inspector/chrome/MessageTypes.h | 26 +++- .../chrome/tests/AsyncHermesRuntime.cpp | 4 + .../chrome/tests/AsyncHermesRuntime.h | 5 + .../chrome/tests/ConnectionTests.cpp | 78 +++++++++++ .../hermes/inspector/tools/message_types.txt | 1 + 8 files changed, 287 insertions(+), 9 deletions(-) diff --git a/ReactCommon/hermes/inspector/Inspector.cpp b/ReactCommon/hermes/inspector/Inspector.cpp index 7376b578aa1e1c..3cca8ce1553b22 100644 --- a/ReactCommon/hermes/inspector/Inspector.cpp +++ b/ReactCommon/hermes/inspector/Inspector.cpp @@ -384,7 +384,8 @@ folly::Future Inspector::setPauseOnExceptions( folly::Future Inspector::setPauseOnLoads( const PauseOnLoadMode mode) { - std::unique_lock lock(mutex_); + // This flag does not touch the runtime, so it doesn't need the executor. + // Return a future anyways for consistency. auto promise = std::make_shared>(); pauseOnLoadMode_ = mode; promise->setValue(); diff --git a/ReactCommon/hermes/inspector/chrome/Connection.cpp b/ReactCommon/hermes/inspector/chrome/Connection.cpp index 68d1f30b72dea3..4915395d7896dc 100644 --- a/ReactCommon/hermes/inspector/chrome/Connection.cpp +++ b/ReactCommon/hermes/inspector/chrome/Connection.cpp @@ -35,6 +35,10 @@ namespace debugger = ::facebook::hermes::debugger; namespace inspector = ::facebook::hermes::inspector; namespace m = ::facebook::hermes::inspector::chrome::message; +static const char *const kVirtualBreakpointPrefix = "virtualbreakpoint-"; +static const char *const kBeforeScriptWithSourceMapExecution = + "beforeScriptWithSourceMapExecution"; + /* * Connection::Impl */ @@ -77,6 +81,8 @@ class Connection::Impl : public inspector::InspectorObserver, void handle(const m::debugger::ResumeRequest &req) override; void handle(const m::debugger::SetBreakpointRequest &req) override; void handle(const m::debugger::SetBreakpointByUrlRequest &req) override; + void handle( + const m::debugger::SetInstrumentationBreakpointRequest &req) override; void handle(const m::debugger::SetPauseOnExceptionsRequest &req) override; void handle(const m::debugger::StepIntoRequest &req) override; void handle(const m::debugger::StepOutRequest &req) override; @@ -110,6 +116,7 @@ class Connection::Impl : public inspector::InspectorObserver, folly::Function sendErrorToClient(int id); void sendResponseToClientViaExecutor(int id); void sendResponseToClientViaExecutor(folly::Future future, int id); + void sendResponseToClientViaExecutor(const m::Response &resp); void sendNotificationToClientViaExecutor(const m::Notification ¬e); void sendErrorToClientViaExecutor(int id, const std::string &error); @@ -130,6 +137,19 @@ class Connection::Impl : public inspector::InspectorObserver, std::mutex parsedScriptsMutex_; std::vector parsedScripts_; + // Some events are represented as a mode in Hermes but a breakpoint in CDP, + // e.g. "beforeScriptExecution" and "beforeScriptWithSourceMapExecution". + // Keep track of these separately. The caller should lock the + // virtualBreakpointMutex_. + std::mutex virtualBreakpointMutex_; + uint32_t nextVirtualBreakpoint_ = 1; + const std::string &createVirtualBreakpoint(const std::string &category); + bool isVirtualBreakpointId(const std::string &id); + bool hasVirtualBreakpoint(const std::string &category); + bool removeVirtualBreakpoint(const std::string &id); + std::unordered_map> + virtualBreakpoints_; + // The rest of these member variables are only accessed via executor_. std::unique_ptr executor_; std::unique_ptr remoteConn_; @@ -271,6 +291,7 @@ void Connection::Impl::onContextCreated(Inspector &inspector) { void Connection::Impl::onPause( Inspector &inspector, const debugger::ProgramState &state) { + bool sendNotification = true; m::debugger::PausedNotification note; note.callFrames = m::debugger::makeCallFrames(state, objTable_, getRuntime()); @@ -290,15 +311,37 @@ void Connection::Impl::onPause( case debugger::PauseReason::Exception: note.reason = "exception"; break; - case debugger::PauseReason::ScriptLoaded: - note.reason = "load"; + case debugger::PauseReason::ScriptLoaded: { + note.reason = "other"; + note.hitBreakpoints = std::vector(); + + std::lock_guard lock(virtualBreakpointMutex_); + for (auto &bp : + virtualBreakpoints_[kBeforeScriptWithSourceMapExecution]) { + note.hitBreakpoints->emplace_back(bp); + } + + // Debuggers don't tend to ever remove these kinds of breakpoints, but + // in the extremely unlikely event that it did *and* did it exactly + // between us 1. checking that we should stop, and 2. adding the stop + // reason here, then just resume and skip sending a pause notification. + if (note.hitBreakpoints->empty()) { + sendNotification = false; + inspector_->resume(); + } + }; + // This will be toggled back on in the next onScriptParsed if applicable + // Locking is handled by didPause in the inspector + inspector_->setPauseOnLoads(PauseOnLoadMode::None); break; default: note.reason = "other"; break; } - sendNotificationToClientViaExecutor(note); + if (sendNotification) { + sendNotificationToClientViaExecutor(note); + } } void Connection::Impl::onResume(Inspector &inspector) { @@ -317,6 +360,15 @@ void Connection::Impl::onScriptParsed( if (!info.sourceMappingUrl.empty()) { note.sourceMapURL = info.sourceMappingUrl; + + std::lock_guard lock(virtualBreakpointMutex_); + if (hasVirtualBreakpoint(kBeforeScriptWithSourceMapExecution)) { + // We are precariously relying on the fact that onScriptParsed + // is invoked immediately before the pause load mode is checked. + // That means that we can check for breakpoints and toggle the + // mode here, and then immediately turn it off in onPause. + inspector_->setPauseOnLoads(PauseOnLoadMode::All); + } } { @@ -524,9 +576,18 @@ void Connection::Impl::handle(const m::debugger::PauseRequest &req) { } void Connection::Impl::handle(const m::debugger::RemoveBreakpointRequest &req) { - auto breakpointId = folly::to(req.breakpointId); - sendResponseToClientViaExecutor( - inspector_->removeBreakpoint(breakpointId), req.id); + if (isVirtualBreakpointId(req.breakpointId)) { + std::lock_guard lock(virtualBreakpointMutex_); + if (!removeVirtualBreakpoint(req.breakpointId)) { + sendErrorToClientViaExecutor( + req.id, "Unknown breakpoint ID: " + req.breakpointId); + } + sendResponseToClientViaExecutor(req.id); + } else { + auto breakpointId = folly::to(req.breakpointId); + sendResponseToClientViaExecutor( + inspector_->removeBreakpoint(breakpointId), req.id); + } } void Connection::Impl::handle(const m::debugger::ResumeRequest &req) { @@ -593,6 +654,51 @@ void Connection::Impl::handle( .thenError(sendErrorToClient(req.id)); } +bool Connection::Impl::isVirtualBreakpointId(const std::string &id) { + return id.rfind(kVirtualBreakpointPrefix, 0) == 0; +} + +const std::string &Connection::Impl::createVirtualBreakpoint( + const std::string &category) { + auto ret = virtualBreakpoints_[category].insert(folly::to( + kVirtualBreakpointPrefix, nextVirtualBreakpoint_++)); + return *ret.first; +} + +bool Connection::Impl::hasVirtualBreakpoint(const std::string &category) { + auto pos = virtualBreakpoints_.find(category); + if (pos == virtualBreakpoints_.end()) + return false; + return !pos->second.empty(); +} + +bool Connection::Impl::removeVirtualBreakpoint(const std::string &id) { + // We expect roughly 1 category, so just iterate over all the sets + for (auto &kv : virtualBreakpoints_) { + if (kv.second.erase(id) > 0) { + return true; + } + } + return false; +} + +void Connection::Impl::handle( + const m::debugger::SetInstrumentationBreakpointRequest &req) { + if (req.instrumentation != kBeforeScriptWithSourceMapExecution) { + sendErrorToClientViaExecutor( + req.id, "Unknown instrumentation breakpoint: " + req.instrumentation); + return; + } + + // The act of creating and registering the breakpoint ID is enough + // to "set" it. We merely check for the existence of them later. + std::lock_guard lock(virtualBreakpointMutex_); + m::debugger::SetInstrumentationBreakpointResponse resp; + resp.id = req.id; + resp.breakpointId = createVirtualBreakpoint(req.instrumentation); + sendResponseToClientViaExecutor(resp); +} + void Connection::Impl::handle( const m::debugger::SetPauseOnExceptionsRequest &req) { debugger::PauseOnThrowMode mode = debugger::PauseOnThrowMode::None; @@ -790,6 +896,15 @@ void Connection::Impl::sendResponseToClientViaExecutor(int id) { sendResponseToClientViaExecutor(folly::makeFuture(), id); } +void Connection::Impl::sendResponseToClientViaExecutor( + const m::Response &resp) { + std::string json = resp.toJson(); + + folly::makeFuture() + .via(executor_.get()) + .thenValue([this, json](const Unit &unit) { sendToClient(json); }); +} + void Connection::Impl::sendResponseToClientViaExecutor( folly::Future future, int id) { diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp index ae0f77851a1e14..d40c05e14727d9 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.cpp @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<4ab81efd6f767bd583d00c806b7d1d9b>> +// @generated SignedSource<<575de63c36edd2a9a0f191501fd4f662>> #include "MessageTypes.h" @@ -35,6 +35,8 @@ std::unique_ptr Request::fromJsonThrowOnError(const std::string &str) { {"Debugger.setBreakpoint", makeUnique}, {"Debugger.setBreakpointByUrl", makeUnique}, + {"Debugger.setInstrumentationBreakpoint", + makeUnique}, {"Debugger.setPauseOnExceptions", makeUnique}, {"Debugger.stepInto", makeUnique}, @@ -505,6 +507,36 @@ void debugger::SetBreakpointByUrlRequest::accept( handler.handle(*this); } +debugger::SetInstrumentationBreakpointRequest:: + SetInstrumentationBreakpointRequest() + : Request("Debugger.setInstrumentationBreakpoint") {} + +debugger::SetInstrumentationBreakpointRequest:: + SetInstrumentationBreakpointRequest(const dynamic &obj) + : Request("Debugger.setInstrumentationBreakpoint") { + assign(id, obj, "id"); + assign(method, obj, "method"); + + dynamic params = obj.at("params"); + assign(instrumentation, params, "instrumentation"); +} + +dynamic debugger::SetInstrumentationBreakpointRequest::toDynamic() const { + dynamic params = dynamic::object; + put(params, "instrumentation", instrumentation); + + dynamic obj = dynamic::object; + put(obj, "id", id); + put(obj, "method", method); + put(obj, "params", std::move(params)); + return obj; +} + +void debugger::SetInstrumentationBreakpointRequest::accept( + RequestHandler &handler) const { + handler.handle(*this); +} + debugger::SetPauseOnExceptionsRequest::SetPauseOnExceptionsRequest() : Request("Debugger.setPauseOnExceptions") {} @@ -845,6 +877,24 @@ dynamic debugger::SetBreakpointByUrlResponse::toDynamic() const { return obj; } +debugger::SetInstrumentationBreakpointResponse:: + SetInstrumentationBreakpointResponse(const dynamic &obj) { + assign(id, obj, "id"); + + dynamic res = obj.at("result"); + assign(breakpointId, res, "breakpointId"); +} + +dynamic debugger::SetInstrumentationBreakpointResponse::toDynamic() const { + dynamic res = dynamic::object; + put(res, "breakpointId", breakpointId); + + dynamic obj = dynamic::object; + put(obj, "id", id); + put(obj, "result", std::move(res)); + return obj; +} + runtime::EvaluateResponse::EvaluateResponse(const dynamic &obj) { assign(id, obj, "id"); diff --git a/ReactCommon/hermes/inspector/chrome/MessageTypes.h b/ReactCommon/hermes/inspector/chrome/MessageTypes.h index 503b486743c3a8..931e19fb41ab29 100644 --- a/ReactCommon/hermes/inspector/chrome/MessageTypes.h +++ b/ReactCommon/hermes/inspector/chrome/MessageTypes.h @@ -1,5 +1,5 @@ // Copyright 2004-present Facebook. All Rights Reserved. -// @generated SignedSource<<0a1a011902fd18d4eebd2fe12fafb8b1>> +// @generated SignedSource<> #pragma once @@ -38,6 +38,8 @@ struct SetBreakpointByUrlRequest; struct SetBreakpointByUrlResponse; struct SetBreakpointRequest; struct SetBreakpointResponse; +struct SetInstrumentationBreakpointRequest; +struct SetInstrumentationBreakpointResponse; struct SetPauseOnExceptionsRequest; struct StepIntoRequest; struct StepOutRequest; @@ -86,6 +88,8 @@ struct RequestHandler { virtual void handle(const debugger::ResumeRequest &req) = 0; virtual void handle(const debugger::SetBreakpointRequest &req) = 0; virtual void handle(const debugger::SetBreakpointByUrlRequest &req) = 0; + virtual void handle( + const debugger::SetInstrumentationBreakpointRequest &req) = 0; virtual void handle(const debugger::SetPauseOnExceptionsRequest &req) = 0; virtual void handle(const debugger::StepIntoRequest &req) = 0; virtual void handle(const debugger::StepOutRequest &req) = 0; @@ -110,6 +114,8 @@ struct NoopRequestHandler : public RequestHandler { void handle(const debugger::ResumeRequest &req) override {} void handle(const debugger::SetBreakpointRequest &req) override {} void handle(const debugger::SetBreakpointByUrlRequest &req) override {} + void handle( + const debugger::SetInstrumentationBreakpointRequest &req) override {} void handle(const debugger::SetPauseOnExceptionsRequest &req) override {} void handle(const debugger::StepIntoRequest &req) override {} void handle(const debugger::StepOutRequest &req) override {} @@ -345,6 +351,16 @@ struct debugger::SetBreakpointByUrlRequest : public Request { folly::Optional condition; }; +struct debugger::SetInstrumentationBreakpointRequest : public Request { + SetInstrumentationBreakpointRequest(); + explicit SetInstrumentationBreakpointRequest(const folly::dynamic &obj); + + folly::dynamic toDynamic() const override; + void accept(RequestHandler &handler) const override; + + std::string instrumentation; +}; + struct debugger::SetPauseOnExceptionsRequest : public Request { SetPauseOnExceptionsRequest(); explicit SetPauseOnExceptionsRequest(const folly::dynamic &obj); @@ -483,6 +499,14 @@ struct debugger::SetBreakpointByUrlResponse : public Response { std::vector locations; }; +struct debugger::SetInstrumentationBreakpointResponse : public Response { + SetInstrumentationBreakpointResponse() = default; + explicit SetInstrumentationBreakpointResponse(const folly::dynamic &obj); + folly::dynamic toDynamic() const override; + + debugger::BreakpointId breakpointId{}; +}; + struct runtime::EvaluateResponse : public Response { EvaluateResponse() = default; explicit EvaluateResponse(const folly::dynamic &obj); diff --git a/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.cpp b/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.cpp index 9b85251ab0d415..5f9f96b9bc48b7 100644 --- a/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.cpp +++ b/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.cpp @@ -87,6 +87,10 @@ folly::Future AsyncHermesRuntime::getStoredValue() { return storedValue_.getFuture(); } +bool AsyncHermesRuntime::hasStoredValue() { + return storedValue_.isFulfilled(); +} + jsi::Value AsyncHermesRuntime::awaitStoredValue( std::chrono::milliseconds timeout) { return getStoredValue().get(timeout); diff --git a/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.h b/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.h index e1b8b24d7d70ed..b249746c407622 100644 --- a/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.h +++ b/ReactCommon/hermes/inspector/chrome/tests/AsyncHermesRuntime.h @@ -52,6 +52,11 @@ class AsyncHermesRuntime { */ folly::Future getStoredValue(); + /** + * hasStoredValue returns whether or not a value has been stored yet + */ + bool hasStoredValue(); + /** * awaitStoredValue is a helper for getStoredValue that returns the value * synchronously rather than in a future. diff --git a/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp b/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp index 2f7a4003a4fb29..b55194a1869e1e 100644 --- a/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp +++ b/ReactCommon/hermes/inspector/chrome/tests/ConnectionTests.cpp @@ -2271,6 +2271,84 @@ function foo(){x=1}debugger;foo(); expectNotification(conn); } +TEST(ConnectionTests, canBreakOnScriptsWithSourceMap) { + TestContext context; + AsyncHermesRuntime &asyncRuntime = context.runtime(); + SyncConnection &conn = context.conn(); + int msgId = 1; + + send(conn, msgId++); + expectExecutionContextCreated(conn); + + m::debugger::SetInstrumentationBreakpointRequest req; + req.id = msgId++; + req.instrumentation = "beforeScriptWithSourceMapExecution"; + + conn.send(req.toJson()); + auto bpId = expectResponse( + conn, req.id) + .breakpointId; + + asyncRuntime.executeScriptAsync(R"( + storeValue(42); debugger; + //# sourceURL=http://example.com/source.js + //# sourceMappingURL=http://example.com/source.map + )"); + expectNotification(conn); + + // We should get a pause before the first statement + auto note = expectNotification(conn); + ASSERT_FALSE(asyncRuntime.hasStoredValue()); + EXPECT_EQ(note.reason, "other"); + ASSERT_TRUE(note.hitBreakpoints.hasValue()); + ASSERT_EQ(note.hitBreakpoints->size(), 1); + EXPECT_EQ(note.hitBreakpoints->at(0), bpId); + + // Continue and verify that the JS code has now executed + send(conn, msgId++); + expectNotification(conn); + expectNotification(conn); + EXPECT_EQ(asyncRuntime.awaitStoredValue().asNumber(), 42); + + // Resume and exit + send(conn, msgId++); + expectNotification(conn); +} + +TEST(ConnectionTests, wontStopOnFilesWithoutSourceMaps) { + TestContext context; + AsyncHermesRuntime &asyncRuntime = context.runtime(); + SyncConnection &conn = context.conn(); + int msgId = 1; + + send(conn, msgId++); + expectExecutionContextCreated(conn); + + m::debugger::SetInstrumentationBreakpointRequest req; + req.id = msgId++; + req.instrumentation = "beforeScriptWithSourceMapExecution"; + + conn.send(req.toJson()); + expectResponse( + conn, req.id); + + // This script has no source map, so it should not trigger a break + asyncRuntime.executeScriptAsync(R"( + storeValue(42); debugger; + //# sourceURL=http://example.com/source.js + )"); + expectNotification(conn); + + // Continue and verify that the JS code has now executed without first + // pausing on the script load. + expectNotification(conn); + EXPECT_EQ(asyncRuntime.awaitStoredValue().asNumber(), 42); + + // Resume and exit + send(conn, msgId++); + expectNotification(conn); +} + } // namespace chrome } // namespace inspector } // namespace hermes diff --git a/ReactCommon/hermes/inspector/tools/message_types.txt b/ReactCommon/hermes/inspector/tools/message_types.txt index 420fdad15d6d08..0db4a6b7709ce9 100644 --- a/ReactCommon/hermes/inspector/tools/message_types.txt +++ b/ReactCommon/hermes/inspector/tools/message_types.txt @@ -10,6 +10,7 @@ Debugger.resumed Debugger.scriptParsed Debugger.setBreakpoint Debugger.setBreakpointByUrl +Debugger.setInstrumentationBreakpoint Debugger.setPauseOnExceptions Debugger.stepInto Debugger.stepOut From 164d47f30a7437aa4d50843a084f9c08d71cd40c Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 8 May 2020 00:33:50 -0700 Subject: [PATCH 225/235] label react-native-github targets Summary: For internal code attribution. Changelog: [Internal] Reviewed By: zlern2k Differential Revision: D21468924 fbshipit-source-id: 59cd2a52e0ae46bedbf54816820a5f40b684da8b --- .../java/com/facebook/react/testing/network/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK | 1 + .../src/main/java/com/facebook/hermes/instrumentation/BUCK | 2 ++ ReactAndroid/src/main/java/com/facebook/react/animated/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK | 2 ++ ReactAndroid/src/main/java/com/facebook/react/common/BUCK | 1 + .../src/main/java/com/facebook/react/common/network/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/config/BUCK | 1 + .../src/main/java/com/facebook/react/devsupport/BUCK | 2 ++ ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK | 1 + .../src/main/java/com/facebook/react/fabric/jni/BUCK | 1 + .../src/main/java/com/facebook/react/jscexecutor/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK | 1 + .../main/java/com/facebook/react/module/annotations/BUCK | 1 + .../src/main/java/com/facebook/react/module/model/BUCK | 1 + .../src/main/java/com/facebook/react/module/processing/BUCK | 1 + .../java/com/facebook/react/modules/accessibilityinfo/BUCK | 1 + .../main/java/com/facebook/react/modules/appearance/BUCK | 1 + .../main/java/com/facebook/react/modules/appregistry/BUCK | 1 + .../src/main/java/com/facebook/react/modules/appstate/BUCK | 1 + .../src/main/java/com/facebook/react/modules/blob/BUCK | 1 + .../src/main/java/com/facebook/react/modules/blob/jni/BUCK | 1 + .../src/main/java/com/facebook/react/modules/camera/BUCK | 1 + .../src/main/java/com/facebook/react/modules/clipboard/BUCK | 1 + .../src/main/java/com/facebook/react/modules/common/BUCK | 1 + .../src/main/java/com/facebook/react/modules/core/BUCK | 1 + .../main/java/com/facebook/react/modules/datepicker/BUCK | 1 + .../src/main/java/com/facebook/react/modules/debug/BUCK | 2 ++ .../main/java/com/facebook/react/modules/deviceinfo/BUCK | 1 + .../src/main/java/com/facebook/react/modules/dialog/BUCK | 1 + .../src/main/java/com/facebook/react/modules/fabric/BUCK | 1 + .../src/main/java/com/facebook/react/modules/fresco/BUCK | 1 + .../main/java/com/facebook/react/modules/i18nmanager/BUCK | 1 + .../src/main/java/com/facebook/react/modules/image/BUCK | 1 + .../src/main/java/com/facebook/react/modules/intent/BUCK | 1 + .../src/main/java/com/facebook/react/modules/network/BUCK | 1 + .../main/java/com/facebook/react/modules/permissions/BUCK | 1 + .../src/main/java/com/facebook/react/modules/share/BUCK | 1 + .../src/main/java/com/facebook/react/modules/sound/BUCK | 1 + .../src/main/java/com/facebook/react/modules/statusbar/BUCK | 1 + .../src/main/java/com/facebook/react/modules/storage/BUCK | 1 + .../main/java/com/facebook/react/modules/systeminfo/BUCK | 2 ++ .../main/java/com/facebook/react/modules/timepicker/BUCK | 1 + .../src/main/java/com/facebook/react/modules/toast/BUCK | 1 + .../src/main/java/com/facebook/react/modules/vibration/BUCK | 1 + .../src/main/java/com/facebook/react/modules/websocket/BUCK | 1 + .../main/java/com/facebook/react/packagerconnection/BUCK | 1 + .../src/main/java/com/facebook/react/processing/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/shell/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/surface/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/touch/BUCK | 1 + .../src/main/java/com/facebook/react/turbomodule/core/BUCK | 2 ++ .../com/facebook/react/turbomodule/core/interfaces/BUCK | 1 + .../main/java/com/facebook/react/turbomodule/core/jni/BUCK | 2 ++ .../src/main/java/com/facebook/react/uimanager/BUCK | 2 ++ .../main/java/com/facebook/react/uimanager/annotations/BUCK | 1 + .../src/main/java/com/facebook/react/uimanager/common/BUCK | 1 + .../src/main/java/com/facebook/react/uimanager/util/BUCK | 1 + ReactAndroid/src/main/java/com/facebook/react/util/BUCK | 1 + .../src/main/java/com/facebook/react/viewmanagers/BUCK | 1 + .../src/main/java/com/facebook/react/views/common/BUCK | 1 + .../src/main/java/com/facebook/react/views/drawer/BUCK | 1 + .../src/main/java/com/facebook/react/views/image/BUCK | 2 ++ .../src/main/java/com/facebook/react/views/imagehelper/BUCK | 2 ++ .../src/main/java/com/facebook/react/views/modal/BUCK | 1 + .../src/main/java/com/facebook/react/views/picker/BUCK | 1 + .../src/main/java/com/facebook/react/views/progressbar/BUCK | 1 + .../src/main/java/com/facebook/react/views/scroll/BUCK | 1 + .../src/main/java/com/facebook/react/views/slider/BUCK | 1 + .../main/java/com/facebook/react/views/swiperefresh/BUCK | 1 + .../src/main/java/com/facebook/react/views/switchview/BUCK | 1 + .../src/main/java/com/facebook/react/views/text/BUCK | 1 + .../java/com/facebook/react/views/text/frescosupport/BUCK | 1 + .../src/main/java/com/facebook/react/views/textinput/BUCK | 1 + .../java/com/facebook/react/views/unimplementedview/BUCK | 1 + .../src/main/java/com/facebook/react/views/view/BUCK | 1 + .../src/main/java/com/facebook/react/views/viewpager/BUCK | 1 + ReactAndroid/src/main/jni/react/jni/BUCK | 1 + ReactCommon/better/BUCK | 1 + ReactCommon/callinvoker/BUCK | 1 + ReactCommon/config/BUCK | 1 + ReactCommon/cxxreact/BUCK | 3 +++ ReactCommon/fabric/attributedstring/BUCK | 1 + ReactCommon/fabric/componentregistry/BUCK | 1 + ReactCommon/fabric/components/activityindicator/BUCK | 1 + ReactCommon/fabric/components/image/BUCK | 1 + ReactCommon/fabric/components/modal/BUCK | 1 + ReactCommon/fabric/components/picker/BUCK | 2 ++ ReactCommon/fabric/components/root/BUCK | 1 + ReactCommon/fabric/components/scrollview/BUCK | 1 + ReactCommon/fabric/components/slider/BUCK | 1 + ReactCommon/fabric/components/switch/BUCK | 1 + ReactCommon/fabric/components/text/BUCK | 1 + ReactCommon/fabric/components/textinput/BUCK | 1 + ReactCommon/fabric/components/view/BUCK | 1 + ReactCommon/fabric/core/BUCK | 1 + ReactCommon/fabric/debug/BUCK | 1 + ReactCommon/fabric/graphics/BUCK | 1 + ReactCommon/fabric/imagemanager/BUCK | 1 + ReactCommon/fabric/mounting/BUCK | 1 + ReactCommon/fabric/scheduler/BUCK | 1 + ReactCommon/fabric/templateprocessor/BUCK | 1 + ReactCommon/fabric/textlayoutmanager/BUCK | 1 + ReactCommon/fabric/uimanager/BUCK | 1 + ReactCommon/hermes/inspector/BUCK | 6 ++++++ ReactCommon/jsiexecutor/BUCK | 1 + ReactCommon/jsinspector/BUCK | 1 + ReactCommon/microprofiler/BUCK | 1 + ReactCommon/turbomodule/core/BUCK | 1 + ReactCommon/turbomodule/samples/BUCK | 2 ++ ReactCommon/utils/BUCK | 1 + 113 files changed, 132 insertions(+) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/BUCK b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/BUCK index f5842dcae00118..ebfebaf7fe9f4e 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/BUCK +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/network/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "network", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK b/ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK index 9212d5990f14dd..c1ee4ded0329dd 100644 --- a/ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/debug/holder/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_libra rn_android_library( name = "holder", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK b/ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK index 1442e63d2acfdf..876be9f2ba6753 100644 --- a/ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/debug/tags/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_libra rn_android_library( name = "tags", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK index 9c844d1b75b321..cec027de58b101 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "FBJNI_TARGET", "IS_OSS_BU rn_android_library( name = "FBReactNativeSpec", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = ["PUBLIC"], deps = [ react_native_dep("third-party/java/jsr-305:jsr-305"), diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK index aacd3e0fe2899b..3b4ea04dbfdff0 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/BUCK @@ -11,6 +11,7 @@ rn_android_library( rn_android_library( name = "hermes_samplingprofiler", srcs = ["HermesSamplingProfiler.java"], + labels = ["supermodule:android/default/public.react_native.infra"], visibility = ["PUBLIC"], deps = [ react_native_dep("java/com/facebook/proguard/annotations:annotations"), @@ -29,6 +30,7 @@ rn_xplat_cxx_library( headers = ["HermesSamplingProfiler.h"], header_namespace = "", compiler_flags = ["-fexceptions"], + labels = ["supermodule:android/default/public.react_native.infra"], platforms = ANDROID, soname = "libjsijniprofiler.$(ext)", visibility = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK b/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK index edba01a1b1485d..57e9752b640e08 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/BUCK @@ -6,6 +6,7 @@ rn_android_library( "*.java", ]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK b/ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK index eaa8ab4df53479..53ac6202190a9c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/BUCK @@ -21,6 +21,7 @@ rn_android_library( exclude = INTERFACES, ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], proguard_config = "reactnative.pro", provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), @@ -65,6 +66,7 @@ rn_android_library( name = "interfaces", srcs = glob(INTERFACES), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], proguard_config = "reactnative.pro", provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/BUCK b/ReactAndroid/src/main/java/com/facebook/react/common/BUCK index 5c67573a0254d1..0e5a4b52caeac1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/common/BUCK @@ -11,6 +11,7 @@ rn_android_library( exclude = SUB_PROJECTS, ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK b/ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK index 934c22700dffe1..86005fbc76ae79 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/common/network/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_libra rn_android_library( name = "network", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/BUCK b/ReactAndroid/src/main/java/com/facebook/react/config/BUCK index 82c24dc8158a27..347452197e226b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/config/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library") rn_android_library( name = "config", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK b/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK index a5c503d2f750b0..1c2b6c72e761b4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "devsupport", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], manifest = "AndroidManifest.xml", provided_deps = [ react_native_dep("third-party/android/androidx:core"), @@ -46,6 +47,7 @@ rn_android_library( name = "interfaces", srcs = glob(["interfaces/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK index 7c0d2e0c11a8fa..4aa1d97440a5f3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK @@ -9,6 +9,7 @@ rn_android_library( "mounting/**/*.java", ]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK index 3023a1498477c2..83d5ba3a4fb4fc 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/BUCK @@ -18,6 +18,7 @@ rn_xplat_cxx_library( "-frtti", ], fbandroid_allow_jni_merging = True, + labels = ["supermodule:android/default/public.react_native.infra"], platforms = (ANDROID), preprocessor_flags = [ "-DLOG_TAG=\"ReactNative\"", diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK index ef047b2e31f02e..1f1f74690a4719 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "FBJNI_TARGET", "react_nat rn_android_library( name = "jscexecutor", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK b/ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK index fa2fc5ceadf033..b2cdc99110b575 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "jstasks", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK b/ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK index 211b98157bf10e..f081fc83a17774 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/module/annotations/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "annotations", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK b/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK index b76f609c809272..59e700971e872b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/module/model/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_libra rn_android_library( name = "model", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK b/ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK index 663c170036449a..b2c8041bdc6981 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/module/processing/BUCK @@ -15,6 +15,7 @@ rn_java_annotation_processor( rn_java_library( name = "processing-lib", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], source = "8", target = "8", deps = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK index c7d1ffc46c759e..5d0fa7d9d1c958 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/accessibilityinfo/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "accessibilityinfo", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK index 60c8584e16c264..62802072e94797 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "appearance", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK index 5ea989b39c9429..dc2c4d824b2a52 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/appregistry/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_target", "rn_android_li rn_android_library( name = "appregistry", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK index b3e191047dc295..3b873f61574438 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/appstate/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "appstate", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK index aedfca7dd5888f..0a4d2b472e2210 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "blob", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK index 4bd4ee666c3d62..2ab5488c94a15f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/BUCK @@ -11,6 +11,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + labels = ["supermodule:android/default/public.react_native.infra"], platforms = ANDROID, soname = "libreactnativeblob.$(ext)", visibility = ["PUBLIC"], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK index 775fd1db0f00c1..01e0240e5b7dee 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/camera/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "camera", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK index 9e0390ea8527b8..c3fa4b7884140b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "clipboard", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK index 938ef3c649f912..c8376f61beec51 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/common/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "common", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK index 9432c4513c5e4b..4e8a8ee3fafff2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/core/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "core", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK index 4a5b7eeb92f7ed..91683c6f233033 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "datepicker", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK index 61950b38fbe2ba..2f0d2caef1a471 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/debug/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "debug", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], @@ -29,6 +30,7 @@ rn_android_library( rn_android_library( name = "interfaces", srcs = glob(["interfaces/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK index 0f33ea66f71e80..a33ecbf2677641 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "deviceinfo", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK index 93cae84131f6e4..1987e6e9223e16 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "dialog", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/BUCK index b19a3c20bbc8df..5bbb74d994b22f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_target", "rn_android_li rn_android_library( name = "fabric", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ ], visibility = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK index 0e467a7738e3f9..fd6819910638ce 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "fresco", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK index 36bb281dc280c0..a00c306f8da8a4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "i18nmanager", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK index 1116925eee2954..d924754e990d0e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/image/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "image", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK index 616d73ed7507a5..a7f538cc2ea321 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/intent/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "intent", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK index fb4b470d71e615..ccb9013abe9045 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/network/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "network", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK index e947137a59ba69..484e374c72a94c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "permissions", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK index 0e45037b0cee9e..11288aa404c14c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/share/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "share", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK index ac4b1d2f0920c2..8e199ed82a85e2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/sound/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "sound", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ ], visibility = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK index 4082dcd67a9148..8643e041815f6a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "statusbar", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK index 81a13ec37975bf..2231b08feec476 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/storage/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "storage", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK index 30e4988a0fad6c..afc48e3db35129 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/BUCK @@ -7,6 +7,7 @@ rn_android_library( "ReactNativeVersion.java", ], is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], @@ -31,6 +32,7 @@ rn_android_library( "AndroidInfoHelpers.java", ], is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/BUCK index 9740b735f71328..dac030819debc6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/timepicker/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "timepicker", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK index a297071e700324..fb3b79960fe585 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/toast/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "toast", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK index d817e4149e38e1..219a1d36feb288 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/vibration/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "vibration", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK index 26f6686d14a861..4299354a4a6d76 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "websocket", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK b/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK index 092745fd177118..1cfd88bfc35a01 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/BUCK @@ -6,6 +6,7 @@ rn_android_library( ["**/*.java"], ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/processing/BUCK b/ReactAndroid/src/main/java/com/facebook/react/processing/BUCK index f88f4fe679b860..5ff37878c58a18 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/processing/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/processing/BUCK @@ -15,6 +15,7 @@ rn_java_annotation_processor( rn_java_library( name = "processing-lib", srcs = glob(["*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], source = "7", target = "7", deps = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK index 3b5d4e7f99fc7e..5f114f91e88e13 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "shell", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/surface/BUCK b/ReactAndroid/src/main/java/com/facebook/react/surface/BUCK index ad6bcd33c4a20d..7ea360411204d6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/surface/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/surface/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "surface", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/touch/BUCK b/ReactAndroid/src/main/java/com/facebook/react/touch/BUCK index bcd493aaf746b8..c57d2e682f350d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/touch/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/touch/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "touch", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK index f3e34f4e46effc..7547027a771a8d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/BUCK @@ -8,6 +8,7 @@ rn_android_library( ], exclude = ["CallInvokerHolderImpl.java"], ), + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", @@ -38,6 +39,7 @@ rn_android_library( rn_android_library( name = "callinvokerholder", srcs = ["CallInvokerHolderImpl.java"], + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/BUCK b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/BUCK index e48328e07291ae..3e07e5c5355a80 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/BUCK @@ -6,6 +6,7 @@ rn_android_library( ["*.java"], ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK index 4de25abe7deacc..183194f3d47dd9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/BUCK @@ -17,6 +17,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + labels = ["supermodule:android/default/public.react_native.infra"], platforms = ANDROID, preprocessor_flags = [ "-DLOG_TAG=\"ReactNative\"", @@ -55,6 +56,7 @@ rn_xplat_cxx_library( fbandroid_deps = [ FBJNI_TARGET, ], + labels = ["supermodule:android/default/public.react_native.infra"], platforms = ANDROID, preferred_linkage = "static", preprocessor_flags = [ diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK index 33eeffd0434703..a88d679b87f4f3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK @@ -14,6 +14,7 @@ rn_android_library( ], ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), @@ -59,6 +60,7 @@ rn_android_library( "DisplayMetricsHolder.java", ], is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK b/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK index 3ecec7beea0e36..39953cea578b08 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/annotations/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "annotations", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/BUCK b/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/BUCK index f3b3d20aaaa3f6..9f54d4ad220281 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "common", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK b/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK index 446c2dce76055b..1f67fb5365cf5e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "util", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/util/BUCK b/ReactAndroid/src/main/java/com/facebook/react/util/BUCK index b78a3fd8e3d8c8..84188101bbfc06 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/util/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/util/BUCK @@ -3,6 +3,7 @@ load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_tar rn_android_library( name = "util", srcs = glob(["**/*.java"]), + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/BUCK b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/BUCK index 16bd74bbb87148..d950d48939265a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/viewmanagers/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "viewmanagers", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK index b6a8fbdbde991d..c9f4f1bda7ce78 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/common/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "common", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/android/androidx:annotation"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK index 57d72472c1964a..9b24b8e6611515 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/drawer/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "drawer", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK index 3cddf8e7158472..e60547c2a4101b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/image/BUCK @@ -8,6 +8,7 @@ rn_android_library( name = "imageevents", srcs = IMAGE_EVENT_FILES, is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), @@ -31,6 +32,7 @@ rn_android_library( exclude = IMAGE_EVENT_FILES, ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK index b870bef0195b24..990f459c89c89a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/BUCK @@ -7,6 +7,7 @@ rn_android_library( exclude = ["MultiSourceHelper.java"], ), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], @@ -21,6 +22,7 @@ rn_android_library( name = "withmultisource", srcs = ["MultiSourceHelper.java"], is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK index bb6d9818b89266..6c69eb6af88884 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "modal", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK index 32fdd11dc47ebe..ca04eca2315179 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/picker/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "picker", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:appcompat"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK index 4e480cd5c812ae..6ef5436e19a58a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "progressbar", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK index ef2b7b77d4eda6..ed41f3c10ebe43 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "scroll", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK index f41e9bcc83b927..4aa48da0029ddf 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/slider/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "slider", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK index e6ea16364a92f1..f4e77eb6322462 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "swiperefresh", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK index f7140b7d6ea198..677c0ddb179f57 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "switchview", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:appcompat"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK index 62458f6ae265ae..6b4ef8857c33a5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "text", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK index 8b755be5593036..d882979b4893af 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "frescosupport", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], visibility = [ "PUBLIC", ], diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK index 745cfe2b89e8f0..ba19532ffc7fa1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "textinput", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], required_for_source_only_abi = True, visibility = [ "PUBLIC", diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview/BUCK index 41bdc06a8225f0..a4d7b073035547 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/unimplementedview/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "unimplementedview", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK index 186cf548b42d7c..1b9b8e05181547 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "view", srcs = glob(["*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:core"), react_native_dep("third-party/android/androidx:fragment"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/BUCK b/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/BUCK index bcde344867c3f4..77179a7e98f8f1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/views/viewpager/BUCK @@ -4,6 +4,7 @@ rn_android_library( name = "viewpager", srcs = glob(["**/*.java"]), is_androidx = True, + labels = ["supermodule:android/default/public.react_native.infra"], provided_deps = [ react_native_dep("third-party/android/androidx:annotation"), react_native_dep("third-party/android/androidx:core"), diff --git a/ReactAndroid/src/main/jni/react/jni/BUCK b/ReactAndroid/src/main/jni/react/jni/BUCK index 2d294604819b1c..931a8933d92986 100644 --- a/ReactAndroid/src/main/jni/react/jni/BUCK +++ b/ReactAndroid/src/main/jni/react/jni/BUCK @@ -43,6 +43,7 @@ rn_xplat_cxx_library( "-Wno-inconsistent-missing-override", ], fbandroid_allow_jni_merging = True, + labels = ["supermodule:android/default/public.react_native.infra"], platforms = ANDROID, preprocessor_flags = [ "-DLOG_TAG=\"ReactNativeJNI\"", diff --git a/ReactCommon/better/BUCK b/ReactCommon/better/BUCK index e0e9d716c02dea..fb403d3a8dfad5 100644 --- a/ReactCommon/better/BUCK +++ b/ReactCommon/better/BUCK @@ -35,6 +35,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/callinvoker/BUCK b/ReactCommon/callinvoker/BUCK index a9c3fca7e279b5..0f702cb7282867 100644 --- a/ReactCommon/callinvoker/BUCK +++ b/ReactCommon/callinvoker/BUCK @@ -16,6 +16,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], platforms = (ANDROID, APPLE), preferred_linkage = "static", diff --git a/ReactCommon/config/BUCK b/ReactCommon/config/BUCK index ac2d066f6465fb..9c81d30e98dab6 100644 --- a/ReactCommon/config/BUCK +++ b/ReactCommon/config/BUCK @@ -24,6 +24,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/cxxreact/BUCK b/ReactCommon/cxxreact/BUCK index ef23abe0562aa1..22ec861acd0bfc 100644 --- a/ReactCommon/cxxreact/BUCK +++ b/ReactCommon/cxxreact/BUCK @@ -18,6 +18,7 @@ rn_xplat_cxx_library( prefix = "cxxreact", ), compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = get_apple_compiler_flags(), fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], force_static = True, @@ -43,6 +44,7 @@ rn_xplat_cxx_library( "-fexceptions", "-frtti", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = get_apple_compiler_flags(), fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], force_static = True, @@ -126,6 +128,7 @@ rn_xplat_cxx_library( "-fexceptions", "-frtti", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_preprocessor_flags = get_android_inspector_flags(), fbobjc_compiler_flags = get_apple_compiler_flags(), fbobjc_force_static = True, diff --git a/ReactCommon/fabric/attributedstring/BUCK b/ReactCommon/fabric/attributedstring/BUCK index 612c5a9ae5c062..cb6d8c234116b8 100644 --- a/ReactCommon/fabric/attributedstring/BUCK +++ b/ReactCommon/fabric/attributedstring/BUCK @@ -37,6 +37,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/componentregistry/BUCK b/ReactCommon/fabric/componentregistry/BUCK index 5cf1eb19c64013..1eec505f7e2cdf 100644 --- a/ReactCommon/fabric/componentregistry/BUCK +++ b/ReactCommon/fabric/componentregistry/BUCK @@ -36,6 +36,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/activityindicator/BUCK b/ReactCommon/fabric/components/activityindicator/BUCK index a10ed8fa723d9e..b0eaa75eae36a7 100644 --- a/ReactCommon/fabric/components/activityindicator/BUCK +++ b/ReactCommon/fabric/components/activityindicator/BUCK @@ -35,6 +35,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/image/BUCK b/ReactCommon/fabric/components/image/BUCK index b6a5e50a38f7de..9f94284cf15630 100644 --- a/ReactCommon/fabric/components/image/BUCK +++ b/ReactCommon/fabric/components/image/BUCK @@ -35,6 +35,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/modal/BUCK b/ReactCommon/fabric/components/modal/BUCK index 24c2dbf0920470..a84b80df2a456e 100644 --- a/ReactCommon/fabric/components/modal/BUCK +++ b/ReactCommon/fabric/components/modal/BUCK @@ -48,6 +48,7 @@ rn_xplat_cxx_library( fbandroid_headers = glob( ["platform/android/*.h"], ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( ["platform/android/*.cpp"], ), diff --git a/ReactCommon/fabric/components/picker/BUCK b/ReactCommon/fabric/components/picker/BUCK index 68bce53ffa9bb3..8508262ce704d0 100644 --- a/ReactCommon/fabric/components/picker/BUCK +++ b/ReactCommon/fabric/components/picker/BUCK @@ -44,7 +44,9 @@ rn_xplat_cxx_library( fbandroid_deps = [ react_native_target("jni/react/jni:jni"), ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), force_static = True, platforms = (ANDROID, APPLE, CXX), diff --git a/ReactCommon/fabric/components/root/BUCK b/ReactCommon/fabric/components/root/BUCK index d7256d80cc82e5..5805cff81df76a 100644 --- a/ReactCommon/fabric/components/root/BUCK +++ b/ReactCommon/fabric/components/root/BUCK @@ -35,6 +35,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/scrollview/BUCK b/ReactCommon/fabric/components/scrollview/BUCK index ac7e1848ed2085..5f59cfba1a4768 100644 --- a/ReactCommon/fabric/components/scrollview/BUCK +++ b/ReactCommon/fabric/components/scrollview/BUCK @@ -38,6 +38,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/slider/BUCK b/ReactCommon/fabric/components/slider/BUCK index 9f5c683501af4c..41ce2c68985eb3 100644 --- a/ReactCommon/fabric/components/slider/BUCK +++ b/ReactCommon/fabric/components/slider/BUCK @@ -53,6 +53,7 @@ rn_xplat_cxx_library( fbandroid_headers = glob( ["platform/android/*.h"], ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( ["platform/android/*.cpp"], ), diff --git a/ReactCommon/fabric/components/switch/BUCK b/ReactCommon/fabric/components/switch/BUCK index 373e40d111e5fb..8d12a6a070fa0d 100644 --- a/ReactCommon/fabric/components/switch/BUCK +++ b/ReactCommon/fabric/components/switch/BUCK @@ -44,6 +44,7 @@ rn_xplat_cxx_library( fbandroid_deps = [ react_native_target("jni/react/jni:jni"), ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/text/BUCK b/ReactCommon/fabric/components/text/BUCK index 16221beea0658a..a1271eb16c66ec 100644 --- a/ReactCommon/fabric/components/text/BUCK +++ b/ReactCommon/fabric/components/text/BUCK @@ -43,6 +43,7 @@ rn_xplat_cxx_library( "-Wall", ], cxx_tests = [":tests"], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/textinput/BUCK b/ReactCommon/fabric/components/textinput/BUCK index 5624b19a7aff66..616d7c0468e780 100644 --- a/ReactCommon/fabric/components/textinput/BUCK +++ b/ReactCommon/fabric/components/textinput/BUCK @@ -40,6 +40,7 @@ rn_xplat_cxx_library( "-Wall", ], cxx_tests = [":tests"], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/components/view/BUCK b/ReactCommon/fabric/components/view/BUCK index 268e404748a235..eb8a63fe20375a 100644 --- a/ReactCommon/fabric/components/view/BUCK +++ b/ReactCommon/fabric/components/view/BUCK @@ -41,6 +41,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/core/BUCK b/ReactCommon/fabric/core/BUCK index 1cd25344e2b68e..5930a38025e754 100644 --- a/ReactCommon/fabric/core/BUCK +++ b/ReactCommon/fabric/core/BUCK @@ -44,6 +44,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/debug/BUCK b/ReactCommon/fabric/debug/BUCK index 766570e9ddbab2..9971b09cb503e3 100644 --- a/ReactCommon/fabric/debug/BUCK +++ b/ReactCommon/fabric/debug/BUCK @@ -39,6 +39,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/graphics/BUCK b/ReactCommon/fabric/graphics/BUCK index 2920275606ffc8..bcedde153577c2 100644 --- a/ReactCommon/fabric/graphics/BUCK +++ b/ReactCommon/fabric/graphics/BUCK @@ -56,6 +56,7 @@ rn_xplat_cxx_library( ], prefix = "react/graphics", ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( [ "platform/cxx/**/*.cpp", diff --git a/ReactCommon/fabric/imagemanager/BUCK b/ReactCommon/fabric/imagemanager/BUCK index d3f5436412cb5a..ba638f1d1e8098 100644 --- a/ReactCommon/fabric/imagemanager/BUCK +++ b/ReactCommon/fabric/imagemanager/BUCK @@ -45,6 +45,7 @@ rn_xplat_cxx_library( ], prefix = "", ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( [ "platform/cxx/**/*.cpp", diff --git a/ReactCommon/fabric/mounting/BUCK b/ReactCommon/fabric/mounting/BUCK index 57e0218b4ca794..afa937d70bd0cc 100644 --- a/ReactCommon/fabric/mounting/BUCK +++ b/ReactCommon/fabric/mounting/BUCK @@ -38,6 +38,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/scheduler/BUCK b/ReactCommon/fabric/scheduler/BUCK index c5dc8406e2dcd0..e65958365b3007 100644 --- a/ReactCommon/fabric/scheduler/BUCK +++ b/ReactCommon/fabric/scheduler/BUCK @@ -36,6 +36,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/templateprocessor/BUCK b/ReactCommon/fabric/templateprocessor/BUCK index 5e99f4c3b9783f..168a55862964e0 100644 --- a/ReactCommon/fabric/templateprocessor/BUCK +++ b/ReactCommon/fabric/templateprocessor/BUCK @@ -37,6 +37,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/fabric/textlayoutmanager/BUCK b/ReactCommon/fabric/textlayoutmanager/BUCK index 7f63e0cbfc710e..720f3d3e8e2344 100644 --- a/ReactCommon/fabric/textlayoutmanager/BUCK +++ b/ReactCommon/fabric/textlayoutmanager/BUCK @@ -75,6 +75,7 @@ rn_xplat_cxx_library( ], prefix = "", ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( [ "platform/android/**/*.cpp", diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index ed49ba95cc6133..0d46cf3f3fea90 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -37,6 +37,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(), diff --git a/ReactCommon/hermes/inspector/BUCK b/ReactCommon/hermes/inspector/BUCK index 54faba2ded4882..9757b023533637 100644 --- a/ReactCommon/hermes/inspector/BUCK +++ b/ReactCommon/hermes/inspector/BUCK @@ -50,7 +50,9 @@ fb_xplat_cxx_library( header_namespace = "hermes/inspector", exported_headers = CHROME_EXPORTED_HEADERS, compiler_flags = CFLAGS_BY_MODE[hermes_build_mode()], + fbandroid_labels = ["supermodule:android/default/public.hermes"], fbobjc_header_path_prefix = "hermes/inspector/chrome", + fbobjc_labels = ["supermodule:ios/default/public.hermes"], macosx_tests_override = [], tests = [":chrome-tests"], visibility = [ @@ -116,7 +118,9 @@ fb_xplat_cxx_library( fbandroid_deps = [ "//fbandroid/native/fb:fb", ], + fbandroid_labels = ["supermodule:android/default/public.hermes"], fbobjc_header_path_prefix = "hermes/inspector/detail", + fbobjc_labels = ["supermodule:ios/default/public.hermes"], macosx_tests_override = [], tests = [":detail-tests"], visibility = [ @@ -188,7 +192,9 @@ fb_xplat_cxx_library( exported_headers = INSPECTOR_EXPORTED_HEADERS, compiler_flags = CFLAGS_BY_MODE[hermes_build_mode()], cxx_tests = [":inspector-tests"], + fbandroid_labels = ["supermodule:android/default/public.hermes"], fbobjc_header_path_prefix = "hermes/inspector", + fbobjc_labels = ["supermodule:ios/default/public.hermes"], macosx_tests_override = [], visibility = [ "PUBLIC", diff --git a/ReactCommon/jsiexecutor/BUCK b/ReactCommon/jsiexecutor/BUCK index b376d26f28d754..1edfe366a9ac7e 100644 --- a/ReactCommon/jsiexecutor/BUCK +++ b/ReactCommon/jsiexecutor/BUCK @@ -20,6 +20,7 @@ cxx_library( "//xplat/folly:molly", "//xplat/third-party/linker_lib:atomic", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_force_static = True, fbobjc_header_path_prefix = "", fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], diff --git a/ReactCommon/jsinspector/BUCK b/ReactCommon/jsinspector/BUCK index 18cb5aeaf394c9..22b569eabee601 100644 --- a/ReactCommon/jsinspector/BUCK +++ b/ReactCommon/jsinspector/BUCK @@ -30,6 +30,7 @@ rn_xplat_cxx_library( "-fexceptions", "-std=c++1y", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_preferred_linkage = "shared", fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], visibility = [ diff --git a/ReactCommon/microprofiler/BUCK b/ReactCommon/microprofiler/BUCK index 09cb9ae5053496..571b3cea525be1 100644 --- a/ReactCommon/microprofiler/BUCK +++ b/ReactCommon/microprofiler/BUCK @@ -16,6 +16,7 @@ cxx_library( "-fexceptions", "-fno-data-sections", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], force_static = True, visibility = [ diff --git a/ReactCommon/turbomodule/core/BUCK b/ReactCommon/turbomodule/core/BUCK index 7a429af31525a3..af7350e7f2ccad 100644 --- a/ReactCommon/turbomodule/core/BUCK +++ b/ReactCommon/turbomodule/core/BUCK @@ -28,6 +28,7 @@ rn_xplat_cxx_library( ], prefix = "ReactCommon", ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( [ "platform/android/**/*.cpp", diff --git a/ReactCommon/turbomodule/samples/BUCK b/ReactCommon/turbomodule/samples/BUCK index 1948f743955733..44173730827899 100644 --- a/ReactCommon/turbomodule/samples/BUCK +++ b/ReactCommon/turbomodule/samples/BUCK @@ -26,6 +26,7 @@ rn_xplat_cxx_library( ], prefix = "ReactCommon", ), + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbandroid_srcs = glob( [ "platform/android/**/*.cpp", @@ -36,6 +37,7 @@ rn_xplat_cxx_library( "-fobjc-arc-exceptions", ], fbobjc_inherited_buck_flags = get_static_library_ios_flags(), + fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], fbobjc_preprocessor_flags = OBJC_ARC_PREPROCESSOR_FLAGS + get_preprocessor_flags_for_build_mode(), force_static = True, ios_deps = [ diff --git a/ReactCommon/utils/BUCK b/ReactCommon/utils/BUCK index dfcc229b285c5d..c9660e082d7157 100644 --- a/ReactCommon/utils/BUCK +++ b/ReactCommon/utils/BUCK @@ -39,6 +39,7 @@ rn_xplat_cxx_library( "-std=c++14", "-Wall", ], + fbandroid_labels = ["supermodule:android/default/public.react_native.infra"], fbobjc_compiler_flags = APPLE_COMPILER_FLAGS, fbobjc_frameworks = ["Foundation"], fbobjc_labels = ["supermodule:ios/default/public.react_native.infra"], From 91a49d8827cb8a3c4835b525d412cb6a9548cac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Fri, 8 May 2020 12:20:23 -0700 Subject: [PATCH 226/235] Add script to generate native modules specs with react-native-codegen Summary: Adds a script that uses `react-native-codegen` to generate FBReactNativeSpec. The generated output should not be considered ready for production use at this time. The goal of adding this script at this time is to demonstrate the current status of native modules specs code generation in open source. For example, the generated output may be used in RNTester, with some modifications due to some naming differences in react-native-codegen's output when compared to the FBReactNativeSpec files generated by the old codegen. Usage: ``` ./scripts/generate-native-modules-specs.sh ./codegen-out ``` Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21471004 fbshipit-source-id: 5ff3c57807d9ba2c91dc7fe32d227d218732b059 --- .gitignore | 1 + scripts/generate-native-modules-specs.sh | 52 ++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 scripts/generate-native-modules-specs.sh diff --git a/.gitignore b/.gitignore index dfb25a59ee69b1..14b3dddf669aef 100644 --- a/.gitignore +++ b/.gitignore @@ -96,6 +96,7 @@ RNTester/Pods/* # react-native-codegen /ReactCommon/fabric/components/rncore/ /schema-rncore.json +/schema-native-modules.json # Visual studio .vscode diff --git a/scripts/generate-native-modules-specs.sh b/scripts/generate-native-modules-specs.sh new file mode 100755 index 00000000000000..505a7769a338b0 --- /dev/null +++ b/scripts/generate-native-modules-specs.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# 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. + +# This script collects the JavaScript spec definitions for native +# modules, then uses react-native-codegen to generate native code. +# The script will copy the generated code to the final location by +# default. Optionally, call the script with a path to the desired +# output location. +# +# Usage: +# ./scripts/generate-native-modules-specs.sh [output-dir] +# +# Example: +# ./scripts/generate-native-modules-specs.sh ./codegen-out + +# shellcheck disable=SC2038 + +set -e + +describe () { + printf "\\n\\n>>>>> %s\\n\\n\\n" "$1" +} + +THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) +RN_DIR=$(cd "$THIS_DIR/.." && pwd) + +TEMP_DIR=$(mktemp -d /tmp/react-native-codegen-XXXXXXXX) + +SRCS_DIR=$(cd "$RN_DIR/Libraries" && pwd) +LIBRARY_NAME="FBReactNativeSpec" +MODULE_SPEC_NAME="FBReactNativeSpec" + +SCHEMA_FILE="$RN_DIR/schema-native-modules.json" +OUTPUT_DIR="$SRCS_DIR/$LIBRARY_NAME/$MODULE_SPEC_NAME" + +describe "Generating schema from flow types" +grep --exclude NativeUIManager.js --include=Native\*.js -rnwl "$SRCS_DIR" -e 'export interface Spec extends TurboModule' -e "export default \(TurboModuleRegistry.get(Enforcing)?\('.*\): Spec\);/" \ + | xargs yarn flow-node packages/react-native-codegen/src/cli/combine/combine-js-to-schema-cli.js "$SCHEMA_FILE" + +describe "Generating native code from schema" +yarn flow-node packages/react-native-codegen/buck_tests/generate-tests.js "$SCHEMA_FILE" "$LIBRARY_NAME" "$TEMP_DIR" "$MODULE_SPEC_NAME" + +if [ -n "$1" ]; then + OUTPUT_DIR="$1" + mkdir -p "$OUTPUT_DIR" +fi + +describe "Copying $MODULE_SPEC_NAME output to $OUTPUT_DIR" +cp "$TEMP_DIR"/$MODULE_SPEC_NAME* "$OUTPUT_DIR/." From 69ce9c21d433a23ffb9934062b46fa64277ee255 Mon Sep 17 00:00:00 2001 From: Enes Date: Fri, 8 May 2020 15:33:38 -0700 Subject: [PATCH 227/235] Update .gitignore (#28789) Summary: When you profile your heap and memory allocations with Memory Profiler, files with *.hprof extension are created in /android folder that has big sizes (up to 600 MB for each). These files may be needed to add to gitignore. ## Changelog [Android] [Added] - Add *.hprof files to gitignore Pull Request resolved: https://github.com/facebook/react-native/pull/28789 Differential Revision: D21432927 Pulled By: hramos fbshipit-source-id: a20f12645de5ca0874c9130094e2f97fe16b2203 --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 14b3dddf669aef..73882e2b7b5de5 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,6 @@ RNTester/Pods/* # Visual studio .vscode .vs + +# Android memory profiler files +*.hprof From c67e1fe42fe2b31eb37b8aee648269f176401c62 Mon Sep 17 00:00:00 2001 From: empyrical Date: Fri, 8 May 2020 15:39:11 -0700 Subject: [PATCH 228/235] Codegen: Add prepublish script to build Flow files (#28827) Summary: *This is a follow-up to https://github.com/facebook/react-native/issues/28645, redone using a build script based off of Metro's build script instead of using `flow-remove-types` and `flow-copy-source`.* This pull request adds a build step to `react-native-codegen` that builds the Flow-annotated JS files so that users of the NPM module `react-native-codegen` do not need to use require hooks to be able to import it. A new build script, `scripts/build.js` is added that builds every JS file in `src/` into a `lib/` folder, and also copies over the original Flow annotated files to `lib/` with a `.js.flow` extension, so users of `react-native-codegen` can still typecheck against it using Flow. The shell scripts in `src` are also copied over. It is based off of the [build script from Metro](https://github.com/facebook/metro/blob/00867816eb9b2f69c8af9cebb523e9e4d280671a/scripts/build.js) ## Changelog [General] [Added] - Codegen: Add prepublish script to build Flow files Pull Request resolved: https://github.com/facebook/react-native/pull/28827 Test Plan: I am able to make use of the Codegen scripts without needing to use the `flow-node` CLI or the `flow-remove-types/register` require hook. Reviewed By: cpojer Differential Revision: D21412173 Pulled By: hramos fbshipit-source-id: 26ae67cdd04652ca4700a069a234a25558773cb1 --- .eslintignore | 1 + .gitignore | 3 +- packages/react-native-codegen/.babelrc | 11 ++ packages/react-native-codegen/.prettierrc | 7 ++ packages/react-native-codegen/package.json | 22 +++- .../react-native-codegen/scripts/build.js | 117 ++++++++++++++++++ 6 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 packages/react-native-codegen/.babelrc create mode 100644 packages/react-native-codegen/.prettierrc create mode 100644 packages/react-native-codegen/scripts/build.js diff --git a/.eslintignore b/.eslintignore index bd7805631588cd..a00ba35784f0a1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -10,3 +10,4 @@ Libraries/vendor/**/* packages/*/node_modules pr-inactivity-bookmarklet.js question-bookmarklet.js +packages/react-native-codegen/lib diff --git a/.gitignore b/.gitignore index 73882e2b7b5de5..43810959f7eca0 100644 --- a/.gitignore +++ b/.gitignore @@ -94,9 +94,10 @@ RNTester/Pods/* !RNTester/Pods/__offline_mirrors # react-native-codegen +/packages/react-native-codegen/lib /ReactCommon/fabric/components/rncore/ -/schema-rncore.json /schema-native-modules.json +/schema-rncore.json # Visual studio .vscode diff --git a/packages/react-native-codegen/.babelrc b/packages/react-native-codegen/.babelrc new file mode 100644 index 00000000000000..b8ac81899b77e0 --- /dev/null +++ b/packages/react-native-codegen/.babelrc @@ -0,0 +1,11 @@ +{ + "plugins": [ + "@babel/plugin-proposal-object-rest-spread", + "@babel/plugin-transform-async-to-generator", + "@babel/plugin-transform-destructuring", + "@babel/plugin-transform-flow-strip-types", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-optional-chaining" + ] +} diff --git a/packages/react-native-codegen/.prettierrc b/packages/react-native-codegen/.prettierrc new file mode 100644 index 00000000000000..20374fd919f060 --- /dev/null +++ b/packages/react-native-codegen/.prettierrc @@ -0,0 +1,7 @@ +{ + "requirePragma": true, + "singleQuote": true, + "trailingComma": "all", + "bracketSpacing": false, + "jsxBracketSameLine": true +} diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 3c77e91f8bce28..2bcba86fdefe1e 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -7,13 +7,33 @@ "type": "git", "url": "git@github.com:facebook/react-native.git" }, + "scripts": { + "build": "yarn clean && node scripts/build.js --verbose", + "clean": "rm -rf lib", + "prepublish": "yarn run build" + }, "license": "MIT", "files": [ - "src" + "lib" ], "dependencies": { "flow-parser": "^0.121.0", "jscodeshift": "^0.9.0", "nullthrows": "^1.1.1" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "chalk": "^4.0.0", + "glob": "^7.1.1", + "micromatch": "^4.0.2", + "mkdirp": "^0.5.1", + "prettier": "1.19.1" } } diff --git a/packages/react-native-codegen/scripts/build.js b/packages/react-native-codegen/scripts/build.js new file mode 100644 index 00000000000000..9eefd4fdbb8f98 --- /dev/null +++ b/packages/react-native-codegen/scripts/build.js @@ -0,0 +1,117 @@ +/** + * 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 + */ + +/** + * script to build (transpile) files. + * + * Based off of the build script from Metro, and tweaked to run in just one + * package instead of in a monorepo. Just run `build.js` and the JS files in + * `src/` will be built in `lib/`, and the original source files will be copied + * over as `Example.js.flow`, so consumers of this module can still make use of + * type checking. + * + * Call this script with the `--verbose` flag to show the full output of this + * script. + */ + +'use strict'; + +const babel = require('@babel/core'); +const chalk = require('chalk'); +const fs = require('fs'); +const glob = require('glob'); +const micromatch = require('micromatch'); +const mkdirp = require('mkdirp'); +const path = require('path'); +const prettier = require('prettier'); +const prettierConfig = JSON.parse( + fs.readFileSync(path.resolve(__dirname, '..', '.prettierrc'), 'utf8'), +); + +const SRC_DIR = 'src'; +const BUILD_DIR = 'lib'; +const JS_FILES_PATTERN = '**/*.js'; +const IGNORE_PATTERN = '**/__tests__/**'; +const PACKAGE_DIR = path.resolve(__dirname, '../'); + +const fixedWidth = str => { + const WIDTH = 80; + const strs = str.match(new RegExp(`(.{1,${WIDTH}})`, 'g')) || [str]; + let lastString = strs[strs.length - 1]; + if (lastString.length < WIDTH) { + lastString += Array(WIDTH - lastString.length).join(chalk.dim('.')); + } + return strs + .slice(0, -1) + .concat(lastString) + .join('\n'); +}; + +function getBuildPath(file, buildFolder) { + const pkgSrcPath = path.resolve(PACKAGE_DIR, SRC_DIR); + const pkgBuildPath = path.resolve(PACKAGE_DIR, BUILD_DIR); + const relativeToSrcPath = path.relative(pkgSrcPath, file); + return path.resolve(pkgBuildPath, relativeToSrcPath); +} + +function buildFile(file, silent) { + const destPath = getBuildPath(file, BUILD_DIR); + + mkdirp.sync(path.dirname(destPath)); + if (micromatch.isMatch(file, IGNORE_PATTERN)) { + silent || + process.stdout.write( + chalk.dim(' \u2022 ') + + path.relative(PACKAGE_DIR, file) + + ' (ignore)\n', + ); + } else if (!micromatch.isMatch(file, JS_FILES_PATTERN)) { + fs.createReadStream(file).pipe(fs.createWriteStream(destPath)); + silent || + process.stdout.write( + chalk.red(' \u2022 ') + + path.relative(PACKAGE_DIR, file) + + chalk.red(' \u21D2 ') + + path.relative(PACKAGE_DIR, destPath) + + ' (copy)' + + '\n', + ); + } else { + const transformed = prettier.format( + babel.transformFileSync(file, {}).code, + { + ...prettierConfig, + parser: 'babel', + }, + ); + fs.writeFileSync(destPath, transformed); + const source = fs.readFileSync(file).toString('utf-8'); + if (/\@flow/.test(source)) { + fs.createReadStream(file).pipe(fs.createWriteStream(destPath + '.flow')); + } + silent || + process.stdout.write( + chalk.green(' \u2022 ') + + path.relative(PACKAGE_DIR, file) + + chalk.green(' \u21D2 ') + + path.relative(PACKAGE_DIR, destPath) + + '\n', + ); + } +} + +const srcDir = path.resolve(__dirname, '..', SRC_DIR); +const pattern = path.resolve(srcDir, '**/*'); +const files = glob.sync(pattern, {nodir: true}); + +process.stdout.write(fixedWidth(`${path.basename(PACKAGE_DIR)}\n`)); + +files.forEach(file => buildFile(file, !process.argv.includes('--verbose'))); + +process.stdout.write(`[ ${chalk.green('OK')} ]\n`); From 77d1380f1751127c82f7ddb37545979490dd2984 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 8 May 2020 15:40:10 -0700 Subject: [PATCH 229/235] Remove RCTLogError from RCTScrollViewManager.calculateChildFrames Summary: Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21483553 fbshipit-source-id: 0c681979a4988c36cfa6f05aa5bca896590f9e3d --- React/Views/ScrollView/RCTScrollViewManager.m | 1 - 1 file changed, 1 deletion(-) diff --git a/React/Views/ScrollView/RCTScrollViewManager.m b/React/Views/ScrollView/RCTScrollViewManager.m index cb5700ca6deddd..dc895745db0175 100644 --- a/React/Views/ScrollView/RCTScrollViewManager.m +++ b/React/Views/ScrollView/RCTScrollViewManager.m @@ -147,7 +147,6 @@ - (UIView *)view addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) { RCTScrollView *view = viewRegistry[reactTag]; if (!view || ![view isKindOfClass:[RCTScrollView class]]) { - RCTLogError(@"Cannot find RCTScrollView with tag #%@", reactTag); return; } From 13ee5c4c166388dca126d5565e34a3671c724bc2 Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Fri, 8 May 2020 16:10:26 -0700 Subject: [PATCH 230/235] Enable animations in bridgeless mode on iOS Reviewed By: ejanzer Differential Revision: D21465166 fbshipit-source-id: b34e8e97330b897e20d9a4b05dba1826df569e16 --- Libraries/Animated/src/Animated.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Libraries/Animated/src/Animated.js b/Libraries/Animated/src/Animated.js index 580b40f0ef92df..0891d75a3f3649 100644 --- a/Libraries/Animated/src/Animated.js +++ b/Libraries/Animated/src/Animated.js @@ -21,9 +21,7 @@ import typeof AnimatedView from './components/AnimatedView'; const AnimatedMock = require('./AnimatedMock'); const AnimatedImplementation = require('./AnimatedImplementation'); -//TODO(T57411659): Remove the bridgeless check when Animated perf regressions are fixed. -const Animated = ((Platform.isTesting || -(global.RN$Bridgeless && Platform.OS === 'ios') +const Animated = ((Platform.isTesting ? AnimatedMock : AnimatedImplementation): typeof AnimatedMock); From a4a47b9a1e890e303d29f2b065e92a0c36cec4c5 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Fri, 8 May 2020 16:10:38 -0700 Subject: [PATCH 231/235] Expose RuntimeExecutor on CatalystInstance (#28851) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28851 This diff creates a RuntimeExecutor that uses the bridge and exposes it on CatalystInstanceImpl. Changelog: [Internal] Reviewed By: mdvacca, RSNara Differential Revision: D21051949 fbshipit-source-id: b3977fc14fa19089f33e297d29cedba0d067526d --- RNTester/Podfile.lock | 9 ++++- .../react/bridge/CatalystInstance.java | 6 +++- .../react/bridge/CatalystInstanceImpl.java | 3 ++ .../jni/react/jni/CatalystInstanceImpl.cpp | 11 ++++++ .../main/jni/react/jni/CatalystInstanceImpl.h | 4 +++ ReactCommon/cxxreact/Android.mk | 2 +- ReactCommon/cxxreact/BUCK | 1 + ReactCommon/cxxreact/Instance.cpp | 4 +++ ReactCommon/cxxreact/Instance.h | 6 ++++ ReactCommon/cxxreact/NativeToJsBridge.cpp | 17 +++++++++ ReactCommon/cxxreact/NativeToJsBridge.h | 7 ++++ ReactCommon/cxxreact/React-cxxreact.podspec | 1 + .../React-runtimeexecutor.podspec | 36 +++++++++++++++++++ scripts/react_native_pods.rb | 1 + 14 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 85013c176d71b7..85de4e30cae5d0 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -236,6 +236,7 @@ PODS: - glog - React-callinvoker (= 1000.0.0) - React-jsinspector (= 1000.0.0) + - React-runtimeexecutor (= 1000.0.0) - React-jsi (1000.0.0): - boost-for-react-native (= 1.63.0) - DoubleConversion @@ -318,6 +319,8 @@ PODS: - React-Core/RCTVibrationHeaders (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) + - React-runtimeexecutor (1000.0.0): + - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (1000.0.0): - DoubleConversion - Folly (= 2020.01.13.00) @@ -388,6 +391,7 @@ DEPENDENCIES: - React-RCTTest (from `./RCTTest`) - React-RCTText (from `../Libraries/Text`) - React-RCTVibration (from `../Libraries/Vibration`) + - React-runtimeexecutor (from `../ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../ReactCommon`) - ReactCommon/turbomodule/samples (from `../ReactCommon`) - Yoga (from `../ReactCommon/yoga`) @@ -462,6 +466,8 @@ EXTERNAL SOURCES: :path: "../Libraries/Text" React-RCTVibration: :path: "../Libraries/Vibration" + React-runtimeexecutor: + :path: "../ReactCommon/runtimeexecutor" ReactCommon: :path: "../ReactCommon" Yoga: @@ -491,7 +497,7 @@ SPEC CHECKSUMS: React-callinvoker: 0dada022d38b73e6e15b33e2a96476153f79bbf6 React-Core: 08c69f013e6fd654ea8f9fd84bbd66780a54d886 React-CoreModules: d13d148c851af5780f864be74bc2165140923dc7 - React-cxxreact: 091da030e879ed93d970e95dd74fcbacb2a1d661 + React-cxxreact: b43a94e679b307660de530a3af872ab4c7d9925d React-jsi: fe94132da767bfc4801968c2a12abae43e9a833e React-jsiexecutor: 55eff40b2e0696e7a979016e321793ec8b28a2ac React-jsinspector: 7fbf9b42b58b02943a0d89b0ba9fff0070f2de98 @@ -506,6 +512,7 @@ SPEC CHECKSUMS: React-RCTTest: cfe25fcf70b04a747dba4326105db398250caa9a React-RCTText: 6c01963d3e562109f5548262b09b1b2bc260dd60 React-RCTVibration: d42d73dafd9f63cf758656ee743aa80c566798ff + React-runtimeexecutor: 60dd6204a13f68a1aa1118870edcc604a791df2b ReactCommon: 39e00b754f5e1628804fab28f44146d06280f700 Yoga: f7fa200d8c49f97b54c9421079e781fb900b5cae YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java index f95b974e30d064..1a5067b7edb358 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java @@ -99,14 +99,18 @@ public interface CatalystInstance void setGlobalVariable(String propName, String jsonValue); /** - * Get the C pointer (as a long) to the JavaScriptCore context associated with this instance. + * Do not use this anymore. Use {@link #getRuntimeExecutor()} instead. Get the C pointer (as a + * long) to the JavaScriptCore context associated with this instance. * *

Use the following pattern to ensure that the JS context is not cleared while you are using * it: JavaScriptContextHolder jsContext = reactContext.getJavaScriptContextHolder() * synchronized(jsContext) { nativeThingNeedingJsContext(jsContext.get()); } */ + @Deprecated JavaScriptContextHolder getJavaScriptContextHolder(); + RuntimeExecutor getRuntimeExecutor(); + void addJSIModules(List jsiModules); /** diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 864c85c73601e6..62cdb8a6cda784 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -664,6 +664,9 @@ public JavaScriptContextHolder getJavaScriptContextHolder() { return mJavaScriptContextHolder; } + @Override + public native RuntimeExecutor getRuntimeExecutor(); + @Override public void addJSIModules(List jsiModules) { mJSIModuleRegistry.registerModules(jsiModules); diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index 4b279d208b41b1..7d5b1acf483f88 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -131,6 +131,8 @@ void CatalystInstanceImpl::registerNatives() { makeNativeMethod( "jniHandleMemoryPressure", CatalystInstanceImpl::handleMemoryPressure), + makeNativeMethod( + "getRuntimeExecutor", CatalystInstanceImpl::getRuntimeExecutor), }); JNativeRunnable::registerNatives(); @@ -326,5 +328,14 @@ CatalystInstanceImpl::getNativeCallInvokerHolder() { return nativeCallInvokerHolder_; } +jni::alias_ref +CatalystInstanceImpl::getRuntimeExecutor() { + if (!runtimeExecutor_) { + runtimeExecutor_ = jni::make_global( + JRuntimeExecutor::newObjectCxxArgs(instance_->getRuntimeExecutor())); + } + return runtimeExecutor_; +} + } // namespace react } // namespace facebook diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h index 32a2eef9178399..dd9990ef090a00 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h @@ -9,10 +9,12 @@ #include #include +#include #include #include "CxxModuleWrapper.h" #include "JMessageQueueThread.h" +#include "JRuntimeExecutor.h" #include "JSLoader.h" #include "JavaModuleWrapper.h" #include "ModuleRegistryBuilder.h" @@ -92,6 +94,7 @@ class CatalystInstanceImpl : public jni::HybridClass { void jniCallJSCallback(jint callbackId, NativeArray *arguments); jni::alias_ref getJSCallInvokerHolder(); jni::alias_ref getNativeCallInvokerHolder(); + jni::alias_ref getRuntimeExecutor(); void setGlobalVariable(std::string propName, std::string &&jsonValue); jlong getJavaScriptContext(); void handleMemoryPressure(int pressureLevel); @@ -103,6 +106,7 @@ class CatalystInstanceImpl : public jni::HybridClass { std::shared_ptr moduleMessageQueue_; jni::global_ref jsCallInvokerHolder_; jni::global_ref nativeCallInvokerHolder_; + jni::global_ref runtimeExecutor_; }; } // namespace react diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index 553e0a93e5ca89..32d7e91cae7b50 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -19,7 +19,7 @@ LOCAL_CFLAGS := \ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture -LOCAL_STATIC_LIBRARIES := boost jsi callinvoker +LOCAL_STATIC_LIBRARIES := boost jsi callinvoker runtimeexecutor LOCAL_SHARED_LIBRARIES := jsinspector libfolly_json glog include $(BUILD_STATIC_LIBRARY) diff --git a/ReactCommon/cxxreact/BUCK b/ReactCommon/cxxreact/BUCK index 22ec861acd0bfc..d5453556bd6e91 100644 --- a/ReactCommon/cxxreact/BUCK +++ b/ReactCommon/cxxreact/BUCK @@ -154,6 +154,7 @@ rn_xplat_cxx_library( react_native_xplat_target("callinvoker:callinvoker"), react_native_xplat_target("jsinspector:jsinspector"), react_native_xplat_target("microprofiler:microprofiler"), + react_native_xplat_target("runtimeexecutor:runtimeexecutor"), "//third-party/glog:glog", "//xplat/folly:optional", ], diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index 6643b83a617865..d5b4af5e515ad8 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -229,6 +229,10 @@ std::shared_ptr Instance::getJSCallInvoker() { return std::static_pointer_cast(jsCallInvoker_); } +RuntimeExecutor Instance::getRuntimeExecutor() { + return nativeToJsBridge_->getRuntimeExecutor(); +} + std::shared_ptr Instance::getDecoratedNativeCallInvoker( std::shared_ptr nativeInvoker) { return nativeToJsBridge_->getDecoratedNativeCallInvoker(nativeInvoker); diff --git a/ReactCommon/cxxreact/Instance.h b/ReactCommon/cxxreact/Instance.h index 0d5bacb5360243..f475bf8a7fa72c 100644 --- a/ReactCommon/cxxreact/Instance.h +++ b/ReactCommon/cxxreact/Instance.h @@ -12,6 +12,7 @@ #include #include +#include #include #ifndef RN_EXPORT @@ -129,6 +130,11 @@ class RN_EXPORT Instance { std::shared_ptr getDecoratedNativeCallInvoker( std::shared_ptr nativeInvoker); + /** + * RuntimeExecutor is used by Fabric to access the jsi::Runtime. + */ + RuntimeExecutor getRuntimeExecutor(); + private: void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch); void loadBundle( diff --git a/ReactCommon/cxxreact/NativeToJsBridge.cpp b/ReactCommon/cxxreact/NativeToJsBridge.cpp index 4d31ef058a17ad..64b0673423b8d9 100644 --- a/ReactCommon/cxxreact/NativeToJsBridge.cpp +++ b/ReactCommon/cxxreact/NativeToJsBridge.cpp @@ -331,5 +331,22 @@ std::shared_ptr NativeToJsBridge::getDecoratedNativeCallInvoker( return std::make_shared(m_delegate, nativeInvoker); } +RuntimeExecutor NativeToJsBridge::getRuntimeExecutor() { + auto runtimeExecutor = + [this, isDestroyed = m_destroyed]( + std::function &&callback) { + if (*isDestroyed) { + return; + } + runOnExecutorQueue( + [callback = std::move(callback)](JSExecutor *executor) { + jsi::Runtime *runtime = + (jsi::Runtime *)executor->getJavaScriptContext(); + callback(*runtime); + }); + }; + return runtimeExecutor; +} + } // namespace react } // namespace facebook diff --git a/ReactCommon/cxxreact/NativeToJsBridge.h b/ReactCommon/cxxreact/NativeToJsBridge.h index 9cc9176b093bca..d298f9c27960c2 100644 --- a/ReactCommon/cxxreact/NativeToJsBridge.h +++ b/ReactCommon/cxxreact/NativeToJsBridge.h @@ -13,6 +13,7 @@ #include #include +#include #include namespace folly { @@ -106,6 +107,12 @@ class NativeToJsBridge { std::shared_ptr getDecoratedNativeCallInvoker( std::shared_ptr nativeInvoker); + /** + * RuntimeExecutor is used on Android to access the jsi::Runtime from Fabric + * and TurboModules + */ + RuntimeExecutor getRuntimeExecutor(); + private: // This is used to avoid a race condition where a proxyCallback gets queued // after ~NativeToJsBridge(), on the same thread. In that case, the callback diff --git a/ReactCommon/cxxreact/React-cxxreact.podspec b/ReactCommon/cxxreact/React-cxxreact.podspec index cb6835be464488..452d817812e87b 100644 --- a/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/ReactCommon/cxxreact/React-cxxreact.podspec @@ -41,4 +41,5 @@ Pod::Spec.new do |s| s.dependency "glog" s.dependency "React-jsinspector", version s.dependency "React-callinvoker", version + s.dependency "React-runtimeexecutor", version end diff --git a/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec b/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec new file mode 100644 index 00000000000000..e7fc8d2d2a3319 --- /dev/null +++ b/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec @@ -0,0 +1,36 @@ +# 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. + +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) +version = package['version'] + +source = { :git => 'https://github.com/facebook/react-native.git' } +if version == '1000.0.0' + # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. + source[:commit] = `git rev-parse HEAD`.strip +else + source[:tag] = "v#{version}" +end + +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' +folly_version = '2020.01.13.00' +boost_compiler_flags = '-Wno-documentation' + +Pod::Spec.new do |s| + s.name = "React-runtimeexecutor" + s.version = version + s.summary = "-" # TODO + s.homepage = "https://reactnative.dev/" + s.license = package["license"] + s.author = "Facebook, Inc. and its affiliates" + s.platforms = { :ios => "10.0", :tvos => "10.0" } + s.source = source + s.source_files = "**/*.{cpp,h}" + s.header_dir = "ReactCommon" + + s.dependency "React-jsi", version +end diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 86afd7ff5a0653..d54c09f3406846 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -41,6 +41,7 @@ def use_react_native! (options={}) pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor" pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector" pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker" + pod 'React-runtimeexecutor', :path => "#{prefix}/ReactCommon/runtimeexecutor" pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon" pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga", :modular_headers => true From f535c8b4bb4474ffe0a0765270cbca8d839deca8 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 8 May 2020 16:34:54 -0700 Subject: [PATCH 232/235] Inject ImagePipeline into FrescoModule Summary: This diff refactors the FrescoModule in order to receive an ImagePipeline as a parameter. This is necessary to ensure the same ImagePipeline is used by every RN module changelog: [Internal][Android] Reviewed By: JoshuaGross Differential Revision: D21428346 fbshipit-source-id: 70a6cc57c8585fe74b6d0b0d1fd86c539974ec23 --- .../react/modules/fresco/FrescoModule.java | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java index df26770d309376..ac70eff2adcc19 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java @@ -12,6 +12,7 @@ import com.facebook.common.logging.FLog; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory; +import com.facebook.imagepipeline.core.ImagePipeline; import com.facebook.imagepipeline.core.ImagePipelineConfig; import com.facebook.imagepipeline.listener.RequestListener; import com.facebook.react.bridge.LifecycleEventListener; @@ -41,6 +42,7 @@ public class FrescoModule extends ReactContextBaseJavaModule public static final String NAME = "FrescoModule"; private final boolean mClearOnDestroy; private @Nullable ImagePipelineConfig mConfig; + private @Nullable ImagePipeline mImagePipeline; private static boolean sHasBeenInitialized = false; @@ -66,6 +68,20 @@ public FrescoModule(ReactApplicationContext reactContext, boolean clearOnDestroy this(reactContext, clearOnDestroy, null); } + /** + * Create a new Fresco module with a default configuration (or the previously given configuration + * via {@link #FrescoModule(ReactApplicationContext, boolean, ImagePipelineConfig)}. + * + * @param clearOnDestroy whether to clear the memory cache in onHostDestroy: this should be {@code + * true} for pure RN apps and {@code false} for apps that use Fresco outside of RN as well + * @param reactContext the context to use + */ + public FrescoModule( + ReactApplicationContext reactContext, ImagePipeline imagePipeline, boolean clearOnDestroy) { + this(reactContext, clearOnDestroy); + mImagePipeline = imagePipeline; + } + /** * Create a new Fresco module with a given ImagePipelineConfig. This should only be called when * the module has not been initialized yet. You can use {@link #hasBeenInitialized()} to check @@ -114,7 +130,7 @@ public String getName() { @Override public void clearSensitiveData() { // Clear image cache. - Fresco.getImagePipeline().clearCaches(); + getImagePipeline().clearCaches(); } /** @@ -168,7 +184,14 @@ public void onHostDestroy() { // the 'last' ReactActivity is being destroyed, which effectively means the app is being // backgrounded. if (hasBeenInitialized() && mClearOnDestroy) { - Fresco.getImagePipeline().clearMemoryCaches(); + getImagePipeline().clearMemoryCaches(); + } + } + + private ImagePipeline getImagePipeline() { + if (mImagePipeline == null) { + mImagePipeline = Fresco.getImagePipeline(); } + return mImagePipeline; } } From aece57be291ebdcbab300a667480bc0454c15561 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 8 May 2020 17:30:24 -0700 Subject: [PATCH 233/235] Fabric: Calling JSVM GC on memory pressure event on iOS Summary: This change is especially important for Fabric when a lot of objects (mostly `ShadowNode`s) have shared ownership. Without this change, JSVM could not know that bunch of natively allocated objects should be deallocated. Changelog: [Internal] Fabric-specific internal change. Reviewed By: dulinriley Differential Revision: D21484773 fbshipit-source-id: 46e32de0f108082e60df346884c9287023156149 --- React/CxxBridge/RCTCxxBridge.mm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index ec4090a862c3d1..4f2189c1ced5fc 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -241,10 +241,20 @@ - (instancetype)initWithParentBridge:(RCTBridge *)bridge _moduleDataByID = [NSMutableArray new]; [RCTBridge setCurrentBridge:self]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleMemoryWarning) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; } return self; } +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + + (void)runRunLoop { @autoreleasepool { @@ -278,6 +288,13 @@ - (void)_tryAndHandleError:(dispatch_block_t)block } } +- (void)handleMemoryWarning +{ + if (_reactInstance) { + _reactInstance->handleMemoryPressure(15 /* TRIM_MEMORY_RUNNING_CRITICAL */); + } +} + /** * Ensure block is run on the JS thread. If we're already on the JS thread, the block will execute synchronously. * If we're not on the JS thread, the block is dispatched to that thread. Any errors encountered while executing From a1ac2518a364ebcd3cc024a22229cadc1791e1c4 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Sat, 9 May 2020 17:21:51 -0700 Subject: [PATCH 234/235] TextInput: Default `blurOnSubmit` in JS Summary: Consolidates the logic for the default value of `blurOnSubmit` on `TextInput` in the JavaScript component. This only materially impacts Fabric. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21491482 fbshipit-source-id: 16d8aba32e7d0321a4583e87e03405ea587e35d4 --- Libraries/Components/TextInput/TextInput.js | 6 ++++++ .../__tests__/__snapshots__/TextInput-test.js.snap | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index decaeae0057f21..da0e0bd77b3fb6 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -1057,6 +1057,10 @@ function InternalTextInput(props: Props): React.Node { // This is a hack to let Flow know we want an exact object |} = {...null}; + // The default value for `blurOnSubmit` is true for single-line fields and + // false for multi-line fields. + const blurOnSubmit = props.blurOnSubmit ?? !props.multiline; + if (Platform.OS === 'ios') { const RCTTextInputView = props.multiline ? RCTMultilineTextInputView @@ -1073,6 +1077,7 @@ function InternalTextInput(props: Props): React.Node { Date: Tue, 3 Aug 2021 16:14:28 -0700 Subject: [PATCH 235/235] (Temporarily) remove droid-node-patching portions of Apple verification --- .ado/templates/apple-job-javascript.yml | 4 ---- .ado/templates/apple-job-react-native.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.ado/templates/apple-job-javascript.yml b/.ado/templates/apple-job-javascript.yml index ccdf9a3ce1f2c8..2568873ba8f318 100644 --- a/.ado/templates/apple-job-javascript.yml +++ b/.ado/templates/apple-job-javascript.yml @@ -12,10 +12,6 @@ steps: slice_name: ${{ parameters.slice_name }} xcode_version: ${{ parameters.xcode_version }} - - template: apple-droid-node-patching.yml - parameters: - apply_office_patches: $(apply_office_patches) - - script: 'yarn install' displayName: 'yarn install' diff --git a/.ado/templates/apple-job-react-native.yml b/.ado/templates/apple-job-react-native.yml index c74069067a08e4..b0ece761841b4f 100644 --- a/.ado/templates/apple-job-react-native.yml +++ b/.ado/templates/apple-job-react-native.yml @@ -24,10 +24,6 @@ steps: slice_name: ${{ parameters.slice_name }} xcode_version: ${{ parameters.xcode_version }} - - template: apple-droid-node-patching.yml - parameters: - apply_office_patches: $(apply_office_patches) - - task: CmdLine@2 displayName: yarn install inputs: