Commit Graph

452 Commits

Author SHA1 Message Date
Miguel Jimenez Esun bae5505902 Migrate tests away from "jsdom" environment
Reviewed By: leebyron

Differential Revision: D5748304

fbshipit-source-id: c66df45f1f35333f994c41eb8ff4cfccc1bb04d4
2017-09-11 09:49:11 -07:00
Rafael Oleza 8e0b970ff7 Bump metro-bundler to 0.16.0
Reviewed By: davidaurelio

Differential Revision: D5793558

fbshipit-source-id: c5d7f3029b889987613034150ba13a72b4850421
2017-09-08 06:30:03 -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
Martin Yrjölä 25639176ff Asset basenames in Jest snapshots
Summary:
This change only affects tests run with Jest. `require('/images/image1.png')` will be replaced with

```
Object {
  "testUri": "relative/path/to/images/image1.png",
}
```

in the Jest snapshot instead of always being 1 returned by RelativeImageStub. This change makes it possible to test conditional asset loading in components.

The problem with this change is that it will probably break a lot of existing snapshots, but that should be easily fixed when a project updates to a new version of React Native by running `jest -u` to update all snapshots.

A component can have conditional asset loading based on its props, this logic would be nice to test with Jest snapshots. This problem has been discussed in https://github.com/facebook/jest/issues/2838.

* **Who does this affect**: Everyone using `Image` in Jest snapshots
* **How to migrate**: Running `jest -u` will update the snapshots, the snapshots should be reviewed that they are correct.
* **Why make this breaking change**: It enables testing of conditional asset loading.
* **Severity (number of people affected x effort)**: Low.
Closes https://github.com/facebook/react-native/pull/13319

Reviewed By: rafeca

Differential Revision: D5708180

Pulled By: mjesun

fbshipit-source-id: 16ac42004d597db08545a21d4fffe95c5ee7e21f
2017-09-06 03:33:43 -07:00
Miguel Jimenez Esun baa873e506 Update Jest to v21
Reviewed By: cpojer

Differential Revision: D5765333

fbshipit-source-id: 94ea448c4380fdc68f42f84eb3963322ea18ec70
2017-09-05 05:18:30 -07:00
Rafael Oleza 307e40b8e5 Upgrade metro-bunder to v0.15.0
Summary: Some breaking changes require a new release.

Reviewed By: cpojer

Differential Revision: D5766207

fbshipit-source-id: d0ebc5cb46fbd2ad167c0a3369d0f354346f61b9
2017-09-05 05:18:30 -07:00
Jean Lauliac 83bb8022e1 metro-bunder: v0.14.0
Summary: Some breaking changes require a new release.

Reviewed By: cpojer

Differential Revision: D5763898

fbshipit-source-id: 0580c9b1256c2c019adc5fb2f771c54d7e7a0bf1
2017-09-04 04:38:45 -07:00
Jean Lauliac 3ab973ed80 metro-bundler: v0.13
Reviewed By: cpojer

Differential Revision: D5754623

fbshipit-source-id: b70bfa105e6752db5350b82433bd64e1ca45f33b
2017-09-01 07:35:57 -07:00
Jean Lauliac 33884671b2 metro-bundler: v0.12
Reviewed By: cpojer

Differential Revision: D5745702

fbshipit-source-id: 6dc88811525e1595f58b23b7d0ebd5cc9f309785
2017-08-31 11:00:46 -07:00
Peter Ruibal 22d283b3c5 Update flow-bin in package.json to ^0.53.0 (to match .flowconfig)
Reviewed By: calebmer

Differential Revision: D5692975

fbshipit-source-id: 6a6fdf9d499e0baaab47aea2d3b435698ec80d5c
2017-08-23 16:15:04 -07:00
Matt Oakes 2172bb4acb Revert "Add a new babel transformer for inlining regenerator-runtime per file"
Summary:
This reverts commit e7c1cf5b7d.

Fixes #14838.

Test using the steps in #14838.
Closes https://github.com/facebook/react-native/pull/15584

Reviewed By: jeanlauliac

Differential Revision: D5670640

