From 33650db05093d30903b0823b8cbb084e5279e72e Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 18 Dec 2017 10:45:31 +0100 Subject: [PATCH] Revert "Upgrade to 1.9.1" This reverts commit 9f33fe258312987f490cc0f3a71c0c4f93494e7f. --- .../Animated/src/AnimatedImplementation.js | 38 +++++++-------- .../Animated/src/NativeAnimatedHelper.js | 4 +- Libraries/Animated/src/nodes/AnimatedValue.js | 26 +++++----- .../Animated/src/nodes/AnimatedValueXY.js | 48 +++++++++---------- Libraries/Blob/URL.js | 4 +- Libraries/CameraRoll/CameraRoll.js | 4 +- Libraries/Lists/ViewabilityHelper.js | 22 ++++----- Libraries/ReactNative/AppRegistry.js | 12 ++--- Libraries/ReactNative/YellowBox.js | 3 +- RNTester/js/CheckBoxExample.js | 6 +-- .../server/util/debugger-ui/DeltaPatcher.js | 16 +++---- package.json | 2 +- 12 files changed, 89 insertions(+), 96 deletions(-) diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index 08d69c3bd80..ef5669276f1 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -528,14 +528,14 @@ module.exports = { ValueXY: AnimatedValueXY, /** * Exported to use the Interpolation type in flow. - * + * * See http://facebook.github.io/react-native/docs/animated.html#interpolation */ Interpolation: AnimatedInterpolation, /** * Exported for ease of type checking. All animated values derive from this * class. - * + * * See http://facebook.github.io/react-native/docs/animated.html#node */ Node: AnimatedNode, @@ -557,7 +557,7 @@ module.exports = { /** * Animates a value according to an analytical spring model based on * damped harmonic oscillation. - * + * * See http://facebook.github.io/react-native/docs/animated.html#spring */ spring, @@ -565,7 +565,7 @@ module.exports = { /** * Creates a new Animated value composed from two Animated values added * together. - * + * * See http://facebook.github.io/react-native/docs/animated.html#add */ add, @@ -573,7 +573,7 @@ module.exports = { /** * Creates a new Animated value composed by dividing the first Animated value * by the second Animated value. - * + * * See http://facebook.github.io/react-native/docs/animated.html#divide */ divide, @@ -581,7 +581,7 @@ module.exports = { /** * Creates a new Animated value composed from two Animated values multiplied * together. - * + * * See http://facebook.github.io/react-native/docs/animated.html#multiply */ multiply, @@ -589,7 +589,7 @@ module.exports = { /** * Creates a new Animated value that is the (non-negative) modulo of the * provided Animated value. - * + * * See http://facebook.github.io/react-native/docs/animated.html#modulo */ modulo, @@ -598,14 +598,14 @@ module.exports = { * Create a new Animated value that is limited between 2 values. It uses the * difference between the last value so even if the value is far from the * bounds it will start changing when the value starts getting closer again. - * + * * See http://facebook.github.io/react-native/docs/animated.html#diffclamp */ diffClamp, /** * Starts an animation after the given delay. - * + * * See http://facebook.github.io/react-native/docs/animated.html#delay */ delay, @@ -613,7 +613,7 @@ module.exports = { * Starts an array of animations in order, waiting for each to complete * before starting the next. If the current running animation is stopped, no * following animations will be started. - * + * * See http://facebook.github.io/react-native/docs/animated.html#sequence */ sequence, @@ -621,44 +621,44 @@ module.exports = { * Starts an array of animations all at the same time. By default, if one * of the animations is stopped, they will all be stopped. You can override * this with the `stopTogether` flag. - * + * * See http://facebook.github.io/react-native/docs/animated.html#parallel */ parallel, /** * Array of animations may run in parallel (overlap), but are started in * sequence with successive delays. Nice for doing trailing effects. - * + * * See http://facebook.github.io/react-native/docs/animated.html#stagger */ stagger, /** * Loops a given animation continuously, so that each time it reaches the * end, it resets and begins again from the start. - * + * * See http://facebook.github.io/react-native/docs/animated.html#loop - */ + */ loop, /** * Takes an array of mappings and extracts values from each arg accordingly, * then calls `setValue` on the mapped outputs. - * + * * See http://facebook.github.io/react-native/docs/animated.html#event */ event, /** * Make any React component Animatable. Used to create `Animated.View`, etc. - * + * * See http://facebook.github.io/react-native/docs/animated.html#createanimatedcomponent */ createAnimatedComponent, /** - * Imperative API to attach an animated value to an event on a view. Prefer + * Imperative API to attach an animated value to an event on a view. Prefer * using `Animated.event` with `useNativeDrive: true` if possible. - * + * * See http://facebook.github.io/react-native/docs/animated.html#attachnativeevent */ attachNativeEvent, @@ -666,7 +666,7 @@ module.exports = { /** * Advanced imperative API for snooping on animated events that are passed in * through props. Use values directly where possible. - * + * * See http://facebook.github.io/react-native/docs/animated.html#forkevent */ forkEvent, diff --git a/Libraries/Animated/src/NativeAnimatedHelper.js b/Libraries/Animated/src/NativeAnimatedHelper.js index 6bebbe427cb..74f410c5151 100644 --- a/Libraries/Animated/src/NativeAnimatedHelper.js +++ b/Libraries/Animated/src/NativeAnimatedHelper.js @@ -193,9 +193,7 @@ function validateTransform(configs: Array): void { configs.forEach(config => { if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { throw new Error( - `Property '${ - config.property - }' is not supported by native animated module`, + `Property '${config.property}' is not supported by native animated module`, ); } }); diff --git a/Libraries/Animated/src/nodes/AnimatedValue.js b/Libraries/Animated/src/nodes/AnimatedValue.js index 49f440471e1..03a8077e2cb 100644 --- a/Libraries/Animated/src/nodes/AnimatedValue.js +++ b/Libraries/Animated/src/nodes/AnimatedValue.js @@ -68,7 +68,7 @@ function _flush(rootNode: AnimatedValue): void { * multiple properties in a synchronized fashion, but can only be driven by one * mechanism at a time. Using a new mechanism (e.g. starting a new animation, * or calling `setValue`) will stop any previous ones. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html */ class AnimatedValue extends AnimatedWithChildren { @@ -108,7 +108,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Directly set the value. This will stop any animations running on the value * and update all the bound properties. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#setvalue */ setValue(value: number): void { @@ -129,7 +129,7 @@ class AnimatedValue extends AnimatedWithChildren { * Sets an offset that is applied on top of whatever value is set, whether via * `setValue`, an animation, or `Animated.event`. Useful for compensating * things like the start of a pan gesture. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#setoffset */ setOffset(offset: number): void { @@ -142,7 +142,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Merges the offset value into the base value and resets the offset to zero. * The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#flattenoffset */ flattenOffset(): void { @@ -156,7 +156,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Sets the offset value to the base value, and resets the base value to zero. * The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#extractoffset */ extractOffset(): void { @@ -171,7 +171,7 @@ class AnimatedValue extends AnimatedWithChildren { * Adds an asynchronous listener to the value so you can observe updates from * animations. This is useful because there is no way to * synchronously read the value because it might be driven natively. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#addlistener */ addListener(callback: ValueListenerCallback): string { @@ -184,9 +184,9 @@ class AnimatedValue extends AnimatedWithChildren { } /** - * Unregister a listener. The `id` param shall match the identifier - * previously returned by `addListener()`. - * + * Unregister a listener. The `id` param shall match the identifier + * previously returned by `addListener()`. + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#removelistener */ removeListener(id: string): void { @@ -198,7 +198,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Remove all registered listeners. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#removealllisteners */ removeAllListeners(): void { @@ -239,7 +239,7 @@ class AnimatedValue extends AnimatedWithChildren { * Stops any running animation or tracking. `callback` is invoked with the * final value after stopping the animation, which is useful for updating * state to match the animation position with layout. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#stopanimation */ stopAnimation(callback?: ?(value: number) => void): void { @@ -251,7 +251,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Stops any animation and resets the value to its original. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#resetanimation */ resetAnimation(callback?: ?(value: number) => void): void { @@ -270,7 +270,7 @@ class AnimatedValue extends AnimatedWithChildren { /** * Typically only used internally, but could be used by a custom Animation * class. - * + * * See http://facebook.github.io/react-native/docs/animatedvalue.html#animate */ animate(animation: Animation, callback: ?EndCallback): void { diff --git a/Libraries/Animated/src/nodes/AnimatedValueXY.js b/Libraries/Animated/src/nodes/AnimatedValueXY.js index 496ccd7958f..d04fe0940cc 100644 --- a/Libraries/Animated/src/nodes/AnimatedValueXY.js +++ b/Libraries/Animated/src/nodes/AnimatedValueXY.js @@ -22,9 +22,9 @@ type ValueXYListenerCallback = (value: {x: number, y: number}) => void; let _uniqueId = 1; /** - * 2D Value for driving 2D animations, such as pan gestures. Almost identical + * 2D Value for driving 2D animations, such as pan gestures. Almost identical * API to normal `Animated.Value`, but multiplexed. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html */ class AnimatedValueXY extends AnimatedWithChildren { @@ -55,7 +55,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Directly set the value. This will stop any animations running on the value * and update all the bound properties. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setvalue */ setValue(value: {x: number, y: number}) { @@ -64,10 +64,10 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Sets an offset that is applied on top of whatever value is set, whether - * via `setValue`, an animation, or `Animated.event`. Useful for compensating + * Sets an offset that is applied on top of whatever value is set, whether + * via `setValue`, an animation, or `Animated.event`. Useful for compensating * things like the start of a pan gesture. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setoffset */ setOffset(offset: {x: number, y: number}) { @@ -76,9 +76,9 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Merges the offset value into the base value and resets the offset to zero. + * Merges the offset value into the base value and resets the offset to zero. * The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#flattenoffset */ flattenOffset(): void { @@ -87,9 +87,9 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Sets the offset value to the base value, and resets the base value to + * Sets the offset value to the base value, and resets the base value to * zero. The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset */ extractOffset(): void { @@ -106,7 +106,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Stops any animation and resets the value to its original. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation */ resetAnimation(callback?: (value: {x: number, y: number}) => void): void { @@ -116,10 +116,10 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Stops any running animation or tracking. `callback` is invoked with the - * final value after stopping the animation, which is useful for updating + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating * state to match the animation position with layout. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation */ stopAnimation(callback?: (value: {x: number, y: number}) => void): void { @@ -129,12 +129,12 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Adds an asynchronous listener to the value so you can observe updates from - * animations. This is useful because there is no way to synchronously read + * Adds an asynchronous listener to the value so you can observe updates from + * animations. This is useful because there is no way to synchronously read * the value because it might be driven natively. - * + * * Returns a string that serves as an identifier for the listener. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener */ addListener(callback: ValueXYListenerCallback): string { @@ -150,9 +150,9 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Unregister a listener. The `id` param shall match the identifier - * previously returned by `addListener()`. - * + * Unregister a listener. The `id` param shall match the identifier + * previously returned by `addListener()`. + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removelistener */ removeListener(id: string): void { @@ -163,7 +163,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Remove all registered listeners. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removealllisteners */ removeAllListeners(): void { @@ -174,7 +174,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Converts `{x, y}` into `{left, top}` for use in style. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#getlayout */ getLayout(): {[key: string]: AnimatedValue} { @@ -186,7 +186,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Converts `{x, y}` into a useable translation transform. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform */ getTranslateTransform(): Array<{[key: string]: AnimatedValue}> { diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index ed40cae6567..eddddf258b7 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -59,9 +59,7 @@ class URL { if (BLOB_URL_PREFIX === null) { throw new Error('Cannot create URL for blob!'); } - return `${BLOB_URL_PREFIX}${blob.blobId}?offset=${blob.offset}&size=${ - blob.size - }`; + return `${BLOB_URL_PREFIX}${blob.blobId}?offset=${blob.offset}&size=${blob.size}`; } static revokeObjectURL(url: string) { diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 78f8d365aae..5a4b3889d9d 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -72,8 +72,8 @@ const getPhotosParamChecker = createStrictShapeTypeChecker({ groupName: PropTypes.string, /** - * Specifies filter on asset type - */ + * Specifies filter on asset type + */ assetType: PropTypes.oneOf(Object.keys(ASSET_TYPE_OPTIONS)), /** diff --git a/Libraries/Lists/ViewabilityHelper.js b/Libraries/Lists/ViewabilityHelper.js index 03c84abdb92..858bb4d07e2 100644 --- a/Libraries/Lists/ViewabilityHelper.js +++ b/Libraries/Lists/ViewabilityHelper.js @@ -60,17 +60,17 @@ export type ViewabilityConfig = {| |}; /** - * A Utility class for calculating viewable items based on current metrics like scroll position and - * layout. - * - * An item is said to be in a "viewable" state when any of the following - * is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction` - * is true): - * - * - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item - * visible in the view area >= `itemVisiblePercentThreshold`. - * - Entirely visible on screen - */ +* A Utility class for calculating viewable items based on current metrics like scroll position and +* layout. +* +* An item is said to be in a "viewable" state when any of the following +* is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction` +* is true): +* +* - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item +* visible in the view area >= `itemVisiblePercentThreshold`. +* - Entirely visible on screen +*/ class ViewabilityHelper { _config: ViewabilityConfig; _hasInteracted: boolean = false; diff --git a/Libraries/ReactNative/AppRegistry.js b/Libraries/ReactNative/AppRegistry.js index 98699f18f0a..c7d0ebe6d18 100644 --- a/Libraries/ReactNative/AppRegistry.js +++ b/Libraries/ReactNative/AppRegistry.js @@ -59,7 +59,7 @@ let wrapperComponentProvider: ?WrapperComponentProvider; /** * `AppRegistry` is the JavaScript entry point to running all React Native apps. - * + * * See http://facebook.github.io/react-native/docs/appregistry.html */ const AppRegistry = { @@ -89,7 +89,7 @@ const AppRegistry = { /** * Registers an app's root component. - * + * * See http://facebook.github.io/react-native/docs/appregistry.html#registercomponent */ registerComponent( @@ -155,7 +155,7 @@ const AppRegistry = { /** * Loads the JavaScript bundle and runs the app. - * + * * See http://facebook.github.io/react-native/docs/appregistry.html#runapplication */ runApplication(appKey: string, appParameters: any): void { @@ -197,8 +197,8 @@ const AppRegistry = { }, /** - * Stops an application when a view should be destroyed. - * + * Stops an application when a view should be destroyed. + * * See http://facebook.github.io/react-native/docs/appregistry.html#unmountapplicationcomponentatroottag */ unmountApplicationComponentAtRootTag(rootTag: number): void { @@ -207,7 +207,7 @@ const AppRegistry = { /** * Register a headless task. A headless task is a bit of code that runs without a UI. - * + * * See http://facebook.github.io/react-native/docs/appregistry.html#registerheadlesstask */ registerHeadlessTask(taskKey: string, task: TaskProvider): void { diff --git a/Libraries/ReactNative/YellowBox.js b/Libraries/ReactNative/YellowBox.js index 08421ad2538..88e786ab0d7 100644 --- a/Libraries/ReactNative/YellowBox.js +++ b/Libraries/ReactNative/YellowBox.js @@ -398,8 +398,7 @@ class YellowBox extends React.Component< onDismissAll={() => this.dismissWarning(null)} onMinimize={() => this.setState({inspecting: null})} toggleStacktrace={() => - this.setState({stacktraceVisible: !stacktraceVisible}) - } + this.setState({stacktraceVisible: !stacktraceVisible})} /> ) : null; diff --git a/RNTester/js/CheckBoxExample.js b/RNTester/js/CheckBoxExample.js index 42e689180fc..9e7b8f5db99 100644 --- a/RNTester/js/CheckBoxExample.js +++ b/RNTester/js/CheckBoxExample.js @@ -75,15 +75,13 @@ class EventCheckBoxExample extends React.Component<{}, $FlowFixMeState> { - this.setState({eventCheckBoxRegressionIsOn: value}) - } + this.setState({eventCheckBoxRegressionIsOn: value})} style={{marginBottom: 10}} value={this.state.eventCheckBoxRegressionIsOn} /> - this.setState({eventCheckBoxRegressionIsOn: value}) - } + this.setState({eventCheckBoxRegressionIsOn: value})} style={{marginBottom: 10}} value={this.state.eventCheckBoxRegressionIsOn} /> diff --git a/local-cli/server/util/debugger-ui/DeltaPatcher.js b/local-cli/server/util/debugger-ui/DeltaPatcher.js index 1787307b99a..d087db202dd 100644 --- a/local-cli/server/util/debugger-ui/DeltaPatcher.js +++ b/local-cli/server/util/debugger-ui/DeltaPatcher.js @@ -10,14 +10,14 @@ */ /** - * This file is a copy of the reference `DeltaPatcher`, located in - * metro. The reason to not reuse that file is that in this context - * we cannot have flow annotations or CJS syntax (since this file is directly) - * injected into a static HTML page. - * - * TODO: Find a simple and lightweight way to compile `DeltaPatcher` to avoid - * having this duplicated file. - */ + * This file is a copy of the reference `DeltaPatcher`, located in + * metro. The reason to not reuse that file is that in this context + * we cannot have flow annotations or CJS syntax (since this file is directly) + * injected into a static HTML page. + * + * TODO: Find a simple and lightweight way to compile `DeltaPatcher` to avoid + * having this duplicated file. + */ (function(global) { 'use strict'; diff --git a/package.json b/package.json index 391b110b45d..050117d45d9 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "eslint-plugin-react": "^7.2.1", "flow-bin": "^0.61.0", "jest": "21.3.0-beta.13", - "prettier": "1.9.1", + "prettier": "1.7.0", "react": "16.2.0", "react-test-renderer": "16.2.0", "shelljs": "^0.7.8",