- Notifications
You must be signed in to change notification settings - Fork426
feat: upgrade React to v16.6.3#225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
aleclarson wants to merge13 commits intoptmt:masterChoose a base branch fromaleclarson:alpha
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
13 commits Select commitHold shift + click to select a range
a452209 feat: upgrade React to v16.6.3
aleclarsonc3a959d Log query name for fetchRelayQuery
alexeylang7d2f74b RN: Remove React Stack Systrace Logic
yungstersa24dedb Move TouchHistoryMath from React Repo to React Native
sebmarkbaged14d4a7 Move takeSnapshot from React repo to RN
sebmarkbage9246b13 fix: delete ReactNativePropRegistry
aleclarsona9c2266 fix: stop using ReactNativeComponentTree
aleclarsond2ad9c7 fix: stop using ReactNativeBridgeEventPlugin
aleclarson11144a8 throw when <View> exists in <Text>
aleclarsonb412767 fix: remove unused Renderer shims
aleclarson9c0e377 fix: add @providesModule to updated Renderer shims
aleclarsond40506d React sync for revisions 6bf5e85...aa94237
aleclarsona8e563b fix: add @providesModule to Renderer shims
aleclarsonFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
15 changes: 1 addition & 14 deletionsLibraries/Components/ScrollResponder.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionsLibraries/Components/View/View.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionLibraries/Core/InitializeCore.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletionLibraries/Interaction/PanResponder.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
151 changes: 151 additions & 0 deletionsLibraries/Interaction/TouchHistoryMath.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| /** | ||
| * Copyright (c) 2016-present, Facebook, Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
| const TouchHistoryMath = { | ||
| /** | ||
| * This code is optimized and not intended to look beautiful. This allows | ||
| * computing of touch centroids that have moved after `touchesChangedAfter` | ||
| * timeStamp. You can compute the current centroid involving all touches | ||
| * moves after `touchesChangedAfter`, or you can compute the previous | ||
| * centroid of all touches that were moved after `touchesChangedAfter`. | ||
| * | ||
| * @param {TouchHistoryMath} touchHistory Standard Responder touch track | ||
| * data. | ||
| * @param {number} touchesChangedAfter timeStamp after which moved touches | ||
| * are considered "actively moving" - not just "active". | ||
| * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension. | ||
| * @param {boolean} ofCurrent Compute current centroid for actively moving | ||
| * touches vs. previous centroid of now actively moving touches. | ||
| * @return {number} value of centroid in specified dimension. | ||
| */ | ||
| centroidDimension: function( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| isXAxis, | ||
| ofCurrent, | ||
| ) { | ||
| const touchBank = touchHistory.touchBank; | ||
| let total = 0; | ||
| let count = 0; | ||
| const oneTouchData = | ||
| touchHistory.numberActiveTouches === 1 | ||
| ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] | ||
| : null; | ||
| if (oneTouchData !== null) { | ||
| if ( | ||
| oneTouchData.touchActive && | ||
| oneTouchData.currentTimeStamp > touchesChangedAfter | ||
| ) { | ||
| total += | ||
| ofCurrent && isXAxis | ||
| ? oneTouchData.currentPageX | ||
| : ofCurrent && !isXAxis | ||
| ? oneTouchData.currentPageY | ||
| : !ofCurrent && isXAxis | ||
| ? oneTouchData.previousPageX | ||
| : oneTouchData.previousPageY; | ||
| count = 1; | ||
| } | ||
| } else { | ||
| for (let i = 0; i < touchBank.length; i++) { | ||
| const touchTrack = touchBank[i]; | ||
| if ( | ||
| touchTrack !== null && | ||
| touchTrack !== undefined && | ||
| touchTrack.touchActive && | ||
| touchTrack.currentTimeStamp >= touchesChangedAfter | ||
| ) { | ||
| let toAdd; // Yuck, program temporarily in invalid state. | ||
| if (ofCurrent && isXAxis) { | ||
| toAdd = touchTrack.currentPageX; | ||
| } else if (ofCurrent && !isXAxis) { | ||
| toAdd = touchTrack.currentPageY; | ||
| } else if (!ofCurrent && isXAxis) { | ||
| toAdd = touchTrack.previousPageX; | ||
| } else { | ||
| toAdd = touchTrack.previousPageY; | ||
| } | ||
| total += toAdd; | ||
| count++; | ||
| } | ||
| } | ||
| } | ||
| return count > 0 ? total / count : TouchHistoryMath.noCentroid; | ||
| }, | ||
| currentCentroidXOfTouchesChangedAfter: function( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| ) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| true, // isXAxis | ||
| true, // ofCurrent | ||
| ); | ||
| }, | ||
| currentCentroidYOfTouchesChangedAfter: function( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| ) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| false, // isXAxis | ||
| true, // ofCurrent | ||
| ); | ||
| }, | ||
| previousCentroidXOfTouchesChangedAfter: function( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| ) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| true, // isXAxis | ||
| false, // ofCurrent | ||
| ); | ||
| }, | ||
| previousCentroidYOfTouchesChangedAfter: function( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| ) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| touchesChangedAfter, | ||
| false, // isXAxis | ||
| false, // ofCurrent | ||
| ); | ||
| }, | ||
| currentCentroidX: function(touchHistory) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| 0, // touchesChangedAfter | ||
| true, // isXAxis | ||
| true, // ofCurrent | ||
| ); | ||
| }, | ||
| currentCentroidY: function(touchHistory) { | ||
| return TouchHistoryMath.centroidDimension( | ||
| touchHistory, | ||
| 0, // touchesChangedAfter | ||
| false, // isXAxis | ||
| true, // ofCurrent | ||
| ); | ||
| }, | ||
| noCentroid: -1, | ||
| }; | ||
| module.exports = TouchHistoryMath; |
64 changes: 8 additions & 56 deletionsLibraries/Performance/Systrace.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletionsLibraries/ReactNative/requireNativeComponent.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletionsLibraries/ReactNative/takeSnapshot.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @providesModule takeSnapshot | ||
| * @format | ||
| * @flow | ||
| */ | ||
| const ReactNative = require('ReactNative'); | ||
| const UIManager = require('UIManager'); | ||
| /** | ||
| * Capture an image of the screen, window or an individual view. The image | ||
| * will be stored in a temporary file that will only exist for as long as the | ||
| * app is running. | ||
| * | ||
| * The `view` argument can be the literal string `window` if you want to | ||
| * capture the entire window, or it can be a reference to a specific | ||
| * React Native component. | ||
| * | ||
| * The `options` argument may include: | ||
| * - width/height (number) - the width and height of the image to capture. | ||
| * - format (string) - either 'png' or 'jpeg'. Defaults to 'png'. | ||
| * - quality (number) - the quality when using jpeg. 0.0 - 1.0 (default). | ||
| * | ||
| * Returns a Promise. | ||
| * @platform ios | ||
| */ | ||
| module.exports = function takeSnapshot( | ||
| view?: 'window' | React$Element<any> | number, | ||
| options?: { | ||
| width?: number, | ||
| height?: number, | ||
| format?: 'png' | 'jpeg', | ||
| quality?: number, | ||
| }, | ||
| ): Promise<any> { | ||
| if (typeof view !== 'number' && view !== 'window') { | ||
| view = ReactNative.findNodeHandle(view) || 'window'; | ||
| } | ||
| // Call the hidden '__takeSnapshot' method; the main one throws an error to | ||
| // prevent accidental backwards-incompatible usage. | ||
| return UIManager.__takeSnapshot(view, options); | ||
| }; |
2 changes: 1 addition & 1 deletionLibraries/Renderer/REVISION
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 8e25ed20bd27d126f670d04680db85209f779056 |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.