From a06c0da828f42b804b526a5de35b94b5b4468c1c Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 12:38:26 -0700 Subject: [PATCH 001/290] Remove var in Libraries/Component (#22020) Summary: I removed `var` in Libraries/Component. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [Libraries/Component] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22020 Differential Revision: D12843058 Pulled By: TheSavior fbshipit-source-id: 90723f3905191cbd29cb18474c700ac65f2503cd --- Libraries/Components/RefreshControl/RefreshControl.js | 5 +++-- Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index 0f3f4c857557df..98ce10af6d0d73 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -20,15 +20,16 @@ const nullthrows = require('nullthrows'); import type {ColorValue} from 'StyleSheetTypes'; import type {ViewProps} from 'ViewPropTypes'; +let RefreshLayoutConsts; if (Platform.OS === 'android') { const AndroidSwipeRefreshLayout = require('UIManager').getViewManagerConfig( 'AndroidSwipeRefreshLayout', ); - var RefreshLayoutConsts = AndroidSwipeRefreshLayout + RefreshLayoutConsts = AndroidSwipeRefreshLayout ? AndroidSwipeRefreshLayout.Constants : {SIZE: {}}; } else { - var RefreshLayoutConsts = {SIZE: {}}; + RefreshLayoutConsts = {SIZE: {}}; } type NativeRefreshControlType = Class>; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 7fc4fadeac9683..873573ad8a025c 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -132,20 +132,21 @@ class TabBarItemIOS extends React.Component { showedDeprecationWarning = true; } } - + render() { const {style, children, ...props} = this.props; // if the tab has already been shown once, always continue to show it so we // preserve state between tab transitions + let tabContents; if (this.state.hasBeenSelected) { - var tabContents = ( + tabContents = ( {children} ); } else { - var tabContents = ; + tabContents = ; } return ( From 7a9d86019f4c02ad4572b9f412e4b5832de81b34 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 12:55:17 -0700 Subject: [PATCH 002/290] Remove var in RNTester (#22017) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22017 Differential Revision: D12843109 Pulled By: TheSavior fbshipit-source-id: 936ed5efdcff2e7b85e90ed90c589eb98c60c411 --- RNTester/js/LayoutEventsExample.js | 14 +++--- RNTester/js/LayoutExample.js | 20 ++++---- RNTester/js/ListViewExample.js | 22 ++++----- RNTester/js/ListViewGridLayoutExample.js | 20 ++++---- RNTester/js/ListViewPagingExample.js | 48 +++++++++---------- RNTester/js/ModalExample.js | 16 +++---- RNTester/js/NativeAnimationsExample.js | 2 +- RNTester/js/PanResponderExample.js | 2 +- .../js/PermissionsExampleAndroid.android.js | 2 +- RNTester/js/PickerExample.js | 2 +- RNTester/js/PickerIOSExample.js | 15 +++--- RNTester/js/PointerEventsExample.js | 12 ++--- .../js/ProgressBarAndroidExample.android.js | 14 +++--- RNTester/js/ProgressViewIOSExample.js | 6 +-- RNTester/js/PushNotificationIOSExample.js | 8 ++-- 15 files changed, 102 insertions(+), 101 deletions(-) diff --git a/RNTester/js/LayoutEventsExample.js b/RNTester/js/LayoutEventsExample.js index c921f90087457c..e0676af568b31e 100644 --- a/RNTester/js/LayoutEventsExample.js +++ b/RNTester/js/LayoutEventsExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, LayoutAnimation, StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, LayoutAnimation, StyleSheet, Text, View} = ReactNative; import type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes'; @@ -71,9 +71,9 @@ class LayoutEventExample extends React.Component<{}, State> { }; render() { - var viewStyle = [styles.view, this.state.viewStyle]; - var textLayout = this.state.textLayout || {width: '?', height: '?'}; - var imageLayout = this.state.imageLayout || {x: '?', y: '?'}; + const viewStyle = [styles.view, this.state.viewStyle]; + const textLayout = this.state.textLayout || {width: '?', height: '?'}; + const imageLayout = this.state.imageLayout || {x: '?', y: '?'}; return ( @@ -113,7 +113,7 @@ class LayoutEventExample extends React.Component<{}, State> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ view: { padding: 12, borderColor: 'black', diff --git a/RNTester/js/LayoutExample.js b/RNTester/js/LayoutExample.js index 9b32ec60c4443e..fed6f705783acd 100644 --- a/RNTester/js/LayoutExample.js +++ b/RNTester/js/LayoutExample.js @@ -10,17 +10,17 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, View} = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); class Circle extends React.Component<$FlowFixMeProps> { render() { - var size = this.props.size || 20; - var backgroundColor = this.props.bgColor || '#527fe4'; + const size = this.props.size || 20; + const backgroundColor = this.props.bgColor || '#527fe4'; return ( { class CircleBlock extends React.Component<$FlowFixMeProps> { render() { - var circleStyle = { + const circleStyle = { flexDirection: 'row', backgroundColor: '#f6f7f8', borderWidth: 0.5, @@ -56,7 +56,7 @@ class LayoutExample extends React.Component<$FlowFixMeProps> { static displayName = 'LayoutExample'; render() { - var fiveColoredCircles = [ + const fiveColoredCircles = [ , , , @@ -186,7 +186,7 @@ class LayoutExample extends React.Component<$FlowFixMeProps> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ overlay: { backgroundColor: '#aaccff', borderRadius: 10, diff --git a/RNTester/js/ListViewExample.js b/RNTester/js/ListViewExample.js index f52f3dfb461af1..eb2c572be2844c 100644 --- a/RNTester/js/ListViewExample.js +++ b/RNTester/js/ListViewExample.js @@ -69,8 +69,8 @@ class ListViewSimpleExample extends React.Component { rowID: number, highlightRow: (sectionID: number, rowID: number) => void, ) => { - var rowHash = Math.abs(hashCode(rowData)); - var imgSource = THUMB_URLS[rowHash % THUMB_URLS.length]; + const rowHash = Math.abs(hashCode(rowData)); + const imgSource = THUMB_URLS[rowHash % THUMB_URLS.length]; return ( { @@ -90,9 +90,9 @@ class ListViewSimpleExample extends React.Component { }; _genRows(pressData: {[key: number]: boolean}): Array { - var dataBlob = []; - for (var ii = 0; ii < 100; ii++) { - var pressedText = pressData[ii] ? ' (pressed)' : ''; + const dataBlob = []; + for (let ii = 0; ii < 100; ii++) { + const pressedText = pressData[ii] ? ' (pressed)' : ''; dataBlob.push('Row ' + ii + pressedText); } return dataBlob; @@ -124,7 +124,7 @@ class ListViewSimpleExample extends React.Component { } } -var THUMB_URLS = [ +const THUMB_URLS = [ require('./Thumbnails/like.png'), require('./Thumbnails/dislike.png'), require('./Thumbnails/call.png'), @@ -138,19 +138,19 @@ var THUMB_URLS = [ require('./Thumbnails/superlike.png'), require('./Thumbnails/victory.png'), ]; -var LOREM_IPSUM = +const LOREM_IPSUM = 'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud modus, putant invidunt reprehendunt ne qui.'; /* eslint no-bitwise: 0 */ -var hashCode = function(str) { - var hash = 15; - for (var ii = str.length - 1; ii >= 0; ii--) { +const hashCode = function(str) { + let hash = 15; + for (let ii = str.length - 1; ii >= 0; ii--) { hash = (hash << 5) - hash + str.charCodeAt(ii); } return hash; }; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ row: { flexDirection: 'row', justifyContent: 'center', diff --git a/RNTester/js/ListViewGridLayoutExample.js b/RNTester/js/ListViewGridLayoutExample.js index 2f3340d151af5d..2bc2cb2514389a 100644 --- a/RNTester/js/ListViewGridLayoutExample.js +++ b/RNTester/js/ListViewGridLayoutExample.js @@ -24,7 +24,7 @@ const ListViewDataSource = require('ListViewDataSource'); import type {RNTesterProps} from 'RNTesterTypes'; -var THUMB_URLS = [ +const THUMB_URLS = [ require('./Thumbnails/like.png'), require('./Thumbnails/dislike.png'), require('./Thumbnails/call.png'), @@ -78,8 +78,8 @@ class ListViewGridLayoutExample extends React.Component { } _renderRow = (rowData: string, sectionID: number, rowID: number) => { - var rowHash = Math.abs(hashCode(rowData)); - var imgSource = THUMB_URLS[rowHash % THUMB_URLS.length]; + const rowHash = Math.abs(hashCode(rowData)); + const imgSource = THUMB_URLS[rowHash % THUMB_URLS.length]; return ( this._pressRow(rowID)} @@ -95,9 +95,9 @@ class ListViewGridLayoutExample extends React.Component { }; _genRows(pressData: {[key: number]: boolean}): Array { - var dataBlob = []; - for (var ii = 0; ii < 100; ii++) { - var pressedText = pressData[ii] ? ' (X)' : ''; + const dataBlob = []; + for (let ii = 0; ii < 100; ii++) { + const pressedText = pressData[ii] ? ' (X)' : ''; dataBlob.push('Cell ' + ii + pressedText); } return dataBlob; @@ -114,15 +114,15 @@ class ListViewGridLayoutExample extends React.Component { } /* eslint no-bitwise: 0 */ -var hashCode = function(str) { - var hash = 15; - for (var ii = str.length - 1; ii >= 0; ii--) { +const hashCode = function(str) { + let hash = 15; + for (let ii = str.length - 1; ii >= 0; ii--) { hash = (hash << 5) - hash + str.charCodeAt(ii); } return hash; }; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ list: { justifyContent: 'space-around', flexDirection: 'row', diff --git a/RNTester/js/ListViewPagingExample.js b/RNTester/js/ListViewPagingExample.js index 85598c2ae5fb75..a19e3afd040f66 100644 --- a/RNTester/js/ListViewPagingExample.js +++ b/RNTester/js/ListViewPagingExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { Image, LayoutAnimation, ListView, @@ -22,10 +22,10 @@ var { View, } = ReactNative; -var NativeModules = require('NativeModules'); -var {UIManager} = NativeModules; +const NativeModules = require('NativeModules'); +const {UIManager} = NativeModules; -var THUMB_URLS = [ +const THUMB_URLS = [ require('./Thumbnails/like.png'), require('./Thumbnails/dislike.png'), require('./Thumbnails/call.png'), @@ -39,8 +39,8 @@ var THUMB_URLS = [ require('./Thumbnails/superlike.png'), require('./Thumbnails/victory.png'), ]; -var NUM_SECTIONS = 100; -var NUM_ROWS_PER_SECTION = 10; +const NUM_SECTIONS = 100; +const NUM_ROWS_PER_SECTION = 10; class Thumb extends React.Component<{}, $FlowFixMeState> { UNSAFE_componentWillMount() { @@ -53,7 +53,7 @@ class Thumb extends React.Component<{}, $FlowFixMeState> { }; _onPressThumb = () => { - var config = + const config = layoutAnimationConfigs[ this.state.thumbIndex % layoutAnimationConfigs.length ]; @@ -94,31 +94,31 @@ class ListViewPagingExample extends React.Component<$FlowFixMeProps, *> { // $FlowFixMe found when converting React.createClass to ES6 constructor(props) { super(props); - var getSectionData = (dataBlob, sectionID) => { + const getSectionData = (dataBlob, sectionID) => { return dataBlob[sectionID]; }; - var getRowData = (dataBlob, sectionID, rowID) => { + const getRowData = (dataBlob, sectionID, rowID) => { return dataBlob[rowID]; }; - var dataSource = new ListView.DataSource({ + const dataSource = new ListView.DataSource({ getRowData: getRowData, getSectionHeaderData: getSectionData, rowHasChanged: (row1, row2) => row1 !== row2, sectionHeaderHasChanged: (s1, s2) => s1 !== s2, }); - var dataBlob = {}; - var sectionIDs = []; - var rowIDs = []; - for (var ii = 0; ii < NUM_SECTIONS; ii++) { - var sectionName = 'Section ' + ii; + const dataBlob = {}; + const sectionIDs = []; + const rowIDs = []; + for (let ii = 0; ii < NUM_SECTIONS; ii++) { + const sectionName = 'Section ' + ii; sectionIDs.push(sectionName); dataBlob[sectionName] = sectionName; rowIDs[ii] = []; - for (var jj = 0; jj < NUM_ROWS_PER_SECTION; jj++) { - var rowName = 'S' + ii + ', R' + jj; + for (let jj = 0; jj < NUM_ROWS_PER_SECTION; jj++) { + const rowName = 'S' + ii + ', R' + jj; rowIDs[ii].push(rowName); dataBlob[rowName] = rowName; } @@ -151,7 +151,7 @@ class ListViewPagingExample extends React.Component<$FlowFixMeProps, *> { }; renderHeader = () => { - var headerLikeText = + const headerLikeText = this.state.headerPressCount % 2 ? ( 1 Like @@ -198,7 +198,7 @@ class ListViewPagingExample extends React.Component<$FlowFixMeProps, *> { } _onPressHeader = () => { - var config = + const config = layoutAnimationConfigs[ Math.floor(this.state.headerPressCount / 2) % layoutAnimationConfigs.length @@ -208,7 +208,7 @@ class ListViewPagingExample extends React.Component<$FlowFixMeProps, *> { }; } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ listview: { backgroundColor: '#B0C4DE', }, @@ -256,7 +256,7 @@ var styles = StyleSheet.create({ }, }); -var animations = { +const animations = { layout: { spring: { duration: 750, @@ -284,7 +284,7 @@ var animations = { }, }; -var layoutAnimationConfigs = [ +const layoutAnimationConfigs = [ animations.layout.spring, animations.layout.easeInEaseOut, ]; diff --git a/RNTester/js/ModalExample.js b/RNTester/js/ModalExample.js index 34025634360242..e8a306b17aba27 100644 --- a/RNTester/js/ModalExample.js +++ b/RNTester/js/ModalExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { Modal, Picker, Platform, @@ -44,7 +44,7 @@ class Button extends React.Component<$FlowFixMeProps, $FlowFixMeState> { }; render() { - var colorStyle = { + const colorStyle = { color: this.state.active ? '#fff' : '#000', }; return ( @@ -106,15 +106,15 @@ class ModalExample extends React.Component<{}, $FlowFixMeState> { } render() { - var modalBackgroundStyle = { + const modalBackgroundStyle = { backgroundColor: this.state.transparent ? 'rgba(0, 0, 0, 0.5)' : '#f5fcff', }; - var innerContainerTransparentStyle = this.state.transparent + const innerContainerTransparentStyle = this.state.transparent ? {backgroundColor: '#fff', padding: 20} : null; - var activeButtonStyle = { + const activeButtonStyle = { backgroundColor: '#ddd', }; @@ -241,7 +241,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', diff --git a/RNTester/js/NativeAnimationsExample.js b/RNTester/js/NativeAnimationsExample.js index 4c5a094033a4e5..176e668f52d44f 100644 --- a/RNTester/js/NativeAnimationsExample.js +++ b/RNTester/js/NativeAnimationsExample.js @@ -21,7 +21,7 @@ const { Slider, } = ReactNative; -var AnimatedSlider = Animated.createAnimatedComponent(Slider); +const AnimatedSlider = Animated.createAnimatedComponent(Slider); class Tester extends React.Component<$FlowFixMeProps, $FlowFixMeState> { state = { diff --git a/RNTester/js/PanResponderExample.js b/RNTester/js/PanResponderExample.js index 82e0ecf0134ee5..b484dc086bfb52 100644 --- a/RNTester/js/PanResponderExample.js +++ b/RNTester/js/PanResponderExample.js @@ -126,7 +126,7 @@ class PanResponderExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ circle: { width: CIRCLE_SIZE, height: CIRCLE_SIZE, diff --git a/RNTester/js/PermissionsExampleAndroid.android.js b/RNTester/js/PermissionsExampleAndroid.android.js index b58251d9aef13d..285b2827f31fdd 100644 --- a/RNTester/js/PermissionsExampleAndroid.android.js +++ b/RNTester/js/PermissionsExampleAndroid.android.js @@ -114,7 +114,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'white', diff --git a/RNTester/js/PickerExample.js b/RNTester/js/PickerExample.js index f4bfe5f23b61fe..ad234e5ebe8bad 100644 --- a/RNTester/js/PickerExample.js +++ b/RNTester/js/PickerExample.js @@ -123,7 +123,7 @@ class PickerExample extends React.Component<{}, $FlowFixMeState> { }; } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ picker: { width: 100, }, diff --git a/RNTester/js/PickerIOSExample.js b/RNTester/js/PickerIOSExample.js index 0965e29f1b04ed..4023834242e72f 100644 --- a/RNTester/js/PickerIOSExample.js +++ b/RNTester/js/PickerIOSExample.js @@ -10,13 +10,13 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {PickerIOS, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {PickerIOS, Text, View} = ReactNative; -var PickerItemIOS = PickerIOS.Item; +const PickerItemIOS = PickerIOS.Item; -var CAR_MAKES_AND_MODELS = { +const CAR_MAKES_AND_MODELS = { amc: { name: 'AMC', models: ['AMX', 'Concord', 'Eagle', 'Gremlin', 'Matador', 'Pacer'], @@ -105,8 +105,9 @@ class PickerExample extends React.Component<{}, $FlowFixMeState> { }; render() { - var make = CAR_MAKES_AND_MODELS[this.state.carMake]; - var selectionString = make.name + ' ' + make.models[this.state.modelIndex]; + const make = CAR_MAKES_AND_MODELS[this.state.carMake]; + const selectionString = + make.name + ' ' + make.models[this.state.modelIndex]; return ( Please choose a make for your car: diff --git a/RNTester/js/PointerEventsExample.js b/RNTester/js/PointerEventsExample.js index ddc9a9cf0ccf8b..73552838d1527d 100644 --- a/RNTester/js/PointerEventsExample.js +++ b/RNTester/js/PointerEventsExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, View} = ReactNative; class ExampleBox extends React.Component<$FlowFixMeProps, $FlowFixMeState> { state = { @@ -171,7 +171,7 @@ type ExampleClass = { description: string, }; -var exampleClasses: Array = [ +const exampleClasses: Array = [ { Component: NoneExample, title: '`none`', @@ -192,7 +192,7 @@ var exampleClasses: Array = [ }, ]; -var infoToExample = info => { +const infoToExample = info => { return { title: info.title, description: info.description, @@ -202,7 +202,7 @@ var infoToExample = info => { }; }; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ text: { fontSize: 10, color: '#5577cc', diff --git a/RNTester/js/ProgressBarAndroidExample.android.js b/RNTester/js/ProgressBarAndroidExample.android.js index 81c0a4554253ad..c806a4c6c331cb 100644 --- a/RNTester/js/ProgressBarAndroidExample.android.js +++ b/RNTester/js/ProgressBarAndroidExample.android.js @@ -10,13 +10,13 @@ 'use strict'; -var ProgressBar = require('ProgressBarAndroid'); -var React = require('React'); -var createReactClass = require('create-react-class'); -var RNTesterBlock = require('RNTesterBlock'); -var RNTesterPage = require('RNTesterPage'); +const ProgressBar = require('ProgressBarAndroid'); +const React = require('React'); +const createReactClass = require('create-react-class'); +const RNTesterBlock = require('RNTesterBlock'); +const RNTesterPage = require('RNTesterPage'); -var MovingBar = createReactClass({ +const MovingBar = createReactClass({ displayName: 'MovingBar', _intervalID: (null: ?IntervalID), @@ -28,7 +28,7 @@ var MovingBar = createReactClass({ componentDidMount: function() { this._intervalID = setInterval(() => { - var progress = (this.state.progress + 0.02) % 1; + const progress = (this.state.progress + 0.02) % 1; this.setState({progress: progress}); }, 50); }, diff --git a/RNTester/js/ProgressViewIOSExample.js b/RNTester/js/ProgressViewIOSExample.js index 7c6ebfe6c2a5ab..8f0c54dbc72d45 100644 --- a/RNTester/js/ProgressViewIOSExample.js +++ b/RNTester/js/ProgressViewIOSExample.js @@ -37,13 +37,13 @@ class ProgressViewExample extends React.Component { } updateProgress = () => { - var progress = this.state.progress + 0.01; + const progress = this.state.progress + 0.01; this.setState({progress}); this._rafId = requestAnimationFrame(() => this.updateProgress()); }; getProgress = offset => { - var progress = this.state.progress + offset; + const progress = this.state.progress + offset; return Math.sin(progress % Math.PI) % 1; }; @@ -92,7 +92,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { marginTop: -20, backgroundColor: 'transparent', diff --git a/RNTester/js/PushNotificationIOSExample.js b/RNTester/js/PushNotificationIOSExample.js index ba85c879488c6a..a841f126e7de95 100644 --- a/RNTester/js/PushNotificationIOSExample.js +++ b/RNTester/js/PushNotificationIOSExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { AlertIOS, PushNotificationIOS, StyleSheet, @@ -192,7 +192,7 @@ class NotificationPermissionExample extends React.Component< } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ button: { padding: 10, alignItems: 'center', From cdbf719307f41e94a62307ec22463bb562d1c8de Mon Sep 17 00:00:00 2001 From: Juuso Heikkinen Date: Tue, 30 Oct 2018 13:34:58 -0700 Subject: [PATCH 003/290] Bump fbjs-scripts to ^1.0.0 (#21880) Summary: This PR bumps also fbjs-scripts to latest version. Benefit is smaller node_modules and less deps to download as newer version doesn't depend on babel6 anymore. Pull Request resolved: https://github.com/facebook/react-native/pull/21880 Differential Revision: D12832002 Pulled By: hramos fbshipit-source-id: fa801aeb70a2f22be6f9c05cd6d981d0af0a0da9 --- Libraries/Animated/release/package.json | 2 +- package.json | 2 +- yarn.lock | 537 ++++-------------------- 3 files changed, 83 insertions(+), 458 deletions(-) diff --git a/Libraries/Animated/release/package.json b/Libraries/Animated/release/package.json index 4873f784a5ffad..cccaf09d35f896 100644 --- a/Libraries/Animated/release/package.json +++ b/Libraries/Animated/release/package.json @@ -19,7 +19,7 @@ "babel-core": "^5.8.25", "babel-loader": "^5.3.2", "del": "^1.2.0", - "fbjs-scripts": "^0.2.0", + "fbjs-scripts": "^1.0.0", "gulp": "^3.9.0", "gulp-babel": "^5.1.0", "gulp-derequire": "^2.1.0", diff --git a/package.json b/package.json index 1d06791d4cf258..9751c062fec866 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "escape-string-regexp": "^1.0.5", "event-target-shim": "^1.0.5", "fbjs": "^1.0.0", - "fbjs-scripts": "^0.8.1", + "fbjs-scripts": "^1.0.0", "fs-extra": "^1.0.0", "glob": "^7.1.1", "graceful-fs": "^4.1.3", diff --git a/yarn.lock b/yarn.lock index 5f1c4115058cd0..5abd8424680bff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -996,7 +996,7 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@^6.0.0, babel-core@^6.26.0, babel-core@^6.7.2: +babel-core@^6.0.0, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== @@ -1047,82 +1047,6 @@ babel-generator@^6.18.0, babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-helper-builder-react-jsx@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" - integrity sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA= - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - esutils "^2.0.2" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" @@ -1146,13 +1070,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-check-es2015-constants@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= - dependencies: - babel-runtime "^6.22.0" - babel-plugin-istanbul@^4.1.6: version "4.1.6" resolved "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" @@ -1168,265 +1085,17 @@ babel-plugin-jest-hoist@^24.0.0-alpha.2: resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.0.0-alpha.2.tgz#b2e53c9e09a96a34c23072ea4ca8c498e0428670" integrity sha512-lj+zLXu4ixXZhmjQxc4ZTo1Nhhb2Jx3mdUDMFdV8iAlURVAJiiP8bAnbVmOGxn7uMBhsTWtDOfHaAvKRMUQp3g== -babel-plugin-syntax-class-properties@^6.8.0: - version "6.13.0" - resolved "http://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" - integrity sha1-1+sjt5oxf4VDlixQW4J8fWysJ94= - -babel-plugin-syntax-flow@^6.18.0, babel-plugin-syntax-flow@^6.8.0: - version "6.18.0" - resolved "http://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" - integrity sha1-TDqyCiryaqIM0lmVw5jE63AxDI0= - -babel-plugin-syntax-jsx@^6.8.0: - version "6.18.0" - resolved "http://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - -babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: +babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" resolved "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= -babel-plugin-syntax-trailing-function-commas@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= - babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ== -babel-plugin-transform-class-properties@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" - integrity sha1-anl2PqYdM9NvN7YRqp3vgagbRqw= - dependencies: - babel-helper-function-name "^6.24.1" - babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-arrow-functions@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.8.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.8.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-for-of@^6.8.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-commonjs@^6.8.0: - version "6.26.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-object-super@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-template-literals@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es3-member-expression-literals@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es3-member-expression-literals/-/babel-plugin-transform-es3-member-expression-literals-6.22.0.tgz#733d3444f3ecc41bef8ed1a6a4e09657b8969ebb" - integrity sha1-cz00RPPsxBvvjtGmpOCWV7iWnrs= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es3-property-literals@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es3-property-literals/-/babel-plugin-transform-es3-property-literals-6.22.0.tgz#b2078d5842e22abf40f73e8cde9cd3711abd5758" - integrity sha1-sgeNWELiKr9A9z6M3pzTcRq9V1g= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-flow-strip-types@^6.8.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" - integrity sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988= - dependencies: - babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-object-rest-spread@^6.8.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" - -babel-plugin-transform-react-display-name@^6.8.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" - integrity sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-react-jsx@^6.8.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" - integrity sha1-hAoCjn30YN/DotKfDA2R9jduZqM= - dependencies: - babel-helper-builder-react-jsx "^6.24.1" - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-preset-fbjs@^2.1.2: - version "2.3.0" - resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-2.3.0.tgz#92ff81307c18b926895114f9828ae1674c097f80" - integrity sha512-ZOpAI1/bN0Y3J1ZAK9gRsFkHy9gGgJoDRUjtUCla/129LC7uViq9nIK22YdHfey8szohYoZY3f9L2lGOv0Edqw== - dependencies: - babel-plugin-check-es2015-constants "^6.8.0" - babel-plugin-syntax-class-properties "^6.8.0" - babel-plugin-syntax-flow "^6.8.0" - babel-plugin-syntax-jsx "^6.8.0" - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-plugin-syntax-trailing-function-commas "^6.8.0" - babel-plugin-transform-class-properties "^6.8.0" - babel-plugin-transform-es2015-arrow-functions "^6.8.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.8.0" - babel-plugin-transform-es2015-block-scoping "^6.8.0" - babel-plugin-transform-es2015-classes "^6.8.0" - babel-plugin-transform-es2015-computed-properties "^6.8.0" - babel-plugin-transform-es2015-destructuring "^6.8.0" - babel-plugin-transform-es2015-for-of "^6.8.0" - babel-plugin-transform-es2015-function-name "^6.8.0" - babel-plugin-transform-es2015-literals "^6.8.0" - babel-plugin-transform-es2015-modules-commonjs "^6.8.0" - babel-plugin-transform-es2015-object-super "^6.8.0" - babel-plugin-transform-es2015-parameters "^6.8.0" - babel-plugin-transform-es2015-shorthand-properties "^6.8.0" - babel-plugin-transform-es2015-spread "^6.8.0" - babel-plugin-transform-es2015-template-literals "^6.8.0" - babel-plugin-transform-es3-member-expression-literals "^6.8.0" - babel-plugin-transform-es3-property-literals "^6.8.0" - babel-plugin-transform-flow-strip-types "^6.8.0" - babel-plugin-transform-object-rest-spread "^6.8.0" - babel-plugin-transform-react-display-name "^6.8.0" - babel-plugin-transform-react-jsx "^6.8.0" - -babel-preset-fbjs@^3.0.1: +babel-preset-fbjs@^3.0.0, babel-preset-fbjs@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-3.0.1.tgz#0be99c39367d6fb5bbcf1f6c33be0321b5234c1c" integrity sha512-Fc0t7v8T1tBwv5AVyDDZEnS3T7OQ97qV0XawVZg1ouarlM9xCHL994C5tU8TBIKPk3yZXG+SaEM1YQcx/yLlcg== @@ -1500,7 +1169,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: +babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= @@ -1515,7 +1184,7 @@ babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-tra invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= @@ -1648,6 +1317,11 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-crc32@^0.2.13: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -2733,14 +2407,14 @@ fbjs-css-vars@^1.0.0: resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.1.tgz#836d876e887d702f45610f5ebd2fbeef649527fc" integrity sha512-IM+v/C40MNZWqsLErc32e0TyIk/NhkkQZL0QmjBh6zi1eXv0/GeVKmKmueQX7nn9SXQBQbTUcB8zuexIF3/88w== -fbjs-scripts@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-0.8.3.tgz#b854de7a11e62a37f72dab9aaf4d9b53c4a03174" - integrity sha512-aUJ/uEzMIiBYuj/blLp4sVNkQQ7ZEB/lyplG1IzzOmZ83meiWecrGg5jBo4wWrxXmO4RExdtsSV1QkTjPt2Gag== +fbjs-scripts@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fbjs-scripts/-/fbjs-scripts-1.0.1.tgz#7d8d09d76e83308bf3b1fc7b4c9c6fd081c5ef64" + integrity sha512-x8bfX7k0z5B24Ue0YqjZq/2QxxaKZUNbkGdX//zbQDElMJFqBRrvRi8O3qds7UNNzs78jYqIYCS32Sk/wu5UJg== dependencies: + "@babel/core" "^7.0.0" ansi-colors "^1.0.1" - babel-core "^6.7.2" - babel-preset-fbjs "^2.1.2" + babel-preset-fbjs "^3.0.0" core-js "^2.4.1" cross-spawn "^5.1.0" fancy-log "^1.3.2" @@ -3792,13 +3466,6 @@ jest-diff@^24.0.0-alpha.2: jest-get-type "^24.0.0-alpha.2" pretty-format "^24.0.0-alpha.2" -jest-docblock@23.2.0, jest-docblock@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" - integrity sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c= - dependencies: - detect-newline "^2.1.0" - jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" @@ -3847,21 +3514,7 @@ jest-get-type@^24.0.0-alpha.2: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0-alpha.2.tgz#458f787989bc678107b5923dc862d36269b45d0c" integrity sha512-LFVJsgKfBCnxlwJNtFNwn4BRWsCgszlae86a53viD0swWFNiG431BmNz1xaBKe2VWxXd18jewnowkxtxpulg5w== -jest-haste-map@23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.5.0.tgz#d4ca618188bd38caa6cb20349ce6610e194a8065" - integrity sha512-bt9Swigb6KZ6ZQq/fQDUwdUeHenVvZ6G/lKwJjwRGp+Fap8D4B3bND3FaeJg7vXVsLX8hXshRArbVxLop/5wLw== - dependencies: - fb-watchman "^2.0.0" - graceful-fs "^4.1.11" - invariant "^2.2.4" - jest-docblock "^23.2.0" - jest-serializer "^23.0.1" - jest-worker "^23.2.0" - micromatch "^2.3.11" - sane "^2.0.0" - -jest-haste-map@^24.0.0-alpha.2: +jest-haste-map@24.0.0-alpha.2, jest-haste-map@^24.0.0-alpha.2: version "24.0.0-alpha.2" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0-alpha.2.tgz#bc1d498536c395699a44b1e61a3e901c95a2e5a6" integrity sha512-FTSIbJdmaddjgpcaXOq+sPGegcE28w7uOHonpsCuEwBQcB0REhkNYY9Wj/e1w+q3SBmEK1++ChgTMEXEzAf0yQ== @@ -4004,12 +3657,7 @@ jest-runtime@^24.0.0-alpha.2: write-file-atomic "^2.1.0" yargs "^12.0.2" -jest-serializer@23.0.1, jest-serializer@^23.0.1: - version "23.0.1" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" - integrity sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU= - -jest-serializer@^24.0.0-alpha.2: +jest-serializer@24.0.0-alpha.2, jest-serializer@^24.0.0-alpha.2: version "24.0.0-alpha.2" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0-alpha.2.tgz#adcaa73ef49e56377f7fada19921c300b576e7f9" integrity sha512-jLHHT71gyYdgMH5sFWP/e8bZjq/TC5iz9DQZlLsRE/7Er//m8WqyiNJs022FEc18PLq3jyk/z06N0xS6YlbsUA== @@ -4073,14 +3721,7 @@ jest-watcher@^24.0.0-alpha.2: chalk "^2.0.1" string-length "^2.0.0" -jest-worker@23.2.0, jest-worker@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" - integrity sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk= - dependencies: - merge-stream "^1.0.1" - -jest-worker@^24.0.0-alpha.2: +jest-worker@24.0.0-alpha.2, jest-worker@^24.0.0-alpha.2: version "24.0.0-alpha.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0-alpha.2.tgz#d376b328094dd5f1e0c6156b4f41b308a99a35bd" integrity sha512-77YRl8eI4rrtdJ4mzzo4LVABecQmmy7lXsXc00rIJ9oiXJYbz4R4eL6RXcxZcRbwwqYjFL0g9h6H9iQaWqC/Kg== @@ -4464,10 +4105,10 @@ merge@^1.2.0: resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" integrity sha1-dTHjnUlJwoGma4xabgJl6LBYlNo= -metro-babel-register@^0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.48.1.tgz#b889aee7fe78423a35c895dc1fb6a8d1a375ff5c" - integrity sha512-bSjMAD16vpyHRWeMJ6CXvhWbFbiW58YXhA9zgRbFBdxOcJPbkhj6HEX+FlxTlr2O0MNY27/4U96MFXTcRWcZhQ== +metro-babel-register@^0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.49.0.tgz#b9c21e2f28fe52a1094772d9aa1c7f5f90edb1bf" + integrity sha512-n/HSHp5pWHaJ3JKA8WJsSpz8jOdJBRY95eaCxBXi8CjIKdJK1izVEZbSEb4Cic0PitBiud14J1FlJftNPracBQ== dependencies: "@babel/core" "^7.0.0" "@babel/plugin-proposal-class-properties" "^7.0.0" @@ -4482,60 +4123,60 @@ metro-babel-register@^0.48.1: core-js "^2.2.2" escape-string-regexp "^1.0.5" -metro-babel7-plugin-react-transform@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-babel7-plugin-react-transform/-/metro-babel7-plugin-react-transform-0.48.1.tgz#d5c8aeadcf30b75344477017b52edf4683a00e6a" - integrity sha512-b39Sowwzp0bqitbS3NkF5fzcuoT6vpLqj6Su7xgfCyW5EmYpvxunK7HwMSoZagAIpbD0H6r+iw+L2Ib1EEWfWw== +metro-babel7-plugin-react-transform@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-babel7-plugin-react-transform/-/metro-babel7-plugin-react-transform-0.49.0.tgz#1df801a17215c8271e89bb55c15e7305592c33bf" + integrity sha512-2QCWBQybANIsib/ofj/JinA4yksQcERzouZEtW81TnDElETIcQo1YAoJoe7pg7BTLCx8NBHPt2tOp8AucV0z+w== dependencies: "@babel/helper-module-imports" "^7.0.0" -metro-cache@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.48.1.tgz#befbac2f3a0f259f76d064a0f47e93e00441775d" - integrity sha512-Nq1RQ7SkhVKKO/uWKzc6JtvDm0JJD/kDsoIQNR2Db37fNlyGxij0FoYRNOX3BOnyhz0NG8kU1pz0qH43bPQ5rg== +metro-cache@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-cache/-/metro-cache-0.49.0.tgz#30b310c554b6ba72d56feed06805cee38de49bb0" + integrity sha512-g5QcD423bhrpYrODEh+3Vp92wnH/4rH3DsLV/Lja1c23KU2CQ9iL5+yrhkmGlO/wktdZf+FxNdZxn03G1J74rQ== dependencies: - jest-serializer "23.0.1" - metro-core "0.48.1" + jest-serializer "24.0.0-alpha.2" + metro-core "0.49.0" mkdirp "^0.5.1" rimraf "^2.5.4" -metro-config@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.48.1.tgz#b5fac7d3a7e3817d7ff25ff88dcba9578876aae4" - integrity sha512-pqdbDHUtoQPfWiL8h3x/cN5Q8w/sPt5/UaXk4oIzalU+ooEh0Hi9w10wJHKVRtWzD27o828O04En51C9eEDY5g== +metro-config@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-config/-/metro-config-0.49.0.tgz#fd7e8a91459b5ec1f0b9ff4ad13c0df37c7ef921" + integrity sha512-iuXSoQ+0nA6gP/4kwor0/wrun5n3DDFCZ9TUzn9LVDeGwvfNNXkX2gTfh6+TrBPEpwZKmR1zBIIsdFVZo0EzsQ== dependencies: cosmiconfig "^5.0.5" - metro "0.48.1" - metro-cache "0.48.1" - metro-core "0.48.1" + metro "0.49.0" + metro-cache "0.49.0" + metro-core "0.49.0" pretty-format "^23.4.1" -metro-core@0.48.1, metro-core@^0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.48.1.tgz#67980160b8d24859308bad9f4394e7e43b54c237" - integrity sha512-uctosjP4imHThHlD5hAt0Yg7tiRLmY3GlU4VaIs0YH2i82yI56b93RtTCI1ACWhL7LUuttSVpPXCBN3ERTe+KA== +metro-core@0.49.0, metro-core@^0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-core/-/metro-core-0.49.0.tgz#6fa04961f9a764a28614d6f95d1fc88f82a4024f" + integrity sha512-5L1AiGwdpHSrOx+0h6fXM5D38I+Xm67uOv/arOSbW580PEHzxtgQkdUbWaSbvdEaWGV97RGuicpKqyqQqpdiXg== dependencies: - jest-haste-map "23.5.0" + jest-haste-map "24.0.0-alpha.2" lodash.throttle "^4.1.1" - metro-resolver "0.48.1" + metro-resolver "0.49.0" wordwrap "^1.0.0" -metro-memory-fs@^0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-memory-fs/-/metro-memory-fs-0.48.1.tgz#3590f224ded5c33fb7684d4c0611e74dcafab039" - integrity sha512-ASbRBpmfRraFilm5o5gdY9X0DQAmkvCgAHDunCo0J2vlQ730VbuhhR67pVRmRr5oXXmDdEIYUkJSIqzP0Q+UKQ== +metro-memory-fs@^0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-memory-fs/-/metro-memory-fs-0.49.0.tgz#55bce3a2038a74e96bf6d64ce3920f353fc1c4c6" + integrity sha512-TjamHF1WER33duZPuRIPTr9r5SJNEjXvExG18UJRvZgSdqkQkVjGoBKpOTXM5SSUN9Q0Rvow9e1FONUptI2Cdw== -metro-minify-uglify@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-minify-uglify/-/metro-minify-uglify-0.48.1.tgz#f8122bb266f7ad799a6b81eef85f0ae3a5623e18" - integrity sha512-8htDNs3dil5CopLnMrE6SGjMGg44KB+omE3ZyTNSWXbmZl8aG3spl+xpSJyvkIQrSFNSCzMVZ8V+lDJDwKJ/zg== +metro-minify-uglify@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-minify-uglify/-/metro-minify-uglify-0.49.0.tgz#e3e049f852f9e1987a1f993b0070b99369c40ebb" + integrity sha512-ZJPyviXZ4krbyBIzsguieRpy9AeNPmzR3GKsOJGhHHkk7GscgWPp2SqZALD7Y9IpbqUkNmyQJ6ApqUlxq1BzHw== dependencies: uglify-es "^3.1.9" -metro-react-native-babel-preset@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.48.1.tgz#dddbbe205bdfe75f25cd8dafeb7d1b628a90b755" - integrity sha512-euJ0MOyBYTa76kQNbly6An9FNpu9BqxfkXhKtD8hWZxo5dxIAk25AmoWfXU2OHj7PogG/u0Ndo3tmhZZ2NWYvA== +metro-react-native-babel-preset@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.49.0.tgz#c74480d88817f32aec7474e45e7eda1716112ecf" + integrity sha512-pwjfnNlXdmPsRMof0SSO5juroYXGw3oRF6+Irzn0aBzAjW7aaIYyT5f7hSMuVU5iL1J9izQt9V4pI2ObkVjnwg== dependencies: "@babel/plugin-proposal-class-properties" "^7.0.0" "@babel/plugin-proposal-export-default-from" "^7.0.0" @@ -4570,27 +4211,27 @@ metro-react-native-babel-preset@0.48.1: "@babel/plugin-transform-typescript" "^7.0.0" "@babel/plugin-transform-unicode-regex" "^7.0.0" "@babel/template" "^7.0.0" - metro-babel7-plugin-react-transform "0.48.1" + metro-babel7-plugin-react-transform "0.49.0" react-transform-hmr "^1.0.4" -metro-resolver@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.48.1.tgz#31078581624f3af828fb5943e916f3f0b97e8cde" - integrity sha512-d28ki5RTRUPFNQVJEgiMx3Zr81NlxOm1mKgaBx93Alyy2ZZ1Gvs25olZHwHgKPsRTgCqg5kgImkIHtjP2j8BdQ== +metro-resolver@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.49.0.tgz#abfb82dbaae645599ecd4ed119e9b2b343a0c54d" + integrity sha512-mwlA4nn3/smjpPIthzvA5xHT9IXLCoLXjKL+AqeoYtIvCdGHf5x17xM/I0b9BatdXCmirYnC3PD9G2hcmkje0Q== dependencies: absolute-path "^0.0.0" -metro-source-map@0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.48.1.tgz#800ea0666d5cc0b640dfd9e66f76f8a3c5f6202c" - integrity sha512-6+YSKB3zRLGA39I0G/wfPizf1HPlrnmeX70E1vvH0G1HVD/ko5dqjJgH4vlr71Za9xYZLSuaXoQmmgkcf6at4w== +metro-source-map@0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.49.0.tgz#7e0c74a095d15a5d443f015549659465e2cfcaad" + integrity sha512-pd0UPPEXO7JeOlpPbGJhYvUxvoZC9uR1OpDjMEPohoacdgqw17NgyaxNkJY3aAYfhGQNuiLCxYOFgEjK3BacdA== dependencies: source-map "^0.5.6" -metro@0.48.1, metro@^0.48.1: - version "0.48.1" - resolved "https://registry.yarnpkg.com/metro/-/metro-0.48.1.tgz#10cc5cbca1bdf8e4239bf43d3aa74babcf573705" - integrity sha512-7V+YOqfmgGhomdWAoD58zRQvPxUgBIo6b1YgcZULvh7yPPMo3tTkTvrzS2Qd2N3LFTysRQWzOlkb7O7jAV5FDw== +metro@0.49.0, metro@^0.49.0: + version "0.49.0" + resolved "https://registry.yarnpkg.com/metro/-/metro-0.49.0.tgz#5630b95537a25544624052c22027841c5a3d13e1" + integrity sha512-/GDvO9JYmTrQmzuCfBfDKEC+Gg3/xxn3/3pnIypB+QwTXuiYpO5mpub9XVcPRiN2gr+mMgQWGiwyL+z/TJbaPA== dependencies: "@babel/core" "^7.0.0" "@babel/generator" "^7.0.0" @@ -4602,6 +4243,7 @@ metro@0.48.1, metro@^0.48.1: absolute-path "^0.0.0" async "^2.4.0" babel-preset-fbjs "^3.0.1" + buffer-crc32 "^0.2.13" chalk "^1.1.1" concat-stream "^1.6.0" connect "^3.6.5" @@ -4612,19 +4254,18 @@ metro@0.48.1, metro@^0.48.1: fs-extra "^1.0.0" graceful-fs "^4.1.3" image-size "^0.6.0" - jest-docblock "23.2.0" - jest-haste-map "23.5.0" - jest-worker "23.2.0" + jest-haste-map "24.0.0-alpha.2" + jest-worker "24.0.0-alpha.2" json-stable-stringify "^1.0.1" lodash.throttle "^4.1.1" merge-stream "^1.0.1" - metro-cache "0.48.1" - metro-config "0.48.1" - metro-core "0.48.1" - metro-minify-uglify "0.48.1" - metro-react-native-babel-preset "0.48.1" - metro-resolver "0.48.1" - metro-source-map "0.48.1" + metro-cache "0.49.0" + metro-config "0.49.0" + metro-core "0.49.0" + metro-minify-uglify "0.49.0" + metro-react-native-babel-preset "0.49.0" + metro-resolver "0.49.0" + metro-source-map "0.49.0" mime-types "2.1.11" mkdirp "^0.5.1" node-fetch "^2.2.0" @@ -5943,22 +5584,6 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^2.0.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" - integrity sha1-tNwYYcIbQn6SlQej51HiosuKs/o= - dependencies: - anymatch "^2.0.0" - capture-exit "^1.2.0" - exec-sh "^0.2.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.18.0" - optionalDependencies: - fsevents "^1.2.3" - sane@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/sane/-/sane-3.1.0.tgz#995193b7dc1445ef1fe41ddfca2faf9f111854c6" From a21b8b736054ebfd80bd9d0497b04f296174fe65 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 14:03:18 -0700 Subject: [PATCH 004/290] Remove var in RNTester (#22019) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22019 Differential Revision: D12843071 Pulled By: TheSavior fbshipit-source-id: 3652ea91b3ab92c367332cbe2ff7de0343508dad --- RNTester/js/ARTExample.js | 8 ++++---- .../js/AccessibilityAndroidExample.android.js | 14 +++++++------- RNTester/js/AccessibilityIOSExample.js | 6 +++--- RNTester/js/ActionSheetIOSExample.js | 18 +++++++++--------- RNTester/js/AlertExample.js | 12 ++++++------ RNTester/js/AlertIOSExample.js | 10 +++++----- RNTester/js/AnimatedExample.js | 12 ++++++------ RNTester/js/AppStateExample.js | 2 +- RNTester/js/AssetScaledImageExample.js | 10 +++++----- RNTester/js/AsyncStorageExample.js | 16 ++++++++-------- 10 files changed, 54 insertions(+), 54 deletions(-) diff --git a/RNTester/js/ARTExample.js b/RNTester/js/ARTExample.js index 06d483a5b1ea68..e78b19e5dd5c6d 100644 --- a/RNTester/js/ARTExample.js +++ b/RNTester/js/ARTExample.js @@ -10,13 +10,13 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {ART, Platform, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {ART, Platform, View} = ReactNative; const {Surface, Path, Group, Transform, Shape} = ART; -var scale = Platform.isTV ? 4 : 1; +const scale = Platform.isTV ? 4 : 1; class ARTExample extends React.Component<{}> { render() { diff --git a/RNTester/js/AccessibilityAndroidExample.android.js b/RNTester/js/AccessibilityAndroidExample.android.js index 9e42a1e57ca411..0989f9f62d0780 100644 --- a/RNTester/js/AccessibilityAndroidExample.android.js +++ b/RNTester/js/AccessibilityAndroidExample.android.js @@ -9,9 +9,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { AccessibilityInfo, StyleSheet, Text, @@ -20,10 +20,10 @@ var { TouchableWithoutFeedback, } = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); -var importantForAccessibilityValues = [ +const importantForAccessibilityValues = [ 'auto', 'yes', 'no', @@ -293,7 +293,7 @@ class AccessibilityAndroidExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ embedded: { backgroundColor: 'yellow', padding: 10, diff --git a/RNTester/js/AccessibilityIOSExample.js b/RNTester/js/AccessibilityIOSExample.js index 76a05adb026558..fcae4284450022 100644 --- a/RNTester/js/AccessibilityIOSExample.js +++ b/RNTester/js/AccessibilityIOSExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {AccessibilityInfo, Text, View, TouchableOpacity} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {AccessibilityInfo, Text, View, TouchableOpacity} = ReactNative; class AccessibilityIOSExample extends React.Component<{}> { render() { diff --git a/RNTester/js/ActionSheetIOSExample.js b/RNTester/js/ActionSheetIOSExample.js index e0850aced1f647..36e3d9e81da10a 100644 --- a/RNTester/js/ActionSheetIOSExample.js +++ b/RNTester/js/ActionSheetIOSExample.js @@ -10,13 +10,13 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {ActionSheetIOS, StyleSheet, takeSnapshot, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {ActionSheetIOS, StyleSheet, takeSnapshot, Text, View} = ReactNative; -var BUTTONS = ['Option 0', 'Option 1', 'Option 2', 'Delete', 'Cancel']; -var DESTRUCTIVE_INDEX = 3; -var CANCEL_INDEX = 4; +const BUTTONS = ['Option 0', 'Option 1', 'Option 2', 'Delete', 'Cancel']; +const DESTRUCTIVE_INDEX = 3; +const CANCEL_INDEX = 4; class ActionSheetExample extends React.Component<{}, $FlowFixMeState> { state = { @@ -108,7 +108,7 @@ class ShareActionSheetExample extends React.Component< }, error => alert(error), (completed, method) => { - var text; + let text; if (completed) { text = `Shared via ${method}`; } else { @@ -148,7 +148,7 @@ class ShareScreenshotExample extends React.Component<{}, $FlowFixMeState> { }, error => alert(error), (completed, method) => { - var text; + let text; if (completed) { text = `Shared via ${method}`; } else { @@ -162,7 +162,7 @@ class ShareScreenshotExample extends React.Component<{}, $FlowFixMeState> { }; } -var style = StyleSheet.create({ +const style = StyleSheet.create({ button: { marginBottom: 10, fontWeight: '500', diff --git a/RNTester/js/AlertExample.js b/RNTester/js/AlertExample.js index 3f399d6716d50c..fd888a73afb955 100644 --- a/RNTester/js/AlertExample.js +++ b/RNTester/js/AlertExample.js @@ -9,14 +9,14 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Alert, StyleSheet, Text, TouchableHighlight, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Alert, StyleSheet, Text, TouchableHighlight, View} = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); +const RNTesterBlock = require('./RNTesterBlock'); // corporate ipsum > lorem ipsum -var alertMessage = +const alertMessage = 'Credibly reintermediate next-generation potentialities after goal-oriented ' + 'catalysts for change. Dynamically revolutionize.'; @@ -134,7 +134,7 @@ class AlertExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/AlertIOSExample.js b/RNTester/js/AlertIOSExample.js index 03777a8b713fa6..87f9e2f6f13e5f 100644 --- a/RNTester/js/AlertIOSExample.js +++ b/RNTester/js/AlertIOSExample.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, View, Text, TouchableHighlight, AlertIOS} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, View, Text, TouchableHighlight, AlertIOS} = ReactNative; -var {SimpleAlertExampleBlock} = require('./AlertExample'); +const {SimpleAlertExampleBlock} = require('./AlertExample'); exports.framework = 'React'; exports.title = 'AlertIOS'; @@ -180,7 +180,7 @@ class PromptOptions extends React.Component<$FlowFixMeProps, any> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/AnimatedExample.js b/RNTester/js/AnimatedExample.js index 0510efe7a0e260..5012ff7dffea69 100644 --- a/RNTester/js/AnimatedExample.js +++ b/RNTester/js/AnimatedExample.js @@ -10,10 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, Easing, StyleSheet, Text, View} = ReactNative; -var RNTesterButton = require('./RNTesterButton'); +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, Easing, StyleSheet, Text, View} = ReactNative; +const RNTesterButton = require('./RNTesterButton'); exports.framework = 'React'; exports.title = 'Animated - Examples'; @@ -158,7 +158,7 @@ exports.examples = [ { - var timing = Animated.timing; + const timing = Animated.timing; Animated.sequence([ // One after the other timing(this.anims[0], { @@ -285,7 +285,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ content: { backgroundColor: 'deepskyblue', borderWidth: 1, diff --git a/RNTester/js/AppStateExample.js b/RNTester/js/AppStateExample.js index 8309aac323febd..4ea4949d5af275 100644 --- a/RNTester/js/AppStateExample.js +++ b/RNTester/js/AppStateExample.js @@ -39,7 +39,7 @@ class AppStateSubscription extends React.Component< }; _handleAppStateChange = appState => { - var previousAppStates = this.state.previousAppStates.slice(); + const previousAppStates = this.state.previousAppStates.slice(); previousAppStates.push(this.state.appState); this.setState({ appState, diff --git a/RNTester/js/AssetScaledImageExample.js b/RNTester/js/AssetScaledImageExample.js index ae74d599c72db8..8a70b61c62f978 100644 --- a/RNTester/js/AssetScaledImageExample.js +++ b/RNTester/js/AssetScaledImageExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, StyleSheet, View, ScrollView} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, StyleSheet, View, ScrollView} = ReactNative; import type {PhotoIdentifier} from 'CameraRoll'; @@ -30,7 +30,7 @@ class AssetScaledImageExample extends React.Component { }; render() { - var image = this.state.asset.node.image; + const image = this.state.asset.node.image; return ( @@ -50,7 +50,7 @@ class AssetScaledImageExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ row: { padding: 5, flex: 1, diff --git a/RNTester/js/AsyncStorageExample.js b/RNTester/js/AsyncStorageExample.js index 27ba9d87fc4819..9e43cdc617968e 100644 --- a/RNTester/js/AsyncStorageExample.js +++ b/RNTester/js/AsyncStorageExample.js @@ -10,13 +10,13 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {AsyncStorage, PickerIOS, Text, View} = ReactNative; -var PickerItemIOS = PickerIOS.Item; +const React = require('react'); +const ReactNative = require('react-native'); +const {AsyncStorage, PickerIOS, Text, View} = ReactNative; +const PickerItemIOS = PickerIOS.Item; -var STORAGE_KEY = '@AsyncStorageExample:key'; -var COLORS = ['red', 'orange', 'yellow', 'green', 'blue']; +const STORAGE_KEY = '@AsyncStorageExample:key'; +const COLORS = ['red', 'orange', 'yellow', 'green', 'blue']; class BasicStorageExample extends React.Component<{}, $FlowFixMeState> { state = { @@ -30,7 +30,7 @@ class BasicStorageExample extends React.Component<{}, $FlowFixMeState> { _loadInitialState = async () => { try { - var value = await AsyncStorage.getItem(STORAGE_KEY); + const value = await AsyncStorage.getItem(STORAGE_KEY); if (value !== null) { this.setState({selectedValue: value}); this._appendMessage('Recovered selection from disk: ' + value); @@ -43,7 +43,7 @@ class BasicStorageExample extends React.Component<{}, $FlowFixMeState> { }; render() { - var color = this.state.selectedValue; + const color = this.state.selectedValue; return ( From 2648f47a4edd38433f48f56267f8ab0794404e67 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 14:22:46 -0700 Subject: [PATCH 005/290] Remove var in RNTester (#22015) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22015 Differential Revision: D12843132 Pulled By: TheSavior fbshipit-source-id: ef835b25bc078fc870127946d013e01e34672b1b --- RNTester/js/TextInputExample.android.js | 46 ++++++++++++-------- RNTester/js/TextInputExample.ios.js | 34 +++++++-------- RNTester/js/TimePickerAndroidExample.js | 14 +++--- RNTester/js/TimerExample.js | 21 ++++----- RNTester/js/ToastAndroidExample.android.js | 12 ++--- RNTester/js/ToolbarAndroidExample.android.js | 20 ++++----- RNTester/js/TouchableExample.js | 26 ++++++----- RNTester/js/TransformExample.js | 8 ++-- RNTester/js/TransparentHitTestExample.js | 6 +-- 9 files changed, 99 insertions(+), 88 deletions(-) diff --git a/RNTester/js/TextInputExample.android.js b/RNTester/js/TextInputExample.android.js index 882c343e8459e6..d8c26ecaa53e6b 100644 --- a/RNTester/js/TextInputExample.android.js +++ b/RNTester/js/TextInputExample.android.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Text, TextInput, View, StyleSheet, Slider, Switch} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Text, TextInput, View, StyleSheet, Slider, Switch} = ReactNative; class TextEventsExample extends React.Component<{}, $FlowFixMeState> { state = { @@ -80,9 +80,9 @@ class RewriteExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> { this.state = {text: ''}; } render() { - var limit = 20; - var remainder = limit - this.state.text.length; - var remainderColor = remainder > 5 ? 'blue' : 'red'; + const limit = 20; + const remainder = limit - this.state.text.length; + const remainderColor = remainder > 5 ? 'blue' : 'red'; return ( /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found * when making Flow check .android.js files. */ @@ -273,7 +273,7 @@ class SelectionExample extends React.Component< } getRandomPosition() { - var length = this.state.value.length; + const length = this.state.value.length; return Math.round(Math.random() * length); } @@ -283,7 +283,10 @@ class SelectionExample extends React.Component< } selectRandom() { - var positions = [this.getRandomPosition(), this.getRandomPosition()].sort(); + const positions = [ + this.getRandomPosition(), + this.getRandomPosition(), + ].sort(); this.select(...positions); } @@ -296,7 +299,7 @@ class SelectionExample extends React.Component< } render() { - var length = this.state.value.length; + const length = this.state.value.length; return ( @@ -358,7 +361,7 @@ class AutogrowingTextInputExample extends React.Component<{}> { render() { /* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found * when making Flow check .android.js files. */ - var {style, multiline, ...props} = this.props; + const {style, multiline, ...props} = this.props; return ( Width: @@ -410,7 +413,7 @@ class AutogrowingTextInputExample extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ multiline: { height: 60, fontSize: 16, @@ -458,8 +461,8 @@ exports.examples = [ { title: 'Auto-capitalize', render: function() { - var autoCapitalizeTypes = ['none', 'sentences', 'words', 'characters']; - var examples = autoCapitalizeTypes.map(type => { + const autoCapitalizeTypes = ['none', 'sentences', 'words', 'characters']; + const examples = autoCapitalizeTypes.map(type => { return ( { + const keyboardTypes = [ + 'default', + 'email-address', + 'numeric', + 'phone-pad', + ]; + const examples = keyboardTypes.map(type => { return ( { + const returnKeyLabels = ['Compile', 'React Native']; + const examples = returnKeyTypes.map(type => { return ( ); }); - var types = returnKeyLabels.map(type => { + const types = returnKeyLabels.map(type => { return ( { render() { @@ -126,9 +126,9 @@ class RewriteExample extends React.Component<$FlowFixMeProps, any> { this.state = {text: ''}; } render() { - var limit = 20; - var remainder = limit - this.state.text.length; - var remainderColor = remainder > 5 ? 'blue' : 'red'; + const limit = 20; + const remainder = limit - this.state.text.length; + const remainderColor = remainder > 5 ? 'blue' : 'red'; return ( a - b, ); this.select(...positions); @@ -381,7 +381,7 @@ class SelectionExample extends React.Component< } render() { - var length = this.state.value.length; + const length = this.state.value.length; return ( @@ -436,7 +436,7 @@ class AutogrowingTextInputExample extends React.Component< } render() { - var {style, multiline, ...props} = this.props; + const {style, multiline, ...props} = this.props; return ( Width: @@ -471,7 +471,7 @@ class AutogrowingTextInputExample extends React.Component< } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ page: { paddingBottom: 300, }, @@ -643,7 +643,7 @@ exports.examples = [ { title: 'Keyboard types', render: function() { - var keyboardTypes = [ + const keyboardTypes = [ 'default', 'ascii-capable', 'numbers-and-punctuation', @@ -657,7 +657,7 @@ exports.examples = [ 'web-search', 'numeric', ]; - var examples = keyboardTypes.map(type => { + const examples = keyboardTypes.map(type => { return ( @@ -670,8 +670,8 @@ exports.examples = [ { title: 'Keyboard appearance', render: function() { - var keyboardAppearance = ['default', 'light', 'dark']; - var examples = keyboardAppearance.map(type => { + const keyboardAppearance = ['default', 'light', 'dark']; + const examples = keyboardAppearance.map(type => { return ( @@ -684,7 +684,7 @@ exports.examples = [ { title: 'Return key types', render: function() { - var returnKeyTypes = [ + const returnKeyTypes = [ 'default', 'go', 'google', @@ -697,7 +697,7 @@ exports.examples = [ 'done', 'emergency-call', ]; - var examples = returnKeyTypes.map(type => { + const examples = returnKeyTypes.map(type => { return ( diff --git a/RNTester/js/TimePickerAndroidExample.js b/RNTester/js/TimePickerAndroidExample.js index 76232ecf86a89b..e2b56d9dcc6cc7 100644 --- a/RNTester/js/TimePickerAndroidExample.js +++ b/RNTester/js/TimePickerAndroidExample.js @@ -9,17 +9,17 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { TimePickerAndroid, StyleSheet, Text, TouchableWithoutFeedback, } = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); class TimePickerAndroidExample extends React.Component { static title = 'TimePickerAndroid'; @@ -39,7 +39,7 @@ class TimePickerAndroidExample extends React.Component { showPicker = async (stateKey, options) => { try { const {action, minute, hour} = await TimePickerAndroid.open(options); - var newState = {}; + const newState = {}; if (action === TimePickerAndroid.timeSetAction) { newState[stateKey + 'Text'] = _formatTime(hour, minute); newState[stateKey + 'Hour'] = hour; @@ -111,7 +111,7 @@ function _formatTime(hour, minute) { return hour + ':' + (minute < 10 ? '0' + minute : minute); } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ text: { color: 'black', }, diff --git a/RNTester/js/TimerExample.js b/RNTester/js/TimerExample.js index 023b2decfe9247..f1be0ece82b460 100644 --- a/RNTester/js/TimerExample.js +++ b/RNTester/js/TimerExample.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {AlertIOS, Platform, ToastAndroid, Text, View} = ReactNative; -var RNTesterButton = require('./RNTesterButton'); -var performanceNow = require('fbjs/lib/performanceNow'); +const React = require('react'); +const ReactNative = require('react-native'); +const {AlertIOS, Platform, ToastAndroid, Text, View} = ReactNative; +const RNTesterButton = require('./RNTesterButton'); +const performanceNow = require('fbjs/lib/performanceNow'); function burnCPU(milliseconds) { const start = performanceNow(); @@ -153,7 +153,8 @@ class TimerTester extends React.Component { _timerFn: ?() => any = null; render() { - var args = 'fn' + (this.props.dt !== undefined ? ', ' + this.props.dt : ''); + const args = + 'fn' + (this.props.dt !== undefined ? ', ' + this.props.dt : ''); return ( Measure: {this.props.type}({args}) - {this._ii || 0} @@ -185,7 +186,7 @@ class TimerTester extends React.Component { _run = () => { if (!this._start) { - var d = new Date(); + const d = new Date(); this._start = d.getTime(); this._iters = 100; this._ii = 0; @@ -214,9 +215,9 @@ class TimerTester extends React.Component { } } if (this._ii >= this._iters && this._intervalId == null) { - var d = new Date(); - var e = d.getTime() - this._start; - var msg = + const d = new Date(); + const e = d.getTime() - this._start; + const msg = 'Finished ' + this._ii + ' ' + diff --git a/RNTester/js/ToastAndroidExample.android.js b/RNTester/js/ToastAndroidExample.android.js index fb440f73683dce..7894ba0c3d31f6 100644 --- a/RNTester/js/ToastAndroidExample.android.js +++ b/RNTester/js/ToastAndroidExample.android.js @@ -10,12 +10,12 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, ToastAndroid, TouchableWithoutFeedback} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, ToastAndroid, TouchableWithoutFeedback} = ReactNative; -var RNTesterBlock = require('RNTesterBlock'); -var RNTesterPage = require('RNTesterPage'); +const RNTesterBlock = require('RNTesterBlock'); +const RNTesterPage = require('RNTesterPage'); class ToastExample extends React.Component<{}, $FlowFixMeState> { static title = 'Toast Example'; @@ -117,7 +117,7 @@ class ToastExample extends React.Component<{}, $FlowFixMeState> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ text: { color: 'black', }, diff --git a/RNTester/js/ToolbarAndroidExample.android.js b/RNTester/js/ToolbarAndroidExample.android.js index 8c39831e6c5b3d..4e1c5338ecf1b2 100644 --- a/RNTester/js/ToolbarAndroidExample.android.js +++ b/RNTester/js/ToolbarAndroidExample.android.js @@ -10,16 +10,16 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); +const React = require('react'); +const ReactNative = require('react-native'); -var nativeImageSource = require('nativeImageSource'); -var {StyleSheet, Text, View} = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const nativeImageSource = require('nativeImageSource'); +const {StyleSheet, Text, View} = ReactNative; +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); -var Switch = require('Switch'); -var ToolbarAndroid = require('ToolbarAndroid'); +const Switch = require('Switch'); +const ToolbarAndroid = require('ToolbarAndroid'); class ToolbarAndroidExample extends React.Component<{}, $FlowFixMeState> { static title = ''; @@ -141,7 +141,7 @@ class ToolbarAndroidExample extends React.Component<{}, $FlowFixMeState> { }; } -var toolbarActions = [ +const toolbarActions = [ { title: 'Create', icon: nativeImageSource({ @@ -163,7 +163,7 @@ var toolbarActions = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ toolbar: { backgroundColor: '#e9eaed', height: 56, diff --git a/RNTester/js/TouchableExample.js b/RNTester/js/TouchableExample.js index fa52cac64e75fb..fe6aad74dcc046 100644 --- a/RNTester/js/TouchableExample.js +++ b/RNTester/js/TouchableExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { Animated, Image, StyleSheet, @@ -169,7 +169,7 @@ class TouchableWithoutFeedbackBox extends React.Component<{}, $FlowFixMeState> { }; render() { - var textLog = ''; + let textLog = ''; if (this.state.timesPressed > 1) { textLog = this.state.timesPressed + 'x TouchableWithoutFeedback onPress'; } else if (this.state.timesPressed > 0) { @@ -203,7 +203,7 @@ class TextOnPressBox extends React.Component<{}, $FlowFixMeState> { }; render() { - var textLog = ''; + let textLog = ''; if (this.state.timesPressed > 1) { textLog = this.state.timesPressed + 'x text onPress'; } else if (this.state.timesPressed > 0) { @@ -254,8 +254,8 @@ class TouchableFeedbackEvents extends React.Component<{}, $FlowFixMeState> { } _appendEvent = eventName => { - var limit = 6; - var eventLog = this.state.eventLog.slice(0, limit - 1); + const limit = 6; + const eventLog = this.state.eventLog.slice(0, limit - 1); eventLog.unshift(eventName); this.setState({eventLog}); }; @@ -293,8 +293,8 @@ class TouchableDelayEvents extends React.Component<{}, $FlowFixMeState> { } _appendEvent = eventName => { - var limit = 6; - var eventLog = this.state.eventLog.slice(0, limit - 1); + const limit = 6; + const eventLog = this.state.eventLog.slice(0, limit - 1); eventLog.unshift(eventName); this.setState({eventLog}); }; @@ -346,7 +346,7 @@ class TouchableHitSlop extends React.Component<{}, $FlowFixMeState> { }; render() { - var log = ''; + let log = ''; if (this.state.timesPressed > 1) { log = this.state.timesPressed + 'x onPress'; } else if (this.state.timesPressed > 0) { @@ -458,9 +458,11 @@ class TouchableDisabled extends React.Component<{}> { } } -var heartImage = {uri: 'https://pbs.twimg.com/media/BlXBfT3CQAA6cVZ.png:small'}; +const heartImage = { + uri: 'https://pbs.twimg.com/media/BlXBfT3CQAA6cVZ.png:small', +}; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ row: { justifyContent: 'center', flexDirection: 'row', diff --git a/RNTester/js/TransformExample.js b/RNTester/js/TransformExample.js index 7359462c809fd4..90737e8e33255e 100644 --- a/RNTester/js/TransformExample.js +++ b/RNTester/js/TransformExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, StyleSheet, Text, View} = ReactNative; class Flip extends React.Component<{}, $FlowFixMeState> { state = { @@ -76,7 +76,7 @@ class Flip extends React.Component<{}, $FlowFixMeState> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { height: 500, }, diff --git a/RNTester/js/TransparentHitTestExample.js b/RNTester/js/TransparentHitTestExample.js index 50c49b9ab422ae..34fa7387cc25f2 100644 --- a/RNTester/js/TransparentHitTestExample.js +++ b/RNTester/js/TransparentHitTestExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Text, View, TouchableOpacity} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Text, View, TouchableOpacity} = ReactNative; class TransparentHitTestExample extends React.Component<{}> { render() { From 6b29b908dda4a7f998887516622559dfce0bccd4 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 14:26:13 -0700 Subject: [PATCH 006/290] Remove var in RNTester (#22018) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22018 Differential Revision: D12843078 Pulled By: TheSavior fbshipit-source-id: a3928436b2c73ead931e7c957fab8ad74975ef73 --- RNTester/js/BorderExample.js | 8 +++--- RNTester/js/BoxShadowExample.js | 8 +++--- RNTester/js/CameraRollView.js | 2 +- RNTester/js/ClipboardExample.js | 8 +++--- RNTester/js/DatePickerAndroidExample.js | 16 ++++++------ RNTester/js/DatePickerIOSExample.js | 10 ++++---- RNTester/js/GeolocationExample.js | 12 ++++----- RNTester/js/ImageCapInsetsExample.js | 10 ++++---- RNTester/js/ImageEditingExample.js | 34 ++++++++++++------------- RNTester/js/ImageExample.js | 10 ++++---- 10 files changed, 59 insertions(+), 59 deletions(-) diff --git a/RNTester/js/BorderExample.js b/RNTester/js/BorderExample.js index c6650eea09c2a2..f70ffcb0b6bfaa 100644 --- a/RNTester/js/BorderExample.js +++ b/RNTester/js/BorderExample.js @@ -9,11 +9,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, View} = ReactNative; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ box: { width: 100, height: 100, diff --git a/RNTester/js/BoxShadowExample.js b/RNTester/js/BoxShadowExample.js index 0370b52d3627d1..5c94582e1b18fe 100644 --- a/RNTester/js/BoxShadowExample.js +++ b/RNTester/js/BoxShadowExample.js @@ -9,11 +9,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, StyleSheet, View} = ReactNative; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ box: { width: 100, height: 100, diff --git a/RNTester/js/CameraRollView.js b/RNTester/js/CameraRollView.js index 7220008f79faff..42480ee292c342 100644 --- a/RNTester/js/CameraRollView.js +++ b/RNTester/js/CameraRollView.js @@ -39,7 +39,7 @@ function rowHasChanged(r1: Array, r2: Array): boolean { return true; } - for (var i = 0; i < r1.length; i++) { + for (let i = 0; i < r1.length; i++) { if (r1[i] !== r2[i]) { return true; } diff --git a/RNTester/js/ClipboardExample.js b/RNTester/js/ClipboardExample.js index 1d0317ded4fa8d..4f6c5d0ea0ce97 100644 --- a/RNTester/js/ClipboardExample.js +++ b/RNTester/js/ClipboardExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Clipboard, View, Text} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Clipboard, View, Text} = ReactNative; class ClipboardExample extends React.Component<{}, $FlowFixMeState> { state = { @@ -22,7 +22,7 @@ class ClipboardExample extends React.Component<{}, $FlowFixMeState> { _setClipboardContent = async () => { Clipboard.setString('Hello World'); try { - var content = await Clipboard.getString(); + const content = await Clipboard.getString(); this.setState({content}); } catch (e) { this.setState({content: e.message}); diff --git a/RNTester/js/DatePickerAndroidExample.js b/RNTester/js/DatePickerAndroidExample.js index 2ef17fc89098c4..8e50de025950f6 100644 --- a/RNTester/js/DatePickerAndroidExample.js +++ b/RNTester/js/DatePickerAndroidExample.js @@ -9,17 +9,17 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { DatePickerAndroid, StyleSheet, Text, TouchableWithoutFeedback, } = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); class DatePickerAndroidExample extends React.Component { static title = 'DatePickerAndroid'; @@ -44,12 +44,12 @@ class DatePickerAndroidExample extends React.Component { showPicker = async (stateKey, options) => { try { - var newState = {}; + const newState = {}; const {action, year, month, day} = await DatePickerAndroid.open(options); if (action === DatePickerAndroid.dismissedAction) { newState[stateKey + 'Text'] = 'dismissed'; } else { - var date = new Date(year, month, day); + const date = new Date(year, month, day); newState[stateKey + 'Text'] = date.toLocaleDateString(); newState[stateKey + 'Date'] = date; } @@ -138,7 +138,7 @@ class DatePickerAndroidExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ text: { color: 'black', }, diff --git a/RNTester/js/DatePickerIOSExample.js b/RNTester/js/DatePickerIOSExample.js index 94afc7abb9403b..647359009269c9 100644 --- a/RNTester/js/DatePickerIOSExample.js +++ b/RNTester/js/DatePickerIOSExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {DatePickerIOS, StyleSheet, Text, TextInput, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {DatePickerIOS, StyleSheet, Text, TextInput, View} = ReactNative; class DatePickerExample extends React.Component< $FlowFixMeProps, @@ -33,7 +33,7 @@ class DatePickerExample extends React.Component< }; onTimezoneChange = event => { - var offset = parseInt(event.nativeEvent.text, 10); + const offset = parseInt(event.nativeEvent.text, 10); if (isNaN(offset)) { return; } @@ -122,7 +122,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ textinput: { height: 26, width: 50, diff --git a/RNTester/js/GeolocationExample.js b/RNTester/js/GeolocationExample.js index bcb300ecba042f..f659b7c4afc5ba 100644 --- a/RNTester/js/GeolocationExample.js +++ b/RNTester/js/GeolocationExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, View} = ReactNative; exports.framework = 'React'; exports.title = 'Geolocation'; @@ -38,14 +38,14 @@ class GeolocationExample extends React.Component<{}, $FlowFixMeState> { componentDidMount() { navigator.geolocation.getCurrentPosition( position => { - var initialPosition = JSON.stringify(position); + const initialPosition = JSON.stringify(position); this.setState({initialPosition}); }, error => alert(JSON.stringify(error)), {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}, ); this.watchID = navigator.geolocation.watchPosition(position => { - var lastPosition = JSON.stringify(position); + const lastPosition = JSON.stringify(position); this.setState({lastPosition}); }); } @@ -70,7 +70,7 @@ class GeolocationExample extends React.Component<{}, $FlowFixMeState> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ title: { fontWeight: '500', }, diff --git a/RNTester/js/ImageCapInsetsExample.js b/RNTester/js/ImageCapInsetsExample.js index e55b308dd0aff2..ae122fe0271c20 100644 --- a/RNTester/js/ImageCapInsetsExample.js +++ b/RNTester/js/ImageCapInsetsExample.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); +const React = require('react'); +const ReactNative = require('react-native'); -var nativeImageSource = require('nativeImageSource'); -var {Image, StyleSheet, Text, View} = ReactNative; +const nativeImageSource = require('nativeImageSource'); +const {Image, StyleSheet, Text, View} = ReactNative; class ImageCapInsetsExample extends React.Component<{}> { render() { @@ -51,7 +51,7 @@ class ImageCapInsetsExample extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ background: { backgroundColor: '#F6F6F6', justifyContent: 'center', diff --git a/RNTester/js/ImageEditingExample.js b/RNTester/js/ImageEditingExample.js index c34c5d3ff5a57b..31663ceffd47ae 100644 --- a/RNTester/js/ImageEditingExample.js +++ b/RNTester/js/ImageEditingExample.js @@ -9,9 +9,9 @@ */ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { CameraRoll, Image, ImageEditor, @@ -23,7 +23,7 @@ var { View, } = ReactNative; -var PAGE_SIZE = 20; +const PAGE_SIZE = 20; type ImageOffset = {| x: number, @@ -68,9 +68,9 @@ class SquareImageCropper extends React.Component< if (!this._isMounted) { return; } - var edges = data.edges; - var edge = edges[Math.floor(Math.random() * edges.length)]; - var randomPhoto = edge && edge.node && edge.node.image; + const edges = data.edges; + const edge = edges[Math.floor(Math.random() * edges.length)]; + const randomPhoto = edge && edge.node && edge.node.image; if (randomPhoto) { this.setState({randomPhoto}); } @@ -89,7 +89,7 @@ class SquareImageCropper extends React.Component< { - var measuredWidth = event.nativeEvent.layout.width; + const measuredWidth = event.nativeEvent.layout.width; if (!measuredWidth) { return; } @@ -111,7 +111,7 @@ class SquareImageCropper extends React.Component< if (!this.state.randomPhoto) { return ; } - var error = null; + let error = null; if (this.state.cropError) { error = {this.state.cropError.message}; } @@ -184,8 +184,8 @@ class ImageCropper extends React.Component<$FlowFixMeProps, $FlowFixMeState> { componentWillMount() { // Scale an image to the minimum size that is large enough to completely // fill the crop box. - var widthRatio = this.props.image.width / this.props.size.width; - var heightRatio = this.props.image.height / this.props.size.height; + const widthRatio = this.props.image.width / this.props.size.width; + const heightRatio = this.props.image.height / this.props.size.height; this._horizontal = widthRatio > heightRatio; if (this._horizontal) { this._scaledImageSize = { @@ -234,12 +234,12 @@ class ImageCropper extends React.Component<$FlowFixMeProps, $FlowFixMeState> { } _updateTransformData(offset, scaledImageSize, croppedImageSize) { - var offsetRatioX = offset.x / scaledImageSize.width; - var offsetRatioY = offset.y / scaledImageSize.height; - var sizeRatioX = croppedImageSize.width / scaledImageSize.width; - var sizeRatioY = croppedImageSize.height / scaledImageSize.height; + const offsetRatioX = offset.x / scaledImageSize.width; + const offsetRatioY = offset.y / scaledImageSize.height; + const sizeRatioX = croppedImageSize.width / scaledImageSize.width; + const sizeRatioY = croppedImageSize.height / scaledImageSize.height; - var cropData: ImageCropData = { + const cropData: ImageCropData = { offset: { x: this.props.image.width * offsetRatioX, y: this.props.image.height * offsetRatioY, @@ -287,7 +287,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, alignSelf: 'stretch', diff --git a/RNTester/js/ImageExample.js b/RNTester/js/ImageExample.js index f6c62b540e8bee..abec3802716c1e 100644 --- a/RNTester/js/ImageExample.js +++ b/RNTester/js/ImageExample.js @@ -93,7 +93,7 @@ class NetworkImageCallbackExample extends React.Component< `✔ Prefetch OK (+${new Date() - mountTime}ms)`, ); Image.queryCache([IMAGE_PREFETCH_URL]).then(map => { - var result = map.get(IMAGE_PREFETCH_URL); + const result = map.get(IMAGE_PREFETCH_URL); if (result) { this._loadEventFired( `✔ queryCache "${result}" (+${new Date() - @@ -172,7 +172,7 @@ class NetworkImageExample extends React.Component< }; render() { - var loader = this.state.loading ? ( + const loader = this.state.loading ? ( {this.state.progress}% @@ -891,14 +891,14 @@ exports.examples = [ }, ]; -var fullImage = { +const fullImage = { uri: 'https://facebook.github.io/react-native/img/opengraph.png', }; -var smallImage = { +const smallImage = { uri: 'https://facebook.github.io/react-native/img/favicon.png', }; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ base: { width: 38, height: 38, From 791fa2d83a615e58b1803c32b342f04c7312c734 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 14:29:54 -0700 Subject: [PATCH 007/290] Remove var in RNTester (#22016) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22016 Differential Revision: D12843122 Pulled By: TheSavior fbshipit-source-id: 7e207366c457f0bda707773e9de02fe5afdbb144 --- RNTester/js/RNTesterExampleContainer.js | 3 ++- RNTester/js/RNTesterTitle.js | 8 ++++---- RNTester/js/SafeAreaViewExample.js | 2 +- RNTester/js/ScrollViewSimpleExample.js | 18 +++++++++--------- RNTester/js/SegmentedControlIOSExample.js | 8 ++++---- RNTester/js/ShareExample.js | 8 ++++---- RNTester/js/SliderExample.js | 8 ++++---- RNTester/js/StatusBarExample.js | 2 +- RNTester/js/SwipeableFlatListExample.js | 2 +- RNTester/js/SwitchExample.js | 8 ++++---- RNTester/js/TVEventHandlerExample.js | 13 +++---------- RNTester/js/TabBarIOSBarStyleExample.js | 10 +++++----- RNTester/js/TabBarIOSExample.js | 10 +++++----- RNTester/js/TextExample.android.js | 14 +++++++------- RNTester/js/TextExample.ios.js | 6 +++--- 15 files changed, 57 insertions(+), 63 deletions(-) diff --git a/RNTester/js/RNTesterExampleContainer.js b/RNTester/js/RNTesterExampleContainer.js index 012923869b241b..e1c66e3333f1dd 100644 --- a/RNTester/js/RNTesterExampleContainer.js +++ b/RNTester/js/RNTesterExampleContainer.js @@ -17,7 +17,8 @@ const RNTesterPage = require('./RNTesterPage'); class RNTesterExampleContainer extends React.Component { renderExample(example, i) { // Filter platform-specific examples - var {title, description, platform} = example; + const {description, platform} = example; + let {title} = example; if (platform) { if (Platform.OS !== platform) { return null; diff --git a/RNTester/js/RNTesterTitle.js b/RNTester/js/RNTesterTitle.js index b9f5a77c838dff..0c9b8b69615f95 100644 --- a/RNTester/js/RNTesterTitle.js +++ b/RNTester/js/RNTesterTitle.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, View} = ReactNative; class RNTesterTitle extends React.Component<$FlowFixMeProps> { render() { @@ -24,7 +24,7 @@ class RNTesterTitle extends React.Component<$FlowFixMeProps> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { borderRadius: 4, borderWidth: 0.5, diff --git a/RNTester/js/SafeAreaViewExample.js b/RNTester/js/SafeAreaViewExample.js index ed66587d733189..37a3910a71620d 100644 --- a/RNTester/js/SafeAreaViewExample.js +++ b/RNTester/js/SafeAreaViewExample.js @@ -118,7 +118,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ modal: { flex: 1, }, diff --git a/RNTester/js/ScrollViewSimpleExample.js b/RNTester/js/ScrollViewSimpleExample.js index 2f157c215d9e01..e7393ec073bbde 100644 --- a/RNTester/js/ScrollViewSimpleExample.js +++ b/RNTester/js/ScrollViewSimpleExample.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {ScrollView, StyleSheet, Text, TouchableOpacity} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {ScrollView, StyleSheet, Text, TouchableOpacity} = ReactNative; -var NUM_ITEMS = 20; +const NUM_ITEMS = 20; class ScrollViewSimpleExample extends React.Component<{}> { static title = ''; @@ -22,8 +22,8 @@ class ScrollViewSimpleExample extends React.Component<{}> { 'Component that enables scrolling through child components.'; makeItems = (nItems: number, styles): Array => { - var items = []; - for (var i = 0; i < nItems; i++) { + const items = []; + for (let i = 0; i < nItems; i++) { items[i] = ( {'Item ' + i} @@ -35,7 +35,7 @@ class ScrollViewSimpleExample extends React.Component<{}> { render() { // One of the items is a horizontal scroll view - var items = this.makeItems(NUM_ITEMS, styles.itemWrapper); + const items = this.makeItems(NUM_ITEMS, styles.itemWrapper); items[4] = ( {this.makeItems(NUM_ITEMS, [ @@ -58,7 +58,7 @@ class ScrollViewSimpleExample extends React.Component<{}> { , ); - var verticalScrollView = ( + const verticalScrollView = ( {items} ); @@ -66,7 +66,7 @@ class ScrollViewSimpleExample extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ verticalScrollView: { margin: 10, }, diff --git a/RNTester/js/SegmentedControlIOSExample.js b/RNTester/js/SegmentedControlIOSExample.js index 9021a95b7f4026..2b17f70cf5f415 100644 --- a/RNTester/js/SegmentedControlIOSExample.js +++ b/RNTester/js/SegmentedControlIOSExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {SegmentedControlIOS, Text, View, StyleSheet} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {SegmentedControlIOS, Text, View, StyleSheet} = ReactNative; class BasicSegmentedControlExample extends React.Component<{}> { render() { @@ -132,7 +132,7 @@ class EventSegmentedControlExample extends React.Component< }; } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ text: { fontSize: 14, textAlign: 'center', diff --git a/RNTester/js/ShareExample.js b/RNTester/js/ShareExample.js index 9f1a824368cb2d..30d18280f50c69 100644 --- a/RNTester/js/ShareExample.js +++ b/RNTester/js/ShareExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, View, Text, TouchableHighlight, Share} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, View, Text, TouchableHighlight, Share} = ReactNative; exports.framework = 'React'; exports.title = 'Share'; @@ -103,7 +103,7 @@ class ShareMessageExample extends React.Component<$FlowFixMeProps, any> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/SliderExample.js b/RNTester/js/SliderExample.js index f4129b2f3ba50b..22f0da2f02f36a 100644 --- a/RNTester/js/SliderExample.js +++ b/RNTester/js/SliderExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Slider, Text, StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Slider, Text, StyleSheet, View} = ReactNative; class SliderExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> { static defaultProps = { @@ -68,7 +68,7 @@ class SlidingCompleteExample extends React.Component< } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ slider: { height: 10, margin: 10, diff --git a/RNTester/js/StatusBarExample.js b/RNTester/js/StatusBarExample.js index 77f51a4242cc02..58b87ab53f372e 100644 --- a/RNTester/js/StatusBarExample.js +++ b/RNTester/js/StatusBarExample.js @@ -498,7 +498,7 @@ const examples = [ exports.examples = examples; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', diff --git a/RNTester/js/SwipeableFlatListExample.js b/RNTester/js/SwipeableFlatListExample.js index 7f27b4dc2c9804..7cf2a0810dcc50 100644 --- a/RNTester/js/SwipeableFlatListExample.js +++ b/RNTester/js/SwipeableFlatListExample.js @@ -103,7 +103,7 @@ class SwipeableFlatListExample extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ row: { flexDirection: 'row', justifyContent: 'center', diff --git a/RNTester/js/SwitchExample.js b/RNTester/js/SwitchExample.js index 22e224bb16c3ad..eeca71fa6486bb 100644 --- a/RNTester/js/SwitchExample.js +++ b/RNTester/js/SwitchExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Platform, Switch, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Switch, Text, View} = ReactNative; class BasicSwitchExample extends React.Component<{}, $FlowFixMeState> { state = { @@ -125,7 +125,7 @@ class EventSwitchExample extends React.Component<{}, $FlowFixMeState> { } } -var examples = [ +const examples = [ { title: 'Switches can be set to true or false', render(): React.Element { diff --git a/RNTester/js/TVEventHandlerExample.js b/RNTester/js/TVEventHandlerExample.js index 1b71a1001d48cd..ed90ddeb2a9173 100644 --- a/RNTester/js/TVEventHandlerExample.js +++ b/RNTester/js/TVEventHandlerExample.js @@ -10,17 +10,10 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); +const React = require('react'); +const ReactNative = require('react-native'); -var { - Platform, - StyleSheet, - View, - Text, - TouchableOpacity, - TVEventHandler, -} = ReactNative; +const {Platform, View, Text, TouchableOpacity, TVEventHandler} = ReactNative; exports.framework = 'React'; exports.title = 'TVEventHandler example'; diff --git a/RNTester/js/TabBarIOSBarStyleExample.js b/RNTester/js/TabBarIOSBarStyleExample.js index 0cf0df73b1c1a4..a8dfd135c4eced 100644 --- a/RNTester/js/TabBarIOSBarStyleExample.js +++ b/RNTester/js/TabBarIOSBarStyleExample.js @@ -22,11 +22,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, TabBarIOS, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, TabBarIOS, Text, View} = ReactNative; -var base64Icon = +const base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg=='; class TabBarIOSBarStyleExample extends React.Component<{}> { @@ -47,7 +47,7 @@ class TabBarIOSBarStyleExample extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ tabContent: { flex: 1, alignItems: 'center', diff --git a/RNTester/js/TabBarIOSExample.js b/RNTester/js/TabBarIOSExample.js index 9dafdf3b3479f8..6fc9015ce2eda6 100644 --- a/RNTester/js/TabBarIOSExample.js +++ b/RNTester/js/TabBarIOSExample.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, TabBarIOS, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, TabBarIOS, Text, View} = ReactNative; -var base64Icon = +const base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg=='; class TabBarExample extends React.Component<{}, $FlowFixMeState> { @@ -89,7 +89,7 @@ class TabBarExample extends React.Component<{}, $FlowFixMeState> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ tabContent: { flex: 1, alignItems: 'center', diff --git a/RNTester/js/TextExample.android.js b/RNTester/js/TextExample.android.js index 283d5f25fc0f47..a8b23ad87b2cba 100644 --- a/RNTester/js/TextExample.android.js +++ b/RNTester/js/TextExample.android.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Image, StyleSheet, Text, View} = ReactNative; -var RNTesterBlock = require('./RNTesterBlock'); -var RNTesterPage = require('./RNTesterPage'); +const React = require('react'); +const ReactNative = require('react-native'); +const {Image, StyleSheet, Text, View} = ReactNative; +const RNTesterBlock = require('./RNTesterBlock'); +const RNTesterPage = require('./RNTesterPage'); const TextLegend = require('./Shared/TextLegend'); class Entity extends React.Component<$FlowFixMeProps> { @@ -43,7 +43,7 @@ class AttributeToggler extends React.Component<{}, $FlowFixMeState> { }; render() { - var curStyle = { + const curStyle = { fontWeight: this.state.fontWeight, fontSize: this.state.fontSize, }; @@ -590,7 +590,7 @@ class TextExample extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ backgroundColorText: { left: 5, backgroundColor: 'rgba(100, 100, 100, 0.3)', diff --git a/RNTester/js/TextExample.ios.js b/RNTester/js/TextExample.ios.js index 760d450fac3e05..439c9c714c6f7d 100644 --- a/RNTester/js/TextExample.ios.js +++ b/RNTester/js/TextExample.ios.js @@ -91,7 +91,7 @@ class AttributeToggler extends React.Component<{}, $FlowFixMeState> { }; render() { - var curStyle = { + const curStyle = { fontWeight: this.state.fontWeight, fontSize: this.state.fontSize, }; @@ -239,8 +239,8 @@ class AdjustingFontSize extends React.Component< class TextBaseLineLayoutExample extends React.Component<*, *> { render() { - var texts = []; - for (var i = 9; i >= 0; i--) { + const texts = []; + for (let i = 9; i >= 0; i--) { texts.push( {i} From 5af577439b9c58ab3891bc651fb5ca71a68df841 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 14:30:44 -0700 Subject: [PATCH 008/290] Remove var in RNTester (#22014) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22014 Differential Revision: D12843150 Pulled By: TheSavior fbshipit-source-id: 593adf141164cffe0ddc2db756721df26e38b4f5 --- RNTester/js/VibrationExample.js | 10 +++--- .../js/ViewPagerAndroidExample.android.js | 31 ++++++++++--------- RNTester/js/WebViewExample.js | 24 +++++++------- RNTester/js/XHRExample.js | 16 +++++----- RNTester/js/XHRExampleBinaryUpload.js | 6 ++-- RNTester/js/XHRExampleCookies.js | 14 ++++----- RNTester/js/XHRExampleFetch.js | 24 +++++++------- RNTester/js/XHRExampleFormData.js | 26 ++++++++-------- RNTester/js/XHRExampleHeaders.js | 12 +++---- RNTester/js/XHRExampleOnTimeOut.js | 12 +++---- 10 files changed, 88 insertions(+), 87 deletions(-) diff --git a/RNTester/js/VibrationExample.js b/RNTester/js/VibrationExample.js index 550809483a8dd3..32f2b2f5f1c7c6 100644 --- a/RNTester/js/VibrationExample.js +++ b/RNTester/js/VibrationExample.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { StyleSheet, View, Text, @@ -25,7 +25,7 @@ exports.framework = 'React'; exports.title = 'Vibration'; exports.description = 'Vibration API'; -var pattern, patternLiteral, patternDescription; +let pattern, patternLiteral, patternDescription; if (Platform.OS === 'android') { pattern = [0, 500, 200, 500]; patternLiteral = '[0, 500, 200, 500]'; @@ -115,7 +115,7 @@ exports.examples = [ }, ]; -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/ViewPagerAndroidExample.android.js b/RNTester/js/ViewPagerAndroidExample.android.js index 0a666fdf080a9e..e904661607264c 100644 --- a/RNTester/js/ViewPagerAndroidExample.android.js +++ b/RNTester/js/ViewPagerAndroidExample.android.js @@ -9,9 +9,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +const React = require('react'); +const ReactNative = require('react-native'); +const { Image, StyleSheet, Text, @@ -23,9 +23,9 @@ var { import type {ViewPagerScrollState} from 'ViewPagerAndroid'; -var PAGES = 5; -var BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273']; -var IMAGE_URIS = [ +const PAGES = 5; +const BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273']; +const IMAGE_URIS = [ 'https://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg', 'https://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg', 'https://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg', @@ -43,7 +43,7 @@ class LikeCount extends React.Component { }; render() { - var thumbsUp = '\uD83D\uDC4D'; + const thumbsUp = '\uD83D\uDC4D'; return ( @@ -79,9 +79,10 @@ class Button extends React.Component { class ProgressBar extends React.Component { render() { - var fractionalPosition = + const fractionalPosition = this.props.progress.position + this.props.progress.offset; - var progressBarSize = (fractionalPosition / (PAGES - 1)) * this.props.size; + const progressBarSize = + (fractionalPosition / (PAGES - 1)) * this.props.size; return ( @@ -118,7 +119,7 @@ class ViewPagerAndroidExample extends React.Component { }; move = delta => { - var page = this.state.page + delta; + const page = this.state.page + delta; this.go(page); }; @@ -133,9 +134,9 @@ class ViewPagerAndroidExample extends React.Component { }; render() { - var pages = []; - for (var i = 0; i < PAGES; i++) { - var pageStyle = { + const pages = []; + for (let i = 0; i < PAGES; i++) { + const pageStyle = { backgroundColor: BGCOLOR[i % BGCOLOR.length], alignItems: 'center', padding: 20, @@ -150,7 +151,7 @@ class ViewPagerAndroidExample extends React.Component { , ); } - var {page, animationsAreEnabled} = this.state; + const {page, animationsAreEnabled} = this.state; return ( { @@ -44,7 +44,7 @@ class WebViewExample extends React.Component<{}, $FlowFixMeState> { inputText = ''; handleTextInputChange = event => { - var url = event.nativeEvent.text; + let url = event.nativeEvent.text; if (!/^[a-zA-Z-_]+:/.test(url)) { url = 'http://' + url; } @@ -143,7 +143,7 @@ class WebViewExample extends React.Component<{}, $FlowFixMeState> { }; pressGoButton = () => { - var url = this.inputText.toLowerCase(); + const url = this.inputText.toLowerCase(); if (url === this.state.url) { this.reload(); } else { @@ -297,7 +297,7 @@ class InjectJS extends React.Component<{}> { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: HEADER, diff --git a/RNTester/js/XHRExample.js b/RNTester/js/XHRExample.js index 72078dea6020f7..789a08a80ac3e4 100644 --- a/RNTester/js/XHRExample.js +++ b/RNTester/js/XHRExample.js @@ -10,15 +10,15 @@ 'use strict'; -var React = require('react'); +const React = require('react'); -var XHRExampleDownload = require('./XHRExampleDownload'); -var XHRExampleBinaryUpload = require('./XHRExampleBinaryUpload'); -var XHRExampleFormData = require('./XHRExampleFormData'); -var XHRExampleHeaders = require('./XHRExampleHeaders'); -var XHRExampleFetch = require('./XHRExampleFetch'); -var XHRExampleOnTimeOut = require('./XHRExampleOnTimeOut'); -var XHRExampleCookies = require('./XHRExampleCookies'); +const XHRExampleDownload = require('./XHRExampleDownload'); +const XHRExampleBinaryUpload = require('./XHRExampleBinaryUpload'); +const XHRExampleFormData = require('./XHRExampleFormData'); +const XHRExampleHeaders = require('./XHRExampleHeaders'); +const XHRExampleFetch = require('./XHRExampleFetch'); +const XHRExampleOnTimeOut = require('./XHRExampleOnTimeOut'); +const XHRExampleCookies = require('./XHRExampleCookies'); exports.framework = 'React'; exports.title = 'XMLHttpRequest'; diff --git a/RNTester/js/XHRExampleBinaryUpload.js b/RNTester/js/XHRExampleBinaryUpload.js index 00a9b46a01e174..dd896b5750e2ed 100644 --- a/RNTester/js/XHRExampleBinaryUpload.js +++ b/RNTester/js/XHRExampleBinaryUpload.js @@ -62,12 +62,12 @@ class XHRExampleBinaryUpload extends React.Component<{}, $FlowFixMeState> { Alert.alert('Upload failed', 'No response payload.'); return; } - var index = xhr.responseText.indexOf('http://www.posttestserver.com/'); + const index = xhr.responseText.indexOf('http://www.posttestserver.com/'); if (index === -1) { Alert.alert('Upload failed', 'Invalid response payload.'); return; } - var url = xhr.responseText.slice(index).split('\n')[0]; + const url = xhr.responseText.slice(index).split('\n')[0]; console.log('Upload successful: ' + url); Linking.openURL(url); } @@ -77,7 +77,7 @@ class XHRExampleBinaryUpload extends React.Component<{}, $FlowFixMeState> { }; _upload = () => { - var xhr = new XMLHttpRequest(); + const xhr = new XMLHttpRequest(); xhr.open('POST', 'http://posttestserver.com/post.php'); xhr.onload = () => XHRExampleBinaryUpload.handlePostTestServerUpload(xhr); xhr.setRequestHeader('Content-Type', 'text/plain'); diff --git a/RNTester/js/XHRExampleCookies.js b/RNTester/js/XHRExampleCookies.js index 89a43c8372dd14..0d835f3901c747 100644 --- a/RNTester/js/XHRExampleCookies.js +++ b/RNTester/js/XHRExampleCookies.js @@ -10,11 +10,11 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, TouchableHighlight, View, WebView} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, TouchableHighlight, View, WebView} = ReactNative; -var RCTNetworking = require('RCTNetworking'); +const RCTNetworking = require('RCTNetworking'); class XHRExampleCookies extends React.Component { cancelled: boolean; @@ -30,8 +30,8 @@ class XHRExampleCookies extends React.Component { } setCookie(domain: string) { - var {a, b} = this.state; - var url = `https://${domain}/cookies/set?a=${a}&b=${b}`; + const {a, b} = this.state; + const url = `https://${domain}/cookies/set?a=${a}&b=${b}`; fetch(url).then(response => { this.setStatus(`Cookies a=${a}, b=${b} set`); this.refreshWebview(); @@ -130,7 +130,7 @@ class XHRExampleCookies extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/XHRExampleFetch.js b/RNTester/js/XHRExampleFetch.js index c7d5aef7787fe5..cae80aa41d1ab4 100644 --- a/RNTester/js/XHRExampleFetch.js +++ b/RNTester/js/XHRExampleFetch.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, TextInput, View, Platform} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, TextInput, View, Platform} = ReactNative; class XHRExampleFetch extends React.Component { responseURL: ?string; @@ -44,11 +44,11 @@ class XHRExampleFetch extends React.Component { return null; } - var responseHeaders = []; - var keys = Object.keys(this.responseHeaders.map); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = this.responseHeaders.get(key); + const responseHeaders = []; + const keys = Object.keys(this.responseHeaders.map); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = this.responseHeaders.get(key); responseHeaders.push( {key}: {value} @@ -59,21 +59,21 @@ class XHRExampleFetch extends React.Component { } render() { - var responseURL = this.responseURL ? ( + const responseURL = this.responseURL ? ( Server response URL: {this.responseURL} ) : null; - var responseHeaders = this.responseHeaders ? ( + const responseHeaders = this.responseHeaders ? ( Server response headers: {this._renderHeaders()} ) : null; - var response = this.state.responseText ? ( + const response = this.state.responseText ? ( Server response: { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ textInput: { flex: 1, borderRadius: 3, diff --git a/RNTester/js/XHRExampleFormData.js b/RNTester/js/XHRExampleFormData.js index 408030f2e6563c..525e55d23e04e3 100644 --- a/RNTester/js/XHRExampleFormData.js +++ b/RNTester/js/XHRExampleFormData.js @@ -54,9 +54,9 @@ class XHRExampleFormData extends React.Component { if (!this._isMounted) { return; } - var edges = data.edges; - var edge = edges[Math.floor(Math.random() * edges.length)]; - var randomPhoto = edge && edge.node && edge.node.image; + const edges = data.edges; + const edge = edges[Math.floor(Math.random() * edges.length)]; + const randomPhoto = edge && edge.node && edge.node.image; if (randomPhoto) { let {width, height} = randomPhoto; width *= 0.25; @@ -72,31 +72,31 @@ class XHRExampleFormData extends React.Component { }; _addTextParam = () => { - var textParams = this.state.textParams; + const textParams = this.state.textParams; textParams.push({name: '', value: ''}); this.setState({textParams}); }; _onTextParamNameChange(index, text) { - var textParams = this.state.textParams; + const textParams = this.state.textParams; textParams[index].name = text; this.setState({textParams}); } _onTextParamValueChange(index, text) { - var textParams = this.state.textParams; + const textParams = this.state.textParams; textParams[index].value = text; this.setState({textParams}); } _upload = () => { - var xhr = new XMLHttpRequest(); + const xhr = new XMLHttpRequest(); xhr.open('POST', 'http://posttestserver.com/post.php'); xhr.onload = () => { this.setState({isUploading: false}); XHRExampleBinaryUpload.handlePostTestServerUpload(xhr); }; - var formdata = new FormData(); + const formdata = new FormData(); if (this.state.randomPhoto) { formdata.append('image', { ...this.state.randomPhoto, @@ -118,13 +118,13 @@ class XHRExampleFormData extends React.Component { }; render() { - var image = null; + let image = null; if (this.state.randomPhoto) { image = ( ); } - var textItems = this.state.textParams.map((item, index) => ( + const textItems = this.state.textParams.map((item, index) => ( { /> )); - var uploadButtonLabel = this.state.isUploading ? 'Uploading...' : 'Upload'; - var uploadProgress = this.state.uploadProgress; + let uploadButtonLabel = this.state.isUploading ? 'Uploading...' : 'Upload'; + const uploadProgress = this.state.uploadProgress; if (uploadProgress !== null) { uploadButtonLabel += ' ' + Math.round(uploadProgress * 100) + '%'; } - var uploadButton = ( + let uploadButton = ( {uploadButtonLabel} diff --git a/RNTester/js/XHRExampleHeaders.js b/RNTester/js/XHRExampleHeaders.js index ea3c95f5be3f27..074df010b00d42 100644 --- a/RNTester/js/XHRExampleHeaders.js +++ b/RNTester/js/XHRExampleHeaders.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, TouchableHighlight, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, TouchableHighlight, View} = ReactNative; class XHRExampleHeaders extends React.Component { xhr: XMLHttpRequest; @@ -32,7 +32,7 @@ class XHRExampleHeaders extends React.Component { download() { this.xhr && this.xhr.abort(); - var xhr = this.xhr || new XMLHttpRequest(); + const xhr = this.xhr || new XMLHttpRequest(); xhr.onreadystatechange = () => { if (xhr.readyState === xhr.DONE) { if (this.cancelled) { @@ -75,7 +75,7 @@ class XHRExampleHeaders extends React.Component { } render() { - var button = + const button = this.state.status === 'Downloading...' ? ( @@ -101,7 +101,7 @@ class XHRExampleHeaders extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, diff --git a/RNTester/js/XHRExampleOnTimeOut.js b/RNTester/js/XHRExampleOnTimeOut.js index 5721774bda3eb4..095dd3631356b4 100644 --- a/RNTester/js/XHRExampleOnTimeOut.js +++ b/RNTester/js/XHRExampleOnTimeOut.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {StyleSheet, Text, TouchableHighlight, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {StyleSheet, Text, TouchableHighlight, View} = ReactNative; class XHRExampleOnTimeOut extends React.Component { xhr: XMLHttpRequest; @@ -28,7 +28,7 @@ class XHRExampleOnTimeOut extends React.Component { loadTimeOutRequest() { this.xhr && this.xhr.abort(); - var xhr = this.xhr || new XMLHttpRequest(); + const xhr = this.xhr || new XMLHttpRequest(); xhr.onerror = () => { console.log('Status ', xhr.status); @@ -60,7 +60,7 @@ class XHRExampleOnTimeOut extends React.Component { } render() { - var button = this.state.loading ? ( + const button = this.state.loading ? ( Loading... @@ -85,7 +85,7 @@ class XHRExampleOnTimeOut extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, From 18423fe16b68ae5ba140045b6eec4d6a32aeab99 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 30 Oct 2018 14:35:52 -0700 Subject: [PATCH 009/290] Fabric: Removing accidental unnecessary BUCK dep Summary: Trivial. Reviewed By: mdvacca Differential Revision: D12840490 fbshipit-source-id: b97340e6369ecff7f22b0dc746d1596a86519eea --- ReactCommon/fabric/uimanager/BUCK | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactCommon/fabric/uimanager/BUCK b/ReactCommon/fabric/uimanager/BUCK index 2859b33ca8d045..939589962fb911 100644 --- a/ReactCommon/fabric/uimanager/BUCK +++ b/ReactCommon/fabric/uimanager/BUCK @@ -58,7 +58,6 @@ rn_xplat_cxx_library( "xplat//jsi:JSIDynamic", "xplat//jsi:jsi", "xplat//third-party/glog:glog", - react_native_xplat_target("cxxreact:bridge"), react_native_xplat_target("fabric/components/root:root"), react_native_xplat_target("fabric/components/view:view"), react_native_xplat_target("fabric/core:core"), From cae253427a223c4e8df2aa9798e2f90da98c1e9e Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Tue, 30 Oct 2018 14:39:37 -0700 Subject: [PATCH 010/290] Fix the lazily LaodedView to avoid weird naming issues Summary: Fix the lazily LaodedView to avoid weird naming issues This makes more sense. i would like to not have this suffix Manager at all in play, but it is possible that some of the names should be tweaked for that. Since TurboModule is coming we should probably not invest in that removal. Reviewed By: dshahidehpour Differential Revision: D12831482 fbshipit-source-id: 1cc557cf0bdfaca35032f75823b2facb778dc3ac --- React/Modules/RCTUIManager.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index e1b5dbc7db267b..18a2201dd752e3 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -1565,8 +1565,12 @@ static void RCTMeasureLayout(RCTShadowView *view, return @{}; } - NSString *moduleName = [name stringByAppendingString:@"Manager"]; + NSString *moduleName = name; BOOL result = [delegate bridge:self.bridge didNotFindModule:moduleName]; + if (!result) { + moduleName = [name stringByAppendingString:@"Manager"]; + result = [delegate bridge:self.bridge didNotFindModule:moduleName]; + } if (!result) { return @{}; } From ce860803a4341c4121a0bb504dc669349ac0db35 Mon Sep 17 00:00:00 2001 From: Ely Alvarado Date: Tue, 30 Oct 2018 15:11:35 -0700 Subject: [PATCH 011/290] Prepend passed sourceExts to default ones and pass them to metro (#21855) Summary: Fixes react-native start not using passed --sourceExts #21854 Pull Request resolved: https://github.com/facebook/react-native/pull/21855 Differential Revision: D12840358 Pulled By: rafeca fbshipit-source-id: 4ee09341b5128d83274a39d8d01c13749efaa78b --- local-cli/server/runServer.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index e393a8a61241b0..e9439bf60b0f93 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -70,6 +70,13 @@ async function runServer(args: Args, config: ConfigT) { config.server.enhanceMiddleware = middleware => middlewareManager.getConnectInstance().use(middleware); + if (args.sourceExts !== config.resolver.sourceExts) { + // $FlowFixMe Metro configuration is immutable. + config.resolver.sourceExts = args.sourceExts.concat( + config.resolver.sourceExts, + ); + } + const serverInstance = await Metro.runServer(config, { host: args.host, secure: args.https, From 811a99caab4032c5780d6b6f0b93c862c93d8c17 Mon Sep 17 00:00:00 2001 From: nd-02110114 Date: Tue, 30 Oct 2018 16:29:22 -0700 Subject: [PATCH 012/290] Remove var in RNTester (#22013) Summary: I removed `var` in RNTester. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ENHANCEMENT] [RNTester] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22013 Differential Revision: D12849927 Pulled By: TheSavior fbshipit-source-id: 4a2fd11939bd8ae8604ef59512f532adc0a09eda --- RNTester/js/AnimatedGratuitousApp/AnExApp.js | 60 ++++++++++--------- .../js/AnimatedGratuitousApp/AnExBobble.js | 44 +++++++------- .../js/AnimatedGratuitousApp/AnExChained.js | 22 +++---- .../js/AnimatedGratuitousApp/AnExScroll.js | 14 ++--- RNTester/js/AnimatedGratuitousApp/AnExSet.js | 22 +++---- RNTester/js/AnimatedGratuitousApp/AnExTilt.js | 12 ++-- RNTester/js/createExamplePage.js | 2 +- 7 files changed, 90 insertions(+), 86 deletions(-) diff --git a/RNTester/js/AnimatedGratuitousApp/AnExApp.js b/RNTester/js/AnimatedGratuitousApp/AnExApp.js index ca24eac844008d..f9aa375a7d9677 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExApp.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExApp.js @@ -10,15 +10,15 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, LayoutAnimation, PanResponder, StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, LayoutAnimation, PanResponder, StyleSheet, View} = ReactNative; -var AnExSet = require('AnExSet'); +const AnExSet = require('AnExSet'); -var CIRCLE_SIZE = 80; -var CIRCLE_MARGIN = 18; -var NUM_CIRCLES = 30; +const CIRCLE_SIZE = 80; +const CIRCLE_MARGIN = 18; +const NUM_CIRCLES = 30; class Circle extends React.Component { longTimer: number; @@ -37,7 +37,7 @@ class Circle extends React.Component { } _onLongPress(): void { - var config = {tension: 40, friction: 3}; + const config = {tension: 40, friction: 3}; this.state.pan.addListener(value => { // Async listener for state changes (step1: uncomment) this.props.onMove && this.props.onMove(value); @@ -77,9 +77,11 @@ class Circle extends React.Component { } render(): React.Node { + let handlers; + let dragStyle = null; if (this.state.panResponder) { - var handlers = this.state.panResponder.panHandlers; - var dragStyle = { + handlers = this.state.panResponder.panHandlers; + dragStyle = { // Used to position while dragging position: 'absolute', // Hoist out of layout (step1: uncomment) ...this.state.pan.getLayout(), // Convenience converter (step1: uncomment) @@ -106,7 +108,7 @@ class Circle extends React.Component { }, }; } - var animatedStyle: Object = { + const animatedStyle: Object = { shadowOpacity: this.state.pop, // no need for interpolation (step2d: uncomment) transform: [ { @@ -117,11 +119,12 @@ class Circle extends React.Component { }, ], }; - var openVal = this.props.openVal; + const openVal = this.props.openVal; + let innerOpenStyle = null; if (this.props.dummy) { animatedStyle.opacity = 0; } else if (this.state.isActive) { - var innerOpenStyle = [ + innerOpenStyle = [ styles.open, { // (step4: uncomment) @@ -175,7 +178,7 @@ class Circle extends React.Component { ); } _toggleIsActive(velocity) { - var config = {tension: 30, friction: 7}; + const config = {tension: 30, friction: 7}; if (this.state.isActive) { Animated.spring(this.props.openVal, {toValue: 0, ...config}).start(() => { // (step4: uncomment) @@ -200,8 +203,8 @@ class AnExApp extends React.Component { _onMove: (position: Point) => void; constructor(props: any): void { super(props); - var keys = []; - for (var idx = 0; idx < NUM_CIRCLES; idx++) { + const keys = []; + for (let idx = 0; idx < NUM_CIRCLES; idx++) { keys.push('E' + idx); } this.state = { @@ -213,13 +216,14 @@ class AnExApp extends React.Component { } render(): React.Node { - var circles = this.state.keys.map((key, idx) => { + const circles = this.state.keys.map((key, idx) => { if (key === this.state.activeKey) { return ; } else { + let onLayout = null; if (!this.state.restLayouts[idx]) { - var onLayout = function(index, e) { - var layout = e.nativeEvent.layout; + onLayout = function(index, e) { + const layout = e.nativeEvent.layout; this.setState(state => { state.restLayouts[index] = layout; return state; @@ -274,7 +278,7 @@ class AnExApp extends React.Component { } _onMove(position: Point): void { - var newKeys = moveToClosest(this.state, position); + const newKeys = moveToClosest(this.state, position); if (newKeys !== this.state.keys) { LayoutAnimation.easeInEaseOut(); // animates layout update as one batch (step3: uncomment) this.setState({keys: newKeys}); @@ -284,18 +288,18 @@ class AnExApp extends React.Component { type Point = {x: number, y: number}; function distance(p1: Point, p2: Point): number { - var dx = p1.x - p2.x; - var dy = p1.y - p2.y; + const dx = p1.x - p2.x; + const dy = p1.y - p2.y; return dx * dx + dy * dy; } function moveToClosest({activeKey, keys, restLayouts}, position) { - var activeIdx = -1; - var closestIdx = activeIdx; - var minDist = Infinity; - var newKeys = []; + const activeIdx = -1; + let closestIdx = activeIdx; + let minDist = Infinity; + const newKeys = []; keys.forEach((key, idx) => { - var dist = distance(position, restLayouts[idx]); + const dist = distance(position, restLayouts[idx]); if (key === activeKey) { idx = activeIdx; } else { @@ -314,7 +318,7 @@ function moveToClosest({activeKey, keys, restLayouts}, position) { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, }, diff --git a/RNTester/js/AnimatedGratuitousApp/AnExBobble.js b/RNTester/js/AnimatedGratuitousApp/AnExBobble.js index 68b5a136094c33..4be52c650f41b8 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExBobble.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExBobble.js @@ -10,14 +10,14 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, PanResponder, StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, PanResponder, StyleSheet, View} = ReactNative; -var NUM_BOBBLES = 5; -var RAD_EACH = Math.PI / 2 / (NUM_BOBBLES - 2); -var RADIUS = 160; -var BOBBLE_SPOTS = [...Array(NUM_BOBBLES)].map((_, i) => { +const NUM_BOBBLES = 5; +const RAD_EACH = Math.PI / 2 / (NUM_BOBBLES - 2); +const RADIUS = 160; +const BOBBLE_SPOTS = [...Array(NUM_BOBBLES)].map((_, i) => { // static positions return i === 0 ? {x: 0, y: 0} @@ -36,12 +36,12 @@ class AnExBobble extends React.Component { return new Animated.ValueXY(); }); this.state.selectedBobble = null; - var bobblePanListener = (e, gestureState) => { + const bobblePanListener = (e, gestureState) => { // async events => change selection - var newSelected = computeNewSelected(gestureState); + const newSelected = computeNewSelected(gestureState); if (this.state.selectedBobble !== newSelected) { if (this.state.selectedBobble !== null) { - var restSpot = BOBBLE_SPOTS[this.state.selectedBobble]; + const restSpot = BOBBLE_SPOTS[this.state.selectedBobble]; Animated.spring(this.state.bobbles[this.state.selectedBobble], { toValue: restSpot, // return previously selected bobble to rest position }).start(); @@ -54,7 +54,7 @@ class AnExBobble extends React.Component { this.state.selectedBobble = newSelected; } }; - var releaseBobble = () => { + const releaseBobble = () => { this.state.bobbles.forEach((bobble, i) => { Animated.spring(bobble, { toValue: {x: 0, y: 0}, // all bobbles return to zero @@ -84,8 +84,8 @@ class AnExBobble extends React.Component { return ( {this.state.bobbles.map((_, i) => { - var j = this.state.bobbles.length - i - 1; // reverse so lead on top - var handlers = j > 0 ? {} : this.state.bobbleResponder.panHandlers; + const j = this.state.bobbles.length - i - 1; // reverse so lead on top + const handlers = j > 0 ? {} : this.state.bobbleResponder.panHandlers; return ( { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ circle: { position: 'absolute', height: 60, @@ -125,14 +125,14 @@ var styles = StyleSheet.create({ }); function computeNewSelected(gestureState: Object): ?number { - var {dx, dy} = gestureState; - var minDist = Infinity; - var newSelected = null; - var pointRadius = Math.sqrt(dx * dx + dy * dy); + const {dx, dy} = gestureState; + let minDist = Infinity; + let newSelected = null; + const pointRadius = Math.sqrt(dx * dx + dy * dy); if (Math.abs(RADIUS - pointRadius) < 80) { BOBBLE_SPOTS.forEach((spot, idx) => { - var delta = {x: spot.x - dx, y: spot.y - dy}; - var dist = delta.x * delta.x + delta.y * delta.y; + const delta = {x: spot.x - dx, y: spot.y - dy}; + const dist = delta.x * delta.x + delta.y * delta.y; if (dist < minDist) { minDist = dist; newSelected = idx; @@ -143,11 +143,11 @@ function computeNewSelected(gestureState: Object): ?number { } function randColor(): string { - var colors = [0, 1, 2].map(() => Math.floor(Math.random() * 150 + 100)); + const colors = [0, 1, 2].map(() => Math.floor(Math.random() * 150 + 100)); return 'rgb(' + colors.join(',') + ')'; } -var BOBBLE_IMGS = [ +const BOBBLE_IMGS = [ 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xpf1/t39.1997-6/10173489_272703316237267_1025826781_n.png', 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/l/t39.1997-6/p240x240/851578_631487400212668_2087073502_n.png', 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/p240x240/851583_654446917903722_178118452_n.png', diff --git a/RNTester/js/AnimatedGratuitousApp/AnExChained.js b/RNTester/js/AnimatedGratuitousApp/AnExChained.js index 0a74da47d0bbaa..91e85e0b1714d6 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExChained.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExChained.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, PanResponder, StyleSheet, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, PanResponder, StyleSheet, View} = ReactNative; class AnExChained extends React.Component { constructor(props: Object) { @@ -20,17 +20,17 @@ class AnExChained extends React.Component { this.state = { stickers: [new Animated.ValueXY()], // 1 leader }; - var stickerConfig = {tension: 2, friction: 3}; // soft spring - for (var i = 0; i < 4; i++) { + const stickerConfig = {tension: 2, friction: 3}; // soft spring + for (let i = 0; i < 4; i++) { // 4 followers - var sticker = new Animated.ValueXY(); + const sticker = new Animated.ValueXY(); Animated.spring(sticker, { ...stickerConfig, toValue: this.state.stickers[i], // Animated toValue's are tracked }).start(); this.state.stickers.push(sticker); // push on the followers } - var releaseChain = (e, gestureState) => { + const releaseChain = (e, gestureState) => { this.state.stickers[0].flattenOffset(); // merges offset into value and resets Animated.sequence([ // spring to start after decay finishes @@ -64,8 +64,8 @@ class AnExChained extends React.Component { return ( {this.state.stickers.map((_, i) => { - var j = this.state.stickers.length - i - 1; // reverse so leader is on top - var handlers = j === 0 ? this.state.chainResponder.panHandlers : {}; + const j = this.state.stickers.length - i - 1; // reverse so leader is on top + const handlers = j === 0 ? this.state.chainResponder.panHandlers : {}; return ( { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ chained: { alignSelf: 'flex-end', top: -160, @@ -99,7 +99,7 @@ var styles = StyleSheet.create({ }, }); -var CHAIN_IMGS = [ +const CHAIN_IMGS = [ require('../hawk.png'), require('../bunny.png'), require('../relay.png'), diff --git a/RNTester/js/AnimatedGratuitousApp/AnExScroll.js b/RNTester/js/AnimatedGratuitousApp/AnExScroll.js index b51d889442aaf7..1920bc245e9fd6 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExScroll.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExScroll.js @@ -10,15 +10,15 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, Image, ScrollView, StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, Image, ScrollView, StyleSheet, Text, View} = ReactNative; class AnExScroll extends React.Component<$FlowFixMeProps, any> { state: any = {scrollX: new Animated.Value(0)}; render() { - var width = this.props.panelWidth; + const width = this.props.panelWidth; return ( { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { backgroundColor: 'transparent', flex: 1, @@ -104,11 +104,11 @@ var styles = StyleSheet.create({ }, }); -var HAWK_PIC = { +const HAWK_PIC = { uri: 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xfa1/t39.1997-6/10734304_1562225620659674_837511701_n.png', }; -var BUNNY_PIC = { +const BUNNY_PIC = { uri: 'https://scontent-sea1-1.xx.fbcdn.net/hphotos-xaf1/t39.1997-6/851564_531111380292237_1898871086_n.png', }; diff --git a/RNTester/js/AnimatedGratuitousApp/AnExSet.js b/RNTester/js/AnimatedGratuitousApp/AnExSet.js index f42702cc29a9d6..1d13a2d8601a0b 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExSet.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExSet.js @@ -10,20 +10,20 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, PanResponder, StyleSheet, Text, View} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, PanResponder, StyleSheet, Text, View} = ReactNative; -var AnExBobble = require('./AnExBobble'); -var AnExChained = require('./AnExChained'); -var AnExScroll = require('./AnExScroll'); -var AnExTilt = require('./AnExTilt'); +const AnExBobble = require('./AnExBobble'); +const AnExChained = require('./AnExChained'); +const AnExScroll = require('./AnExScroll'); +const AnExTilt = require('./AnExTilt'); class AnExSet extends React.Component { constructor(props: Object) { super(props); function randColor() { - var colors = [0, 1, 2].map(() => Math.floor(Math.random() * 150 + 100)); + const colors = [0, 1, 2].map(() => Math.floor(Math.random() * 150 + 100)); return 'rgb(' + colors.join(',') + ')'; } this.state = { @@ -32,7 +32,7 @@ class AnExSet extends React.Component { }; } render(): React.Node { - var backgroundColor = this.props.openVal + const backgroundColor = this.props.openVal ? this.props.openVal.interpolate({ inputRange: [0, 1], outputRange: [ @@ -41,7 +41,7 @@ class AnExSet extends React.Component { ], }) : this.state.closeColor; - var panelWidth = + const panelWidth = (this.props.containerLayout && this.props.containerLayout.width) || 320; return ( @@ -98,7 +98,7 @@ class AnExSet extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, }, diff --git a/RNTester/js/AnimatedGratuitousApp/AnExTilt.js b/RNTester/js/AnimatedGratuitousApp/AnExTilt.js index 6b518ee75e84b7..bcc389d8747a74 100644 --- a/RNTester/js/AnimatedGratuitousApp/AnExTilt.js +++ b/RNTester/js/AnimatedGratuitousApp/AnExTilt.js @@ -10,9 +10,9 @@ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var {Animated, PanResponder, StyleSheet} = ReactNative; +const React = require('react'); +const ReactNative = require('react-native'); +const {Animated, PanResponder, StyleSheet} = ReactNative; class AnExTilt extends React.Component { constructor(props: Object) { @@ -37,7 +37,7 @@ class AnExTilt extends React.Component { [null, {dx: this.state.panX}], // panX is linked to the gesture ), onPanResponderRelease: (e, gestureState) => { - var toValue = 0; + let toValue = 0; if (gestureState.dx > 100) { toValue = 500; } else if (gestureState.dx < -100) { @@ -50,7 +50,7 @@ class AnExTilt extends React.Component { friction: 3, }).start(); this.state.panX.removeAllListeners(); - var id = this.state.panX.addListener(({value}) => { + const id = this.state.panX.addListener(({value}) => { // listen until offscreen if (Math.abs(value) > 400) { this.state.panX.removeListener(id); // offscreen, so stop listening @@ -122,7 +122,7 @@ class AnExTilt extends React.Component { } } -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ tilt: { overflow: 'hidden', height: 200, diff --git a/RNTester/js/createExamplePage.js b/RNTester/js/createExamplePage.js index 781ac727e396c9..271057c3fb66a0 100644 --- a/RNTester/js/createExamplePage.js +++ b/RNTester/js/createExamplePage.js @@ -16,7 +16,7 @@ const RNTesterExampleContainer = require('./RNTesterExampleContainer'); import type {ExampleModule} from 'ExampleTypes'; -var createExamplePage = function( +const createExamplePage = function( title: ?string, exampleModule: ExampleModule, ): React.ComponentType { From 580377201793314ca643250c1bd7cf1c47d49920 Mon Sep 17 00:00:00 2001 From: Wen-Chien Chen Date: Tue, 30 Oct 2018 17:02:45 -0700 Subject: [PATCH 013/290] Wrap measureLayoutRelativeToContainingList in try-catch to mitigate crash Summary: This function sometimes causes an "Unable to find node on an unmounted component" crash during pagination for reasons that still need to be investigated; in the meanwhile, wrap this in a try-catch block to mitigate the crash. Reviewed By: sahrens Differential Revision: D12829971 fbshipit-source-id: bc9fe5b9b8c03430ff890bfbb27c39aa270c9eb7 --- Libraries/Lists/VirtualizedList.js | 56 ++++++++++++++++++------------ 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 05c15e8d48d8e7..37c574f0555530 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1112,28 +1112,40 @@ class VirtualizedList extends React.PureComponent { }; measureLayoutRelativeToContainingList(): void { - UIManager.measureLayout( - ReactNative.findNodeHandle(this), - ReactNative.findNodeHandle( - this.context.virtualizedList.getOutermostParentListRef(), - ), - error => { - console.warn( - "VirtualizedList: Encountered an error while measuring a list's" + - ' offset from its containing VirtualizedList.', - ); - }, - (x, y, width, height) => { - this._offsetFromParentVirtualizedList = this._selectOffset({x, y}); - this._scrollMetrics.contentLength = this._selectLength({width, height}); - - const scrollMetrics = this._convertParentScrollMetrics( - this.context.virtualizedList.getScrollMetrics(), - ); - this._scrollMetrics.visibleLength = scrollMetrics.visibleLength; - this._scrollMetrics.offset = scrollMetrics.offset; - }, - ); + // TODO (T35574538): findNodeHandle sometimes crashes with "Unable to find + // node on an unmounted component" during scrolling + try { + UIManager.measureLayout( + ReactNative.findNodeHandle(this), + ReactNative.findNodeHandle( + this.context.virtualizedList.getOutermostParentListRef(), + ), + error => { + console.warn( + "VirtualizedList: Encountered an error while measuring a list's" + + ' offset from its containing VirtualizedList.', + ); + }, + (x, y, width, height) => { + this._offsetFromParentVirtualizedList = this._selectOffset({x, y}); + this._scrollMetrics.contentLength = this._selectLength({ + width, + height, + }); + + const scrollMetrics = this._convertParentScrollMetrics( + this.context.virtualizedList.getScrollMetrics(), + ); + this._scrollMetrics.visibleLength = scrollMetrics.visibleLength; + this._scrollMetrics.offset = scrollMetrics.offset; + }, + ); + } catch (error) { + console.warn( + 'measureLayoutRelativeToContainingList threw an error', + error.stack, + ); + } } _onLayout = (e: Object) => { From a689711f680bb23795dea6391627383ca6973f88 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Wed, 31 Oct 2018 01:35:03 -0700 Subject: [PATCH 014/290] RN: Missing Copyright Headers Summary: Adds copyright headers to all files that are missing them. Reviewed By: hramos Differential Revision: D12837494 fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930 --- ContainerShip/Dockerfile.android | 5 ++++ ContainerShip/Dockerfile.android-base | 5 ++++ ContainerShip/Dockerfile.javascript | 5 ++++ ...un-android-docker-instrumentation-tests.sh | 6 ++++ .../scripts/run-android-docker-unit-tests.sh | 6 ++++ ContainerShip/scripts/run-ci-e2e-tests.sh | 6 ++++ ...run-instrumentation-tests-via-adb-shell.sh | 7 +++++ Libraries/Animated/examples/style.css | 7 +++++ .../Animated/src/__tests__/bezier-test.js | 5 ++++ Libraries/Animated/src/bezier.js | 5 ++++ .../FBSnapshotTestCase/UIImage+Compare.h | 5 ++++ .../FBSnapshotTestCase/UIImage+Compare.m | 5 ++++ .../RCTTest/FBSnapshotTestCase/UIImage+Diff.h | 5 ++++ .../RCTTest/FBSnapshotTestCase/UIImage+Diff.m | 5 ++++ Libraries/Sample/Sample.h | 5 ++++ Libraries/Sample/Sample.m | 5 ++++ Libraries/vendor/core/merge.js | 29 ++---------------- Libraries/vendor/core/mergeInto.js | 30 ++----------------- RNTester/android/app/build.gradle | 7 +++++ RNTester/android/app/proguard-rules.pro | 5 ++++ .../DevSupport/RCTInspectorDevServerHelper.mm | 5 ++++ React/Inspector/RCTInspector.mm | 4 +++ .../RCTInspectorPackagerConnection.m | 5 ++++ ReactAndroid/proguard-rules.pro | 5 ++++ .../src/main/java/com/facebook/jni/fbjni.pro | 5 ++++ .../annotations/proguard_annotations.pro | 5 ++++ .../facebook/react/ReactPackageHelper.java | 7 +++++ .../com/facebook/react/TurboReactPackage.java | 7 +++++ .../react/animated/SpringAnimation.java | 7 +++++ .../com/facebook/react/bridge/JSIModule.java | 7 +++++ .../react/bridge/JSIModuleHolder.java | 7 +++++ .../react/bridge/JSIModulePackage.java | 7 +++++ .../react/bridge/JSIModuleProvider.java | 7 +++++ .../react/bridge/JSIModuleRegistry.java | 7 +++++ .../facebook/react/bridge/JSIModuleSpec.java | 7 +++++ .../react/bridge/NativeArrayInterface.java | 7 +++++ .../com/facebook/react/bridge/UIManager.java | 9 +++++- .../java/com/facebook/react/bridge/bridge.pro | 5 ++++ .../com/facebook/react/bridge/reactnative.pro | 5 ++++ .../com/facebook/react/common/ArrayUtils.java | 7 +++++ .../react/config/ReactFeatureFlags.java | 7 +++++ .../react/devsupport/ViewHierarchyUtil.java | 7 +++++ .../react/devsupport/WindowOverlayCompat.java | 7 +++++ .../com/facebook/react/jscexecutor/Android.mk | 5 ++++ .../react/modules/fabric/ReactFabric.java | 7 +++++ .../modules/network/CookieJarContainer.java | 7 +++++ .../network/ReactCookieJarContainer.java | 11 +++++-- .../react/uimanager/MatrixMathHelper.java | 7 +++++ .../uimanager/ReactYogaConfigProvider.java | 7 +++++ .../react/uimanager/TransformHelper.java | 7 +++++ .../com/facebook/react/uimanager/UIBlock.java | 7 +++++ .../react/uimanager/UIManagerHelper.java | 7 +++++ ReactAndroid/src/main/jni/Application.mk | 5 ++++ .../src/main/jni/first-party/fb/Android.mk | 5 ++++ .../jni/first-party/fbgloginit/Android.mk | 5 ++++ .../main/jni/first-party/yogajni/Android.mk | 5 ++++ .../src/main/jni/react/jni/Android.mk | 5 ++++ .../NativeAnimatedInterpolationTest.java | 7 +++++ .../react/uimanager/MatrixMathHelperTest.java | 7 +++++ .../views/text/CustomLineHeightSpanTest.java | 7 +++++ ReactCommon/cxxreact/Android.mk | 5 ++++ ReactCommon/cxxreact/JSDeltaBundleClient.cpp | 5 ++++ .../components/text/paragraph/conversions.h | 4 +++ ReactCommon/jsi/Android.mk | 5 ++++ ReactCommon/jsiexecutor/Android.mk | 5 ++++ ReactCommon/jsinspector/Android.mk | 5 ++++ ReactCommon/yoga/Android.mk | 5 ++++ ReactCommon/yoga/yoga.podspec | 5 ++++ android-jsc/build.gradle | 9 +++++- local-cli/core/__fixtures__/commands.js | 9 +++++- local-cli/core/__fixtures__/dependencies.js | 9 +++++- local-cli/core/__fixtures__/files/Main.java | 7 +++++ .../core/__fixtures__/files/ReactPackage.java | 7 +++++ .../core/__fixtures__/files/ReactPackage.kt | 7 +++++ local-cli/core/__fixtures__/ios.js | 9 +++++- local-cli/core/__fixtures__/projects.js | 9 +++++- local-cli/core/ios/findPodfilePath.js | 9 +++++- local-cli/core/ios/findPodspecName.js | 9 +++++- local-cli/generator/promptSync.js | 9 +++++- .../android/0.17/MainActivity.java | 7 +++++ .../android/0.17/patchedMainActivity.java | 7 +++++ .../android/0.18/MainActivity.java | 7 +++++ .../android/0.18/patchedMainActivity.java | 7 +++++ .../android/0.20/MainActivity.java | 7 +++++ .../link/__fixtures__/android/build.gradle | 7 +++++ .../__fixtures__/android/patchedBuild.gradle | 7 +++++ .../android/patchedSettings.gradle | 7 +++++ .../link/__fixtures__/android/settings.gradle | 7 +++++ local-cli/link/android/index.js | 9 +++++- .../android/patches/normalizeProjectName.js | 9 +++++- local-cli/link/ios/common/isInstalled.js | 9 +++++- .../link/ios/common/registerNativeModule.js | 9 +++++- .../link/ios/common/unregisterNativeModule.js | 9 +++++- local-cli/link/ios/index.js | 9 +++++- scripts/circleci/validate_yarn_lockfile.sh | 4 +++ scripts/test-manual-e2e.sh | 6 +++- third-party-podspecs/DoubleConversion.podspec | 5 ++++ third-party-podspecs/Folly.podspec | 5 ++++ third-party-podspecs/glog.podspec | 5 ++++ tools/build_defs/fb_native_wrapper.bzl | 5 ++++ tools/build_defs/oss/rn_defs.bzl | 5 ++++ 101 files changed, 628 insertions(+), 71 deletions(-) diff --git a/ContainerShip/Dockerfile.android b/ContainerShip/Dockerfile.android index ab311060b2c328..39b02062d152c4 100644 --- a/ContainerShip/Dockerfile.android +++ b/ContainerShip/Dockerfile.android @@ -1,3 +1,8 @@ +# 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. + # React Native Android Unit Tests # # This image builds upon the React Native Base Android Development Environment diff --git a/ContainerShip/Dockerfile.android-base b/ContainerShip/Dockerfile.android-base index 433adf5470e122..560a2c461283b0 100644 --- a/ContainerShip/Dockerfile.android-base +++ b/ContainerShip/Dockerfile.android-base @@ -1,3 +1,8 @@ +# 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. + # React Native Base Android Development Environment # # This image provides a base Android development environment for React Native, diff --git a/ContainerShip/Dockerfile.javascript b/ContainerShip/Dockerfile.javascript index 7c1e14bb9b845b..5e077f972318c9 100644 --- a/ContainerShip/Dockerfile.javascript +++ b/ContainerShip/Dockerfile.javascript @@ -1,3 +1,8 @@ +# 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. + FROM library/node:6.9.2 ENV YARN_VERSION=0.27.5 diff --git a/ContainerShip/scripts/run-android-docker-instrumentation-tests.sh b/ContainerShip/scripts/run-android-docker-instrumentation-tests.sh index e2c320d7e61afe..63ee31b47cf2d6 100644 --- a/ContainerShip/scripts/run-android-docker-instrumentation-tests.sh +++ b/ContainerShip/scripts/run-android-docker-instrumentation-tests.sh @@ -1,4 +1,10 @@ #!/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. +# # for buck gen mount -o remount,exec /dev/shm diff --git a/ContainerShip/scripts/run-android-docker-unit-tests.sh b/ContainerShip/scripts/run-android-docker-unit-tests.sh index 1a422c25bf1b17..8653ccd9d19555 100644 --- a/ContainerShip/scripts/run-android-docker-unit-tests.sh +++ b/ContainerShip/scripts/run-android-docker-unit-tests.sh @@ -1,4 +1,10 @@ #!/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. +# # set default environment variables UNIT_TESTS_BUILD_THREADS="${UNIT_TESTS_BUILD_THREADS:-1}" diff --git a/ContainerShip/scripts/run-ci-e2e-tests.sh b/ContainerShip/scripts/run-ci-e2e-tests.sh index be916439735dfd..aead257ffce6b4 100755 --- a/ContainerShip/scripts/run-ci-e2e-tests.sh +++ b/ContainerShip/scripts/run-ci-e2e-tests.sh @@ -1,4 +1,10 @@ #!/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. +# set -ex diff --git a/ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh b/ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh index 72b011ca9c3c8b..d2b4b9ee275a12 100755 --- a/ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh +++ b/ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh @@ -1,4 +1,11 @@ #!/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. +# + # shellcheck disable=SC1117 # Python script to run instrumentation tests, copied from https://github.com/circleci/circle-dummy-android # Example: ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests com.facebook.react.tests.ReactPickerTestCase diff --git a/Libraries/Animated/examples/style.css b/Libraries/Animated/examples/style.css index c188ad79b07fd2..24191a56b985ca 100644 --- a/Libraries/Animated/examples/style.css +++ b/Libraries/Animated/examples/style.css @@ -1,3 +1,10 @@ +/** + * 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. + */ + html, h1, h2 { font-family: 'Roboto', sans-serif; font-weight: 300; diff --git a/Libraries/Animated/src/__tests__/bezier-test.js b/Libraries/Animated/src/__tests__/bezier-test.js index e9f00a7d214878..360d6262f91144 100644 --- a/Libraries/Animated/src/__tests__/bezier-test.js +++ b/Libraries/Animated/src/__tests__/bezier-test.js @@ -1,4 +1,9 @@ /** + * 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. + * * BezierEasing - use bezier curve for transition easing function * https://github.com/gre/bezier-easing * diff --git a/Libraries/Animated/src/bezier.js b/Libraries/Animated/src/bezier.js index 15f8e2dc1b686f..d3ea74c27f56c6 100644 --- a/Libraries/Animated/src/bezier.js +++ b/Libraries/Animated/src/bezier.js @@ -1,4 +1,9 @@ /** + * 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. + * * BezierEasing - use bezier curve for transition easing function * https://github.com/gre/bezier-easing * diff --git a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h index 11c6fa6385e2d5..816e61ed411cf5 100644 --- a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h +++ b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.h @@ -1,3 +1,8 @@ +// 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. + // // Created by Gabriel Handford on 3/1/09. // Copyright 2009-2013. All rights reserved. diff --git a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m index 24635509d82dd6..1c73254f8ecab8 100644 --- a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m +++ b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Compare.m @@ -1,3 +1,8 @@ +// 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. + // // Created by Gabriel Handford on 3/1/09. // Copyright 2009-2013. All rights reserved. diff --git a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h index 35595843f35f22..a09d243b6c8136 100644 --- a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h +++ b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.h @@ -1,3 +1,8 @@ +// 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. + // // Created by Gabriel Handford on 3/1/09. // Copyright 2009-2013. All rights reserved. diff --git a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m index 44ecb59ee87b41..5e9f06c028f889 100644 --- a/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m +++ b/Libraries/RCTTest/FBSnapshotTestCase/UIImage+Diff.m @@ -1,3 +1,8 @@ +// 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. + // // Created by Gabriel Handford on 3/1/09. // Copyright 2009-2013. All rights reserved. diff --git a/Libraries/Sample/Sample.h b/Libraries/Sample/Sample.h index 2bee4ac5694a95..0c618d9211ed49 100644 --- a/Libraries/Sample/Sample.h +++ b/Libraries/Sample/Sample.h @@ -1,3 +1,8 @@ +// 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 @interface Sample : NSObject diff --git a/Libraries/Sample/Sample.m b/Libraries/Sample/Sample.m index d3094111251982..2c8a7f03063c02 100644 --- a/Libraries/Sample/Sample.m +++ b/Libraries/Sample/Sample.m @@ -1,3 +1,8 @@ +// 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 "Sample.h" @implementation Sample diff --git a/Libraries/vendor/core/merge.js b/Libraries/vendor/core/merge.js index 6963eddd5628af..c9604a42a852bd 100644 --- a/Libraries/vendor/core/merge.js +++ b/Libraries/vendor/core/merge.js @@ -1,31 +1,8 @@ /** - * @generated SignedSource<<148d1974f94f5c9597e86f946bdf0d4e>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 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. */ "use strict"; diff --git a/Libraries/vendor/core/mergeInto.js b/Libraries/vendor/core/mergeInto.js index d42b3dcf36ed3f..31e869059328ea 100644 --- a/Libraries/vendor/core/mergeInto.js +++ b/Libraries/vendor/core/mergeInto.js @@ -1,32 +1,8 @@ /** - * @generated SignedSource<> + * Copyright (c) Facebook, Inc. and its affiliates. * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in of a static_upstream project! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Use `fjs use-upstream` to temporarily replace this with !! - * !! the latest version from upstream. !! - * !! 2) Make your changes, test them, etc. !! - * !! 3) Use `fjs push-upstream` to copy your changes back to !! - * !! static_upstream. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @typechecks static-only + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ "use strict"; diff --git a/RNTester/android/app/build.gradle b/RNTester/android/app/build.gradle index 6656f6a40fedc4..f0f5926139f923 100644 --- a/RNTester/android/app/build.gradle +++ b/RNTester/android/app/build.gradle @@ -1,3 +1,10 @@ +/** + * 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. + */ + apply plugin: 'com.android.application' import com.android.build.OutputFile diff --git a/RNTester/android/app/proguard-rules.pro b/RNTester/android/app/proguard-rules.pro index a92fa177ee49f0..4dc17584e316c7 100644 --- a/RNTester/android/app/proguard-rules.pro +++ b/RNTester/android/app/proguard-rules.pro @@ -1,3 +1,8 @@ +# 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. + # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt diff --git a/React/DevSupport/RCTInspectorDevServerHelper.mm b/React/DevSupport/RCTInspectorDevServerHelper.mm index 7aad19bc286404..2901b68335c610 100644 --- a/React/DevSupport/RCTInspectorDevServerHelper.mm +++ b/React/DevSupport/RCTInspectorDevServerHelper.mm @@ -1,3 +1,8 @@ +// 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 "RCTInspectorDevServerHelper.h" #if RCT_DEV diff --git a/React/Inspector/RCTInspector.mm b/React/Inspector/RCTInspector.mm index 79c1431f0faa00..32201f76086fd6 100644 --- a/React/Inspector/RCTInspector.mm +++ b/React/Inspector/RCTInspector.mm @@ -1,3 +1,7 @@ +// 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 "RCTInspector.h" diff --git a/React/Inspector/RCTInspectorPackagerConnection.m b/React/Inspector/RCTInspectorPackagerConnection.m index 8852d921bcd4d2..5d0ed99ab468d0 100644 --- a/React/Inspector/RCTInspectorPackagerConnection.m +++ b/React/Inspector/RCTInspectorPackagerConnection.m @@ -1,3 +1,8 @@ +// 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 "RCTInspectorPackagerConnection.h" #if RCT_DEV diff --git a/ReactAndroid/proguard-rules.pro b/ReactAndroid/proguard-rules.pro index aa586132f2f853..84f5e603a17b9a 100644 --- a/ReactAndroid/proguard-rules.pro +++ b/ReactAndroid/proguard-rules.pro @@ -1,3 +1,8 @@ +# 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. + # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt diff --git a/ReactAndroid/src/main/java/com/facebook/jni/fbjni.pro b/ReactAndroid/src/main/java/com/facebook/jni/fbjni.pro index 5b5b6454d32adf..09fad6a9e4ad87 100644 --- a/ReactAndroid/src/main/java/com/facebook/jni/fbjni.pro +++ b/ReactAndroid/src/main/java/com/facebook/jni/fbjni.pro @@ -1,3 +1,8 @@ +# 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. + # For common use cases for the hybrid pattern, keep symbols which may # be referenced only from C++. diff --git a/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro b/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro index b1ef5f7ce94678..f9d4677e299ba8 100644 --- a/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro +++ b/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro @@ -1,3 +1,8 @@ +# 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. + # Keep our interfaces so they can be used by other ProGuard rules. # See http://sourceforge.net/p/proguard/bugs/466/ -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java b/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java index 83630844bac243..5ce5b82595943a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactPackageHelper.java @@ -1,3 +1,10 @@ +/** + * 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; import android.support.annotation.NonNull; diff --git a/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java b/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java index a55e473af53e87..bd2b019eb7c919 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java +++ b/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java @@ -1,3 +1,10 @@ +/** + * 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; import android.support.annotation.NonNull; diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java b/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java index 3558756149b969..6b76ae32daa1bf 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java @@ -1,3 +1,10 @@ +/** + * 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.animated; import com.facebook.react.bridge.ReadableMap; diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java index 8ee96fee2181ac..43b1d3349b5355 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModule.java @@ -1,3 +1,10 @@ +/** + * 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; /** diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java index 14d0f97eba0bf2..7e7f4b0914cb01 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleHolder.java @@ -1,3 +1,10 @@ +/** + * 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; public class JSIModuleHolder { diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java index 9a85f68d69f00f..e5c28700b83700 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java @@ -1,3 +1,10 @@ +/** + * 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 java.util.List; diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java index a94162f12a06c3..d8c3765878c694 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleProvider.java @@ -1,3 +1,10 @@ +/** + * 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; public interface JSIModuleProvider { diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java index dbca620dcfcc6e..c90d4007762a2c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java @@ -1,3 +1,10 @@ +/** + * 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.infer.annotation.Assertions; diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java index d8c21220049048..1178921292e567 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleSpec.java @@ -1,3 +1,10 @@ +/** + * 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; /** diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArrayInterface.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArrayInterface.java index 74b49a890e7321..989208814f2758 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArrayInterface.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArrayInterface.java @@ -1,3 +1,10 @@ +/** + * 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; public interface NativeArrayInterface { 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 29a5a93148b272..6d4824390194db 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java @@ -1,3 +1,10 @@ +/** + * 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.react.uimanager.common.MeasureSpecProvider; @@ -26,7 +33,7 @@ public interface UIManager extends JSIModule, PerformanceCounter { /** * Dispatches the commandId received by parameter to the view associated with the reactTag. * The command will be processed in the UIThread. - * + * * @param reactTag {@link int} that identifies the view that will receive this command * @param commandId {@link int} command id * @param commandArgs {@link ReadableArray} parameters associated with the command diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/bridge.pro b/ReactAndroid/src/main/java/com/facebook/react/bridge/bridge.pro index a03ce0287e5e84..028d56d0782864 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/bridge.pro +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/bridge.pro @@ -1,3 +1,8 @@ +# 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. + ## Putting this here is kind of a hack. I don't want to modify the OSS bridge. ## TODO mhorowitz: add @DoNotStrip to the interface directly. diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/reactnative.pro b/ReactAndroid/src/main/java/com/facebook/react/bridge/reactnative.pro index 2625c0032a0f9e..4031578963f7cb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/reactnative.pro +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/reactnative.pro @@ -1,3 +1,8 @@ +# 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. + -keepnames class * extends com.facebook.react.bridge.JavaScriptModule { *; } -keepnames class * extends com.facebook.react.bridge.CxxModuleWrapper {*; } -keepclassmembers class * extends com.facebook.react.bridge.NativeModule { diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java b/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java index 5b2f32023c1c8f..b689d8b0ad9ea1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java +++ b/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java @@ -1,3 +1,10 @@ +/** + * 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.common; import java.util.Arrays; 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 f9f1b70833301b..be48e96bc6188b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -1,3 +1,10 @@ +/** + * 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.config; /** diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java index 1aee0099e5f31f..56e617cafd81ce 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/ViewHierarchyUtil.java @@ -1,3 +1,10 @@ +/** + * 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.devsupport; import android.util.Pair; diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/WindowOverlayCompat.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/WindowOverlayCompat.java index b4bfa91eeba915..9027148553d2ba 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/WindowOverlayCompat.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/WindowOverlayCompat.java @@ -1,3 +1,10 @@ +/** + * 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.devsupport; import android.os.Build; diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk index 9b7404543b56c5..21642e63726355 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/ReactFabric.java b/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/ReactFabric.java index fd0896bdd6fd8a..fbf3233688b64c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/ReactFabric.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/fabric/ReactFabric.java @@ -1,3 +1,10 @@ +/** + * 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.modules.fabric; import com.facebook.react.bridge.JavaScriptModule; diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/network/CookieJarContainer.java b/ReactAndroid/src/main/java/com/facebook/react/modules/network/CookieJarContainer.java index fcf375f08dd97d..6e58b76e91c37d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/network/CookieJarContainer.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/network/CookieJarContainer.java @@ -1,3 +1,10 @@ +/** + * 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.modules.network; import okhttp3.CookieJar; diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/network/ReactCookieJarContainer.java b/ReactAndroid/src/main/java/com/facebook/react/modules/network/ReactCookieJarContainer.java index 370586fa50ca9c..0589bfd1705b2b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/network/ReactCookieJarContainer.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/network/ReactCookieJarContainer.java @@ -1,3 +1,10 @@ +/** + * 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.modules.network; import java.util.ArrayList; @@ -12,8 +19,8 @@ import okhttp3.HttpUrl; /** - * Basic okhttp3 CookieJar container - */ + * Basic okhttp3 CookieJar container + */ public class ReactCookieJarContainer implements CookieJarContainer { @Nullable diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java index cbf665a7ed8fd3..8ce6fe2bf86482 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import com.facebook.infer.annotation.Assertions; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.java index 3e2b109765d441..4facdbf2a57838 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactYogaConfigProvider.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import com.facebook.yoga.YogaConfig; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java index 52895d4b7c4363..0dd0e2d276eed1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.java index 86678d897b6b7a..619c793c1259a5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import android.view.View; diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java index fa2ac80a572a9f..6c4219e1e6e150 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import static com.facebook.react.uimanager.common.UIManagerType.FABRIC; diff --git a/ReactAndroid/src/main/jni/Application.mk b/ReactAndroid/src/main/jni/Application.mk index 0e3d85e32dd6c3..942a122de79183 100644 --- a/ReactAndroid/src/main/jni/Application.mk +++ b/ReactAndroid/src/main/jni/Application.mk @@ -1,3 +1,8 @@ +# 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. + APP_BUILD_SCRIPT := Android.mk APP_ABI := armeabi-v7a x86 arm64-v8a x86_64 diff --git a/ReactAndroid/src/main/jni/first-party/fb/Android.mk b/ReactAndroid/src/main/jni/first-party/fb/Android.mk index bd0b6cf1cb5e9d..90f2565152d1aa 100644 --- a/ReactAndroid/src/main/jni/first-party/fb/Android.mk +++ b/ReactAndroid/src/main/jni/first-party/fb/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk b/ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk index 17e352bccb82b4..ee9f3709cea6d4 100644 --- a/ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk +++ b/ReactAndroid/src/main/jni/first-party/fbgloginit/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactAndroid/src/main/jni/first-party/yogajni/Android.mk b/ReactAndroid/src/main/jni/first-party/yogajni/Android.mk index 22fe6854de8657..4850810df7f6bd 100644 --- a/ReactAndroid/src/main/jni/first-party/yogajni/Android.mk +++ b/ReactAndroid/src/main/jni/first-party/yogajni/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index d76dd0fc2052db..85e5fddc769de8 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java b/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java index 27973a3acea1bf..a43308b7d41661 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java @@ -1,3 +1,10 @@ +/** + * 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.animated; import org.junit.Test; diff --git a/ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.java b/ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.java index ac61c012dff76b..5866ca66f8dd7e 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/uimanager/MatrixMathHelperTest.java @@ -1,3 +1,10 @@ +/** + * 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.uimanager; import org.junit.Test; diff --git a/ReactAndroid/src/test/java/com/facebook/react/views/text/CustomLineHeightSpanTest.java b/ReactAndroid/src/test/java/com/facebook/react/views/text/CustomLineHeightSpanTest.java index eadb7d3544bcb5..219143edfca99a 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/views/text/CustomLineHeightSpanTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/views/text/CustomLineHeightSpanTest.java @@ -1,3 +1,10 @@ +/** + * 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.text; import android.graphics.Paint; diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index 4a5a043733c4c4..faf9935abee4c2 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactCommon/cxxreact/JSDeltaBundleClient.cpp b/ReactCommon/cxxreact/JSDeltaBundleClient.cpp index d6785226d63999..86edf47c80069d 100644 --- a/ReactCommon/cxxreact/JSDeltaBundleClient.cpp +++ b/ReactCommon/cxxreact/JSDeltaBundleClient.cpp @@ -1,3 +1,8 @@ +// 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 "JSDeltaBundleClient.h" #include diff --git a/ReactCommon/fabric/components/text/paragraph/conversions.h b/ReactCommon/fabric/components/text/paragraph/conversions.h index c9d614144d0f74..e3f2f6c1f386f0 100644 --- a/ReactCommon/fabric/components/text/paragraph/conversions.h +++ b/ReactCommon/fabric/components/text/paragraph/conversions.h @@ -1,3 +1,7 @@ +// 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 diff --git a/ReactCommon/jsi/Android.mk b/ReactCommon/jsi/Android.mk index 1b27989ff058ad..4e650d9ca391a2 100644 --- a/ReactCommon/jsi/Android.mk +++ b/ReactCommon/jsi/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactCommon/jsiexecutor/Android.mk b/ReactCommon/jsiexecutor/Android.mk index 8580c9f4befcee..c6bb60124a0744 100644 --- a/ReactCommon/jsiexecutor/Android.mk +++ b/ReactCommon/jsiexecutor/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactCommon/jsinspector/Android.mk b/ReactCommon/jsinspector/Android.mk index 2e36c22745a7d1..4ac55536236532 100644 --- a/ReactCommon/jsinspector/Android.mk +++ b/ReactCommon/jsinspector/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactCommon/yoga/Android.mk b/ReactCommon/yoga/Android.mk index 07e664037f359d..f1cd07fc953346 100644 --- a/ReactCommon/yoga/Android.mk +++ b/ReactCommon/yoga/Android.mk @@ -1,3 +1,8 @@ +# 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) diff --git a/ReactCommon/yoga/yoga.podspec b/ReactCommon/yoga/yoga.podspec index 6d5dc0357d9d9f..455d2e87b8b69b 100644 --- a/ReactCommon/yoga/yoga.podspec +++ b/ReactCommon/yoga/yoga.podspec @@ -1,3 +1,8 @@ +# 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 = JSON.parse(File.read(File.expand_path('../../package.json', __dir__))) version = package['version'] diff --git a/android-jsc/build.gradle b/android-jsc/build.gradle index dc3e8d0b867b06..fcc9f9d533a5eb 100644 --- a/android-jsc/build.gradle +++ b/android-jsc/build.gradle @@ -1,2 +1,9 @@ +/** + * 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. + */ + configurations.maybeCreate("default") -artifacts.add("default", file('android-jsc.aar')) \ No newline at end of file +artifacts.add("default", file('android-jsc.aar')) diff --git a/local-cli/core/__fixtures__/commands.js b/local-cli/core/__fixtures__/commands.js index 2f98b7ef505f47..5331649a7bd5a2 100644 --- a/local-cli/core/__fixtures__/commands.js +++ b/local-cli/core/__fixtures__/commands.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ exports.single = { func: () => {}, diff --git a/local-cli/core/__fixtures__/dependencies.js b/local-cli/core/__fixtures__/dependencies.js index 3b9c9abc3f9727..f5a3c1c333e389 100644 --- a/local-cli/core/__fixtures__/dependencies.js +++ b/local-cli/core/__fixtures__/dependencies.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const fs = jest.requireActual('fs'); const path = require('path'); diff --git a/local-cli/core/__fixtures__/files/Main.java b/local-cli/core/__fixtures__/files/Main.java index 08dc35a58bfabf..5ddddfae8e40ea 100644 --- a/local-cli/core/__fixtures__/files/Main.java +++ b/local-cli/core/__fixtures__/files/Main.java @@ -1,3 +1,10 @@ +/** + * 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.some.example; import java.util.ArrayList; diff --git a/local-cli/core/__fixtures__/files/ReactPackage.java b/local-cli/core/__fixtures__/files/ReactPackage.java index 1f65e4f5fb3c5d..08695ebb760816 100644 --- a/local-cli/core/__fixtures__/files/ReactPackage.java +++ b/local-cli/core/__fixtures__/files/ReactPackage.java @@ -1,3 +1,10 @@ +/** + * 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.some.example; import com.facebook.react.ReactPackage; diff --git a/local-cli/core/__fixtures__/files/ReactPackage.kt b/local-cli/core/__fixtures__/files/ReactPackage.kt index f17b5b760a3f75..17b0db22bd9187 100644 --- a/local-cli/core/__fixtures__/files/ReactPackage.kt +++ b/local-cli/core/__fixtures__/files/ReactPackage.kt @@ -1,3 +1,10 @@ +/** + * 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.some.example; import android.view.View diff --git a/local-cli/core/__fixtures__/ios.js b/local-cli/core/__fixtures__/ios.js index ef0ba538af675a..1792f67309ed25 100644 --- a/local-cli/core/__fixtures__/ios.js +++ b/local-cli/core/__fixtures__/ios.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const fs = jest.requireActual('fs'); const path = require('path'); diff --git a/local-cli/core/__fixtures__/projects.js b/local-cli/core/__fixtures__/projects.js index 28414b3d95a33b..c3d42d693ba6eb 100644 --- a/local-cli/core/__fixtures__/projects.js +++ b/local-cli/core/__fixtures__/projects.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const android = require('./android'); const ios = require('./ios'); diff --git a/local-cli/core/ios/findPodfilePath.js b/local-cli/core/ios/findPodfilePath.js index 91efb191d63551..67232535468f5e 100644 --- a/local-cli/core/ios/findPodfilePath.js +++ b/local-cli/core/ios/findPodfilePath.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ 'use strict'; diff --git a/local-cli/core/ios/findPodspecName.js b/local-cli/core/ios/findPodspecName.js index 8f43d4360538db..1041a0a99916f7 100644 --- a/local-cli/core/ios/findPodspecName.js +++ b/local-cli/core/ios/findPodspecName.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ 'use strict'; diff --git a/local-cli/generator/promptSync.js b/local-cli/generator/promptSync.js index 636138abf257ef..ba1b4d7f1da923 100644 --- a/local-cli/generator/promptSync.js +++ b/local-cli/generator/promptSync.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ // Simplified version of: // https://github.com/0x00A/prompt-sync/blob/master/index.js diff --git a/local-cli/link/__fixtures__/android/0.17/MainActivity.java b/local-cli/link/__fixtures__/android/0.17/MainActivity.java index 0a532a7eddfa85..d0794b72b8e783 100644 --- a/local-cli/link/__fixtures__/android/0.17/MainActivity.java +++ b/local-cli/link/__fixtures__/android/0.17/MainActivity.java @@ -1,3 +1,10 @@ +/** + * 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.basic; import android.app.Activity; diff --git a/local-cli/link/__fixtures__/android/0.17/patchedMainActivity.java b/local-cli/link/__fixtures__/android/0.17/patchedMainActivity.java index edd841d76211c3..17c2b278d5be7f 100644 --- a/local-cli/link/__fixtures__/android/0.17/patchedMainActivity.java +++ b/local-cli/link/__fixtures__/android/0.17/patchedMainActivity.java @@ -1,3 +1,10 @@ +/** + * 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.basic; import android.app.Activity; diff --git a/local-cli/link/__fixtures__/android/0.18/MainActivity.java b/local-cli/link/__fixtures__/android/0.18/MainActivity.java index c2ccca8905f7b6..c630627442cbf2 100644 --- a/local-cli/link/__fixtures__/android/0.18/MainActivity.java +++ b/local-cli/link/__fixtures__/android/0.18/MainActivity.java @@ -1,3 +1,10 @@ +/** + * 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.testrn; import com.facebook.react.ReactActivity; diff --git a/local-cli/link/__fixtures__/android/0.18/patchedMainActivity.java b/local-cli/link/__fixtures__/android/0.18/patchedMainActivity.java index 3c6331eaf9fb78..b099735c4185ed 100644 --- a/local-cli/link/__fixtures__/android/0.18/patchedMainActivity.java +++ b/local-cli/link/__fixtures__/android/0.18/patchedMainActivity.java @@ -1,3 +1,10 @@ +/** + * 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.testrn; import com.facebook.react.ReactActivity; diff --git a/local-cli/link/__fixtures__/android/0.20/MainActivity.java b/local-cli/link/__fixtures__/android/0.20/MainActivity.java index d9df1311598a37..642f4259c1ee0f 100644 --- a/local-cli/link/__fixtures__/android/0.20/MainActivity.java +++ b/local-cli/link/__fixtures__/android/0.20/MainActivity.java @@ -1,3 +1,10 @@ +/** + * 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.myawesomeproject; import com.facebook.react.ReactActivity; diff --git a/local-cli/link/__fixtures__/android/build.gradle b/local-cli/link/__fixtures__/android/build.gradle index 4dd26f8e088024..f206d053ecdec2 100644 --- a/local-cli/link/__fixtures__/android/build.gradle +++ b/local-cli/link/__fixtures__/android/build.gradle @@ -1,3 +1,10 @@ +/** + * 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. + */ + dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:27.1.1" diff --git a/local-cli/link/__fixtures__/android/patchedBuild.gradle b/local-cli/link/__fixtures__/android/patchedBuild.gradle index 425aaaf7f44427..f5cb4a24a8cd14 100644 --- a/local-cli/link/__fixtures__/android/patchedBuild.gradle +++ b/local-cli/link/__fixtures__/android/patchedBuild.gradle @@ -1,3 +1,10 @@ +/** + * 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. + */ + dependencies { implementation project(':test') implementation(project(':test2')) { diff --git a/local-cli/link/__fixtures__/android/patchedSettings.gradle b/local-cli/link/__fixtures__/android/patchedSettings.gradle index 8854e3d106fae0..2b311263ad815d 100644 --- a/local-cli/link/__fixtures__/android/patchedSettings.gradle +++ b/local-cli/link/__fixtures__/android/patchedSettings.gradle @@ -1,3 +1,10 @@ +/** + * 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. + */ + rootProject.name = 'TestRN' include ':app' diff --git a/local-cli/link/__fixtures__/android/settings.gradle b/local-cli/link/__fixtures__/android/settings.gradle index ded35f713e9413..5bb3d945cc14ae 100644 --- a/local-cli/link/__fixtures__/android/settings.gradle +++ b/local-cli/link/__fixtures__/android/settings.gradle @@ -1,3 +1,10 @@ +/** + * 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. + */ + rootProject.name = 'TestRN' include ':app' diff --git a/local-cli/link/android/index.js b/local-cli/link/android/index.js index 3eacc41750228c..d8b8f5addbc2cf 100644 --- a/local-cli/link/android/index.js +++ b/local-cli/link/android/index.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ module.exports = function() { return { diff --git a/local-cli/link/android/patches/normalizeProjectName.js b/local-cli/link/android/patches/normalizeProjectName.js index 97dae55ededc28..bdf457d74b9a04 100644 --- a/local-cli/link/android/patches/normalizeProjectName.js +++ b/local-cli/link/android/patches/normalizeProjectName.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ module.exports = function normalizeProjectName(name) { return name.replace(/\//g, '_'); diff --git a/local-cli/link/ios/common/isInstalled.js b/local-cli/link/ios/common/isInstalled.js index 71af956bdcff0c..3e5542fe13f97b 100644 --- a/local-cli/link/ios/common/isInstalled.js +++ b/local-cli/link/ios/common/isInstalled.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const isInstalledIOS = require('../isInstalled'); const isInstalledPods = require('../../pods/isInstalled'); diff --git a/local-cli/link/ios/common/registerNativeModule.js b/local-cli/link/ios/common/registerNativeModule.js index 72057712fe0ec6..8a86e688753d29 100644 --- a/local-cli/link/ios/common/registerNativeModule.js +++ b/local-cli/link/ios/common/registerNativeModule.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const registerDependencyIOS = require('../registerNativeModule'); const registerDependencyPods = require('../../pods/registerNativeModule'); diff --git a/local-cli/link/ios/common/unregisterNativeModule.js b/local-cli/link/ios/common/unregisterNativeModule.js index dbf7bc4147dbb3..69d25ea591860e 100644 --- a/local-cli/link/ios/common/unregisterNativeModule.js +++ b/local-cli/link/ios/common/unregisterNativeModule.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ const compact = require('lodash').compact; const isInstalledIOS = require('../isInstalled'); diff --git a/local-cli/link/ios/index.js b/local-cli/link/ios/index.js index bf6b57b2618671..aa31fd2ba11a32 100644 --- a/local-cli/link/ios/index.js +++ b/local-cli/link/ios/index.js @@ -1,4 +1,11 @@ -/** @format */ +/** + * 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 + */ module.exports = function() { return { diff --git a/scripts/circleci/validate_yarn_lockfile.sh b/scripts/circleci/validate_yarn_lockfile.sh index 5626dd9567b5e0..8231cd496468dc 100755 --- a/scripts/circleci/validate_yarn_lockfile.sh +++ b/scripts/circleci/validate_yarn_lockfile.sh @@ -1,4 +1,8 @@ #!/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. # Abort the mission if any command fails set -e diff --git a/scripts/test-manual-e2e.sh b/scripts/test-manual-e2e.sh index ac1157df60514f..84affa42d51cd4 100755 --- a/scripts/test-manual-e2e.sh +++ b/scripts/test-manual-e2e.sh @@ -1,4 +1,8 @@ -#! /bin/bash +#!/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. JAVA_VERSION="1.7" diff --git a/third-party-podspecs/DoubleConversion.podspec b/third-party-podspecs/DoubleConversion.podspec index 2ea6c84a4b02b6..97a80401fe702b 100644 --- a/third-party-podspecs/DoubleConversion.podspec +++ b/third-party-podspecs/DoubleConversion.podspec @@ -1,3 +1,8 @@ +# 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. + Pod::Spec.new do |spec| spec.name = 'DoubleConversion' spec.version = '1.1.6' diff --git a/third-party-podspecs/Folly.podspec b/third-party-podspecs/Folly.podspec index ebe807b8e701eb..c12c8e16b178d6 100644 --- a/third-party-podspecs/Folly.podspec +++ b/third-party-podspecs/Folly.podspec @@ -1,3 +1,8 @@ +# 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. + Pod::Spec.new do |spec| spec.name = 'Folly' spec.version = '2018.10.22.00' diff --git a/third-party-podspecs/glog.podspec b/third-party-podspecs/glog.podspec index bc4bb1e182cf20..b5656e586a2e4b 100644 --- a/third-party-podspecs/glog.podspec +++ b/third-party-podspecs/glog.podspec @@ -1,3 +1,8 @@ +# 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. + Pod::Spec.new do |spec| spec.name = 'glog' spec.version = '0.3.5' diff --git a/tools/build_defs/fb_native_wrapper.bzl b/tools/build_defs/fb_native_wrapper.bzl index 4e251dc0a47334..3d246dee12c3cb 100644 --- a/tools/build_defs/fb_native_wrapper.bzl +++ b/tools/build_defs/fb_native_wrapper.bzl @@ -1,3 +1,8 @@ +# 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. + fb_native = struct( android_aar = native.android_aar, android_app_modularity = native.android_app_modularity, diff --git a/tools/build_defs/oss/rn_defs.bzl b/tools/build_defs/oss/rn_defs.bzl index c4420b22e4ef13..fbf99d0cb90bce 100644 --- a/tools/build_defs/oss/rn_defs.bzl +++ b/tools/build_defs/oss/rn_defs.bzl @@ -1,3 +1,8 @@ +# 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. + """Helpers for referring to React Native open source code. This lets us build React Native: From e90319e9fa18661144ad29faf36efba3750edb32 Mon Sep 17 00:00:00 2001 From: yatatsu Date: Wed, 31 Oct 2018 05:27:13 -0700 Subject: [PATCH 015/290] Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2. (#21782) Summary: When we use product flavor (e.g. develop/production) with Android Gradle Plugin 3.2, javascript bundle is not copied due to that merged asset path point to incorrect location. related #21408 Pull Request resolved: https://github.com/facebook/react-native/pull/21782 Differential Revision: D12854056 Pulled By: hramos fbshipit-source-id: d1e6a395e762cc4a4f133977d54d0f469fa66b8c --- react.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react.gradle b/react.gradle index bcc24b0c24cd18..b9187afba414aa 100644 --- a/react.gradle +++ b/react.gradle @@ -132,7 +132,7 @@ afterEvaluate { } // Workaround for Android Gradle Plugin 3.2+ new asset directory - into ("merged_assets/${targetPath}/merge${targetName}Assets/out") { + into ("merged_assets/${variant.name}/merge${targetName}Assets/out") { from jsBundleDir } } From c1470736b028d21614d2a352a227f83a80e32215 Mon Sep 17 00:00:00 2001 From: Scott Rice Date: Wed, 31 Oct 2018 11:45:33 -0700 Subject: [PATCH 016/290] Use fb_native_wrapper for all targets Differential Revision: D12867696 fbshipit-source-id: bd52c1ead04065addece3a3104c4a1a9359ceb95 --- ReactAndroid/libs/BUCK | 10 +++-- ReactAndroid/src/main/jni/prebuilt/BUCK | 3 +- .../src/main/jni/third-party/glibc/BUCK | 10 +++-- .../src/test/java/com/facebook/powermock/BUCK | 25 ++++++------ .../libraries/fresco/fresco-react-native/BUCK | 21 +++++----- .../soloader/java/com/facebook/soloader/BUCK | 6 ++- .../android/support-annotations/BUCK | 6 ++- .../src/main/third-party/android/support/BUCK | 3 +- .../main/third-party/android/support/v4/BUCK | 40 ++++++++++--------- .../android/support/v7/appcompat-orig/BUCK | 9 +++-- .../src/main/third-party/java/asm/BUCK | 11 ++--- .../java/buck-android-support/BUCK | 3 +- .../src/main/third-party/java/fest/BUCK | 5 ++- .../third-party/java/infer-annotations/BUCK | 6 ++- .../src/main/third-party/java/javapoet/BUCK | 6 ++- .../src/main/third-party/java/jsr-305/BUCK | 6 ++- .../src/main/third-party/java/jsr-330/BUCK | 6 ++- .../src/main/third-party/java/junit/BUCK | 5 ++- .../src/main/third-party/java/mockito/BUCK | 5 ++- .../src/main/third-party/java/okhttp/BUCK | 10 +++-- .../src/main/third-party/java/okio/BUCK | 6 ++- .../java/robolectric3/robolectric/BUCK | 31 +++++++------- .../src/main/third-party/java/sqlite/BUCK | 3 +- .../third-party/java/testing-support-lib/BUCK | 10 +++-- keystores/BUCK | 4 +- 25 files changed, 144 insertions(+), 106 deletions(-) diff --git a/ReactAndroid/libs/BUCK b/ReactAndroid/libs/BUCK index 9d188656453694..d647c5f79d8dfe 100644 --- a/ReactAndroid/libs/BUCK +++ b/ReactAndroid/libs/BUCK @@ -1,21 +1,23 @@ -android_prebuilt_aar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.android_prebuilt_aar( name = "appcompat", aar = ":appcompat-binary-aar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "appcompat-binary-aar", sha1 = "22b1ef4ff9ef1a3513c18eb132d597eac6ef1a86", url = "mvn:com.android.support:appcompat-v7:aar:27.1.1", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "android-jsc", aar = ":android-jsc-aar", ) -remote_file( +fb_native.remote_file( name = "android-jsc-aar", sha1 = "880cedd93f43e0fc841f01f2fa185a63d9230f85", url = "mvn:org.webkit:android-jsc:aar:r174650", diff --git a/ReactAndroid/src/main/jni/prebuilt/BUCK b/ReactAndroid/src/main/jni/prebuilt/BUCK index 9be266bd8929b2..fcbe40c84a00c3 100644 --- a/ReactAndroid/src/main/jni/prebuilt/BUCK +++ b/ReactAndroid/src/main/jni/prebuilt/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_prebuilt_aar", "rn_prebuilt_native_library") # Temp workaround to get the build working e2e, Gradle builds them for us @@ -13,7 +14,7 @@ rn_android_prebuilt_aar( visibility = ["PUBLIC"], ) -remote_file( +fb_native.remote_file( name = "android-jsc-aar", sha1 = "880cedd93f43e0fc841f01f2fa185a63d9230f85", url = "mvn:org.webkit:android-jsc:aar:r174650", diff --git a/ReactAndroid/src/main/jni/third-party/glibc/BUCK b/ReactAndroid/src/main/jni/third-party/glibc/BUCK index 6668953843f0ad..e3a4f475489193 100644 --- a/ReactAndroid/src/main/jni/third-party/glibc/BUCK +++ b/ReactAndroid/src/main/jni/third-party/glibc/BUCK @@ -4,7 +4,9 @@ # libpthread is implicitly included in the android runtime so, when building # on an android platform, we don't do anything. -prebuilt_cxx_library( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_cxx_library( name = "pthread", exported_platform_linker_flags = [ ( @@ -26,7 +28,7 @@ prebuilt_cxx_library( ], ) -prebuilt_cxx_library( +fb_native.prebuilt_cxx_library( name = "dl", exported_linker_flags = [ "-ldl", @@ -37,7 +39,7 @@ prebuilt_cxx_library( ], ) -prebuilt_cxx_library( +fb_native.prebuilt_cxx_library( name = "m", exported_linker_flags = [ "-lm", @@ -48,7 +50,7 @@ prebuilt_cxx_library( ], ) -prebuilt_cxx_library( +fb_native.prebuilt_cxx_library( name = "rt", exported_platform_linker_flags = [ ( diff --git a/ReactAndroid/src/main/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK b/ReactAndroid/src/main/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK index 833276c6d04cf2..1473f92d1099f4 100644 --- a/ReactAndroid/src/main/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK +++ b/ReactAndroid/src/main/libraries/fbcore/src/test/java/com/facebook/powermock/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -25,7 +26,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-core.jar", sha1 = "ea04e79244e19dcf0c3ccf6863c5b028b4b58c9c", url = "mvn:org.powermock:powermock-core:jar:1.6.2", @@ -37,7 +38,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-api-mockito.jar", sha1 = "c213230ae20a7b422f3d622a261d0e3427d2464c", url = "mvn:org.powermock:powermock-api-mockito:jar:1.6.2", @@ -49,7 +50,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-api-support.jar", sha1 = "93b21413b4ee99b7bc0dd34e1416fdca96866aaf", url = "mvn:org.powermock:powermock-api-support:jar:1.6.2", @@ -61,7 +62,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-module-junit4-rule.jar", sha1 = "4847638c5729b9f203e21144b0bdb5d34d888473", url = "mvn:org.powermock:powermock-module-junit4-rule:jar:1.6.2", @@ -73,7 +74,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-classloading-xstream.jar", sha1 = "3ced31cd7024fe365b9f3c8082d22c02434577da", url = "mvn:org.powermock:powermock-classloading-xstream:jar:1.6.2", @@ -85,7 +86,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-classloading-base.jar", sha1 = "c8bfc10731a02d3b241892cf2c334a754d473ca7", url = "mvn:org.powermock:powermock-classloading-base:jar:1.6.2", @@ -97,7 +98,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-xstream.jar", sha1 = "97e5013f391487cce4de6b0eebcde21549e91872", url = "mvn:com.thoughtworks.xstream:xstream:jar:1.4.2", @@ -109,7 +110,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-powermock-reflect.jar", sha1 = "1af1bbd1207c3ecdcf64973e6f9d57dcd17cc145", url = "mvn:org.powermock:powermock-reflect:jar:1.6.2", @@ -121,7 +122,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-javassist.jar", sha1 = "a9cbcdfb7e9f86fbc74d3afae65f2248bfbf82a0", url = "mvn:org.javassist:javassist:jar:3.20.0-GA", @@ -133,7 +134,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-mockito-all.jar", sha1 = "539df70269cc254a58cccc5d8e43286b4a73bf30", url = "mvn:org.mockito:mockito-all:jar:1.10.19", @@ -145,7 +146,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-xmlpull.jar", sha1 = "2b8e230d2ab644e4ecaa94db7cdedbc40c805dfa", url = "mvn:xmlpull:xmlpull:jar:1.1.3.1", @@ -157,7 +158,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-xpp3.jar", sha1 = "19d4e90b43059058f6e056f794f0ea4030d60b86", url = "mvn:xpp3:xpp3_min:jar:1.1.4c", diff --git a/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK b/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK index 8e962c86b125c2..d2fef6923a63bf 100644 --- a/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK +++ b/ReactAndroid/src/main/libraries/fresco/fresco-react-native/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_android_prebuilt_aar", "rn_prebuilt_jar") rn_android_prebuilt_aar( @@ -6,19 +7,19 @@ rn_android_prebuilt_aar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "fresco-binary-aar", sha1 = "076812472879be341f392c4aab469b8fdf8c6759", url = "mvn:com.facebook.fresco:fresco:aar:1.10.0", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "fresco-drawee", aar = ":drawee-binary-aar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "drawee-binary-aar", sha1 = "c1fef7cdc5f6e4fd7d7c58522075c6b66f46a52b", url = "mvn:com.facebook.fresco:drawee:aar:1.10.0", @@ -40,7 +41,7 @@ rn_android_prebuilt_aar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "imagepipeline-base-aar", sha1 = "56672fa5fa46bf4962adecc7c88a1544f5a20225", url = "mvn:com.facebook.fresco:imagepipeline-base:aar:1.10.0", @@ -52,7 +53,7 @@ rn_android_prebuilt_aar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "imagepipeline-aar", sha1 = "e317bdb7f18f0f4ac4f3ab5d3edb49fd09290a6f", url = "mvn:com.facebook.fresco:imagepipeline:aar:1.10.0", @@ -64,31 +65,31 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-bolts.jar", sha1 = "d85884acf6810a3bbbecb587f239005cbc846dc4", url = "mvn:com.parse.bolts:bolts-tasks:jar:1.4.0", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "fbcore", aar = ":fbcore-aar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "fbcore-aar", sha1 = "d79dbf5e47d6e528dd1f90170e0299c14d835ab8", url = "mvn:com.facebook.fresco:fbcore:aar:1.10.0", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "imagepipeline-okhttp3", aar = ":imagepipeline-okhttp3-binary-aar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "imagepipeline-okhttp3-binary-aar", sha1 = "3429ffb776d7511d0f911fbe9efda4c73179d416", url = "mvn:com.facebook.fresco:imagepipeline-okhttp3:aar:1.10.0", diff --git a/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK b/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK index 5664b7dd7cf168..b17de3e804437d 100644 --- a/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK +++ b/ReactAndroid/src/main/libraries/soloader/java/com/facebook/soloader/BUCK @@ -1,10 +1,12 @@ -android_prebuilt_aar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.android_prebuilt_aar( name = "soloader", aar = ":soloader-binary-aar", visibility = ["PUBLIC"], ) -remote_file( +fb_native.remote_file( name = "soloader-binary-aar", sha1 = "042357559a6c9313bdb9b1ba137a9df3b5365f35", url = "mvn:com.facebook.soloader:soloader:aar:0.5.1", diff --git a/ReactAndroid/src/main/third-party/android/support-annotations/BUCK b/ReactAndroid/src/main/third-party/android/support-annotations/BUCK index 80a5ef65b053f4..607d39477f0242 100644 --- a/ReactAndroid/src/main/third-party/android/support-annotations/BUCK +++ b/ReactAndroid/src/main/third-party/android/support-annotations/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "android-support-annotations", binary_jar = ":support-annotations-binary.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "support-annotations-binary.jar", sha1 = "39ded76b5e1ce1c5b2688e1d25cdc20ecee32007", url = "mvn:com.android.support:support-annotations:jar:27.1.1", diff --git a/ReactAndroid/src/main/third-party/android/support/BUCK b/ReactAndroid/src/main/third-party/android/support/BUCK index 13e8bff7c29c38..5636024b9632d3 100644 --- a/ReactAndroid/src/main/third-party/android/support/BUCK +++ b/ReactAndroid/src/main/third-party/android/support/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_library", "rn_android_resource", "rn_prebuilt_jar") rn_android_library( @@ -17,7 +18,7 @@ rn_android_library( ) # a fake genrule so that BUCK files in react native are preseable in fbsource -genrule( +fb_native.genrule( name = "appcompat-res-cmd", out = ".", bash = "ls", diff --git a/ReactAndroid/src/main/third-party/android/support/v4/BUCK b/ReactAndroid/src/main/third-party/android/support/v4/BUCK index 27aec407f2907b..584c121123238f 100644 --- a/ReactAndroid/src/main/third-party/android/support/v4/BUCK +++ b/ReactAndroid/src/main/third-party/android/support/v4/BUCK @@ -1,4 +1,6 @@ -android_library( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.android_library( name = "lib-support-v4", visibility = ["PUBLIC"], exported_deps = [ @@ -14,100 +16,100 @@ android_library( ], ) -prebuilt_jar( +fb_native.prebuilt_jar( name = "android-lifecycle-common", binary_jar = ":android-lifecycle-common.jar", ) -prebuilt_jar( +fb_native.prebuilt_jar( name = "android-lifecycle-core", binary_jar = ":android-lifecycle-core.jar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "android-lifecycle-runtime", aar = ":android-lifecycle-runtime-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "android-lifecycle-viewmodel", aar = ":android-lifecycle-viewmodel-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "lib-support-v4-support-compat", aar = ":lib-support-v4-support-compat-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "lib-support-v4-support-core-utils", aar = ":lib-support-v4-support-core-utils-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "lib-support-v4-support-core-ui", aar = ":lib-support-v4-support-core-ui-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "lib-support-v4-support-media-compat", aar = ":lib-support-v4-support-media-compat-aar", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "lib-support-v4-support-fragment", aar = ":lib-support-v4-support-fragment-aar", ) -remote_file( +fb_native.remote_file( name = "android-lifecycle-runtime-aar", sha1 = "95428e5f6bf6875a6a1125d2157c3836a1a837f5", url = "mvn:android.arch.lifecycle:runtime:aar:1.1.0", ) -remote_file( +fb_native.remote_file( name = "android-lifecycle-common.jar", sha1 = "0edf3f7bfb84a7521d0599efa3b0113a0ee90f85", url = "mvn:android.arch.lifecycle:common:jar:1.1.0", ) -remote_file( +fb_native.remote_file( name = "android-lifecycle-core.jar", sha1 = "8007981f7d7540d89cd18471b8e5dcd2b4f99167", url = "mvn:android.arch.core:common:jar:1.1.0", ) -remote_file( +fb_native.remote_file( name = "android-lifecycle-viewmodel-aar", sha1 = "74ee369b874da61b5b81bebd7b8df0c2577309c8", url = "mvn:android.arch.lifecycle:viewmodel:aar:1.1.0", ) -remote_file( +fb_native.remote_file( name = "lib-support-v4-support-compat-aar", sha1 = "a55ad550d0b84c7fec7ecca012690636062c0e64", url = "mvn:com.android.support:support-compat:aar:27.1.1", ) -remote_file( +fb_native.remote_file( name = "lib-support-v4-support-core-utils-aar", sha1 = "b3a7a4040fda0c5138dbc8c477103b6723b9dbe6", url = "mvn:com.android.support:support-core-utils:aar:27.1.1", ) -remote_file( +fb_native.remote_file( name = "lib-support-v4-support-core-ui-aar", sha1 = "f9acdb8a4c3a9fe883fd7fa5efd3f0426bb9dcda", url = "mvn:com.android.support:support-core-ui:aar:27.1.1", ) -remote_file( +fb_native.remote_file( name = "lib-support-v4-support-media-compat-aar", sha1 = "10e309e2cc22ff4cab30bd5f573e4bb30be707ad", url = "mvn:com.android.support:support-media-compat:aar:27.1.1", ) -remote_file( +fb_native.remote_file( name = "lib-support-v4-support-fragment-aar", sha1 = "eb8053ebf038b7561c29e5e8964664fac05f375e", url = "mvn:com.android.support:support-fragment:aar:27.1.1", diff --git a/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK b/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK index 1feeab85b5f7b3..a531a7096a40b9 100644 --- a/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK +++ b/ReactAndroid/src/main/third-party/android/support/v7/appcompat-orig/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_library", "rn_android_resource", "rn_prebuilt_jar") # This is a bit messy and hopefully a temporary thing @@ -37,25 +38,25 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -genrule( +fb_native.genrule( name = "classes-unpacker-cmd", out = "classes.jar", cmd = "$(exe :aar-unpacker) $(location :appcompat-binary-aar) classes.jar $OUT", ) -genrule( +fb_native.genrule( name = "res-unpacker-cmd", out = "res", cmd = "$(exe :aar-unpacker) $(location :appcompat-binary-aar) res/ $OUT", visibility = ["//ReactAndroid/..."], ) -python_binary( +fb_native.python_binary( name = "aar-unpacker", main = "aar-unpacker.py", ) -remote_file( +fb_native.remote_file( name = "appcompat-binary-aar", sha1 = "22b1ef4ff9ef1a3513c18eb132d597eac6ef1a86", url = "mvn:com.android.support:appcompat-v7:aar:27.1.1", diff --git a/ReactAndroid/src/main/third-party/java/asm/BUCK b/ReactAndroid/src/main/third-party/java/asm/BUCK index 61ea0f616a2b47..c56db5422144ea 100644 --- a/ReactAndroid/src/main/third-party/java/asm/BUCK +++ b/ReactAndroid/src/main/third-party/java/asm/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -18,7 +19,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-asm.jar", sha1 = "2fd56467a018aafe6ec6a73ccba520be4a7e1565", url = "mvn:org.ow2.asm:asm:jar:5.0.1", @@ -30,7 +31,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-asm-commons.jar", sha1 = "7b7147a390a93a14d2edfdcf3f7b0e87a0939c3e", url = "mvn:org.ow2.asm:asm-commons:jar:5.0.1", @@ -42,7 +43,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-asm-tree.jar", sha1 = "1b1e6e9d869acd704056d0a4223071a511c619e6", url = "mvn:org.ow2.asm:asm-tree:jar:5.0.1", @@ -54,7 +55,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-asm-util.jar", sha1 = "7c8caddfbd0b2d7b844f8fcc75175b9cb9cf4724", url = "mvn:org.ow2.asm:asm-util:jar:5.0.1", @@ -66,7 +67,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-asm-analysis.jar", sha1 = "e286fbee48efacb4e7c175f7948d9d8b2ab52352", url = "mvn:org.ow2.asm:asm-analysis:jar:5.0.1", diff --git a/ReactAndroid/src/main/third-party/java/buck-android-support/BUCK b/ReactAndroid/src/main/third-party/java/buck-android-support/BUCK index dea24f803e4a36..8fea3737cd28aa 100644 --- a/ReactAndroid/src/main/third-party/java/buck-android-support/BUCK +++ b/ReactAndroid/src/main/third-party/java/buck-android-support/BUCK @@ -1,7 +1,8 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "react_native_integration_tests_target") # this lib was compiled by buck version : 6cbf2709778ea352a169d1c84e3ef2894dfa39ec -prebuilt_jar( +fb_native.prebuilt_jar( name = "buck-android-support", binary_jar = "buck-android-support.jar", visibility = [ diff --git a/ReactAndroid/src/main/third-party/java/fest/BUCK b/ReactAndroid/src/main/third-party/java/fest/BUCK index 888d63a22161bd..10f995f166d306 100644 --- a/ReactAndroid/src/main/third-party/java/fest/BUCK +++ b/ReactAndroid/src/main/third-party/java/fest/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -15,7 +16,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "fest-binary.jar", sha1 = "cb7c91cf614901928ae405f19d9bcdedf82781db", url = "mvn:org.easytesting:fest-assert-core:jar:2.0M10", @@ -27,7 +28,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "fest-util-binary.jar", sha1 = "c4a8d7305b23b8d043be12c979813b096df11f44", url = "mvn:org.easytesting:fest-util:jar:1.2.5", diff --git a/ReactAndroid/src/main/third-party/java/infer-annotations/BUCK b/ReactAndroid/src/main/third-party/java/infer-annotations/BUCK index 48d34008ce742f..481e44b8e07122 100644 --- a/ReactAndroid/src/main/third-party/java/infer-annotations/BUCK +++ b/ReactAndroid/src/main/third-party/java/infer-annotations/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "infer-annotations", binary_jar = ":infer-annotations.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "infer-annotations.jar", sha1 = "f514ff4ca022a579d9cf7524846988b646ae4491", url = "mvn:com.facebook.infer.annotation:infer-annotation:jar:0.11.2", diff --git a/ReactAndroid/src/main/third-party/java/javapoet/BUCK b/ReactAndroid/src/main/third-party/java/javapoet/BUCK index 769b174f34e5d3..cf2a2c77fa7f70 100644 --- a/ReactAndroid/src/main/third-party/java/javapoet/BUCK +++ b/ReactAndroid/src/main/third-party/java/javapoet/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "javapoet", binary_jar = ":jsr305-binary.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "jsr305-binary.jar", sha1 = "ad3ba65c1788f4d814a4da056323e2b84412fb3c", url = "mvn:com.squareup:javapoet:jar:1.2.0", diff --git a/ReactAndroid/src/main/third-party/java/jsr-305/BUCK b/ReactAndroid/src/main/third-party/java/jsr-305/BUCK index 494c6479d213c9..8833e61c52d2b0 100644 --- a/ReactAndroid/src/main/third-party/java/jsr-305/BUCK +++ b/ReactAndroid/src/main/third-party/java/jsr-305/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "jsr-305", binary_jar = ":jsr305-binary.jar", visibility = ["PUBLIC"], ) -remote_file( +fb_native.remote_file( name = "jsr305-binary.jar", sha1 = "25ea2e8b0c338a877313bd4672d3fe056ea78f0d", url = "mvn:com.google.code.findbugs:jsr305:jar:3.0.2", diff --git a/ReactAndroid/src/main/third-party/java/jsr-330/BUCK b/ReactAndroid/src/main/third-party/java/jsr-330/BUCK index def136484a7574..24ab990280a8b0 100644 --- a/ReactAndroid/src/main/third-party/java/jsr-330/BUCK +++ b/ReactAndroid/src/main/third-party/java/jsr-330/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "jsr-330", binary_jar = ":jsr330-binary.jar", visibility = ["PUBLIC"], ) -remote_file( +fb_native.remote_file( name = "jsr330-binary.jar", sha1 = "6975da39a7040257bd51d21a231b76c915872d38", url = "mvn:javax.inject:javax.inject:jar:1", diff --git a/ReactAndroid/src/main/third-party/java/junit/BUCK b/ReactAndroid/src/main/third-party/java/junit/BUCK index 39209726524b35..9f4cbec6221d28 100644 --- a/ReactAndroid/src/main/third-party/java/junit/BUCK +++ b/ReactAndroid/src/main/third-party/java/junit/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -15,7 +16,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-junit.jar", sha1 = "2973d150c0dc1fefe998f834810d68f278ea58ec", url = "mvn:junit:junit:jar:4.12", @@ -27,7 +28,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-hamcrest.jar", sha1 = "63a21ebc981131004ad02e0434e799fd7f3a8d5a", url = "mvn:org.hamcrest:hamcrest-all:jar:1.3", diff --git a/ReactAndroid/src/main/third-party/java/mockito/BUCK b/ReactAndroid/src/main/third-party/java/mockito/BUCK index 7eee994c6e5fa8..a7f91609227a4c 100644 --- a/ReactAndroid/src/main/third-party/java/mockito/BUCK +++ b/ReactAndroid/src/main/third-party/java/mockito/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -15,7 +16,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "mockito-binary.jar", sha1 = "c54c55cae0f4742ad6bf8a1987ada35363f2c4e2", url = "mvn:org.mockito:mockito-core:jar:2.19.1", @@ -27,7 +28,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "objenesis-binary.jar", sha1 = "87c0ea803b69252868d09308b4618f766f135a96", url = "mvn:org.objenesis:objenesis:jar:2.1", diff --git a/ReactAndroid/src/main/third-party/java/okhttp/BUCK b/ReactAndroid/src/main/third-party/java/okhttp/BUCK index db3a2a2affb310..de75ada168cc88 100644 --- a/ReactAndroid/src/main/third-party/java/okhttp/BUCK +++ b/ReactAndroid/src/main/third-party/java/okhttp/BUCK @@ -1,22 +1,24 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "okhttp3", binary_jar = ":okhttp3-binary.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "okhttp3-binary.jar", sha1 = "75966e05a49046ca2ae734e5626f28837a8d1e82", url = "mvn:com.squareup.okhttp3:okhttp:jar:3.11.0", ) -prebuilt_jar( +fb_native.prebuilt_jar( name = "okhttp3-urlconnection", binary_jar = ":okhttp3-urlconnection-binary.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "okhttp3-urlconnection-binary.jar", sha1 = "54ec442e9c0fac51265110cf0cb44dfe5ad1ea05", url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:3.11.0", diff --git a/ReactAndroid/src/main/third-party/java/okio/BUCK b/ReactAndroid/src/main/third-party/java/okio/BUCK index 1219ad4697cfe8..13a8e39757a4d9 100644 --- a/ReactAndroid/src/main/third-party/java/okio/BUCK +++ b/ReactAndroid/src/main/third-party/java/okio/BUCK @@ -1,10 +1,12 @@ -prebuilt_jar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.prebuilt_jar( name = "okio", binary_jar = ":okio-binary.jar", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "okio-binary.jar", sha1 = "102d7be47241d781ef95f1581d414b0943053130", url = "mvn:com.squareup.okio:okio:jar:1.14.0", diff --git a/ReactAndroid/src/main/third-party/java/robolectric3/robolectric/BUCK b/ReactAndroid/src/main/third-party/java/robolectric3/robolectric/BUCK index b29b1b7d316cb8..a24c0db48b21e3 100644 --- a/ReactAndroid/src/main/third-party/java/robolectric3/robolectric/BUCK +++ b/ReactAndroid/src/main/third-party/java/robolectric3/robolectric/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -26,7 +27,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "robolectric-binary.jar", sha1 = "f888cea3bc1a24110e315eb9827ab593610ea62f", url = "mvn:org.robolectric:robolectric:jar:3.0", @@ -38,7 +39,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "robolectric-resources-binary.jar", sha1 = "1ab609054aab67cd13a434567467f4b4774f2465", url = "mvn:org.robolectric:robolectric-resources:jar:3.0", @@ -50,7 +51,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "robolectric-annotations-binary.jar", sha1 = "2a6cfc072d7680694c1ff893c5dc8fec33163110", url = "mvn:org.robolectric:robolectric-annotations:jar:3.0", @@ -62,7 +63,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "robolectric-utils-binary.jar", sha1 = "4bcecd8115fe7296088bb1636e6cbd7ae8927392", url = "mvn:org.robolectric:robolectric-utils:jar:3.0", @@ -74,7 +75,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "bouncycastle-binary.jar", sha1 = "ce091790943599535cbb4de8ede84535b0c1260c", url = "mvn:org.bouncycastle:bcprov-jdk16:jar:1.46", @@ -86,7 +87,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "vtd-xml-binary.jar", sha1 = "ee5bcf62c1acf76434ee9f1c67a840bafef72a6d", url = "mvn:com.ximpleware:vtd-xml:jar:2.11", @@ -98,7 +99,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "icu-binary.jar", sha1 = "786d9055d4ca8c1aab4a7d4ac8283f973fd7e41f", url = "mvn:com.ibm.icu:icu4j:jar:53.1", @@ -112,13 +113,13 @@ rn_prebuilt_jar( # This new rule will make the .jar file appear in the "right" location, # though that may change in the future -export_file( +fb_native.export_file( name = "robolectric-android-all-binary.jar", src = ":robolectric-android-all-binary-remote.jar", out = "../android-all-4.1.2_r1-robolectric-0.jar", # name defines filename used by robolectric in runtime ) -remote_file( +fb_native.remote_file( name = "robolectric-android-all-binary-remote.jar", sha1 = "aecc8ce5119a25fcea1cdf8285469c9d1261a352", url = "mvn:org.robolectric:android-all:jar:4.1.2_r1-robolectric-0", @@ -130,13 +131,13 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -export_file( +fb_native.export_file( name = "json.jar", src = ":json-remote.jar", out = "../json-20080701.jar", # name defines filename used by robolectric in runtime ) -remote_file( +fb_native.remote_file( name = "json-remote.jar", sha1 = "d652f102185530c93b66158b1859f35d45687258", url = "mvn:org.json:json:jar:20080701", @@ -148,13 +149,13 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -export_file( +fb_native.export_file( name = "tagsoup.jar", src = ":tagsoup-remote.jar", out = "../tagsoup-1.2.jar", # name defines filename used by robolectric in runtime ) -remote_file( +fb_native.remote_file( name = "tagsoup-remote.jar", sha1 = "639fd364750d7363c85797dc944b4a80f78fa684", url = "mvn:org.ccil.cowan.tagsoup:tagsoup:jar:1.2", @@ -166,13 +167,13 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -export_file( +fb_native.export_file( name = "robolectric-shadows-binary.jar", src = ":robolectric-shadows-binary-remote.jar", out = "../shadows-core-3.0-16.jar", # name defines filename used by robolectric in runtime ) -remote_file( +fb_native.remote_file( name = "robolectric-shadows-binary-remote.jar", sha1 = "39d7a856bf91640b1a6d044333336a2b3f3c198f", url = "https://repo1.maven.org/maven2/org/robolectric/shadows-core/3.0/shadows-core-3.0-16.jar", diff --git a/ReactAndroid/src/main/third-party/java/sqlite/BUCK b/ReactAndroid/src/main/third-party/java/sqlite/BUCK index ff5c72cd36bcf5..7fd47e8a19d975 100644 --- a/ReactAndroid/src/main/third-party/java/sqlite/BUCK +++ b/ReactAndroid/src/main/third-party/java/sqlite/BUCK @@ -1,3 +1,4 @@ +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") rn_android_library( @@ -14,7 +15,7 @@ rn_prebuilt_jar( visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "download-sqlite4java.jar", sha1 = "745a7e2f35fdbe6336922e0d492c979dbbfa74fb", url = "mvn:com.almworks.sqlite4java:sqlite4java:jar:0.282", diff --git a/ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK b/ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK index 9b9ec7008d9b5a..9ef85775609c06 100644 --- a/ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK +++ b/ReactAndroid/src/main/third-party/java/testing-support-lib/BUCK @@ -1,22 +1,24 @@ -android_prebuilt_aar( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.android_prebuilt_aar( name = "runner", aar = ":testing-support-lib-runner-download", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "testing-support-lib-runner-download", sha1 = "a31e7e8db98ca19fb3fab23f120d19a6f4e3e8a9", url = "mvn:com.android.support.test:runner:aar:0.3", ) -android_prebuilt_aar( +fb_native.android_prebuilt_aar( name = "exposed-instrumentation-api", aar = ":testing-support-instrumentation", visibility = ["//ReactAndroid/..."], ) -remote_file( +fb_native.remote_file( name = "testing-support-instrumentation", sha1 = "a7161eafdfbd02a39461f076c9dce0c8e5e7a149", url = "mvn:com.android.support.test:exposed-instrumentation-api-publish:aar:0.3", diff --git a/keystores/BUCK b/keystores/BUCK index 88e4c31b28d497..a1cea0ff55c4f6 100644 --- a/keystores/BUCK +++ b/keystores/BUCK @@ -1,4 +1,6 @@ -keystore( +load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +fb_native.keystore( name = "debug", properties = "debug.keystore.properties", store = "debug.keystore", From 2a349f87f78a75163bc5cfd5e5233bfe00524676 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Wed, 31 Oct 2018 14:30:18 -0700 Subject: [PATCH 017/290] gradle repo priority (#22041) Summary: Changed gradle repo list to have consistent priority. mavenLocal is top priority because it requires manual setup, also won't conflict with other repos. Pull Request resolved: https://github.com/facebook/react-native/pull/22041 Differential Revision: D12871549 Pulled By: hramos fbshipit-source-id: c86730fde956dca77174c6454fdcb005a5eec8a9 --- build.gradle | 4 ++-- local-cli/templates/HelloWorld/android/build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 08845e85fcc8ab..f85d59f03c1adb 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,9 @@ buildscript { repositories { - jcenter() mavenLocal() google() + jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' @@ -20,9 +20,9 @@ buildscript { allprojects { repositories { + mavenLocal() google() jcenter() - mavenLocal() def androidSdk = System.getenv("ANDROID_SDK") maven { diff --git a/local-cli/templates/HelloWorld/android/build.gradle b/local-cli/templates/HelloWorld/android/build.gradle index 0f3eb27edbe992..7fde4f576be839 100644 --- a/local-cli/templates/HelloWorld/android/build.gradle +++ b/local-cli/templates/HelloWorld/android/build.gradle @@ -9,8 +9,8 @@ buildscript { supportLibVersion = "27.1.1" } repositories { - jcenter() google() + jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' @@ -22,8 +22,8 @@ buildscript { allprojects { repositories { - google() mavenLocal() + google() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm From 798517a267841675956cb52a1c0ae493a913962a Mon Sep 17 00:00:00 2001 From: Adam Comella Date: Wed, 31 Oct 2018 16:08:57 -0700 Subject: [PATCH 018/290] Fix relayout of inline views (#21968) Summary: If a view inside of an inline view became dirty (e.g. its top/left prop changed), its position would not update on screen. This is because Yoga didn't know the view needed to be relaid out because Yoga's dirty signal didn't propagate all the way up to the root. The problem is that inline views don't have a parent in the Yoga tree causing Yoga's dirtiness signal propagation to get cut off early. The fix is, when an inline views gets dirty, mark the parent Text's Yoga node as dirty. This will cause Yoga's dirtiness signal to propagate all the way up to the root node. Yoga has a hook to inform you when your node is marked as dirty: `YGNodeSetDirtiedFunc`. We leverage this to find out when an inline view's Yoga node gets dirtied. React Native almost handled this case. Everything worked fine as long as the inline view was nested inside of a virtual text node like this: ``` ``` However, the bug repros when the inline view is nested in a non-virtual text node: ``` ``` The fix is to move the special dirtiness propagation logic from `RCTVirtualTextShadowView` to `RCTBaseTextShadowView`. **Test Plan** Created an inline view. Tested the following kinds of updates on the inline view's content: - Moved the content - Removed the content - Added the content Tested this for an inline view that is directly inside of a text node as well as one that is nested under a virtual text node. Here's the code I used for the inline view that moved its content after 2 seconds: ``` const RN = require('react-native'); const React = require('react'); export default class InlineView extends React.Component { constructor(props, context) { super(props, context); this.state = { posBottom: false }; } componentDidMount() { super.componentDidMount && super.componentDidMount(); setTimeout(() => { this.setState({ posBottom: true }); }, 2000); } render() { const pos = this.state.posBottom ? 25 : 0; const color = this.state.posBottom ? 'pink' : 'green'; return ( ); } } ``` **Release Notes** [IOS] [BUGFIX] [Text] - Fix case where content of inline views didn't get relaid out Adam Comella Microsoft Corp. Pull Request resolved: https://github.com/facebook/react-native/pull/21968 Differential Revision: D12873795 Pulled By: shergin fbshipit-source-id: bbc9f5d3ef25063b0015cec8c4aaf2e41ecd60a8 --- .../Text/BaseText/RCTBaseTextShadowView.m | 38 +++++++++++++++++++ .../VirtualText/RCTVirtualTextShadowView.m | 35 ----------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/Libraries/Text/BaseText/RCTBaseTextShadowView.m b/Libraries/Text/BaseText/RCTBaseTextShadowView.m index ed5fd8ca9dd056..993e88f8dcad6d 100644 --- a/Libraries/Text/BaseText/RCTBaseTextShadowView.m +++ b/Libraries/Text/BaseText/RCTBaseTextShadowView.m @@ -14,6 +14,20 @@ NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName = @"RCTBaseTextShadowViewEmbeddedShadowViewAttributeName"; +static void RCTInlineViewYogaNodeDirtied(YGNodeRef node) +{ + // An inline view (a view nested inside of a text node) does not have a parent + // in the Yoga tree. Consequently, we have to manually propagate the inline + // view's dirty signal up through the text nodes. At some point, it'll reach + // the outermost text node which has a Yoga node and then Yoga will take over + // the dirty signal propagation. + RCTShadowView *inlineView = (__bridge RCTShadowView *)YGNodeGetContext(node); + RCTBaseTextShadowView *baseTextShadowView = + (RCTBaseTextShadowView *)inlineView.reactSuperview; + + [baseTextShadowView dirtyLayout]; +} + @implementation RCTBaseTextShadowView { NSAttributedString *_Nullable _cachedAttributedText; @@ -35,6 +49,30 @@ - (void)setReactTag:(NSNumber *)reactTag _textAttributes.tag = reactTag; } +#pragma mark - Life Cycle + +- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)index +{ + [super insertReactSubview:subview atIndex:index]; + + [self dirtyLayout]; + + if (![subview isKindOfClass:[RCTVirtualTextShadowView class]]) { + YGNodeSetDirtiedFunc(subview.yogaNode, RCTInlineViewYogaNodeDirtied); + } +} + +- (void)removeReactSubview:(RCTShadowView *)subview +{ + if (![subview isKindOfClass:[RCTVirtualTextShadowView class]]) { + YGNodeSetDirtiedFunc(subview.yogaNode, NULL); + } + + [self dirtyLayout]; + + [super removeReactSubview:subview]; +} + #pragma mark - attributedString - (NSAttributedString *)attributedTextWithBaseTextAttributes:(nullable RCTTextAttributes *)baseTextAttributes diff --git a/Libraries/Text/VirtualText/RCTVirtualTextShadowView.m b/Libraries/Text/VirtualText/RCTVirtualTextShadowView.m index af59ad7dfd565f..ef659cc54b797a 100644 --- a/Libraries/Text/VirtualText/RCTVirtualTextShadowView.m +++ b/Libraries/Text/VirtualText/RCTVirtualTextShadowView.m @@ -16,31 +16,6 @@ @implementation RCTVirtualTextShadowView { BOOL _isLayoutDirty; } -#pragma mark - Life Cycle - -- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)index -{ - [super insertReactSubview:subview atIndex:index]; - - [self dirtyLayout]; - - if (![subview isKindOfClass:[RCTVirtualTextShadowView class]]) { - YGNodeSetDirtiedFunc(subview.yogaNode, RCTVirtualTextShadowViewYogaNodeDirtied); - } - -} - -- (void)removeReactSubview:(RCTShadowView *)subview -{ - if (![subview isKindOfClass:[RCTVirtualTextShadowView class]]) { - YGNodeSetDirtiedFunc(subview.yogaNode, NULL); - } - - [self dirtyLayout]; - - [super removeReactSubview:subview]; -} - #pragma mark - Layout - (void)dirtyLayout @@ -60,14 +35,4 @@ - (void)clearLayout _isLayoutDirty = NO; } -static void RCTVirtualTextShadowViewYogaNodeDirtied(YGNodeRef node) -{ - RCTShadowView *shadowView = (__bridge RCTShadowView *)YGNodeGetContext(node); - - RCTVirtualTextShadowView *virtualTextShadowView = - (RCTVirtualTextShadowView *)shadowView.reactSuperview; - - [virtualTextShadowView dirtyLayout]; -} - @end From 309f85ace280184b5458cc701ccb81716b43b789 Mon Sep 17 00:00:00 2001 From: "Andrew Chen (Eng)" Date: Wed, 31 Oct 2018 16:34:43 -0700 Subject: [PATCH 019/290] Fix ReactRootView mount/unmount race condition Summary: There are multiple reports of the NativeViewHierarchyManager trying to remove a root view with id -1. This can occur because of a race condition caused by calls to startReactApplication + unmountReactApplication. We unfortunately overload overload the id field of the ReactRootView to store its react tag. This id is typically set when the view is attached to the react instance, and reset to NO_ID right before an attach occurs or when the react context is tearing down. If the react context has already been initialized, attaching the root view is synchronous and the id is set immediately. If the context has not been initialized, we save the root view in a mAttachedRootViews list and wait until setupReactContext (where the context is created) to finish attaching the root views. There were two issues: 1) In setupReactContext, synchronizing on mReactContextLock is not enough to ensure that the root views in mAttachedRootViews have been initialized already 2) In detachRootView, removing the root view from mAttachedRootViews immediately will cause mAttachedRootViews to be out of sync when it is accessed by the time it is accessed in setupReactContext To address these, the mReactContextLock will synchronize both the creation of the react context AND the initialization of the root views and detachRootView will synchronize on the mReactContextLock before mutating the mAttachedRootViews list. Reviewed By: mmmulani Differential Revision: D12829677 fbshipit-source-id: 3f3b0669e5be2b570c9d534503d04e5d0816196b --- .../java/com/facebook/react/tests/core/BUCK | 1 + .../tests/core/ReactInstanceManagerTest.java | 46 +++++++++++++++++++ .../facebook/react/ReactInstanceManager.java | 31 +++++++------ 3 files changed, 63 insertions(+), 15 deletions(-) create mode 100644 ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/ReactInstanceManagerTest.java diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK index 5f87d7e94d91e7..e6d696155497d9 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK @@ -20,6 +20,7 @@ rn_android_library( react_native_integration_tests_target("java/com/facebook/react/testing/rule:rule"), react_native_target("java/com/facebook/react:react"), 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/shell:shell"), react_native_target("java/com/facebook/react/uimanager:uimanager"), ]) + ([ diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/ReactInstanceManagerTest.java b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/ReactInstanceManagerTest.java new file mode 100644 index 00000000000000..0d1a2735e2925b --- /dev/null +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/ReactInstanceManagerTest.java @@ -0,0 +1,46 @@ +package com.facebook.react.tests.core; + +import android.app.Activity; +import android.support.test.annotation.UiThreadTest; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; +import com.facebook.react.ReactInstanceManager; +import com.facebook.react.ReactRootView; +import com.facebook.react.common.LifecycleState; +import com.facebook.react.shell.MainReactPackage; +import com.facebook.react.testing.ReactTestHelper; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(AndroidJUnit4.class) +public class ReactInstanceManagerTest { + + private ReactInstanceManager mReactInstanceManager; + private ReactRootView mReactRootView; + + @Rule public ActivityTestRule mActivityRule = new ActivityTestRule<>(Activity.class); + + @Before + public void setup() { + Activity activity = mActivityRule.getActivity(); + mReactRootView = new ReactRootView(activity); + mReactInstanceManager = + ReactTestHelper.getReactTestFactory() + .getReactInstanceManagerBuilder() + .setApplication(activity.getApplication()) + .setBundleAssetName("AndroidTestBundle.js") + .setInitialLifecycleState(LifecycleState.BEFORE_CREATE) + .addPackage(new MainReactPackage()) + .build(); + } + + @Test + @UiThreadTest + public void testMountUnmount() { + mReactInstanceManager.onHostResume(mActivityRule.getActivity()); + mReactRootView.startReactApplication(mReactInstanceManager, "ViewLayoutTestApp"); + mReactRootView.unmountReactApplication(); + } +} diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 003311483f3219..8773bf83f2fbf8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -738,8 +738,9 @@ public void attachRootView(ReactRootView rootView) { @ThreadConfined(UI) public void detachRootView(ReactRootView rootView) { UiThreadUtil.assertOnUiThread(); - if (mAttachedRootViews.remove(rootView)) { + if (mAttachedRootViews.contains(rootView)) { ReactContext currentContext = getCurrentReactContext(); + mAttachedRootViews.remove(rootView); if (currentContext != null && currentContext.hasActiveCatalystInstance()) { detachViewFromInstance(rootView, currentContext.getCatalystInstance()); } @@ -977,22 +978,22 @@ private void setupReactContext(final ReactApplicationContext reactContext) { Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "setupReactContext"); synchronized (mReactContextLock) { mCurrentReactContext = Assertions.assertNotNull(reactContext); - } - CatalystInstance catalystInstance = - Assertions.assertNotNull(reactContext.getCatalystInstance()); - - catalystInstance.initialize(); - mDevSupportManager.onNewReactContextCreated(reactContext); - mMemoryPressureRouter.addMemoryPressureListener(catalystInstance); - moveReactContextToCurrentLifecycleState(); - - ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_START); - synchronized (mAttachedRootViews) { - for (ReactRootView rootView : mAttachedRootViews) { - attachRootViewToInstance(rootView); + CatalystInstance catalystInstance = + Assertions.assertNotNull(reactContext.getCatalystInstance()); + + catalystInstance.initialize(); + mDevSupportManager.onNewReactContextCreated(reactContext); + mMemoryPressureRouter.addMemoryPressureListener(catalystInstance); + moveReactContextToCurrentLifecycleState(); + + ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_START); + synchronized (mAttachedRootViews) { + for (ReactRootView rootView : mAttachedRootViews) { + attachRootViewToInstance(rootView); + } } + ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_END); } - ReactMarker.logMarker(ATTACH_MEASURED_ROOT_VIEWS_END); ReactInstanceEventListener[] listeners = new ReactInstanceEventListener[mReactInstanceEventListeners.size()]; From b3b67499dd4bf4e31fe1231a6c323211483f4e7b Mon Sep 17 00:00:00 2001 From: Ram N Date: Wed, 31 Oct 2018 20:03:20 -0700 Subject: [PATCH 020/290] Add tracing for loading .so files during startup Summary: During RN's startup, libfbjs-slow.so file is loaded when it is injected into FBReactInstanceHolder. This initialization takes a while, and has usually been showing up as a blank under `FBReactInstanceHolder`. By adding Systrace and QPL, we can estimate how long this takes. Traces will also be useful as we start optimizing this. Reviewed By: ejanzer Differential Revision: D5950803 fbshipit-source-id: 711c1d6c16e0f3d5c2dc23606be4e73880152b17 --- .../java/com/facebook/react/bridge/ReactMarkerConstants.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java index d8e03fc957485d..3c3aa74a2849ee 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java @@ -89,4 +89,6 @@ public enum ReactMarkerConstants { REGISTER_JS_SEGMENT_STOP, VM_INIT, ON_FRAGMENT_CREATE, + JAVASCRIPT_EXECUTOR_FACTORY_INJECT_START, + JAVASCRIPT_EXECUTOR_FACTORY_INJECT_END, } From 58732a88b629b40b2d223a76fac46ecee5ae7295 Mon Sep 17 00:00:00 2001 From: Ignacio Olaciregui Date: Wed, 31 Oct 2018 21:10:19 -0700 Subject: [PATCH 021/290] Remove undefined value on init cli command (#22045) Summary: Fixes `undefined` description message when running `react-native init --help` on an existing React Native project. Pull Request resolved: https://github.com/facebook/react-native/pull/22045 Differential Revision: D12878956 Pulled By: TheSavior fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f --- local-cli/cliEntry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-cli/cliEntry.js b/local-cli/cliEntry.js index e2f78eb9dc0386..e53356220d9793 100644 --- a/local-cli/cliEntry.js +++ b/local-cli/cliEntry.js @@ -60,7 +60,7 @@ function printHelpInformation() { let output = [ '', chalk.bold(chalk.cyan(` react-native ${cmdName} ${this.usage()}`)), - ` ${this._description}`, + this._description ? ` ${this._description}` : '', '', ...sourceInformation, ` ${chalk.bold('Options:')}`, From b40e23dee5a9a563ca46a0a90d42f998fb2c3f38 Mon Sep 17 00:00:00 2001 From: Dulmandakh Date: Wed, 31 Oct 2018 21:40:35 -0700 Subject: [PATCH 022/290] bump buck to 2018.10.29.01. fixes Android CI (#22049) Summary: Bump buck to latest or 2018.10.29.01, which will fix Android CI. Pull Request resolved: https://github.com/facebook/react-native/pull/22049 Differential Revision: D12879205 Pulled By: TheSavior fbshipit-source-id: 5d196fba38cb27266cadbebae00367aa773751ca --- .circleci/config.yml | 8 ++++---- ContainerShip/Dockerfile.android-base | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 89fe32f77d405c..777f0221192f41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,13 +57,13 @@ aliases: - &restore-cache-downloads-buck keys: - - v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}} - - v3-buck-v2018.07.23.01- + - v3-buck-v2018.10.29.01-{{ checksum "scripts/circleci/buck_fetch.sh" }}} + - v3-buck-v2018.10.29.01- - &save-cache-downloads-buck paths: - ~/buck - ~/okbuck - key: v3-buck-v2018.07.23.01-{{ checksum "scripts/circleci/buck_fetch.sh" }} + key: v3-buck-v2018.10.29.01-{{ checksum "scripts/circleci/buck_fetch.sh" }} - &restore-cache-watchman keys: @@ -132,7 +132,7 @@ aliases: name: Install BUCK command: | if [[ ! -e ~/buck ]]; then - git clone https://github.com/facebook/buck.git ~/buck --branch v2018.07.23.01 --depth=1 + git clone https://github.com/facebook/buck.git ~/buck --branch v2018.10.29.01 --depth=1 fi cd ~/buck && ant buck --version diff --git a/ContainerShip/Dockerfile.android-base b/ContainerShip/Dockerfile.android-base index 560a2c461283b0..9444f2b7136f27 100644 --- a/ContainerShip/Dockerfile.android-base +++ b/ContainerShip/Dockerfile.android-base @@ -25,7 +25,7 @@ LABEL maintainer="Héctor Ramos " ARG SDK_VERSION=sdk-tools-linux-3859397.zip ARG ANDROID_BUILD_VERSION=27 ARG ANDROID_TOOLS_VERSION=27.0.3 -ARG BUCK_VERSION=v2018.07.23.01 +ARG BUCK_VERSION=v2018.10.29.01 ARG NDK_VERSION=17c ARG NODE_VERSION=8.10.0 ARG WATCHMAN_VERSION=4.9.0 From 66aba092514abd2b278a4fb66c30abffbdd5d5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 31 Oct 2018 22:28:54 -0700 Subject: [PATCH 023/290] jest: upgrade to 24.0.0-alpha.4 Summary: Upgrade Jest to 24.0.0-alpha.4 Reviewed By: mjesun Differential Revision: D12822581 fbshipit-source-id: 6e547ffbd2c3c4f93b8aa540d22dd666582d3f1e --- package.json | 4 +- yarn.lock | 424 +++++++++++++++++++++++++++------------------------ 2 files changed, 230 insertions(+), 198 deletions(-) diff --git a/package.json b/package.json index 9751c062fec866..0a3b6b352d6373 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ "opn": "^3.0.2", "optimist": "^0.6.1", "plist": "^3.0.0", - "pretty-format": "^23.4.1", + "pretty-format": "24.0.0-alpha.4", "promise": "^7.1.1", "prop-types": "^15.5.8", "react-clone-referenced-element": "^1.0.1", @@ -218,7 +218,7 @@ "eslint-plugin-react": "7.8.2", "eslint-plugin-react-native": "3.5.0", "flow-bin": "^0.84.0", - "jest": "24.0.0-alpha.2", + "jest": "24.0.0-alpha.4", "jest-junit": "5.1.0", "prettier": "1.13.6", "react": "16.6.0-alpha.8af6728", diff --git a/yarn.lock b/yarn.lock index 5abd8424680bff..236d79a0a142df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1055,13 +1055,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.0.0-alpha.2.tgz#0b8873d133f9bb3d6831079886037252855315f7" - integrity sha512-3XDrB1kDB1gOySm3mZ/Zwh8oSPN0limFxLYtsje8Fh8E2jb/pxPDNkdgFdfAWpgokGHi896+z/u0QjpQ/q7Y6g== +babel-jest@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.0.0-alpha.4.tgz#e03318023fb23c7646d4ffec97cec8b9034d5e5c" + integrity sha512-Z+KXWy+12w8h87l7G0muSDNh3XNclze3ohRpD0hqBypwZRUgX/755RYW6MpZhxSgHC1de3d9lUnYR016al0bfg== dependencies: babel-plugin-istanbul "^4.1.6" - babel-preset-jest "^24.0.0-alpha.2" + babel-preset-jest "^24.0.0-alpha.4" babel-messages@^6.23.0: version "6.23.0" @@ -1080,10 +1080,10 @@ babel-plugin-istanbul@^4.1.6: istanbul-lib-instrument "^1.10.1" test-exclude "^4.2.1" -babel-plugin-jest-hoist@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.0.0-alpha.2.tgz#b2e53c9e09a96a34c23072ea4ca8c498e0428670" - integrity sha512-lj+zLXu4ixXZhmjQxc4ZTo1Nhhb2Jx3mdUDMFdV8iAlURVAJiiP8bAnbVmOGxn7uMBhsTWtDOfHaAvKRMUQp3g== +babel-plugin-jest-hoist@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.0.0-alpha.4.tgz#4fcb1369b3814f98496153c86946916c22d0a0aa" + integrity sha512-7xF5AEQCJXqT4rRvIK/tUnAAa4OCk62yiemep61qNgyTlGJNeS/SC1CecPOkV0KEhRrVZOhwLScHXAUWxaYagg== babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" @@ -1129,12 +1129,12 @@ babel-preset-fbjs@^3.0.0, babel-preset-fbjs@^3.0.1: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.0.0-alpha.2.tgz#ff1ab8b9830255ad2dbbc7b4648bf462fc805050" - integrity sha512-+Ir4ca+vhL+XN1T9CchVUW/kIqVvkYrXMesAtsHVro12/Y1cmO3RvKUxgljRTq5mPOC9p8h57j9NC61wpsuEzQ== +babel-preset-jest@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.0.0-alpha.4.tgz#2f704b57695d801d1622fb809355a426c5ff0556" + integrity sha512-4/TENlz9eSYPTFBWGsJ8Ezpoj77BkFtIJz2tT7EykfFbbh1OwPoc97+JcFWd0HUtOrKf7SYoT3DW2Adc7XveuA== dependencies: - babel-plugin-jest-hoist "^24.0.0-alpha.2" + babel-plugin-jest-hoist "^24.0.0-alpha.4" babel-plugin-syntax-object-rest-spread "^6.13.0" babel-register@^6.26.0: @@ -2282,17 +2282,17 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -expect@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.0.0-alpha.2.tgz#b54ed8cd90a1963de1783850bd7e8dcfd460d9f2" - integrity sha512-rcEeMPV1LtJo+oE8nAEs1x7pcPqBgzhlrzsdthndHrVm5CVpkjQz0T/F6WibmAIF1gu8Yuh9exrv1rD0yjDX6Q== +expect@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.0.0-alpha.4.tgz#f7d05692668b40983d2affdcf600743a726c9c8d" + integrity sha512-7geaVKj1pxwgNuKXV1osvcCRWPZMrJeWMa5jv6kCJHLjtLwz3yUuGdfVUIL/3JSFVchG3h9nZpE7RNYiAFxpTw== dependencies: ansi-styles "^3.2.0" - jest-diff "^24.0.0-alpha.2" - jest-get-type "^24.0.0-alpha.2" - jest-matcher-utils "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-regex-util "^24.0.0-alpha.2" + jest-diff "^24.0.0-alpha.4" + jest-get-type "^24.0.0-alpha.4" + jest-matcher-utils "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-regex-util "^24.0.0-alpha.4" extend-shallow@^1.1.2: version "1.1.4" @@ -3386,18 +3386,18 @@ istanbul-reports@^1.5.1: dependencies: handlebars "^4.0.3" -jest-changed-files@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.0.0-alpha.2.tgz#64aaa9a493f98919824c5fa05696f318ca0abeb6" - integrity sha512-QyV/Fa9wxBALp99pojvAu3jNpCyWkoNciatc5U/5wGLbyFbSYruGs6LG8uVtSJNdDKRh2PssAnzTBWTmVBXajg== +jest-changed-files@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.0.0-alpha.4.tgz#ffcc670aa1734c2d064d7d6c79851da8ca6a563d" + integrity sha512-UySN8v8OmcN4QL4zJAjL0EE8wqvltwKH69tKzrbAb7Mj1IuOBdlvccJUoDnKg9MkVAbVqk/3/sgn28tWFf7prg== dependencies: execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.0.0-alpha.2.tgz#c294d359b5c478b995d02ed3a17a7b313d548d62" - integrity sha512-TDJOTMxuDh/6Zpk8dDmXY1D6H9DZ+i1KaN/7wW1fsr3+9g1Jru639tS2fHvxC+qbRk6F/rvaTSeM+pub5+ZP9A== +jest-cli@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.0.0-alpha.4.tgz#a91c843b6e53f6a8f953813b704dd12411c98e9c" + integrity sha512-eRjpuLgY2pPPJLFAZ7sLQE9k250Or/HiLZmsmgku4zVV9pHj/LAJzm7S74HOwv+JWexsFqKiYRgW8PrIFWoNNw== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -3410,21 +3410,21 @@ jest-cli@^24.0.0-alpha.2: istanbul-lib-coverage "^1.2.0" istanbul-lib-instrument "^1.10.1" istanbul-lib-source-maps "^1.2.4" - jest-changed-files "^24.0.0-alpha.2" - jest-config "^24.0.0-alpha.2" - jest-environment-jsdom "^24.0.0-alpha.2" - jest-get-type "^24.0.0-alpha.2" - jest-haste-map "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-regex-util "^24.0.0-alpha.2" - jest-resolve-dependencies "^24.0.0-alpha.2" - jest-runner "^24.0.0-alpha.2" - jest-runtime "^24.0.0-alpha.2" - jest-snapshot "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" - jest-validate "^24.0.0-alpha.2" - jest-watcher "^24.0.0-alpha.2" - jest-worker "^24.0.0-alpha.2" + jest-changed-files "^24.0.0-alpha.4" + jest-config "^24.0.0-alpha.4" + jest-environment-jsdom "^24.0.0-alpha.4" + jest-get-type "^24.0.0-alpha.4" + jest-haste-map "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-regex-util "^24.0.0-alpha.4" + jest-resolve-dependencies "^24.0.0-alpha.4" + jest-runner "^24.0.0-alpha.4" + jest-runtime "^24.0.0-alpha.4" + jest-snapshot "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" + jest-validate "^24.0.0-alpha.4" + jest-watcher "^24.0.0-alpha.4" + jest-worker "^24.0.0-alpha.4" micromatch "^2.3.11" node-notifier "^5.2.1" prompts "^1.1.0" @@ -3436,35 +3436,35 @@ jest-cli@^24.0.0-alpha.2: which "^1.2.12" yargs "^12.0.2" -jest-config@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.0.0-alpha.2.tgz#ba9bb40393cc6b2dfcbe7c09ad6a79a49552973b" - integrity sha512-m/pMTtOmMKdV9aPpnFrKFLU5lU+1SlnlMBI4GLKi68du3EYjjufyCMTaRLWkiZHJB8517bMXWxRwifZk5mbzxA== +jest-config@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.0.0-alpha.4.tgz#e07ba3625db86ca28ee34d9422566260a54c865f" + integrity sha512-JlGeIY4cVi+xkNSbL1+44QS6Y0fSSsv/hpLSy+Ml1ruX0cmyGVMUfsq3X5mGa+q843mW9pnkLJRuLVd7Oisuig== dependencies: babel-core "^6.0.0" - babel-jest "^24.0.0-alpha.2" + babel-jest "^24.0.0-alpha.4" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.0.0-alpha.2" - jest-environment-node "^24.0.0-alpha.2" - jest-get-type "^24.0.0-alpha.2" - jest-jasmine2 "^24.0.0-alpha.2" - jest-regex-util "^24.0.0-alpha.2" - jest-resolve "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" - jest-validate "^24.0.0-alpha.2" + jest-environment-jsdom "^24.0.0-alpha.4" + jest-environment-node "^24.0.0-alpha.4" + jest-get-type "^24.0.0-alpha.4" + jest-jasmine2 "^24.0.0-alpha.4" + jest-regex-util "^24.0.0-alpha.4" + jest-resolve "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" + jest-validate "^24.0.0-alpha.4" micromatch "^2.3.11" - pretty-format "^24.0.0-alpha.2" + pretty-format "^24.0.0-alpha.4" -jest-diff@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.0.0-alpha.2.tgz#d02c67b723e8d27c26b6614644011942c27586ef" - integrity sha512-y6Xt1ofi5M9X66XKWB2rXjrWPn2zPACONaKTiBXNFtFZVAnaQTD9og8Wm4/0cqWy5++SXrIcyQB4ZieGCvmKLA== +jest-diff@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.0.0-alpha.4.tgz#fc17a96b6143f686ad2a9977a60b62593a38e0e4" + integrity sha512-T3ZbPHcYOBCye60zjygOwbVyl83qC/MxRgi7CphRh8o+vUZ61Mr34LToLWwgRGxym1X7zI07ATuI33cdksreNw== dependencies: chalk "^2.0.1" diff "^3.2.0" - jest-get-type "^24.0.0-alpha.2" - pretty-format "^24.0.0-alpha.2" + jest-get-type "^24.0.0-alpha.4" + pretty-format "^24.0.0-alpha.4" jest-docblock@^21.0.0: version "21.2.0" @@ -3478,43 +3478,50 @@ jest-docblock@^24.0.0-alpha.2: dependencies: detect-newline "^2.1.0" -jest-each@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.0.0-alpha.2.tgz#88b66ecbb605fc5b851a3bb6009d160e6ce223f0" - integrity sha512-E/FWCg/z+XGvFTg7RuJkQcHO04I2aF8EjukEzNuj4C5t2fvP2LH73c4iosNPf+bMLWMBEu2MNTVyhpHXPssymA== +jest-docblock@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.0.0-alpha.4.tgz#883264370210bbd4dfadf9ea0bc5f89baca926c1" + integrity sha512-NQ6DsiCR6OLLZ8XI1X5E0L/WzobR1vBRbPj5GDNIseblMKtCBOsVy9tzvl3+sgLDoQcWB4GctfrBD7UM9/pItg== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.0.0-alpha.4.tgz#24e0402e631df539e93cdfbfd0641ef39b598124" + integrity sha512-tnD25TU9HmZG/+5zUnWK8nITVqqBOl037oDroHKYrgPdyJez4WbZuwkZDVotsz3rb58Y/aSaCIeRXMUX6+JIDg== dependencies: chalk "^2.0.1" - jest-util "^24.0.0-alpha.2" - pretty-format "^24.0.0-alpha.2" + jest-util "^24.0.0-alpha.4" + pretty-format "^24.0.0-alpha.4" -jest-environment-jsdom@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0-alpha.2.tgz#dde9babf0787addfc724cf4f824e77eba8075073" - integrity sha512-jbdVaq2Hdb82pCTSOvvqywChvIBgPVMrSDKhBTWaK4LMnIH4+yMjxKBMPKAzOgIEcDM2h1tAosCzzKBF0MBGZQ== +jest-environment-jsdom@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0-alpha.4.tgz#07999caaebe6e6b76de9f10cb583b8c113b8d326" + integrity sha512-W+fRQiUChrsuzqn6SiC4FGsfq81sCjsQgBN5k/uLEaP/xYf+ZgtBcYGwT86X1xTYxhP2p16IfezYbkbZwIF6Ug== dependencies: - jest-mock "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" + jest-mock "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" jsdom "^11.5.1" -jest-environment-node@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.0.0-alpha.2.tgz#41abe9524393c34128d8684aa9976b56550117f9" - integrity sha512-joIwQyftWBGkGdCg4XsaxgoXnHoCMXBBdE9V2pKp3bgRx7DlNs9AwC1cPMMfBj5NTlPclfE1tTemxC6zEuAA+w== +jest-environment-node@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.0.0-alpha.4.tgz#7eb4922a1dd9def27cc323b3404873e0d73e79b7" + integrity sha512-+mXkdhFzr8LBlfGRGczlcgwBPQI7RIzQWR+bYRB2lkCB6DP8cZoYApUBHjcE9JlPU56LFGcm+GrZFfdTILqFcQ== dependencies: - jest-mock "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" + jest-mock "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== -jest-get-type@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0-alpha.2.tgz#458f787989bc678107b5923dc862d36269b45d0c" - integrity sha512-LFVJsgKfBCnxlwJNtFNwn4BRWsCgszlae86a53viD0swWFNiG431BmNz1xaBKe2VWxXd18jewnowkxtxpulg5w== +jest-get-type@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0-alpha.4.tgz#2cef0446d2777229c0c2fa327d0da50507adc037" + integrity sha512-MCjKloodDPKLKCJ9yQ72n+PtJtwSAUG5JRBeSWEXF7DEO2GqwYW/nY94UdmEbug0oc+oxNzsAxNMy7nluWS/Jw== -jest-haste-map@24.0.0-alpha.2, jest-haste-map@^24.0.0-alpha.2: +jest-haste-map@24.0.0-alpha.2: version "24.0.0-alpha.2" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0-alpha.2.tgz#bc1d498536c395699a44b1e61a3e901c95a2e5a6" integrity sha512-FTSIbJdmaddjgpcaXOq+sPGegcE28w7uOHonpsCuEwBQcB0REhkNYY9Wj/e1w+q3SBmEK1++ChgTMEXEzAf0yQ== @@ -3528,23 +3535,36 @@ jest-haste-map@24.0.0-alpha.2, jest-haste-map@^24.0.0-alpha.2: micromatch "^2.3.11" sane "^3.0.0" -jest-jasmine2@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.0.0-alpha.2.tgz#4f19e609cbd2856aabd7af381834ecb3905277fc" - integrity sha512-Z+JpMUz5hITpaxbpHq/Nb09gtyPL0Uz9Futn4lTD3VElplfvPtIZQ0y16Nj6J3+zvurqEx0+kQl9WHY/y+0fFQ== +jest-haste-map@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0-alpha.4.tgz#209c13e79a09b4d380d6c46ab12ecc82f02b84ff" + integrity sha512-I2KD+LkcXjQHrPadfE5jx4AQmnxrpziV9NQIrFbytClRJtBKsloL+DlfPdn2sAIIF7y34irlUSB7aybTgxev7A== + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + invariant "^2.2.4" + jest-serializer "^24.0.0-alpha.4" + jest-worker "^24.0.0-alpha.4" + micromatch "^2.3.11" + sane "^3.0.0" + +jest-jasmine2@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.0.0-alpha.4.tgz#ce4e24cb1257c6e64e54e6632e74feeb1bb1c3f2" + integrity sha512-LMdRgseO5qU6fEe3LFhPVk6+F5Jn7z1nfKoVvzjPsHJZ0EPwpob7y1VV9pG4riMZkDGpFsAdHOGziaD5/pgnqg== dependencies: babel-traverse "^6.0.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.0.0-alpha.2" + expect "^24.0.0-alpha.4" is-generator-fn "^1.0.0" - jest-diff "^24.0.0-alpha.2" - jest-each "^24.0.0-alpha.2" - jest-matcher-utils "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-snapshot "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" - pretty-format "^24.0.0-alpha.2" + jest-diff "^24.0.0-alpha.4" + jest-each "^24.0.0-alpha.4" + jest-matcher-utils "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-snapshot "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" + pretty-format "^24.0.0-alpha.4" jest-junit@5.1.0: version "5.1.0" @@ -3556,26 +3576,26 @@ jest-junit@5.1.0: strip-ansi "^4.0.0" xml "^1.0.1" -jest-leak-detector@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.0.0-alpha.2.tgz#a288994d86c619da75f9e7d143d5cecd6f069279" - integrity sha512-o3bWxt1XAKXCu1dkUOtaKcg4Dfv3XiBNImat0Q4uVZrvuEHw2c+mUQl80q6gsWveC/L9Esv6/VF6IHnq8tmmow== +jest-leak-detector@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.0.0-alpha.4.tgz#a14886af34e0f54c5ae84a58a07e96c353d1c190" + integrity sha512-IsHvueFwNqIc/VWk7V+yox21vGnWZz/6idEqcQAm1aZaVaydmMz3hB/YmvyhiE+qZaQF7HlyvbdS+FJkbaD1iA== dependencies: - pretty-format "^24.0.0-alpha.2" + pretty-format "^24.0.0-alpha.4" -jest-matcher-utils@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.0.0-alpha.2.tgz#fb6200efb91047eac00dff47ac39e2bef1e66848" - integrity sha512-XmH4J0s9ujZ3++4nWuMUakcUgrXSN1e/2JkrWbHwK9f3GxhQHcwmt79IWdpsPL4fHqj2XEePz9xJ3C+0zrg09w== +jest-matcher-utils@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.0.0-alpha.4.tgz#a3d4246ef5c8a05097c7df5dfc3bdf36134a9fbb" + integrity sha512-gBDcpSg+4EyYodQV12gVSOPYBcgBE5W+gBmsaMOqHtVQNYvORu9JSK4zeBbR/amC5z1rIsMXOCXRMbN2QepXMA== dependencies: chalk "^2.0.1" - jest-get-type "^24.0.0-alpha.2" - pretty-format "^24.0.0-alpha.2" + jest-get-type "^24.0.0-alpha.4" + pretty-format "^24.0.0-alpha.4" -jest-message-util@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.0.0-alpha.2.tgz#cb2663aa305632466312b21c214d1b8ac9c8ed7b" - integrity sha512-Cs58En85ptDD9JS5M2B304dxesxLdN03Fxgt2+LiinZog3CU7nqmL8j1ftrN6SJO1pddwF7EqEGFDodqYNlujA== +jest-message-util@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.0.0-alpha.4.tgz#e0d4511ef7f94e4bae89aef5f818ffbc6271a51a" + integrity sha512-K3kh0/SL/0/eZQcKwO96d9toQU2IWRKaYxulb8qWMbEnpW2wjBVB8trMU/3r408knVPesKoxPU4V5VdM5xr53g== dependencies: "@babel/code-frame" "^7.0.0" chalk "^2.0.1" @@ -3583,56 +3603,56 @@ jest-message-util@^24.0.0-alpha.2: slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.0.0-alpha.2.tgz#ec10f9775a193269e3f6c1329a6878d2a0e1760a" - integrity sha512-bVODa5INKP+TtuEtxjMZvlnind0mnRZ5DBTSAtPFstqWKN3M6H4xPSD/N2UHWlHG6oZAzEJcxJokTZnfGJ1VIw== +jest-mock@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.0.0-alpha.4.tgz#ec74931dedf61885830fb0ae39350438b29beab9" + integrity sha512-sImD6rT87SNuIhnUvS8e+lSCuaGAJcpGOqZFE2epXelGqhqriYLViMC5eP5b1az5D1CaOkQWx2AZAQg8mGfKtw== -jest-regex-util@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.0.0-alpha.2.tgz#ade43ddb38650c3a209daa55b93da21b38c5afff" - integrity sha512-cbw6z9wNOjCXyRc8aql2ngOTZ9uEwfhZcaHamy49r7wwdL5+sDTUDezh2erVE/P9BC0kLHzcdmM2j/db/LmVwA== +jest-regex-util@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.0.0-alpha.4.tgz#acbac6df4d895a9d3008595efbac5f759b9f69c3" + integrity sha512-zjkN2+Ue4ryS9n7OCXshqtG/oa3f4xXqOeSyxoTmGl5vQ/zAurlHnKA/x54BZtgwFxWLumEuNeyDX85sakwItQ== -jest-resolve-dependencies@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.0.0-alpha.2.tgz#31628d640a9572d7a47999f39249c14cc2e9970b" - integrity sha512-CIAxN1ZGSCfufigepCMDdFRJeHcw+agdHCFbte8NAfpd5YGBz2PWFfNm2Ah2/Lm1aV5eKPvrPqyEA7WL7B0PEg== +jest-resolve-dependencies@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.0.0-alpha.4.tgz#4b9bebc99a87d1f03c6fa54904f48a785bd00d80" + integrity sha512-0Le1dW8eOsMbMpiMCg9blxoRNzwhqZKEjuvE6hT+msZQNdiHbPS9qqCnUGPs6SHLuIWTB3qKGEgjsJHDrckSBg== dependencies: - jest-regex-util "^24.0.0-alpha.2" - jest-snapshot "^24.0.0-alpha.2" + jest-regex-util "^24.0.0-alpha.4" + jest-snapshot "^24.0.0-alpha.4" -jest-resolve@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.0.0-alpha.2.tgz#1dfa31b4a4013c9bac81d402fceb9185d9a965da" - integrity sha512-+yuWdnRba3DRL606IVfqEWNe+VfpQeeky9Jw9CgfxrocX81by4mOrbcRyTfPv9CzUKftONRJgECym+Tj5ETJkw== +jest-resolve@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.0.0-alpha.4.tgz#9073d5635d1088fa01b1239be8e45ffca567b50d" + integrity sha512-oXqZgPErAVz6QRRQBshPcOpd8d4z9lyEuxoS4+6ifcw0x3bWu0u50fhqqivJrBcX195Ul1kUgsE8zHisQEG6UA== dependencies: browser-resolve "^1.11.3" chalk "^2.0.1" realpath-native "^1.0.0" -jest-runner@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.0.0-alpha.2.tgz#e5ee26ec9f18e9baa1bd49d939b6a82699f412d0" - integrity sha512-eye9Hq21JnDVGpoxW7LXV2SfcO3Q7cc1r3hNkXdtcVQ9TcokNzun7hHgx1/FtzKdX/YR5pKNRu2EUsVvzeaOkA== +jest-runner@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.0.0-alpha.4.tgz#6134e33d75aa26acff07d3ec71a892f8cc1c581a" + integrity sha512-HYlraLrQs2mwAQSJM02ozNWDjTXxpIj8QxcMgXhZkfD32VNrR6PR+/c1d76hQ2S0Y6NEkPonesG5fM3l0uV/YA== dependencies: exit "^0.1.2" graceful-fs "^4.1.11" - jest-config "^24.0.0-alpha.2" - jest-docblock "^24.0.0-alpha.2" - jest-haste-map "^24.0.0-alpha.2" - jest-jasmine2 "^24.0.0-alpha.2" - jest-leak-detector "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-runtime "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" - jest-worker "^24.0.0-alpha.2" + jest-config "^24.0.0-alpha.4" + jest-docblock "^24.0.0-alpha.4" + jest-haste-map "^24.0.0-alpha.4" + jest-jasmine2 "^24.0.0-alpha.4" + jest-leak-detector "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-runtime "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" + jest-worker "^24.0.0-alpha.4" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.0.0-alpha.2.tgz#2578d32dfc89db6f45b941f6953615ed7210230d" - integrity sha512-OerLEl2ZInjYjzpnDceXI7KiOHoHjxlEH/qGMrud5Twq8/wTIB+d0i4LnrH1paspJQiPeo8Kyspbuygk771AUQ== +jest-runtime@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.0.0-alpha.4.tgz#f8cb479c5a21a4ec23eadf3d3993afd4778e9a0a" + integrity sha512-3SjUWFB3U6WrhK5Av0kCTZLTI+wjvjDsYVwsE8EeTRt9kGnELm+WezUQuHtKSun0Ygvi0xZLdAl/E0X1hHaeow== dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.1.6" @@ -3642,14 +3662,14 @@ jest-runtime@^24.0.0-alpha.2: fast-json-stable-stringify "^2.0.0" glob "^7.1.3" graceful-fs "^4.1.11" - jest-config "^24.0.0-alpha.2" - jest-haste-map "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-regex-util "^24.0.0-alpha.2" - jest-resolve "^24.0.0-alpha.2" - jest-snapshot "^24.0.0-alpha.2" - jest-util "^24.0.0-alpha.2" - jest-validate "^24.0.0-alpha.2" + jest-config "^24.0.0-alpha.4" + jest-haste-map "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-regex-util "^24.0.0-alpha.4" + jest-resolve "^24.0.0-alpha.4" + jest-snapshot "^24.0.0-alpha.4" + jest-util "^24.0.0-alpha.4" + jest-validate "^24.0.0-alpha.4" micromatch "^2.3.11" realpath-native "^1.0.0" slash "^2.0.0" @@ -3662,32 +3682,37 @@ jest-serializer@24.0.0-alpha.2, jest-serializer@^24.0.0-alpha.2: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0-alpha.2.tgz#adcaa73ef49e56377f7fada19921c300b576e7f9" integrity sha512-jLHHT71gyYdgMH5sFWP/e8bZjq/TC5iz9DQZlLsRE/7Er//m8WqyiNJs022FEc18PLq3jyk/z06N0xS6YlbsUA== -jest-snapshot@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.0.0-alpha.2.tgz#5ff8954dc1b9ce12dd44e85d9c2982ddc05d4111" - integrity sha512-xwHAPn2UFI0Zjx9MyhcYYrtOiSIwbh9HBh0nwNKCcFfnE4ZoZ1C87/uEkrJfdcRNhzF80C6ghEmh1EYeMXLAcg== +jest-serializer@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0-alpha.4.tgz#939c31155b95bebc1ef6f76ae34dbf2c06046e52" + integrity sha512-g/hO2JM6c96wGzbiQNdbOrLlx8p+cA8W8+EwFkKtUlWcmBCxbsZb8TaIK2FLfvxCTKPwMhBujhw46GM5WppAsQ== + +jest-snapshot@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.0.0-alpha.4.tgz#be3d515a38cd75021d2814bc59fdc1dce03f58b8" + integrity sha512-RnNyMfG7Esgykkru9n9BBlR6CiXEdvrdiZSw2+i3LKw7rO5/jjG4w2SDcTM/Rh2j6EEhWQn5Fhr7T/PAUNybiw== dependencies: babel-types "^6.0.0" chalk "^2.0.1" - jest-diff "^24.0.0-alpha.2" - jest-matcher-utils "^24.0.0-alpha.2" - jest-message-util "^24.0.0-alpha.2" - jest-resolve "^24.0.0-alpha.2" + jest-diff "^24.0.0-alpha.4" + jest-matcher-utils "^24.0.0-alpha.4" + jest-message-util "^24.0.0-alpha.4" + jest-resolve "^24.0.0-alpha.4" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.0.0-alpha.2" + pretty-format "^24.0.0-alpha.4" semver "^5.5.0" -jest-util@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.0.0-alpha.2.tgz#21cdbc492daf3b2c481c0f8fc577b78d0ecdc525" - integrity sha512-oBIe0Xc5WIHdmYIijxtmEb039bfAU17BcSOqhey8VsnVkRyCkRlbnnBn4oMZtQLgPta/4Kyeb2APx1Uh3MYbrA== +jest-util@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.0.0-alpha.4.tgz#0021abb2b09c1fea68dc748f6bf3eb93789b5cb4" + integrity sha512-2NYByhPpApO3BwtdWFxhOzjUl70EU5yRtJiqRv3dbsjIKV9pRPdvHUr7miz0GsZkeUyCehrzwJgaWL5iNa3T5Q== dependencies: callsites "^2.0.0" chalk "^2.0.1" graceful-fs "^4.1.11" is-ci "^1.0.10" - jest-message-util "^24.0.0-alpha.2" + jest-message-util "^24.0.0-alpha.4" mkdirp "^0.5.1" slash "^2.0.0" source-map "^0.6.0" @@ -3702,20 +3727,20 @@ jest-validate@^23.0.1: leven "^2.1.0" pretty-format "^23.6.0" -jest-validate@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0-alpha.2.tgz#b9f6a7299cc47cf54339da1828378fe3b51704fc" - integrity sha512-nr6kR7e+eYlgUpRU7AX51wDeDp0Qih9h5Wn3o+j6+9y/htS9ZiFP8gtkvsNZPpqEP5QNbPyexfhJ/o8Z5gcWcA== +jest-validate@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0-alpha.4.tgz#c66cc7d771a17c6441e31d0d4f26f71090e88e47" + integrity sha512-zgkrTlFv0mQjbxAGus2GXEfgZex3iIlZ2xEq/rZqZ3np/cegDPotlC6MckmSRLqHFAzrwe3SRrreXZUSApHJGQ== dependencies: chalk "^2.0.1" - jest-get-type "^24.0.0-alpha.2" + jest-get-type "^24.0.0-alpha.4" leven "^2.1.0" - pretty-format "^24.0.0-alpha.2" + pretty-format "^24.0.0-alpha.4" -jest-watcher@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.0.0-alpha.2.tgz#06db9a092d8755e8ec5c57f3329bd83e38324c08" - integrity sha512-pxm9ARxD8ZwpKxPGd/I7h42d+BLjKxw/i5ZK6Wae0JVKzZJH11J1Nr21BTSWBJa7GPmOoTB6iaEaFdo9UVy5Ww== +jest-watcher@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.0.0-alpha.4.tgz#71ac48ccb510cedaaa1156a637a1bacdc837fdf8" + integrity sha512-RDL1n5BAbnseRTZQDAlBoLmjla3sDx1LQuadFa7a73ujxPG9nQyDusVAnVf8JU684zlNMNpQ4BdK50GAQZW0TQ== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -3728,13 +3753,20 @@ jest-worker@24.0.0-alpha.2, jest-worker@^24.0.0-alpha.2: dependencies: merge-stream "^1.0.1" -jest@24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.0.0-alpha.2.tgz#c9a78450014f9c55b91d273a2ebe2882e1a94e28" - integrity sha512-aW6GFoAW18YcyYpa+L7eT0q6HMtvUPfwhhgFI0LYYPTS5Nbzoal0QprDJmQBE97KVcl6a/rEiSlcde9UcBMR2g== +jest-worker@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0-alpha.4.tgz#6766d11b66e7b2d61f79711d159125657084d021" + integrity sha512-kZYIxqwkvaQggTBiOnoGoI7pyHAsCgFg+1C9NCSpkaQOLQ/MpEdY6cTPTbLwWdtzSloWnECAAj8p9es2VLQd/Q== + dependencies: + merge-stream "^1.0.1" + +jest@24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.0.0-alpha.4.tgz#fc57357ec1a4e12700616569f2ec1b3d2ab3c87f" + integrity sha512-peUdEeRk23o1ntvnoQc6CqOrhIlqXMK88tXXf/MepL6uK17+w2paC+ut0KpdAJ4rNAIoIlN8TLyXspiFDM3w0w== dependencies: import-local "^2.0.0" - jest-cli "^24.0.0-alpha.2" + jest-cli "^24.0.0-alpha.4" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -5044,6 +5076,14 @@ prettier@1.13.6: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.6.tgz#00ae0b777ad92f81a9e7a1df2f0470b6dab0cb44" integrity sha512-p5eqCNiohWZN++7aJXUVj0JgLqHCPLf9GLIcLBHGNWs4Y9FJOPs6+KNO2WT0udJIQJTbeZFrJkjzjcb8fkAYYQ== +pretty-format@24.0.0-alpha.4, pretty-format@^24.0.0-alpha.4: + version "24.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0-alpha.4.tgz#cc1f7497e2496b71f8ad99f1526096e515fada03" + integrity sha512-icvbBt3XlLEVqPHdHwR2Ou9+hezS9Eccd+mA+fXfOU7T9t7ClOpq2HgCwlyw+3WogccCubKWnmzyrA/3ZZ/aOA== + dependencies: + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + pretty-format@^23.4.1, pretty-format@^23.6.0: version "23.6.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" @@ -5052,14 +5092,6 @@ pretty-format@^23.4.1, pretty-format@^23.6.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-format@^24.0.0-alpha.2: - version "24.0.0-alpha.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0-alpha.2.tgz#cbcd7609a4e594c478f46aa1b6d652d285342671" - integrity sha512-mqFCjVVaBk00XB6V3BPrH7WAwOimfLMDjj1YDpSmV8BlDkEcTtQU/Qu6KDTsSi7lYjzHzZp8+NsmeMXw/6Cl4A== - dependencies: - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" From 136dfc831230e5418db02d1202e60d23a95c17b6 Mon Sep 17 00:00:00 2001 From: Evan Worley Date: Thu, 1 Nov 2018 09:49:13 -0700 Subject: [PATCH 024/290] Flow strictifying AdsManagerAudienceImages.js Reviewed By: gkz Differential Revision: D10414273 fbshipit-source-id: 24c7e8955d78aeede8b0644cc9934e0b7fb5aa27 --- Libraries/ART/ReactNativeART.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Libraries/ART/ReactNativeART.js b/Libraries/ART/ReactNativeART.js index 12af4f0b2edc08..ae2d0e58a377ee 100644 --- a/Libraries/ART/ReactNativeART.js +++ b/Libraries/ART/ReactNativeART.js @@ -399,7 +399,19 @@ function extractStrokeJoin(strokeJoin) { // Note: ART has a notion of width and height on Shape but AFAIK it's a noop in // ReactART. -class Shape extends React.Component { +export type ShapeProps = {| + fill?: mixed, + stroke?: mixed, + strokeCap?: mixed, + strokeDash?: mixed, + strokeJoin?: mixed, + strokeWidth?: mixed, + x?: number, + y?: number, + opacity?: mixed, +|}; + +class Shape extends React.Component { render() { const props = this.props; const path = props.d || childrenAsString(props.children); From ae8ec39397cefa66f11432b50ad0632966943f31 Mon Sep 17 00:00:00 2001 From: Ignacio Olaciregui Date: Thu, 1 Nov 2018 14:27:00 -0700 Subject: [PATCH 025/290] Fix linting issues (#22062) Summary: Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes. I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input. Pull Request resolved: https://github.com/facebook/react-native/pull/22062 Differential Revision: D12889447 Pulled By: TheSavior fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50 --- .../run-android-ci-instrumentation-tests.js | 3 +-- Libraries/Animated/src/bezier.js | 2 +- Libraries/Animated/src/nodes/AnimatedValue.js | 1 - .../Keyboard/KeyboardAvoidingView.js | 2 +- .../Components/Touchable/TouchableOpacity.js | 2 +- Libraries/Components/WebView/WebView.ios.js | 1 - Libraries/Experimental/Incremental.js | 5 ++--- .../SwipeableRow/SwipeableFlatList.js | 1 - Libraries/Image/Image.android.js | 2 +- Libraries/Image/Image.ios.js | 2 +- Libraries/Lists/VirtualizedList.js | 2 +- Libraries/Modal/Modal.js | 1 - Libraries/ReactNative/UIManager.js | 4 +++- Libraries/Utilities/setAndForwardRef.js | 2 -- Libraries/polyfills/babelHelpers.js | 2 ++ Libraries/polyfills/console.js | 2 +- .../RNTesterUnitTestsBundle.js | 2 +- RNTester/e2e/sanity.test.js | 4 ++-- RNTester/js/ARTExample.js | 2 +- RNTester/js/AsyncStorageExample.js | 4 ++-- RNTester/js/XHRExampleFormData.js | 2 -- .../src/androidTest/js/TestIdTestModule.js | 1 - bots/dangerfile.js | 4 +--- local-cli/generator/promptSync.js | 22 +++++++------------ .../link/__tests__/ios/writePlist.spec.js | 2 +- local-cli/link/ios/copyAssets.js | 1 - local-cli/link/ios/unregisterNativeModule.js | 1 - .../templates/HelloWorld/__tests__/App.js | 2 +- local-cli/upgrade/upgrade.js | 2 -- scripts/try-n-times.js | 2 -- 30 files changed, 32 insertions(+), 53 deletions(-) diff --git a/ContainerShip/scripts/run-android-ci-instrumentation-tests.js b/ContainerShip/scripts/run-android-ci-instrumentation-tests.js index e538be7a6a9318..a788bf19b80a26 100644 --- a/ContainerShip/scripts/run-android-ci-instrumentation-tests.js +++ b/ContainerShip/scripts/run-android-ci-instrumentation-tests.js @@ -38,7 +38,7 @@ const test_opts = { PATH: argv.path || './ReactAndroid/src/androidTest/java/com/facebook/react/tests', RETRIES: parseInt(argv.retries || 2, 10), - TEST_TIMEOUT: parseInt(argv['test-timeout'] || 1000 * 60 * 10), + TEST_TIMEOUT: parseInt(argv['test-timeout'] || 1000 * 60 * 10, 10), OFFSET: argv.offset, COUNT: argv.count, @@ -68,7 +68,6 @@ testClasses = testClasses.map((clazz) => { // only process subset of the tests at corresponding offset and count if args provided if (test_opts.COUNT != null && test_opts.OFFSET != null) { - const testCount = testClasses.length; const start = test_opts.COUNT * test_opts.OFFSET; const end = start + test_opts.COUNT; diff --git a/Libraries/Animated/src/bezier.js b/Libraries/Animated/src/bezier.js index d3ea74c27f56c6..5fffd867ea9ac1 100644 --- a/Libraries/Animated/src/bezier.js +++ b/Libraries/Animated/src/bezier.js @@ -82,7 +82,7 @@ module.exports = function bezier( mX2: number, mY2: number, ) { - if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { + if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) { throw new Error('bezier x values must be in [0, 1] range'); } diff --git a/Libraries/Animated/src/nodes/AnimatedValue.js b/Libraries/Animated/src/nodes/AnimatedValue.js index 7c4fe9817f98dd..e896f660000ab2 100644 --- a/Libraries/Animated/src/nodes/AnimatedValue.js +++ b/Libraries/Animated/src/nodes/AnimatedValue.js @@ -10,7 +10,6 @@ 'use strict'; const AnimatedInterpolation = require('./AnimatedInterpolation'); -const AnimatedNode = require('./AnimatedNode'); const AnimatedWithChildren = require('./AnimatedWithChildren'); const InteractionManager = require('InteractionManager'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 46e5c2e889e883..f8c620d9a495ae 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -150,7 +150,7 @@ class KeyboardAvoidingView extends React.Component { children, contentContainerStyle, enabled, - keyboardVerticalOffset, // eslint-disable-line no-unused-vars + keyboardVerticalOffset, style, ...props } = this.props; diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 9d153a586a52d6..e5e1993c35cd36 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -247,7 +247,7 @@ const TouchableOpacity = ((createReactClass({ _getChildStyleOpacityWithDefault: function() { const childStyle = flattenStyle(this.props.style) || {}; - return childStyle.opacity == undefined ? 1 : childStyle.opacity; + return childStyle.opacity == null ? 1 : childStyle.opacity; }, render: function() { diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index f6c9295baba802..ba8034644d52a7 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -17,7 +17,6 @@ const Linking = require('Linking'); const PropTypes = require('prop-types'); const React = require('React'); const ReactNative = require('ReactNative'); -const ScrollView = require('ScrollView'); const StyleSheet = require('StyleSheet'); const Text = require('Text'); const UIManager = require('UIManager'); diff --git a/Libraries/Experimental/Incremental.js b/Libraries/Experimental/Incremental.js index b20fb543e947c5..a01bf9ae5c56f0 100644 --- a/Libraries/Experimental/Incremental.js +++ b/Libraries/Experimental/Incremental.js @@ -92,12 +92,11 @@ export type Props = { name: string, children: React.Node, }; -type DefaultProps = { - name: string, -}; + type State = { doIncrementalRender: boolean, }; + class Incremental extends React.Component { props: Props; state: State; diff --git a/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js b/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js index cf54d9d502f7f8..071ee6cdf6e3f5 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js @@ -12,7 +12,6 @@ import type {Props as FlatListProps} from 'FlatList'; import type {renderItemType} from 'VirtualizedList'; -const PropTypes = require('prop-types'); const React = require('React'); const SwipeableRow = require('SwipeableRow'); const FlatList = require('FlatList'); diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 3eda5a7c52d2ec..2930ee90728081 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -17,7 +17,7 @@ const ImageViewNativeComponent = require('ImageViewNativeComponent'); const NativeModules = require('NativeModules'); const PropTypes = require('prop-types'); const React = require('React'); -const ReactNative = require('ReactNative'); +const ReactNative = require('ReactNative'); // eslint-disable-line no-unused-vars const StyleSheet = require('StyleSheet'); const TextAncestor = require('TextAncestor'); diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 29532dea908e89..a20fd0a1206da6 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -12,7 +12,7 @@ const DeprecatedImagePropType = require('DeprecatedImagePropType'); const NativeModules = require('NativeModules'); const React = require('React'); -const ReactNative = require('ReactNative'); +const ReactNative = require('ReactNative'); // eslint-disable-line no-unused-vars const StyleSheet = require('StyleSheet'); const flattenStyle = require('flattenStyle'); diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 37c574f0555530..89df0dab803a7a 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -643,7 +643,7 @@ class VirtualizedList extends React.PureComponent { } static getDerivedStateFromProps(newProps: Props, prevState: State) { - const {data, extraData, getItemCount, maxToRenderPerBatch} = newProps; + const {data, getItemCount, maxToRenderPerBatch} = newProps; // first and last could be stale (e.g. if a new, shorter items props is passed in), so we make // sure we're rendering a reasonable range here. return { diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 28b55f91f1d2be..8e78b71c8750ff 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -20,7 +20,6 @@ const PropTypes = require('prop-types'); const StyleSheet = require('StyleSheet'); const View = require('View'); -const deprecatedPropType = require('deprecatedPropType'); const requireNativeComponent = require('requireNativeComponent'); const RCTModalHostView = requireNativeComponent('RCTModalHostView'); diff --git a/Libraries/ReactNative/UIManager.js b/Libraries/ReactNative/UIManager.js index ae48eaf2f0532a..4b03303b6386d3 100644 --- a/Libraries/ReactNative/UIManager.js +++ b/Libraries/ReactNative/UIManager.js @@ -147,7 +147,9 @@ if (Platform.OS === 'ios') { // we also tell Prepack that it has only partial knowledge of the UIManager, // so that any accesses to unknown properties along the global code will fail // when Prepack encounters them. - if (global.__makePartial) global.__makePartial(UIManager); + if (global.__makePartial) { + global.__makePartial(UIManager); + } } if (__DEV__) { diff --git a/Libraries/Utilities/setAndForwardRef.js b/Libraries/Utilities/setAndForwardRef.js index c135e73788f3a3..759569db41604c 100644 --- a/Libraries/Utilities/setAndForwardRef.js +++ b/Libraries/Utilities/setAndForwardRef.js @@ -10,8 +10,6 @@ 'use strict'; -const invariant = require('fbjs/lib/invariant'); - import type React from 'React'; type Args = $ReadOnly<{| diff --git a/Libraries/polyfills/babelHelpers.js b/Libraries/polyfills/babelHelpers.js index 47bc2440094200..605f6daaaa85d2 100644 --- a/Libraries/polyfills/babelHelpers.js +++ b/Libraries/polyfills/babelHelpers.js @@ -44,6 +44,8 @@ * @polyfill */ +/* eslint-disable no-func-assign, no-shadow, no-proto, no-void, no-undef-init */ + 'use strict'; var babelHelpers = (global.babelHelpers = {}); diff --git a/Libraries/polyfills/console.js b/Libraries/polyfills/console.js index 730a8c0ba57c2a..e8c4a7dbc3dca1 100644 --- a/Libraries/polyfills/console.js +++ b/Libraries/polyfills/console.js @@ -9,7 +9,7 @@ * @format */ -/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void */ +/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void, no-control-regex */ /** * This pipes all of our console logging functions to native logging so that diff --git a/RNTester/RNTesterUnitTests/RNTesterUnitTestsBundle.js b/RNTester/RNTesterUnitTests/RNTesterUnitTestsBundle.js index d55f9b975f9afa..20f4cc8caa1a78 100644 --- a/RNTester/RNTesterUnitTests/RNTesterUnitTestsBundle.js +++ b/RNTester/RNTesterUnitTests/RNTesterUnitTestsBundle.js @@ -9,8 +9,8 @@ 'use strict'; +// eslint-disable-next-line no-unused-vars const __fbBatchedBridge = { - // eslint-disable-line no-unused-vars flushedQueue: function() { return null; }, diff --git a/RNTester/e2e/sanity.test.js b/RNTester/e2e/sanity.test.js index 36bc0f577a60f3..366218c2e6d0ff 100644 --- a/RNTester/e2e/sanity.test.js +++ b/RNTester/e2e/sanity.test.js @@ -10,7 +10,7 @@ describe('Sanity', () => { beforeEach(async () => { await device.reloadReactNative(); - await element(by.label(`