Pulled By: mjesun

fbshipit-source-id: e7c4c4cfdd0d3142561847aefb35b8a8b33e5ffa
2017-08-23 08:06:11 -07:00
Andres Suarez 04c2f55c21 Update to eslint-plugin-react@7.2.1
Reviewed By: davidaurelio

Differential Revision: D5657026

fbshipit-source-id: 2e3f6bc21495e3af45f0e9ee1745cb2809b0fa7c
2017-08-18 09:33:39 -07:00
Ethan Davis 609ee651d6 Remove request dependency from core directory
Summary:
request is an unnecessary dependency of the core package as it is only used in the /website directory as a required primary dependency.

request is only used in the /website directory. Searched entire package with regex.

`/require\(('|")request+\('|"))/gi`

All applicable local tests passed!

![image](https://user-images.githubusercontent.com/14060354/29438186-dade7ba4-8369-11e7-923b-efef0d208e53.png)
Closes https://github.com/facebook/react-native/pull/15539

Differential Revision: D5656298

Pulled By: ericnakagawa

fbshipit-source-id: 4210db7de189ff6aff99a52b5aa92253af4e1c77
2017-08-17 20:00:41 -07:00
Miguel Jimenez Esun 9b30f56693 Update Jest to 20.1.0-echo.1
Reviewed By: cpojer

Differential Revision: D5591819

fbshipit-source-id: 91830096988d88a6f0601d73225a12ae31e61a17
2017-08-10 07:33:20 -07:00
Brian Vaughn 046f600cc2 React 16 beta 5 sync (5495e49...c3718c4)
Reviewed By: spicyj

Differential Revision: D5564030

fbshipit-source-id: fd3e6133df7ee8e7488a3c515ce6c783c11d9401
2017-08-09 12:35:30 -07:00
Miguel Jimenez Esun d268c1f731 Upgrade fbjs-scripts
Reviewed By: aaronabramov

Differential Revision: D5486802

fbshipit-source-id: 3b55b3aa9c8ab354aee9abcba7b933fe83a6e2d6
2017-08-09 07:48:16 -07:00
James Ide 6e2e53f49b Remove more unused jest-related devDependencies
Summary:
Several of the jest-related devDependencies are not directly used -- removing them from package.json.
Closes https://github.com/facebook/react-native/pull/15345

Differential Revision: D5553879

Pulled By: mjesun

fbshipit-source-id: 5ceacaa29bb7e80746a97345fb105ff19ccbf716
2017-08-03 09:16:23 -07:00
glevi@fb.com f0f1b12d9e @allow-large-files [Flow] Deploy v0.52.0 to xplat
Reviewed By: samwgoldman

Differential Revision: D5548893

fbshipit-source-id: b772423f11ff53f85a29b002226c5581c073f9ff
2017-08-03 08:06:58 -07:00
James Ide 6a3128457f Remove unused npm packages and move CI dependency to devDependencies
Summary:
There are several npm packages that are no longer used and do not show up when grepping the code base. Also the "async" dependency is used only in CI and should be moved to devDependencies.
Closes https://github.com/facebook/react-native/pull/13517

Differential Revision: D4963775

Pulled By: hramos

fbshipit-source-id: 8b6d2d67e65c8ba19c7f91ecfdd70ef731c7c46b
2017-08-02 11:07:22 -07:00
Jean Lauliac be0f2288fe metro-bundler: upgrade all jest refs to delta.4
Reviewed By: mjesun

Differential Revision: D5503722

fbshipit-source-id: ca5d1e684e6b909804ae2be8c2055439dda611f5
2017-07-28 13:06:50 -07:00
Jean Lauliac 20066da461 metro-bundler: 0.11.0
Reviewed By: davidaurelio

Differential Revision: D5494606

fbshipit-source-id: 2049fe162b76fa6ffeec9f87871276057d84f892
2017-07-27 11:50:59 -07:00
Sam Goldman 9d54a10cf8 @allow-large-files Deploy Flow v0.51.0 to xplat
Reviewed By: gabelevi

Differential Revision: D5481707

fbshipit-source-id: 66f7417e7ecf1dea609a3efbecfed45dcbc9527f
2017-07-24 14:35:09 -07:00
Alex Dvornikov 70edc2fd80 Upgrade metro-bundler to v0.10.0
Reviewed By: davidaurelio

Differential Revision: D5469746

fbshipit-source-id: 1d2c0f6c5bb9761cfc54b6c9fdbb1a9f20f535ea
2017-07-21 09:40:15 -07:00
Nat Mote 8e8fecdcf8 Upgrade to Flow v0.50.0
Reviewed By: gabelevi

Differential Revision: D5438335

fbshipit-source-id: 7a96f68e7147e984c6f0cb84f957e639d36ca6b3
2017-07-20 14:48:56 -07:00
Miguel Jimenez Esun 737abe3b76 Revert D5388655: BREAKING: Add regenerator-runtime on demand, based on the files
Differential Revision: D5388655

fbshipit-source-id: 2f92d6ae69f4772195aeca7493f53209388b3ad0
2017-07-19 12:08:38 -07:00
Miguel Jimenez Esun 3103258ca0 BREAKING: Add regenerator-runtime on demand, based on the files
Summary:
Adding a Babel plugin that will analyze the file looking for any potential candidate to use `regenerator-runtime`, and if so, will inject dynamically the module. The module is injected per file, so we avoid polluting the global environment. The plugin is also able to inject the `require` call beforehand, so that the inliner can pick them and inline them.

The Babel plugin is part of `react-native-babel-preset`, so as long as you are using this preset you are safe. If not, you should include the specific transformer into your list of plugins, as `react-native-babel-preset/transforms/transform-regenerator-runtime-insertion.js`.

Reviewed By: davidaurelio

Differential Revision: D5388655

fbshipit-source-id: dc403f3d5e2d807529eb8569a85c45fec36a6a3e
2017-07-19 11:04:33 -07:00
Trevor Brindle 95ee3f5cab added info CLI command
Summary:
Many issues filed on Github are missing platform/toolchain version information. Others have different ways of writing it, and require the issue writer to look in multiple places for these versions.
Other CLI tools like Ionic have this function, and it's incredibly useful. Related to https://github.com/facebook/react-native/issues/14420

Run in terminal/command prompt `react-native info`

```
trevors-imac:AwesomeProject tabrindle$ react-native info
Versions:
  React Native:  1000.0.0
  OS:  macOS Sierra
  Node:  v6.10.3
  Yarn:  0.24.5
  npm:  5.0.0
  Xcode:  Xcode 8.3.3 Build version 8E3004b
```

- CLA signed 
- Verify functionality + implementation
Closes https://github.com/facebook/react-native/pull/14428

Differential Revision: D5392446

Pulled By: hramos

fbshipit-source-id: 460079f3860c0af1e0b77bf26552c26032e974be
2017-07-18 11:45:47 -07:00
Miguel Jimenez Esun 4583cc9f02 Enable Jest tests
Reviewed By: cpojer

Differential Revision: D5433324

fbshipit-source-id: d577d5245c884b4036a2ff2d1521eec6f6acf5ab
2017-07-18 07:35:28 -07:00
Miguel Jimenez Esun 1fe8f89bc8 Update Jest to 20.1.0, chi.1
Reviewed By: davidaurelio

Differential Revision: D5423945

fbshipit-source-id: deb58ba9288883b5d671148aeaa59da6629d0de4
2017-07-14 10:19:32 -07:00
Miguel Jimenez Esun 6dd9d16833 Move Array<string> to $ReadOnlyArray<string>. Separate polyfill list into a file.
Summary: Move the returned type of `getPolyfills` from a standard `Array` to a read-only one, so that we make sure the array is not modified once created. Also, refactor the list of polyfills included by default to a generic, central file, then require it both from the CLI utils as well as the development server.

Reviewed By: jeanlauliac

Differential Revision: D5406553

fbshipit-source-id: ab980288bb1c625338de469da77dd6fc70bcedbc
2017-07-13 03:38:23 -07:00
Eli White fc86f25f9a Run eslint on all js files
Reviewed By: zertosh

Differential Revision: D5405047

fbshipit-source-id: 5ade9d8beb3688d8bb08a208709c0dbf1ec671b2
2017-07-12 14:09:53 -07:00
Brian Vaughn 1d353b4ef7 Try to match React DevTools theme with current Nuclide theme
Reviewed By: spicyj

Differential Revision: D5362305

fbshipit-source-id: 7d8464f768d124cbb31ba211d81a01a89d6bf692
2017-07-12 12:24:43 -07:00
Eli White 10230707cb Enforce Prettier for @format
Reviewed By: zertosh

Differential Revision: D5392376

fbshipit-source-id: 6f09a4d8f4542c3a74aadb8d62fd216529a4f2bc
2017-07-10 15:37:36 -07:00
Christoph Nakazawa e0eee0bb49 Revert D5321193: BREAKING: Add regenerator-runtime on demand, based on the files
Differential Revision: D5321193

fbshipit-source-id: 9113ed78e59ae9e9f3f86ca2fda2db3bd8c0dd7c
2017-07-07 10:48:37 -07:00
David Aurelio 9b06a3193e Update `throat` dependency to 3.2.0
Summary: it has flow definitions now. OMG!

Reviewed By: cpojer

Differential Revision: D5381183

fbshipit-source-id: bdb3863b24da9802eeeb8a7d08f05d629f735178
2017-07-07 09:21:24 -07:00
Miguel Jimenez Esun 361f03badb BREAKING: Add regenerator-runtime on demand, based on the files
Summary:
Adding a Babel plugin that will analyze the file looking for any potential candidate to use `regenerator-runtime`, and if so, will inject dynamically the module. The module is injected per file, so we avoid polluting the global environment. The plugin is also able to inject the `require` call beforehand, so that the inliner can pick them and inline them.

The Babel plugin is part of `react-native-babel-preset`, so as long as you are using this preset you are safe. If not, you should include the specific transformer into your list of plugins, as `react-native-babel-preset/transforms/transform-regenerator-runtime-insertion.js`.

Reviewed By: davidaurelio

Differential Revision: D5321193

fbshipit-source-id: fd4805b28c8a2b986842e23570a64003370d2067
2017-07-07 07:47:13 -07:00
James Ide 6e13adbf56 Remove remnants of the packager
Summary:
There were still some references to "packager/" that are no longer used since the `packager` directory has been deleted after moving to Metro. Cleaned up the ones that were doing nothing and updated the references that are still meaningful.
Closes https://github.com/facebook/react-native/pull/14881

Reviewed By: cpojer

Differential Revision: D5380731

Pulled By: javache

fbshipit-source-id: 1355268f48db47343d0d38fae2598b64c8c01475
2017-07-07 03:06:21 -07:00
Miguel Jimenez Esun e7c1cf5b7d Add a new babel transformer for inlining regenerator-runtime per file
Reviewed By: davidaurelio

Differential Revision: D5364134

fbshipit-source-id: 45aae705f961819d5a8e3a8a23c2e8b9300d3cb5
2017-07-03 10:04:22 -07:00
Miguel Jimenez Esun 304dc6bd77 Update Jest to 20.1 alpha 3
Reviewed By: cpojer

Differential Revision: D5356174

fbshipit-source-id: b718f9e40d731999329b7ff0e6d498a523772c84
2017-07-03 10:04:22 -07:00
Jean Lauliac d494282fd1 metro-bundler: upgrade jest-haste-map
Reviewed By: cpojer

Differential Revision: D5346860

fbshipit-source-id: 16e9eeeb28804af81428745fda4ffc05a461845c
2017-06-29 08:31:19 -07:00
Marshall Roch 16747dd807 @allow-large-files Flow v0.49
Reviewed By: nmote

Differential Revision: D5339224

fbshipit-source-id: a18f0afb2ce75df736662d84951e392db1e2dbbf
2017-06-28 21:32:48 -07:00
David Aurelio 1faf40b02a Upgrade metro-bundler to v0.9.0
Summary: Upgrade metro-bundler to v0.9.0. This version has no functional change. The only change is that the structure of the npm package reflects the structure of the source code.

Reviewed By: bestander

Differential Revision: D5315651

fbshipit-source-id: 3a69337106d4ccf708823c80d304941973360e8e
2017-06-24 17:15:55 -07:00
David Aurelio 1230549c77 Upgrade babel-preset-fbjs
Summary: Upgrades `babel-preset-fbjs` to v2.1.4, which has better support for moving es2015 imports around.

Reviewed By: BYK

Differential Revision: D5287818

fbshipit-source-id: a2fa7b0267b913f126b37946cf24dd4c5146c245
2017-06-21 02:00:44 -07:00
David Aurelio 86328e9266 Upgrade `babel-transform-react-native` to `v2.0.0`
Summary: Upgrades `babel-transform-react-native` to v2.0.0, which exposes a factory function. That way, the preset will include/exclude dev tools according to `process.env.NODE_ENV` even when that value changes over time.

Reviewed By: cpojer

Differential Revision: D5246801

fbshipit-source-id: 74a1e7e0fb1476750e1fe21ce4befd475907b415
2017-06-19 08:22:23 -07:00
Tim Yung ce5ae53669 RN: Replace Workaround w/ Upgraded `mock-fs`
Reviewed By: cpojer

Differential Revision: D5271612

fbshipit-source-id: 1579f34d4c4e64706f2f128e848b5f6d3d838097
2017-06-18 01:01:59 -07:00
Avik Chaudhuri 71401c1185 update xplat/js to flow 0.48.0
Reviewed By: zertosh

Differential Revision: D5243415

fbshipit-source-id: 78ea4f7f29bcd6a70650f24ceb05f06b18b39018
2017-06-14 15:47:21 -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 383915caeb use default jest automock config setting
Reviewed By: cpojer

Differential Revision: D5246071

fbshipit-source-id: aec9078a5187621745507c4411c40aa993d9d94f
2017-06-14 10:07:58 -07:00
Lxxyx 96d3be18bf upgrade image-size version fix caculate webp image size bugs
Summary:
When I try to use webp for app. But some webp images get an error message `unsupported file type` by image-size@0.3.5.

And I in image-size repo I found a issue https://github.com/image-size/image-size/issues/65.
This is the same problem.

And try image-size^0.5.1 the error fixed.

![image](https://cloud.githubusercontent.com/assets/13161470/23597366/403a3070-026d-11e7-8666-f4357f1eee73.png)
Closes https://github.com/facebook/react-native/pull/14238

Reviewed By: davidaurelio

Differential Revision: D5145534

Pulled By: javache

fbshipit-source-id: a2aeeae19e928ffefbd0b32501d34069ed37386d
2017-06-13 09:31:55 -07:00
Christoph Pojer 29d9c35e12 Add --maxWorkers flag and allow transformers to run in-band.
Summary:
This diff cleans up some cruft and adds some features:

* It removes the usage of an env variable to control workers.
* It removes the lazy and handwavy calculation on how many workers to use for jest-haste-map. Jest itself uses the maximum amount of workers available and it has never been reported as an issue – especially since it is a one-time startup cost of about 3 seconds on a cold cache only.
* It adds a `--max-workers` flag to replace the env variable. This one is able to control both the number of workers for `jest-haste-map` as well as the transformers.
* It makes the transformers run in the parent process if 1 or fewer workers are are specified. This should help with debugging.

Once you approve this diff, I will publish a new version of metro to npm and update the version used in RN and remove the use of the env variable altogether: https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=&case=false&view=default&extre=&s=REACT_NATIVE_MAX_WORKERS&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=

Note: the process of adding a CLI option is really broken. Commander also has a weird API. We should consider building a better public API for Metro and then consider how to build a new CLI on top of it and simplify our internal integration. I really don't like how Metro is integrated across pieces of the RN cli in ways that is hard to manage. But that is a larger task for another time :)

Reviewed By: jeanlauliac

Differential Revision: D5217726

fbshipit-source-id: 74efddbb87755a9e744c816fbc62efa21f6a79bf
2017-06-13 09:16:03 -07:00