Commit Graph

75 Commits

Author SHA1 Message Date
gengjiawen 512676c65e Enable ci for windows (#22028)
Summary:
Enable ci for windows
appveyor pass.
https://github.com/facebook/react-native/pull/21835
 [GENERAL] [INTERNAL] [CI] - Enable ci for windows
Pull Request resolved: https://github.com/facebook/react-native/pull/22028

Differential Revision: D13318242

Pulled By: cpojer

fbshipit-source-id: be4b9b9fe6a4e21572f3d6c38b15a2acf8bb2662
2018-12-04 00:20:38 -08:00
Christoph Nakazawa 4148976a83 Use `invariant` instead of `fbjs/lib/invariant`
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.

Reviewed By: yungsters

Differential Revision: D13195941

fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
2018-12-03 00:07:02 -08:00
Emily Janzer c95071e7d2 Remove explicit requires of Map and Set
Summary: Removing explicit requires of Map and Set (since those are polyfilled), and fixing resulting flow errors.

Reviewed By: yungsters

Differential Revision: D10350673

fbshipit-source-id: 2fefe8ed1ae1f2cc9e5b7923ad630e73eda9e856
2018-10-19 10:57:24 -07:00
Marshall Roch 7b150690b6 @allow-large-files [flow] update to v0.83
Reviewed By: fishythefish

Differential Revision: D10362346

fbshipit-source-id: 0f4cc9977cfaa947e3b23112dd1cf482642e2319
2018-10-13 01:32:48 -07:00
Ramanpreet Nara f40e744b64 Fix internal flow problems
Summary: D10013265 introduces flow types for `PanResponder`. This diff fixes the facebook-internal flow errors that surface as a result.

Reviewed By: TheSavior

Differential Revision: D10035046

fbshipit-source-id: fbba3d61e68851dda2da4f8e98238e0fdb35a27e
2018-09-27 14:18:31 -07:00
empyrical 3f79b2a4e9 Add flow types to PanResponder (#21291)
Summary:
This PR adds flow types to the `PanResponder` module. It is part of my effort to flowtype the `Swipable*` classes.

A new `touchHistory` field had to be added to `SyntheticEvent` as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/21291

Reviewed By: TheSavior

Differential Revision: D10013265

Pulled By: RSNara

fbshipit-source-id: 3cd65a0eae41c756d1605e6771588d820f040e2a
2018-09-27 14:18:30 -07:00
Rafael Oleza c58fb3b73a Remove some automocks from tests
Summary:
They are bad :D

And they affect us when trying to migrate to the babel runtime helpers

Reviewed By: pvdz

Differential Revision: D9829462

fbshipit-source-id: 15240a56e707e13775d57714646e4960cfe202df
2018-09-18 04:18:11 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Tim Yung 70066ecd2b RN: Remove ReactPerf References
Reviewed By: fkgozali

Differential Revision: D8002194

fbshipit-source-id: a60073698d0f348d788b5c67e1c1c0010f7ec7f1
2018-05-15 13:16:57 -07:00
Eli White d01ab66b47 Prettier React Native Libraries
Reviewed By: sahrens

Differential Revision: D7961488

fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
2018-05-10 19:10:38 -07:00
Eli White 8f5ebe5952 Convert react-native-github/Libraries to let/const
Reviewed By: sahrens

Differential Revision: D7956042

fbshipit-source-id: 221851aa311f3cdd6326497352b366048db0a1bb
2018-05-10 16:16:35 -07:00
Riley Dulin 7e97ed00bc Fix prepack warning in RN bridge code
Reviewed By: yungsters

Differential Revision: D7903364

fbshipit-source-id: 4ef888f4e7f773f9fbc5183db2470b0f7b368d8a
2018-05-08 18:17:30 -07:00
Rubén Norte d5e9e55fa3 Remove @providesModule from all modules
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.

It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)

* Checked the Flow configuration by running flow on the project root (no errors):

```
yarn flow
```

* Checked the Jest configuration by running the tests with a clean cache:

```
yarn jest --clearCache && yarn test
```

* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:

```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```

[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995

Reviewed By: mjesun

Differential Revision: D7729509

Pulled By: rubennorte

fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
2018-04-25 07:37:10 -07:00
Sam Mueller 554243eb56 Fix TouchHistoryMath import
Summary:
The reference needed to be updated after the file was moved in this commit:
06085d3836

Otherwise, results in the packager failing with the following error:
> Unable to resolve module TouchHistoryMath from /node_modules/react-native/Libraries/Interaction/PanResponder.js: Module TouchHistoryMath does not exist in the Haste module map
Closes https://github.com/facebook/react-native/pull/18732

Differential Revision: D7547181

Pulled By: sebmarkbage

fbshipit-source-id: 78028c2f46faa2ce130a1a0c25fcaca47d2516a8
2018-04-07 21:09:24 -07:00
Sebastian Markbage 06085d3836 Move TouchHistoryMath from React Repo to React Native
Summary:
This hasn't been used by React core for a while. It's unclear why it was in the first place.

We can move it back next to the Panresponder.

https://github.com/facebook/react/pull/12557

Reviewed By: sophiebits

Differential Revision: D7529949

fbshipit-source-id: ef9892cfa8d2d6768da216b81befabe02795a245
2018-04-05 22:07:01 -07:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
glevi@fb.com 6b95c4fb14 @allow-large-files [Flow] Upgrade xplat/js to flow v0.63
Reviewed By: samwgoldman

Differential Revision: D6675320

fbshipit-source-id: 85575a6f30a50a3c40c6b46ba36f8cd33c091b1d
2018-01-08 12:49:53 -08:00
Miguel Jimenez Esun 834b9d4e6e Adding @email tags to most of the tests
Reviewed By: rafeca

Differential Revision: D6185623

fbshipit-source-id: 30df83288fe85516d8d5a1617a4fb8fea826ed6f
2017-11-02 06:25:03 -07:00
Riley Dulin 7b575d669d Improve flow typing and linting for MessageQueue
Differential Revision: D5987892

fbshipit-source-id: 8b9218875944decc5e21863e3c3f3a659ff2e2e4
2017-10-10 16:32:28 -07:00
Jonathan Lee 182874d972 Reverting changes to MessageQueue
Reviewed By: zjj010104

Differential Revision: D5785916

fbshipit-source-id: ed30e3d2763d16c5a1f550f05d2b9f0997b83fbe
2017-09-07 14:30:59 -07:00
Marshall Roch 91b6b4efb9 @allow-large-files Flow v0.54.0
Reviewed By: leebyron

Differential Revision: D5773490

fbshipit-source-id: 2c54bb6326f23edbe9a969f3010f79da8189923e
2017-09-06 03:33:43 -07:00
Pieter De Baets cb313569e5 Increase information logged to MessageQueue.spy
Reviewed By: dulinriley

Differential Revision: D5517734

fbshipit-source-id: de7ba08130d229882256bcb1496d6efc708bdce7
2017-07-31 06:16:41 -07:00
Kody Greenbaum 26764d4179 Revert D5470356: [react-native] Increase information logged to MessageQueue.spy
Differential Revision: D5470356

fbshipit-source-id: 27b247ac3c538f801c1f9a86f74fb3098064e92e
2017-07-25 11:53:20 -07:00
Pieter De Baets f445ac8ef1 Increase information logged to MessageQueue.spy
Reviewed By: dulinriley

Differential Revision: D5470356

fbshipit-source-id: 663dfa4e0c8cc5292e27f607111fc35a565a0bd8
2017-07-25 08:01:28 -07:00
Miguel Jiménez Esún c9a39b3bd3 Move jest to version 20
Reviewed By: cpojer

Differential Revision: D5235642

fbshipit-source-id: eaeee1c5f67cf295fdc9798fb13bd5a83706af10
2017-06-14 12:48:22 -07:00
James Burnett 51c0e81557 remove disableAutomock from jest tests (new default) @bypass-lint
Reviewed By: cpojer

Differential Revision: D5237192

fbshipit-source-id: dccca52a91259d7fea27931f92bca94184a82d4a
2017-06-13 15:04:09 -07:00
James Burnett 3360999431 disable automock by default in as many places as possible @bypass-lint
Reviewed By: cpojer

Differential Revision: D5190858

fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
2017-06-08 07:45:54 -07:00
Eric Vicenti 4a80dceac7 Re-license and rename UIExplorer integration test app as RNTester
Reviewed By: yungsters

Differential Revision: D4950085

fbshipit-source-id: 44574b5d0ef0d2ad5dfc714309b18dc69cbad9ff
2017-05-08 11:31:19 -07:00
Andrew Ingram dfaa03e1cb Fixes "guesture" typo in PanResponser docs
Summary:
Simple typo fix in docs.
Closes https://github.com/facebook/react-native/pull/13247

Differential Revision: D4819135

Pulled By: ericvicenti

fbshipit-source-id: 64bc597133a31276fdff8f1ef2ee061f2a9bb17d
2017-04-03 09:15:29 -07:00
Spencer Ahrens 27c3e32abf FrameRateLogger JS module
Summary:
This adds a flowified JS module for the FrameRateLogger native module and plugs
it into `ScrollResponder` and `AppRegistry`.

If there is no `FrameRateLogger` native module, then the function calls will be no-ops.

One major limitation is that we can't track animated/programatic scrolls because we don't
have reliable end events. Would be generally useful to add those in a followup though.

Reviewed By: fkgozali

Differential Revision: D4765694

fbshipit-source-id: f3bec771df6ac918200c1afd1a7d8b6da540a4e2
2017-03-24 18:30:59 -07:00
Eric Vicenti a8474c25fd Fix license headers
Reviewed By: hramos

Differential Revision: D4670890

fbshipit-source-id: e8429aa88a1d4f3cc80034dd087739410c0761f2
2017-03-08 00:52:17 -08:00
Spencer Ahrens 5d4d62f474 Some perf tools for debugging js stalls
Summary:
The stall watchdog is handy to detect stalls, but it doesn't really tell us what was
happening. This diff makes it easy to track React perf and bridge traffic during any stall, and
prints it out if the stall exceeds the threshold.

Reviewed By: yungsters

Differential Revision: D4479439

fbshipit-source-id: 87f94913ec341a648d7744249597dc30b29759ab
2017-02-06 17:46:34 -08:00
Alan Norbauer 4aabf4b6b3 Replace jest.resetModuleRegistry() with jest.resetModules()
Reviewed By: cpojer

Differential Revision: D4344961

fbshipit-source-id: 45453ec7ee3211743946ab9156f51430322b5832
2016-12-18 17:13:38 -08:00
Ben Kalman fb4f71f4ac Add missing backtick in PanResponder.js docs
Summary: Closes https://github.com/facebook/react-native/pull/11274

Differential Revision: D4268360

fbshipit-source-id: 8d92300830e4568de14350a539c11b8773c425c0
2016-12-02 15:13:34 -08:00
David Aurelio 3683beb88a RN: Update React (2/2)
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
2016-11-04 05:43:44 -07:00
Seph Soliman d1f8add4d0 Documentation fix: dx vs. x0
Summary:
> What existing problem does the pull request solve?

Purely a documentation/example error. Was misled/wasted time debugging because of this issue.

Description:
`dx`/`dy` are zero in onPanResponderGrant, not `x0`/`y0`. `x0`/`y0` will be the coordinates relative to the granted element, which are rarely zero.
Closes https://github.com/facebook/react-native/pull/9984

Differential Revision: D4001603

Pulled By: hramos

fbshipit-source-id: 32580795f62394585ccfb8f9a2ae65b0b72add69
2016-10-11 08:13:39 -07:00
leeight 5d35df8afa Add missing return, FIX #9886
Summary:
cc sahrens

FIX #9886
Closes https://github.com/facebook/react-native/pull/9938

Differential Revision: D3875766

Pulled By: sahrens

fbshipit-source-id: c3eb7f8203db80403de3b789eea907651bc333da
2016-09-15 22:43:36 -07:00
Spencer Ahrens 3b5e4cc593 Fix InteractionManager promise issue with some OSS setups
Reviewed By: yungsters

Differential Revision: D3860551

fbshipit-source-id: 731ba758e28ce24f12ca80f7be0f962e6929ee2c
2016-09-15 15:13:35 -07:00
Spencer Ahrens 322c160fb1 Add some stall stuff as settings to native animated example
Reviewed By: fkgozali

Differential Revision: D3817885

fbshipit-source-id: 047f806411982aafdf7420eebadff063f56fee69
2016-09-06 19:58:35 -07:00
Spencer Ahrens 5eaef1c631 Introduce Batchinator
Reviewed By: devknoll

Differential Revision: D3796349

fbshipit-source-id: 2e23a2361a612107596cf6381e67252238e970bf
2016-09-06 14:43:46 -07:00
Adam Comella b01feb41d8 Incremental: Fix require of performanceNow
Summary:
Due to an earlier commit, we now have to use the full path for requiring `performanceNow`.

**Test plan (required)**

Verified that the IncrementalExample works when adding it to UIExplorer.
Closes https://github.com/facebook/react-native/pull/9595

Differential Revision: D3775101

Pulled By: javache

fbshipit-source-id: 6252ce8c872896f4cfdb9a31bdbc79d6aaf4684d
2016-08-25 17:43:48 -07:00
Pieter De Baets ad677426cf Cleanup clear/set/throwImmediate
Reviewed By: vjeux

Differential Revision: D3703300

fbshipit-source-id: ad03d558d6af61aba17899ec256d71fdda4c4c84
2016-08-12 07:28:38 -07:00
David Aurelio 94666f16c7 Auto-fix lint errors
Reviewed By: bestander

Differential Revision: D3683952

fbshipit-source-id: 9484d0b0e86859e8edaca0da1aa13a667f200905
2016-08-09 06:43:46 -07:00
Hedger Wang 4843a90c1c PanResponder should not hold stale handle for interaction.
Summary:
For now, `PanResponder.create()` return a new object which may hold a handle
for interaction. The handle is created when the gesture starts, and it's cleared
when the gesture finishes.

However, the handle may become stale cause the owner (view) is removed or
re-rendered before the gesture finishes, which leaves InteractionManager
with handles that can never be removed.

In some cases, this blocks the app that waits for InteractionManager to
be idle and having leaky handles prevents InteractionManager from being idle
again.

The fix is to move the handle from the instance to the static variable, and
we'd clear it whenever a gesture finishes.

Reviewed By: sahrens

Differential Revision: D3550699

fbshipit-source-id: 412e9046a6cd9be34b3a7d572258008016a29f41
2016-07-15 11:58:31 -07:00
Antti Moilanen c06a1360a9 Fix broken link to PanResponderExample.js
Summary:
In recent change in 2f73ca8 all javascript files under UIExplorer were moved to js subfolders but PanResponderExample link wasn't updated accordingly.
Closes https://github.com/facebook/react-native/pull/8725

Differential Revision: D3554851

fbshipit-source-id: 798b9a76ecb667512a23a405d0fee0691a9debce
2016-07-13 00:58:17 -07:00
Spencer Ahrens 9b184cc0f4 Fix bug in cancelling last task in TaskQueue
Summary:
We don't want to remove the last queue from the stack, it should just have no tasks in it.

Fixes issue reported here: https://www.facebook.com/groups/reactnativeoss/permalink/1569170356712926/

Reviewed By: yungsters

Differential Revision: D3539287

fbshipit-source-id: ea95673491fee0ea82f0f1b79b8f60e00cd3d035
2016-07-11 16:13:49 -07:00
David Aurelio bd60d828c5 Remove `node_modules/react` from the list of discoverable haste modules
Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.

Reviewed By: astreet

Differential Revision: D3509863

fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
2016-07-05 06:44:33 -07:00
Spencer Ahrens be09cccb1f Make InteractionManager tasks cancellable
Summary:
Returns a promise-like object with a new cancel function that will dig through the queue
and remove relevant tasks before they are executed. Handy when tasks are scheduled in react
components but should be cleaned up in unmount.

Reviewed By: devknoll

Differential Revision: D3406953

fbshipit-source-id: edf1157d831d5d6b63f13ee64cfd1c46843e79fa
2016-06-08 22:58:19 -07:00
Basil Hosmer ac5636dd59 explicit type args in react-native-github
Reviewed By: vjeux

Differential Revision: D3342856

fbshipit-source-id: ba5a4d5529fc9d1d1efe98cc175d718c5f044a5b
2016-05-24 18:28:26 -07:00