Summary:
Improve current docker by
* Make android build version and tools version config easily, and bump them to 26.
* use less file layer
* fix current docker error (the maintainer line)
* fix typo in package.json
Since ci on master branch still failed, and I run test the docker build. And in the process I found buck related config still is 23.
none
[GENERAL] [ENHANCEMENT] [CI] - Improve docker
Closes https://github.com/facebook/react-native/pull/19354
Differential Revision: D8148376
Pulled By: hramos
fbshipit-source-id: 8f965860487467c1a219e64588ff3000d571ddc1
Summary:
Upgrade Babel from beta.40 to beta.47
There are two important breaking changes here.
- If you want an AST from the Babel `transform` functions you must pass on `ast:true` in the options.
- The `sourceType` is now the only source of truth on whether to parse with the Script or Module goal. It defaults to `script` and can also be `module` or `unambiguous`. In the `unambiguous` case it will first try to parse with the Module goal and only if it crashes it will try again with the Script goal.
Beyond that there were some fixes and some smaller changes that may affect you. See the Babel changelogs for details (https://github.com/babel/babel/tags).
Also updated the way we generate the babel helpers file.
Reviewed By: rubennorte
Differential Revision: D8075280
fbshipit-source-id: 2bb902690e8a4b19d9cada2b7b0c94812b3d4f0f
Summary:
We were incorrectly writing jest's junit output to ~/reports/ instead of ~/react-native/reports.
Run on Circle and confirm JUnit test results are rendered: https://circleci.com/gh/hramos/react-native/2208
[INTERNAL][MINOR][CI] - JUnit test collection
[skip ci]
Closes https://github.com/facebook/react-native/pull/19349
Differential Revision: D8062654
Pulled By: hramos
fbshipit-source-id: 72066270042dfae8afce62469fcfabb57bd405a6
Summary:
`eslint-plugin-react-native` was a dependencies. I think it should be a dev dependencies like `eslint-plugin-eslint-comments`, `eslint-plugin-flowtype`, `eslint-plugin-jest`, `eslint-plugin-prettier` and `eslint-plugin-react`.
No need
Not needed
[INTERNAL] [ENHANCEMENT] [./package.json] - Move `eslint-plugin-react-native` to devDependencies.
Closes https://github.com/facebook/react-native/pull/18851
Differential Revision: D7991437
Pulled By: hramos
fbshipit-source-id: 5481290423848b9c34df24629086239600d42274
Summary:
Quick update to switch to a new React Native CI org on Docker Hub. Note that the images are not yet automatically generated on CI. We could do this on Circle CI in certain scenarios:
- Base image needs to be updated whenever the Android development environment has changed (e.g. switch to a new SDK version, build tools, etc)
- Tests image should ideally be updated on each commit
This PR should be safe to land as Circle CI is not yet using these images.
Closes https://github.com/facebook/react-native/pull/19192
Differential Revision: D7939209
Pulled By: hramos
fbshipit-source-id: 0f845a8fffbf8f5b9cecef4fa0ba802bc755f7aa
Summary:
To prevent people from linking file:// or other URLs inside RN WebViews, default <WebView> to not allowing those types of URLs.
This adds the originWhitelist to specify other schemes or domains to be allowed.
If the url is not allowed, it will be opened in Safari/by the OS instead.
Reviewed By: yungsters
Differential Revision: D7833203
fbshipit-source-id: 6881acd3b434d17910240e4edd585c0a10b5df8c
Summary: bumps the version after cache updates.
Reviewed By: mjesun
Differential Revision: D7776561
fbshipit-source-id: 8afe97323544116f147b93b92e5aa42ec1124d3a
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
Summary: Moves the `buildRegExps` function from `react-native` to `metro-babel-register`. This way, it is easier to reuse, and we can remove FB-specific logic from React Native.
Reviewed By: jeanlauliac, mjesun
Differential Revision: D7727483
fbshipit-source-id: 0f7773ff044033c465f0712c523a0aef61bf8444
Summary:
This adds a locked down version of Babel 7 (beta.40) to the dev dependencies for RN because it's used in testing.
See also; f8d6b97140 (r28569573)
Reviewed By: davidaurelio
Differential Revision: D7685590
fbshipit-source-id: eae8379b586d82527788e9812a573ab321dfc8e3
Summary: Moves the implementation of Buck’s worker protocol into its own package and babelRegisterOnly for better reusability.
Reviewed By: rafeca
Differential Revision: D7666896
fbshipit-source-id: ae297494ced3b8dd1f9d90983a640643d6ce7896
Summary:
Noticed that we're on a version of node-notifier that has a leak mentioned [here](https://github.com/mikaelbr/node-notifier/issues/183) and fixed in the newest version.
Automated tests
[INTERNAL] [BUGFIX] [package.json] - Update node-notifier dependency
Closes https://github.com/facebook/react-native/pull/18033
Differential Revision: D7102637
Pulled By: hramos
fbshipit-source-id: 850f3d826c1d880a6281d95e4d5af68e9af89927
Summary: Releasing a new version of metro with an executable CLI
Reviewed By: davidaurelio
Differential Revision: D6808207
fbshipit-source-id: 68f6522924ea8ad7b6f9aaa3e952ebcf23d2cf8b
Summary:
Use newer Docker image and add script that rebuilds the image locally
Rebuilding should be rarely needed, but in this case we did need a newer BUCK version
To run tests locally:
```
npm run test-android-setup
npm run test-android-build
npm run test-android-run-unit-test
```
If a newer android-base image is needed, just run `npm run test-android-build-base` to rebuild the image locally. Ping hramos if the Docker hub image is too out of date.
Closes https://github.com/facebook/react-native/pull/17325
Differential Revision: D6630793
Pulled By: hramos
fbshipit-source-id: ec76ec86aec0debf914649b7ec5fdafccf28fec7
Summary:
`metro-bundler` v0.21 contains a rewritten bundling mechanism, with simplified logic and much faster rebuild times, called delta bundler. This release contains a couple of breaking changes:
* Now, when using a custom transformer, the list of additional babel plugins to apply are passed to the `transform()` method. These are used in non-dev mode for optimization purposes (Check 367a5f5db8 (diff-40653f0c822ac59a5af13d5b4ab31d84) to see how to handle them from the transformer).
* Now, when using a custom transformer outputting `rawMappings`, the transformer does not need to call the `compactMappings` method before returning (check d74685fd1d (diff-40653f0c822ac59a5af13d5b4ab31d84) for more info).
* We've removed support for two config parameters: `postProcessModules` and `postProcessBundleSourcemap`.
Reviewed By: davidaurelio
Differential Revision: D6186035
fbshipit-source-id: 242c5c2a954c6b9b6f339d345f888eaa44704579
Summary:
Prettier 1.7.0 has config file + pragma support so this works really well with the current prettier usage. Also added a prettier script to run it (taken mostly from the relay repo) and ran it which caused 1 files to change (probably wasn't updated when upgrading prettier to 1.7.0).
**Test plan**
Made sure flow still checked
Run 'yarn prettier', should format only files with `format` using the config in package.json.
Closes https://github.com/facebook/react-native/pull/16176
Differential Revision: D6256899
Pulled By: shergin
fbshipit-source-id: 646d90c15db8032b7b551da228d26d370babf125
Summary:
Adds the dependency to the Babel preset's package.json and enables the plugin only when `**` exists in a source file.
This is https://github.com/facebook/react-native/pull/12339 with merge conflicts resolved and putting the plugin behind a cheaper heuristic.
Closes https://github.com/facebook/react-native/pull/16191
Differential Revision: D6023857
Pulled By: hramos
fbshipit-source-id: 16f4a5f14780c27d2ef95fa7e8d8b611fa992aa0
Summary:
This is first PR from the series I am going to be sending as a result of fixing 0.50-stable test suite. This one removes `mockFS` dependency that has been causing failures on Node 6.x container.
Here's build before this change: https://circleci.com/gh/facebook/react-native/22529
Here's build after this change: https://circleci.com/gh/facebook/react-native/22538 (green)
Note that the CI may be still red as there are other PRs to be addressed. You can see this in the wild on 0.50.
Closes https://github.com/facebook/react-native/pull/16301
Differential Revision: D6031352
Pulled By: hramos
fbshipit-source-id: 5c97ae6c87864c094e29e5d8987521071c67f5bd
Summary:
local-cli now depends on the node-notifier package but it wasn't listed in package.json.
Closes https://github.com/facebook/react-native/pull/15905
Reviewed By: TheSavior
Differential Revision: D5814773
Pulled By: hramos
fbshipit-source-id: 3c397b0a21fea5009f35a69515e70a6d78ece375
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
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
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
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
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
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