Summary:
Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size.
# Update process
Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release:
1: Manually update "react-devtools-core" versions:
```
js/package.json
js/react-native-github/package.json
nuclide/package.json
sonar/desktop/app/package.json
sonar/desktop/plugins/reactdevtools/package.json
vscode/modules/vscode-webview/package.json
```
2: Setup Yarn proxy:
```
yarn config set proxy http://fwdproxy:8080/
yarn config set https-proxy http://fwdproxy:8080
```
3: Run "yarn" in each of the above directories.
4: Run the lockfile shell script:
```
~/xplat/js/scripts/update-oss-yarn-lockfile.sh
```
5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running
```
js1 build buckfiles
```
## Changelog:
[General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0.
Reviewed By: cpojer, gaearon
Differential Revision: D20676091
fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a
Summary:
Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class.
Changelog:
[General][Changed] - Updated the React Hooks ESLint Plugin
Reviewed By: cpojer
Differential Revision: D20675528
fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6
Summary:
This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes.
Changelog:
[General][Changed] - Update to React 16.13.1
Reviewed By: cpojer
Differential Revision: D20642909
fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html
Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.
Reviewed By: zertosh
Differential Revision: D20636268
fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
Summary:
Upgrade detox version to avoid a crash, per https://github.com/wix/Detox/issues/1947#issuecomment-596547229.
Changelog: [Internal] Upgrade Detox to 15.4.4.
Reviewed By: TheSavior
Differential Revision: D20344541
fbshipit-source-id: a7a3d97b858dbbb13a796dbc3c5c0c47f3ffe556
Summary:
Bumps `promise` from 7.1.1 to 8.0.3. The package [hasn't changed significantly between these two versions](https://github.com/then/promise/compare/7.1.1...8.0.3). This is part housekeeping, part making it easier to make PRs to `promise` and then upgrade after they're merged.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D20094814
fbshipit-source-id: d8933bd39aa3e9f9b19e4d5a09b0828ecc032085
Summary:
Used the deploy_xplat.sh script.
There were a few errors after running the script, so I reverted the changes to those files and the errors went away. This is expected because the new version does not introduce errors, so these errors were caused by the deploy script.
Changelog: [Internal]
Reviewed By: samwgoldman
Differential Revision: D20070916
fbshipit-source-id: 56b8f56eab952010f44219ce1b5c4ec66a0b084a
Summary:
Upgrade detox version so the codec of the recording of the iOS simulator can be specified.
Changelog: [Internal] Upgrade Detox to 15.4.0
Reviewed By: hramos, TheSavior
Differential Revision: D20079348
fbshipit-source-id: 4effc040286b92b468550fdbec1a2373339134d1
Summary:
Some dependencies don't need to be downloaded by consumers:
- `connect` is only used in RNTester, moved to dev dependencies
- `escape-string-regexp` is not used directly, removed
- `eslint-plugin-relay` was in both deps and dev deps, removed from deps
Overall, this results in node_modules being 3.3MB smaller on clean install.
cc cpojer as you may already be aware. Feel free to treat these as a reference when optimizing internal deps.
## Changelog
[Internal] [Changed] - Remove connect, escape-string-regexp, eslint-plugin-relay deps
Pull Request resolved: https://github.com/facebook/react-native/pull/28171
Test Plan: CI passes
Reviewed By: hramos
Differential Revision: D20097591
Pulled By: cpojer
fbshipit-source-id: 0800751996accf39fd777bc6458be19f66f436a3
Summary:
Upgrading CLI to latest. alloy should have done a local commit on the 0.62 branch and this pr is just meant to sync the status between master and 0.62 branch.
cc grabbou alloy
nit: it seems that the new 4.1.1 CLI version pulls in quite a bit of dependencies, I hope it's ok. It seems it's mostly because of `pretty-format`.
## Changelog
[Internal] [Changed] - Bump CLI to ^4.1.x
Pull Request resolved: https://github.com/facebook/react-native/pull/28172
Test Plan: None
Reviewed By: hramos
Differential Revision: D20097587
Pulled By: cpojer
fbshipit-source-id: ec95498ced374d1e4e6b696f2167fedf66395ac9
Summary:
Make the script ready for picking in 0.62.0-rc.3.
* Rename the script to remove ambiguity. “autolinking” is a CLI feature where 3rd-party pods are automatically discovered: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
* Make the Flipper version of the pods configurable, as requested [here](https://github.com/facebook/react-native/pull/28044#discussion_r378662636).
* Make RNTester’s Podfile use the same form as the template–including enabling Flipper by moving the CPP define into the right place in the Xcode project and out of the Podfile.
* Get rid of Podfile.lock thrashing by making the default CDN spec source explicit.
## Changelog
[iOS] [Changed] - Disambiguate autolinking-ios.rb script from CLI’s “autolinking” feature and bring RNTester & template in line.
Pull Request resolved: https://github.com/facebook/react-native/pull/28077
Test Plan: RNTester builds, as does a new application.
Reviewed By: PeteTheHeat
Differential Revision: D19956392
Pulled By: TheSavior
fbshipit-source-id: 6c800ddb646b49fc45c088978e2794cd7b60ea48
Summary:
We've updated the version of plugin to 1.7.0 that includes similar fix to D19910353
## Changelog:
Changelog: [Internal]
Reviewed By: kassens
Differential Revision: D19912264
fbshipit-source-id: 973d4211bf56e33da427e01c9c561e15f7406ffb
Summary:
Use the latest published release of hermes-engine.
Changelog: [Android] [Changed] - Upgraded to Hermes 0.4.0
Reviewed By: mhorowitz
Differential Revision: D19866355
fbshipit-source-id: be2bed957bc034d3e6107804229abc2d83e40d40
Summary:
This updates the lint to include an update to `getModuleName` that landed in the compiler a few days ago so that lint and compiler requirements match in all cases again.
js1 upgrade dependency -p eslint-plugin-relay@1.6.0
Changelog:
[General] [Changed] - upgrade eslint-plugin-relay to 1.6.0
Reviewed By: alunyov
Differential Revision: D19856543
fbshipit-source-id: 2fe3b49f6cd2d170132132557ec8834ca7e94181
Summary:
This diff adds required Detox integrations to the RNTester app to be able to run Detox end-to-end tests on the Android version of the app.
* Instructions at https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md were followed.
* The `minSdkVersion` version for the app was bumped to 18, as required by Detox.
* I also added build and test configurations in `package.json`
* The debug app is able to run some of the existing tests, but the release app instacrashes. I do not know the reason for the instacrash at this time.
* CI integrations to build and test the Android app will be added in future diffs
Changelog:
[Internal] add Detox integrations to the RNTester Android app
Reviewed By: TheSavior
Differential Revision: D19566834
fbshipit-source-id: 5dd506bbdbb426a5db18146e5dc7c450a27b1d0c
Summary:
We use this for RN tester but it is not currently included in npm releases. It cleans up the podfile a lot and will make adding / removing pods easier in the future since it won't require users to update their project.
## Changelog
[iOS] [Added] - Use autolink script in template on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/27984
Test Plan: Not sure if there is a way to end to end test this but I've been using this autolink script in my fork for a while.
Differential Revision: D19787729
Pulled By: cpojer
fbshipit-source-id: b843ea723085830f13e8f0149833d1beb1efdfac
Summary:
Upgrading CLI to latest. This diff is intended to be cherry-picked to 0.62.
cc grabbou kelset
## Changelog
[Internal] [Changed] - Bump CLI to ^4.0.0
Pull Request resolved: https://github.com/facebook/react-native/pull/27976
Test Plan: None
Differential Revision: D19769017
Pulled By: cpojer
fbshipit-source-id: c3f5cd8afc0bc26372ee9f9e9dbaf4e68cdec216
Summary:
Upgrades Jest to the latest 24.x release, [24.9.0](https://github.com/facebook/jest/blob/master/CHANGELOG.md#2490). This is a minor update as we are already on 24.x across the board.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D19683451
fbshipit-source-id: 12eaeb8b6341d81daf6bdc8f35728967729f291e
Summary:
Now that react-native has got rid of all the uses of create-react-class, it doesn't need to be listed as a dependency.
## Changelog
[General] [Removed] - Removed create-react-class from dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/27861
Test Plan: Will hit build break when building bundle if its still needed. Other risks are if community packages are relying on create-react-class in their code, but not declaring it in their dependencies. -- But those packages should fix their dependencies.
Differential Revision: D19568065
Pulled By: cpojer
fbshipit-source-id: be26c3376aaebfa829def12983b04349ba9907ae
Summary:
Use newer detox version to take advantage of Android compatibility fix
Changelog:
[Internal] Updating Detox from 14.5.1 to 15.1.4
Reviewed By: TheSavior
Differential Revision: D19564679
fbshipit-source-id: adc3c9acc8b2004b201b7106045ae0d3d3e9e779
Summary:
The latest xcode version removed iPhone 6s, so we need to bump to the latest simulator listed that has 3d touch.
## Changelog
[General] [Fix] - Bump e2e simulator version
Pull Request resolved: https://github.com/facebook/react-native/pull/27733
Test Plan: - `yarn build-ios-e2e && yarn test-ios-e2e `
Reviewed By: hramos, sammy-SC
Differential Revision: D19345576
Pulled By: rickhanlonii
fbshipit-source-id: 428cb83ccb899409e972551f18df580174adee91
Summary:
This diff adds syntax highlighting to LogBox CodeFrames. It works by turning Ansi codes into "JSON" (it's actually just a JS object but the third-party API uses JSON as terminology) and then turning that into `<Text>` elements.
The syntax theme is called Afterglow and I took it from https://iterm2colorschemes.com/. Happy for anyone who wants to further tweak it! I installed this into iTerm and extracted the colors from there as it has a color picker and the labels directly map to the color classes exposed by the `anser` package.
Changelog: [Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: rickhanlonii
Differential Revision: D18618897
fbshipit-source-id: 64815619fc482e08b5671f492dabda8c8c0ceca5
Summary:
This version of Detox has a fix that is required to be compatible with the current React Native API.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D18495247
fbshipit-source-id: b329975b33835e12b7f5b5d1f1aa3eb4a82c1950
Summary:
Upgrading CLI to latest. It's likely not yet compatible with master, because we depend on Metro 0.56, and master is on 0.57. This diff is intended to be cherry-picked to 0.61 and 0.62.
cc grabbou
## Changelog
[Internal] [Changed] - Bump CLI to ^3.0.0
Pull Request resolved: https://github.com/facebook/react-native/pull/27235
Test Plan: None
Differential Revision: D18527709
Pulled By: cpojer
fbshipit-source-id: 44448058c48a66d22a1d71abdc908f532f5aa547
Summary:
This version is needed to correctly generate inexact flow object type
annotations.
Keeping the upgrade minimal to reduce exposure to runtime code generation and avoiding a full babel upgrade.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D18429751
fbshipit-source-id: d83621ed773566005a4dcdd4f99ded5101dc74b4
Summary:
`mem` package vulnerability found.
> In nodejs-mem before version 4.0.0 there is a memory leak due to old results not being removed from the cache despite reaching maxAge. Exploitation of this can lead to exhaustion of memory and subsequent denial of service.
ref: da4e4398cb
`relay-compiler` depends on that.
```
relay-compiler@6.0.0
└─┬ yargs@9.0.1
└─┬ os-locale@2.1.0
└── mem@1.1.0
```
Pull Request resolved: https://github.com/facebook/relay/pull/2934
Test Plan:
- Tested the Relay compiler briefly on the open source examples project, seems like yargs doesn't error
- `js1 build relay --project facebook`
- `js1 jest`
Reviewed By: alunyov
Differential Revision: D18397131
Pulled By: kassens
fbshipit-source-id: 8b7fc5e237c7b4ce14ff3809cdd59d243e7c4523
Summary:
This updates [`eslint-plugin-react-native`](https://github.com/intellicode/eslint-plugin-react-native) to `3.8.1`.
Includes some minor updates and fixes, and avoids errors related to incorrect peer dependencies when using ESLint 6+
```
error "react-native#eslint-plugin-react-native#eslint@^3.17.0 || ^4 || ^5" doesn't satisfy found match of "eslint@6.6.0"
```
## Changelog
[Internal] [Changed] - Update eslint-plugin-react-native to 3.8.1
Pull Request resolved: https://github.com/facebook/react-native/pull/27114
Test Plan: Check that ESlint and CI passes.
Differential Revision: D18323510
Pulled By: cpojer
fbshipit-source-id: 0257eaebe295fec4b0e52b2f08cf62336fc147a3
Summary: Pulls the `0.56.3` release tag internally, by adding the same changes and upgrading react-native-github metro dependencies to `0.56.3`.
Reviewed By: motiz88
Differential Revision: D18114219
fbshipit-source-id: 0be58255eb8c79267e8ea30ab2e9e3d96a794b92
Summary:
Used `yarn` to update all of them except `react-native-github`. That one I did by hand. Sandcastle will let me know if I screwed it up too badly.
## Changelog:
[General] [Internal] - Upgrade `flow-bin` from 0.110.0 to 0.110.1
(Note: this ignores all push blocking failures!)
Reviewed By: mroch
Differential Revision: D18108512
fbshipit-source-id: a04b38f0fd4ec3a4008d7c61c23fa01eaaf8a8e4
Summary: Ports an internal ESLint rule used at Facebook, `error-subclass-name`, to cover the React Native codebase. This rule enforces that error classes ( = those with PascalCase names ending with `Error`) only extend other error classes, and that regular functions don't have names that could be mistaken for those of error classes.
Reviewed By: rubennorte
Differential Revision: D17829298
fbshipit-source-id: 834e457343034a0897ab394b6a2d941789953d2e
Summary:
We used to generate the documentation for the website but moved the docs to another repo.
There is some work on the docs to be able to ingest info from this repo in order to go back to generating API information. The current thinking is we will generate this JSON file and the website repo will pull it in to generate the docs.
I plan to make the script run on CI and fail if the generated file isn't updated, in a follow up PR.
Reviewed By: zackargyle
Differential Revision: D17183936
fbshipit-source-id: 99ce3fa5d7becc0ef20df5d439b175eedbe546f3
Summary: This is part of Lean Core.
Reviewed By: rubennorte
Differential Revision: D17343246
fbshipit-source-id: 1185e6c1f75e8272048ce1a24c2f195728d436c4
Summary: I am unsure whether there was a reason not to use an `index.js` file from the beginning. It always struck me as confusing and odd to have the main API hidden in a folder somewhere. This changes RN to use the standard `index.js` file that is common in almost all JavaScript packages.
Reviewed By: yungsters, rubennorte
Differential Revision: D17314423
fbshipit-source-id: 10eaf4fddd41e91163de7d10c0879b623dab00d7
Summary:
Bump eslint-plugin-relay version to 1.3.11 on fbsource
`js1 upgrade dependency --package eslint-plugin-relay@1.3.11`
And enable lint rule for checking second argument on relay hooks
Reviewed By: jstejada
Differential Revision: D17261273
fbshipit-source-id: 1d898535079ba5b7a7ee0d179e6e68f6a5e2bd46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/26143
A new useColorScheme hook is provided as the preferred way of accessing the user's preferred color scheme (aka Dark Mode).
Changelog:
[General] [Added] - useColorScheme hook
Reviewed By: yungsters
Differential Revision: D16860954
fbshipit-source-id: 8a2b6c2624ed7cf431ab331158bc5456cde1f185
Summary: Bump eslint-plugin-relay version to 1.3.10 which contains fix for JS errors that blocks enabling the rules.
Reviewed By: kassens
Differential Revision: D17052055
fbshipit-source-id: 74867c16d128d2c0767e92861575ffcbe20370cc
Summary:
This Diff is being posted for discussion purposes. It will not be ready to land until React DevTools v4 has been published to NPM.
Update React Native to be compatible with the [new version 4 React DevTools extension](https://github.com/bvaughn/react-devtools-experimental).
**Note that this is a breaking change**, as the version 3 and version 4 backends are **not compatible**. Once this update ships (in React Native) users will be required to update their version of the [`react-devtools` NPM package](https://www.npmjs.com/package/react-devtools). The same will be true for IDEs like Nuclide as well as other developer tools like Flipper and [React Native Debugger](https://github.com/jhen0409/react-native-debugger).
Related changes also included in this diff are:
* Pass an explicit whitelist of style props for the React Native style editor (to improve developer experience when adding new styles).
* Update `YellowBox` console patching to coordinate with DevTools own console patching.
* Also improved formatting slightly by not calling `stringifySafe` for strings (since this adds visible quotation marks).
Regarding the console patching- component stacks will be appended by default when there's no DevTools frontend open. The frontend will provide an option to turn this behavior off though:
{F168852162}
React DevTools will detect if the new version is used with an older version of React Native, and offer inline upgrade instructions:
{F169306863}
**Note that the change to the `RCTEnableTurboModule` will not be included in this Diff**. I've just turned those off temporarily so I can use v8+Chrome for debugging.
Reviewed By: rickhanlonii
Differential Revision: D15973709
fbshipit-source-id: bb9d83fc829af4693e7a10a622acc95a411a48e4
Summary: This catches some errors about hooks being used at the top level in a module
Reviewed By: gaearon
Differential Revision: D16945591
fbshipit-source-id: 116ed24b4394b1f516a2ebcd75977d2ba5c57afb
Summary:
Bumps the CLI to v3 alpha which includes Metro 0.56
## Changelog
[Internal] [Changed] - Bump CLI to ^3.0.0-alpha.1
Pull Request resolved: https://github.com/facebook/react-native/pull/26028
Test Plan: None
Differential Revision: D16763732
Pulled By: cpojer
fbshipit-source-id: 8f35fb80913f623cb44d37208f49040d4a33b07b
Summary:
I created a new test project today using RN 0.60.3 and saw that prettier is now used with eslint. After looking at the `react-native-community` eslint config, I notice that it wasn't using the [recommended configuration](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration) of `eslint-plugin-prettier`
This PR adds the `eslint-config-prettier` to avoid conflicts between eslint and prettier, it also adds the `prettier/react` config to avoid problems with the `eslint-plugin-react`.
## Changelog
[General] [Changed] - Use eslint-plugin-prettier recommended config
Pull Request resolved: https://github.com/facebook/react-native/pull/25674
Test Plan: - ✅ Ensure there is no difference on this repo (no ESLint errors, same number of warnings, and no changes when running prettier).
Differential Revision: D16666178
Pulled By: cpojer
fbshipit-source-id: 70f81db793866acc88388b7b00a496aab5e0b156
Summary: Brings in https://github.com/facebook/react/pull/16302. We were passing roots to a wrong renderer, hence a confusing Fabric-only crash.
Reviewed By: JoshuaGross
Differential Revision: D16672454
fbshipit-source-id: 115894eb375b50da09d145c57f15c7d5668b926d
Summary: Had to split it out if Jest because of tomocchino's patents. I hate it. Anyway, I brought it back into RN because I can't live without it.
Reviewed By: rubennorte
Differential Revision: D16560078
fbshipit-source-id: c394e248dcd048866a31a7b08b233d8966af9ee3
Summary:
It appears that Electron (or the version of Chromium it uses) has a bug that causes a `webview` process to crash if `URL.createObjectURL` is used.
Before releasing `react-devtools-core` 3.5.0, we updated Webpack and the loaders we used. Apparently the version of `style-loader` we now use makes use of the `URL.createObjectURL` API for CSS source maps. This triggers the `webview` crash I mentioned above.
The fix for this is to disable CSS source maps, in which case the loader just uses a `<style>` tag. This diff updates Nuclide to pull in this fixed version.
Reviewed By: bestander
Differential Revision: D16518772
fbshipit-source-id: a779b7d310f869793fa05988d138ce6a46840d8c
Summary:
Yesterday we shipped hermesengine.dev as part of the current 0.60 release. This PR brings those changes to master.
## Changelog
[General] [Added] - Added support for Hermes
Pull Request resolved: https://github.com/facebook/react-native/pull/25613
Test Plan:
* CI is green both on GitHub and at FB
* Creating a new app from source can use Hermes on Android
Reviewed By: cpojer
Differential Revision: D16221777
Pulled By: willholen
fbshipit-source-id: aa6be10537863039cb666292465ba2e1d44b64ef
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.
It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.
The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .
There are still a few breaking changes which I hope will be acceptable:
- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.
Still to do:
- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �
## Changelog
[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619
Test Plan:
### FB
```
buck build catalyst
```
### Sample Project
Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.
You can see that it works with these steps:
1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`
The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.
### RNTesterPods
`RNTesterPodsPods` can now work with or without `use_frameworks!`.
1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.
Reviewed By: PeteTheHeat
Differential Revision: D16465247
Pulled By: PeteTheHeat
fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
Summary:
This updates `react-refresh` to 0.3.0 which brings a new feature: we can now detect if the root fails on _the initial mount_. In that case we currently can't recover with Fast Refresh because we don't know which element to retry mounting. (In the future, we can lift this limitation, but it would require more changes in React renderer.)
Before this diff, after you fix an error on initial mount, you would see a blank screen (because nothing managed to mount).
After this diff, after you fix an error on initial mount, you would fall back to a full reload.
This diff doesn't affect errors on updates. We can recover from those, just like before.
Reviewed By: cpojer
Differential Revision: D16440836
fbshipit-source-id: 4a414202a9eab894acd7baa0525c25ff003dd323
Summary:
Update to the latest React DevTools v3 release, which adds the ability to detect when the (v3) frontend is connected with a v4 backend and shows update instructions to the user.
## Changelog:
[General] [Added] - Updated embedded react-devtools-core package to the latest version in preparation for the upcoming v4 DevTools release.
Reviewed By: rickhanlonii
Differential Revision: D16419553
fbshipit-source-id: a36b0ba5bf6992a490f1234b9a92b8abd4c9b3e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25583
We now use CocoaPods for better maintainability.
Reviewed By: hramos
Differential Revision: D16193719
fbshipit-source-id: 26382f2da4eaba14a71771540b587fdc80b41108
Summary:
Bump the React Native CLI to ^2.0.1 as it's just released now. Comes with fixes to autolinking, helpful warnings and upgrading.
## Changelog
[Internal] [Change] - Bump CLI to ^2.0.1
Pull Request resolved: https://github.com/facebook/react-native/pull/25472
Test Plan: Nothing breaks
Differential Revision: D16107705
Pulled By: cpojer
fbshipit-source-id: 1019330d434294c434b9a9d835dff67e7b3939dd
Summary: Version bump for a minor Babel transform bugfix.
Reviewed By: motiz88
Differential Revision: D16093422
fbshipit-source-id: c1c2181a1cd75d78765e9d951e0bc001eff77bb9
Summary:
Looks we forgot to add this file to publish list. By adding it, we can remove some code in CLI that special-cases `react-native` package, since it now announces itself as a proper platform.
cc kelset, we'd like to have this cherry-picked for 0.60.
## Changelog
[Internal] [Fixed] - Publish `react-native.config.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/25436
Test Plan: `npm pack` shows `react-native.config.js`
Differential Revision: D16071113
Pulled By: cpojer
fbshipit-source-id: df18affbb9a0ad7f2cfdd1a4cc93191aa5ffadeb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416
Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.
This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.
In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.
Changelog:
[iOS] [Changed] - Use RNTesterPods for iOS Tests
Reviewed By: fkgozali
Differential Revision: D16052466
fbshipit-source-id: 724b0c51008882d3c06a9074693fe23e74abe86b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416
Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.
This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.
In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.
Reviewed By: fkgozali
Differential Revision: D15958209
fbshipit-source-id: b51fb907812cb2d4d78cce445d39bc253ae5acf8
Summary: This bumps the dependency so I can get a new export I added.
Reviewed By: rickhanlonii
Differential Revision: D16030064
fbshipit-source-id: 2b539f04d4fbc21c097c0f1d1d1e7b59f376a894
Summary: This updates the renderer and Fresh packages to pull in the new error handling behavior. The new feature is that roots that errored on last save get remounted after an edit. This allows much faster iteration in the Fast Refresh mode as you don't need to do a full reload after typos.
Reviewed By: bvaughn
Differential Revision: D15967396
fbshipit-source-id: 96a82e6a4e00a8cb636d7bca037a1a43552a4cd2
Summary:
This pulls in the latest package updates for Fresh. It doesn't have any user-observable behavior.
The renderer is rebuilt on top of the last cherry-picked sync. I cherry-picked https://github.com/facebook/react/pull/15928 on top of it.
Reviewed By: rickhanlonii
Differential Revision: D15901887
fbshipit-source-id: ccd974f79e4c0a2a8a8cab0d472deeaedf1e3ddd
Summary:
This adds the Fresh Babel plugin and runtime to React Native dependencies. **They're not actually being used or enabled yet**. This is purely additive and just gets the deps setup out of the way for future diffs.
The `react-refresh` source of truth is in the React repo.
Reviewed By: cpojer
Differential Revision: D15828330
fbshipit-source-id: 67ec2dea8c896477ff8b434445f1730e388ea67a
Summary:
The RC1 of the CLI upgrades Metro to 0.54.1 to be compatible with 0.60 and master and fixes an issue with haste backwards compatibility.
cc kelset
## Changelog
[General] [Changed] - Bump CLI to 2.0.0-rc.1
Pull Request resolved: https://github.com/facebook/react-native/pull/25190
Differential Revision: D15737249
Pulled By: cpojer
fbshipit-source-id: a39747620a7652507d29f5dadb6a4bdc9c1393f0
Summary:
Upgrading the CLI to the latest with a bunch of fixes and features included.
## Changelog
[General] [Changed] - Bump CLI to 2.0.0-rc.0
Pull Request resolved: https://github.com/facebook/react-native/pull/25175
Differential Revision: D15694764
Pulled By: cpojer
fbshipit-source-id: 25fbf1c275ed5379e1cdb372512b6bb6327dea92
Summary:
The original reason for vendoring the fetch polyfill was to remove the default blob response type but this was reverted.
Here's a little history around the fetch polyfill and the blob issue:
- Original commit introducing the vendored polyfill: #19333, the goal was to fix a memory leak because our blob implementation doesn't release resources automatically. Not an ideal fix but since the issue was pretty severe and the infra for a proper fix was not in place.
- This introduced an issue when downloading images using `fetch` which was fixed by #22063 which re-added the default blob content type. However that re-introduced the original fetch memory leak.
- We have better infra now with jsi and I was able to get blob deallocation working, see #24405
Currently the vendored fetch polyfill is useless since it was changed back to the original version. We can just use the npm version again. I also updated to 3.0 which brings better spec compliance and support for cancellation via `AbortController`, https://github.com/github/fetch/releases/tag/v3.0.0.
## Changelog
[General] [Changed] - Remove vendored fetch polyfill, update to whatwg-fetch@3.0
Pull Request resolved: https://github.com/facebook/react-native/pull/24418
Differential Revision: D14932683
Pulled By: cpojer
fbshipit-source-id: 915e3d25978e8b9d7507ed807e7fba45aa88385a
Summary:
Updates the CLI version to the latest alpha to fix some issues around init and autolinking. Please port this PR back to `0.60-stable` branch as it fixes an issue with `npx react-native init`.
cc grabbou hramos
## Changelog
[General] [Fix] - Upgrade CLI to latest alpha
Pull Request resolved: https://github.com/facebook/react-native/pull/25094
Differential Revision: D15558082
Pulled By: cpojer
fbshipit-source-id: 60be64fbed996b6667eddc08346b07475dbb5089
Summary:
This is an ESLint plugin that infers whether an import looks like a Haste module name. To keep the linter fast and simple, it does not look in the Haste map. Instead, it looks for uppercase characters in single-name import paths, since npm has disallowed uppercase letters in package names for a long time. There are some false negatives (e.g. "merge" is a Haste module and this linter rule would not pick it up) but those are about 1.1% of the module names in the RN repo, and unit tests and integration tests will fail anyway once Haste is turned off.
You can disable the lint rule on varying granular levels with ESLint's normal disabling/enabling mechanisms.
Also rewrote more Haste imports so that the linter passes (i.e. fixed lint errors as part of this PR).
## Changelog
[General] [Changed] - Add a lint rule to disallow Haste imports
Pull Request resolved: https://github.com/facebook/react-native/pull/25058
Differential Revision: D15515826
Pulled By: cpojer
fbshipit-source-id: d58a3c30dfe0887f8a530e3393af4af5a1ec1cac
Summary:
There is currently no entry point for running the RNTester tests in package.json. This adds a test-ios command which leverages the existing objc-test-ios.sh script.
With this change in place, our documentation for running tests locally can be simplified and made consistent with how JavaScript tests are run (yarn test).
## Changelog
[General] [Added] - Add a test-ios command to run iOS RNTester tests locally
Pull Request resolved: https://github.com/facebook/react-native/pull/24985
Differential Revision: D15449399
Pulled By: cpojer
fbshipit-source-id: 63f7ad653d23c5601a11fc9d27a39b4987fccaad
Summary:
This PR cleans up some of our GitHub bots. The overall goal is to make the contribution process just a tad nicer.
### analysis-bot
* The bot will continue leaving GitHub Reviews when it finds lint issues, but will abstain from leaving inline comments if they would exceed 5 in number.
* The review comment left by the bot has instructions on how to reproduce the lint issues locally. This will educate PR authors on how to run lint and fix the issues without unnecessarily spamming the PR with 50+ comments, while still providing useful reviews to authors when only a handful of lint issues slip by.
* Code moved to `bots/` directory for ease of discovery and co-location with pull-bot.
* Added `yarn lint-ci` command. This seems like the right choice: it's running `yarn lint` and other linters, and it is only intended to run on CI.
* It's still possible to run `yarn lint-ci` locally, though the script will stop short of posting a review to GitHub unless the necessary envvars are provided.
* Added `yarn shellcheck` command. This can be run locally, though it requires `shellcheck` to be installed.
* Outside of this PR, I added instructions on using shellcheck to https://github.com/facebook/react-native/wiki/Development-Dependencies
* Updated Circle CI config to use these new commands, and streamlined the `analyze_pr` step.
* Documented analysis-bot in `bots/README.md`.
### pull-bot
* Bumped `danger-js` dependency. No breaking changes found in this minor bump from what I can tell.
* Documented pull-bot in `bots/README.md`.
### misc
* PR template: don't use jargon.
## Changelog
[Internal] [Changed] - GitHub Bots cleanup
Pull Request resolved: https://github.com/facebook/react-native/pull/24923
Differential Revision: D15399744
Pulled By: hramos
fbshipit-source-id: 32632e775f8554424072270e3f98542de84bfb8c
Summary:
PR https://github.com/facebook/react-native/pull/24843 broke Android tests because of a regression we introduced in terms of passing `reporter` argument to Metro config. This was fixed in latest `alpha.20` release of CLI
## Changelog
[General] [Fix] - update CLI to alpha.20 to fix Android tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24869
Reviewed By: rickhanlonii
Differential Revision: D15355144
Pulled By: cpojer
fbshipit-source-id: faafd8098c708845264b7164557076bce45ea332
Summary:
This PR is related to #24760 and adds the `openURLInBrowser` functionality introduced on react-native-community/cli#383.
[General] [Changed] - Open links from new app in computer's browser.
Pull Request resolved: https://github.com/facebook/react-native/pull/24843
Reviewed By: rickhanlonii
Differential Revision: D15334011
Pulled By: cpojer
fbshipit-source-id: 947ad1b113923989cf706e60851e02a87e1099e8
Summary:
ReactNativeRenderer has `require('scheduler')` in it but we don't seem to declare a dependency. As a result, the latest sync broke `useEffect` in open source master:
```js
function Counter() {
const [count, setCount] = useState(0);
useEffect(() => {
const id = setInterval(() => {
setCount(c => c + 1);
}, 1000)
return () => clearInterval(id);
}, [])
return <View><Text>{count}</Text></View>
}
```
<img width="535" alt="Screen Shot 2019-05-10 at 3 26 05 PM" src="https://user-images.githubusercontent.com/810438/57535832-e04dc000-733a-11e9-8e3e-d685171ec55a.png">
This adds an explicit dependency on the same version we're currently using internally.
<img width="535" alt="Screen Shot 2019-05-10 at 3 47 42 PM" src="https://user-images.githubusercontent.com/810438/57535886-f65b8080-733a-11e9-82c3-78e6c3a3888b.png">
Pull Request resolved: https://github.com/facebook/react-native/pull/24802
Differential Revision: D15295252
Pulled By: hramos
fbshipit-source-id: cd897ac590de1b719f28234f7631b0dcc069d043
Summary:
packagingOptions.pickFirst is unreliable that we could not specify which library will be used.
If user have other third party libraries, the story is more complicated.
From the framework point of view, it is better to drop the pickFirst.
In jsc-android 241213.1.0, we did two things:
1. Remove libc++_shared.so in AAR to prevent the conflict with RN.
2. Build by NDK r17c, which aligned with current RN NDK version.
In this commit, I also revert the pickFirst for JSC.
pickFirst JSC also makes upgrade JSC unreliable.
Currently a lot of user report JSC crash issues, those crash issues may relate to JIT and hard to reproduce in-house.
My plan is to make sure user could choose another JSC build easier,
i.e. only to `yarn add 'jsc-android@latest'`.
We could then propose some experimented JSC build for user to check
if the build could help them to fix the crash issue.
[Android] [Fixed] - Remove unreliable packagingOptions.pickFirst for libc++_shared.so and libjsc.so
NOTE that this may not need to add the changelog, as RN 0.59 does not have pickFirst.
This will also reduce a breaking change for upgrade from RN 0.59 or before.
Pull Request resolved: https://github.com/facebook/react-native/pull/24672
Differential Revision: D15164536
Pulled By: cpojer
fbshipit-source-id: 9fc897a77409173a5841f325b38e2836bb07f599
Summary:
This fixes an issue where the Prettier config was set to the `fb` (Facebook) values for all users of the `react-native-community/eslint-config` package. This was due to [this line](8f186b84ae/packages/eslint-config-react-native-community/index.js (L219)) in the config file.
It was causing issues like these:
* Errors when using newer versions of `eslint-plugin-prettier` (you had to use a version that was >1 year old): https://github.com/facebook/react-native/issues/24564
* Errors due to the Prettier parser being forced to be `flow` when using Typescript: https://github.com/typescript-eslint/typescript-eslint/issues/481
This PR:
* Changes that line to remove the explicit `fb` config so users can set their own.
* Moves the React Native Prettier config to `.prettierrc` so ESLint, Prettier, and code editors can all read from the same place.
* Upgrades both `prettier` and the `eslint-plugin-prettier` to the latest versions.
[General] [Fixed] - Stopped the Prettier config being set for all users of react-native-community/eslint-config
Pull Request resolved: https://github.com/facebook/react-native/pull/24635
Differential Revision: D15122200
Pulled By: cpojer
fbshipit-source-id: 56bae8a7f2d8e133b1d808091a6b73302b94d2ed
Summary:
This pull request removes the tests for out-of-tree platforms and the dependency on the package `react-native-dummy` from the React Native repo.
The logic that this was meant to test was moved to the React Native CLI repo, and [it is being tested there](827daa4c16/packages/cli/src/tools/config/__tests__/index-test.js (L125-L152)) as well making this a bit redundant at this point.
The dependency on `react-native-dummy` was also an issue, because when the file structure under `Libraries/` changes, bundler errors could crop up if there wasn't an update made to the file structure of `react-native-dummy/Libraries/`.
This was an issue when [`TabBarIOS` was removed](02697291ff (diff-b9cfc7f2cdf78a7f4b91a753d10865a2)) - `react-native-dummy` was causing Haste errors and was stopping the commit from being able to land, and I needed to cut a new version just for it. With Lean Core, I expect more issues like this happening in the future.
[General] [Removed] - Removed Out-of-Tree platform tests (functionality is tested in the RN-CLI repo now)
Pull Request resolved: https://github.com/facebook/react-native/pull/24536
Differential Revision: D15063320
Pulled By: cpojer
fbshipit-source-id: 2a0467bed326b286623fa3cfa4e0bb6959b66b78
Summary:
Updates React Native to use latest CLI.
Changes:
- No more `--reactNativePath`, define it once in the configuration file. This reverts the previous PR that added this flag
- Add `platforms` and `commands` - React Native now defines platform like any other package. There's no longer concept of "out-of-tree" platform. All are treated equally. If React Native works, any other platform will work too.
- Updates `jest/hasteImpl.js` to use public CLI interface (`loadConfig`) instead of `findPlugins` and removes a weird conditional that checks for CI presence.
[INTERNAL] - Update React Native CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/24517
Differential Revision: D15044762
Pulled By: cpojer
fbshipit-source-id: 379b61e842e619312c542173219a7d326663cf24
Summary:
Yargs package is used only in test scripts and script for bumping version.
Based on this https://github.com/facebook/react-native/search?q=yargs&unscoped_q=yargs Yargs is not really required in production build and should be moved as development dependency.
[General] [Changed] - Moved Yargs to devDepencies
Pull Request resolved: https://github.com/facebook/react-native/pull/24496
Differential Revision: D14982834
Pulled By: cpojer
fbshipit-source-id: 81b6be413b2037e1b852cba91f4a2c04267ae930
Summary:
This updates `detox` from `12.1.1` to `12.2.0`.
It includes (amongst other things) the following fixes, as described on the [12.1.4 release page](https://github.com/wix/Detox/releases/tag/12.1.4):
- hotfix: redundant logs in the folder
- fix: stabilize simulator log recording
It also updates the detox test script and config in `packages.json` (which was previously missed when detox was updated to 12.1.x). It will remove the following deprecation warnings:
```
detox[6416] WARN: [test.js] Deprecation warning: "file" and "specs" support will be dropped in the next Detox version.
detox[6416] WARN: [test.js] Please edit your package.json according to the migration guide: https://wix.to/I0DOAK0
```
Instead of extra preprocessing the test folder by `detox`, it will now be passed straight to `jest`.
More information in the [migration guide](https://github.com/wix/Detox/blob/master/docs/Guide.Migration.md).
[General] [Changed] - Update detox to 12.2.0
Pull Request resolved: https://github.com/facebook/react-native/pull/24425
Differential Revision: D14973771
Pulled By: cpojer
fbshipit-source-id: 367ed1f75d2cc3b02349282e7a6201684ba130a7
Summary:
This adds https://github.com/mysticatea/abort-controller to polyfill [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). This is used to cancel requests when using `fetch`.
This also updates `event-target-shim` to 5.0 to make sure we only have one version of this dependency. This updates required adding a polyfill for `console.assert` which is used by the new version. I made one based on https://github.com/gskinner/console-polyfill/blob/master/console.js#L74.
The polyfill is very small, especially since we already use `event-target-shim` so I think it makes sense to include in core.
Depends on #24418 so that the fetch polyfill supports the `signal` parameter.
Fixes#18115
[General] [Added] - Add support for cancelling fetch requests with AbortController
Pull Request resolved: https://github.com/facebook/react-native/pull/24419
Differential Revision: D14912858
Pulled By: cpojer
fbshipit-source-id: 8a6402910398db51e2f3e3262f07aabdf68fcf72
Summary: Update Jest to 24.7.1, which has performance improvements I've built over the last few weeks.
Reviewed By: rubennorte
Differential Revision: D14766905
fbshipit-source-id: 9ebb3b6f2a9ed656ca0a41a27099fe1ea6e92710
Summary:
In origin approach, we packed libjsc.so inside react-native.aar and it is difficult for user to choose different JSC variants. E.g., [the Intl supported version](https://github.com/react-native-community/jsc-android-buildscripts#international-variant).
This change list allows application to determine JSC versions or variants by npm/yarn package.
There is a |useIntlJsc| flag in build.gradle, it will use the same JSC version but with Intl support.
`yarn add jsc-android@canary`
[Android] [Changed] - Allow application to select different JSC variants
**MIGRATION**
Note that there are some changes in build.gradle.
Existing application needs to change their android/build.gradle and android/app/build.gradle.
Hopefully, the rn-diff-purge should handle the case well.
Pull Request resolved: https://github.com/facebook/react-native/pull/24276
Differential Revision: D14752359
Pulled By: cpojer
fbshipit-source-id: a4bfb135ad8e328f404a2d1a062412f40ebf4622
Summary:
With new `init` implementation we replace all occurrences of the project name (`HelloWorld`) inside `ios` and `android` directories. For some reason, a product name field in `ios` was named wrongly. This shouldn't impact initialization using `global-cli`
[iOS] [Fixed] - Change productName in iOS in new init.
Pull Request resolved: https://github.com/facebook/react-native/pull/24292
Differential Revision: D14749249
Pulled By: cpojer
fbshipit-source-id: aaf4294ab23180770aac3075789d3ffb4d5a4f3f
Summary:
Add `bin` field to `package.json`. It will be required for initializing `react-native` with `npx`:
```sh
npx react-native init ProjectName
```
[General] [Added] - Added bin to package.json
cc thymikee cpojer
Pull Request resolved: https://github.com/facebook/react-native/pull/24187
Differential Revision: D14672211
Pulled By: hramos
fbshipit-source-id: 9e8633213bba4b3f02d20b54391a04d0a1a19376
Summary: This diff changes `js1 upgrade jest` to add a caret when upgrading so that the open source version of RN is not locked to a concrete version of Jest which doesn't really make much sense. I also added `pretty-format` to the packages that get updated because it is part of Jest's repo.
Reviewed By: rubennorte
Differential Revision: D14503180
fbshipit-source-id: 683c9a6ac768baa578771b9ad677e02df4912baa
Summary:
With recent activity to extract out non-core things into separate repos, I did an audit of the package.json to see what can be removed, and what packages remain that have newer versions that result in less/smaller javascript code. The goal is to:
1. make developer experience better by removing unneeded dependencies, and
2. eliminate things the app bundler needs to process to make the production app bundle smaller.
[internal] [chore] - Remove unneeded packages, bump package versions who now have smaller size
Pull Request resolved: https://github.com/facebook/react-native/pull/23968
Differential Revision: D14519070
Pulled By: cpojer
fbshipit-source-id: 579f035f925668a34d07293810e3d35a7d0ae076
Summary:
I was annoyed by warnings from yarn/npm about eslint peer dependencies not being met, so I dived in to try and get rid of some of them. Sometimes it meant bumping a plugin, but then that plugin needed a newer babel-eslint, so it was a dance.
Some we can't easily update to latest (eslint-plugin-prettier) because the rule format has changed a bit. Happy to do that in this PR if folks think its a good idea. eslint-config-fbjs itself needs to be updated and republished to eliminate the last few warnings.
There are a few new warnings (the repo wasn't linting cleanly for me from the start). I can fix those in this PR, or a separate one, based on people's preferences.
[internal] [chore] - Eliminate some peer dependency warnings and bump some eslint packages to latest.
Pull Request resolved: https://github.com/facebook/react-native/pull/23969
Differential Revision: D14519076
Pulled By: cpojer
fbshipit-source-id: aa44cfd05814d7b79069414aa78d089e448c2235
Summary:
**Summary**
This PR introduces validation for the new `metro-config`. For now I'm keen on only validating new config, because I can see there's yet unused `convertConfig` which, I guess, defeats the purpose. Let me know otherwise.
This is still work in progress, as I need to fix some stuff upstream (e.g. recursive object validation and pretty-printing). Just letting you know I'm working on it :)
**Test plan**
Added a test.
cc CompuIves cpojer
Pull Request resolved: https://github.com/facebook/metro/pull/205
Differential Revision: D14501222
Pulled By: cpojer
fbshipit-source-id: 0ab8f3ad14d6f33690d5f57fd1e7487f3a4a8c71
Summary:
Landing D14472633 again which failed because of a metro-buck issue.
Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).
Fixes#23936
This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).
We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.
[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940
Reviewed By: rickhanlonii
Differential Revision: D14501686
Pulled By: cpojer
fbshipit-source-id: c8dac71b3806d81c9d18b6d4a7e92d82962791f9
Summary: 0.95 has a more accurate definition of JSON.stringify which could return void.
Reviewed By: dsainati1
Differential Revision: D14494286
fbshipit-source-id: 6cf9cb5889b4078548665bc66fe899a266c689ce
Summary:
This is the couple of hacks I used after I finished #23802 in order to get fabric working on RNTester. This is inspired from prior work by kmagiera.
The goal of this PR is to show others what I’m struggling with, and to eventually merge it sans hacks.
- Yarn Install
- Uncomment the commented out pods in RNTester's pod file
- Open RNTesterPods workspace
- Run App
- this is only for pods, the non-pod RNTester will no longer work until updated with fabric too.
- `SurfaceHostingView` & `SurfaceHostingProxyRootView` both try to start the surface immediately, this leads to a race condition due to the javascript not having loaded yet, the hack here is:
1. Swizzle the `start` method on `RCTFabricSurface` to no-op when called.
2. Add observer for `RCTJavaScriptDidLoadNotification`
3. Call private method `_startAllSurfaces` on `_surfacePresenter` in AppDelegate when we receive `RCTJavaScriptDidLoadNotification`.
[General] [Added] - Use Fabric in RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23803
Reviewed By: shergin, mdvacca
Differential Revision: D14450726
Pulled By: fkgozali
fbshipit-source-id: 8ae2d48634fecb60db539aaf0a2c89ba1f572c27
Summary:
This package was a dependency for ListView, which is no longer part of RN. Removed the dependency from package.json and yarn.lock.
Also removed its pattern from the Jest preset -- ListView is not in this repo and also react-clone-referenced-element was written at a time when Node did not support the same modern JS features as RN. The latest Node 8+ supports the features that react-clone-referenced-element uses so we don't need to transform it.
[General] [Removed] - Removed unused react-clone-referenced-element dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/23933
Differential Revision: D14477240
Pulled By: cpojer
fbshipit-source-id: 4f6975133b54cc75088262cedd11da20225cada8
Summary:
Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).
Fixes#23936
This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).
We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.
[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940
Differential Revision: D14472633
Pulled By: cpojer
fbshipit-source-id: b7ea92ee130da6730aa0093265958aa1b8c2ab97
Summary: Upgrade Jest and related packages to their latest stable version (24.5.0)
Reviewed By: mjesun
Differential Revision: D14424512
fbshipit-source-id: 6292b9f95c3315a520233b80ae06074d69a0ea3b
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.
Reviewed By: mjesun
Differential Revision: D14454893
fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
Summary: This new version uses paths relative to the `rootDir` option to compute cache keys, so it is compatible with remote caching.
Reviewed By: rickhanlonii
Differential Revision: D14241858
fbshipit-source-id: fbf244bbf389bf873fb8a42f35c9b023fb06182f
Summary:
This is an effort to clean up the root of the repository. Everything related to Docker is being moved to the `.circleci` directory, as these images are used as part of the Circle CI 2.0 tests on Android.
[GENERAL] [Changed] - Moved Dockerfiles into .circleci directory
Pull Request resolved: https://github.com/facebook/react-native/pull/23677
Differential Revision: D14253735
Pulled By: cpojer
fbshipit-source-id: 4d482d531a71b8259b09c001b310d82ce5349b87
Summary:
The following stack is meant to fix all "unsatisfied peer dependencies" that I could find in xplat/js.
Starting from Yarn v2 such problems will become much more noticeable, as they currently behave in unpredictable ways that can include the peer dependency being satisfied by a random package from the dependency tree. The v2 will enforce well-defined relationships between packages.
In this case, RN was missing some dependency required by `babel-preset-fbjs` through peer dependencies.
Reviewed By: pvdz
Differential Revision: D14136856
fbshipit-source-id: 5a7eeee913ebfe63573353683c152ad5512a66e3
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`
Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.
Reviewed By: TheSavior
Differential Revision: D14181708
fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
Summary:
This adds the deprecated ListView package to xplat/js. I published this module in https://github.com/facebookarchive/react-native-deprecated-modules
The way it is published I tried to reduce duplication of dependencies as much as possible. With this diff and the changes in package.json, the bundle size should not regress (until the actually deprected ListView is included; and then it will be recovered once ListView is fully removed from React Native, which will happen within a short timeframe). The change to `react-clone-referenced-element` are non-breaking.
Reviewed By: TheSavior
Differential Revision: D14163988
fbshipit-source-id: 0fc2d1f33855a8b1a709f5316e68c734716ec049
Summary:
Our `ws` dependency is super outdated, and is [insecure](https://www.npmjs.com/advisories/550). It is used for the websocket example code in RNTester. This PR updates the dependency, and removes undefined console.logs.
[General] [Security] - Updates ws dependency to 6.4.1
Pull Request resolved: https://github.com/facebook/react-native/pull/23520
Differential Revision: D14147596
Pulled By: cpojer
fbshipit-source-id: a03041f613a84bf019d8d0a8c5028d6657b5d89a
Summary:
add `clang-format` toolchain. we have 2558 files need to process in current task.
cc cpojer empyrical shergin matthargett
Pull Request resolved: https://github.com/facebook/react-native/pull/23434
Differential Revision: D14067789
Pulled By: cpojer
fbshipit-source-id: ddf812fc9579068ebb850bacedde6675376f18b7
Summary:
Upgrade `jest-junit` to the latest version (breaking change between 5 and 6 was reverted). In particular, 6.2.0 removes the dependency on `jest-config` which pulls in `babel-core@6` etc.
I noticed this since `react-native` had `jest-junit` in `dependencies` until #23276. So not as big of an issue. Still a nice cleanup, I'd say
/cc palmerj3
Btw, any reason Jest is still at alpha?
[General] [Fixed] - upgrade `jest-junit` to avoid older jest dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/23476
Differential Revision: D14100133
Pulled By: cpojer
fbshipit-source-id: 79877261b7ea995ac1f4249a12a6980ec488f655
Summary:
There are couple of packages which are installed as dependency but are not directly used in the project. In this PR I have remove those packages from dependency from the package.json.
[General] [Removed] - Remove the unused packages from package.json
Pull Request resolved: https://github.com/facebook/react-native/pull/23428
Differential Revision: D14065342
Pulled By: cpojer
fbshipit-source-id: 48a423e51d47742dcf0c8a8b2ec43e6a0f2e94fd
Summary:
Commit 06c13b3e06 pretend to update jest
to new version, but also adds jest and jest-junit to runtime dependencies
list (in addition to dev dependencies).
This commit fixes this, by removing jest and jest-junit from runtime
dependeincies.
As for motivation... story is short:
1. Updating RN 0.58.1 -> 0.58.3 I found that whole babel@6 infrastructure was returned to my `node_modules` (it is dangerous, because many tools like metro can found it and use it instead of babel@7).
2. It was because of this commit: 9d19ab0c0c that have 130 random files changed (and provides no meaning description).
But it points to: b864e7e63e (which also provides no meaning description, why it was reverted?)
And finally points to: 696bd89013, which was a "sync with master" commit. Ok. So it was from master.
3. Then I checked that jest still in runtime dependencies on master and fixed that. Also I hope this will be cherry picked into 0.58-stable.
[General] [Fixed] - Fix jest and jest-junit to be only development dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/23276
Differential Revision: D13941275
Pulled By: cpojer
fbshipit-source-id: a6f3377e670554b21f3ebd2f12d33e29d2969df1
Summary:
Update `xcode` package from 1.0.0 to 2.0.0 due to vulnerability issues affecting `plist`. Please, find below excerpt of the Snyk report.
> LOW SEVERITY
> Regular Expression Denial of Service (ReDoS)
> **Vulnerable module**: plist
> **Introduced through**: react-native@0.57.5
> **Introduced through**: learner-tools-miniapp@0.0.1 › react-native@0.57.5 › xcode@1.0.0 › simple-plist@0.2.1 › plist@2.0.1
>
> **Overview**
> plist is a Mac OS X Plist parser/builder for Node.js and browsers
>
> Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks due to bundling a vulnerable version of the XMLBuilder package. This can cause an impact of about 10 seconds matching time for data 60 characters long.
Pull Request resolved: https://github.com/facebook/react-native/pull/23051
Differential Revision: D13716882
Pulled By: hramos
fbshipit-source-id: 8aa91c8ac85d31b72302b7d24e76bd61623bbbda
Summary:
This updates React Native to use latest CLI. We also create Metro configuration, because CLI looks for React Native in "node_modules" by default. Since we are running React Native from source, it will fail to find required files.
To avoid hacky logic to detect if we are running from source backed into the CLI, I decided to leverage the Metro configuration instead.
Pull Request resolved: https://github.com/facebook/react-native/pull/23052
Reviewed By: rickhanlonii
Differential Revision: D13719938
Pulled By: cpojer
fbshipit-source-id: 1f40a40b3cdbb07ccd42daf75feb457556d3e40f
Summary: Upgrades flow in xplat/js to 0.91. This diff also adds and removes suppressions.
Reviewed By: samwgoldman
Differential Revision: D13720697
fbshipit-source-id: 1bf8830ce286db92277476a2d2404cf0c0dddca2
Summary:
The current way the Jest preset work requires the different files to be in `<rootDir>/node_modules/react-native`. This is not necessarily true - especially in monorepoes.
If we instead do `require.resolve`, we do not need to do `rootDir` replacement in Jest.
Having a JS file as preset has been supported since Jest 23.0.0: https://github.com/facebook/jest/pull/6185
Changelog:
----------
[General] [Fixed] - use `require.resolve` in `jest-preset`
Pull Request resolved: https://github.com/facebook/react-native/pull/22972
Differential Revision: D13662758
Pulled By: hramos
fbshipit-source-id: ca79b5b89d9d05c6fe639b0d88619858e8d05da7
Summary:
Changelog:
----------
[General] [added] - Add `templates` to `react-native` package.
We need a `template` to initialize new RN project from `react-native-cli`. We are planning to remove `templates` from `cli` to be always synced with chosen rn version. Issue for that in `react-native-cli` is here: https://github.com/react-native-community/react-native-cli/issues/39 .
cc grabbou cpojer
Pull Request resolved: https://github.com/facebook/react-native/pull/22952
Differential Revision: D13644364
Pulled By: hramos
fbshipit-source-id: d5d7a820ffacb342e1e97d83739987678ff511e9
Summary:
Hi Team!
This PR fixes#22741
Thanks for labeling as Good First Issue!
Changelog:
----------
[General] [Fixed] - fix deprecation warning of testResultsProcessor flag in test-ci
Pull Request resolved: https://github.com/facebook/react-native/pull/22749
Differential Revision: D13542419
Pulled By: hramos
fbshipit-source-id: 84f33329a6b9431ed1db843a99e7db7dbeda5361
Summary:
This is very much a work in progress. Moving it into the open source repo to be able to hook it up to generate some Fabric files.
Will continue to iterate on it in the open.
Reviewed By: hramos, mdvacca
Differential Revision: D13500969
fbshipit-source-id: 79082447dc52b5834f24eb72bc6e07200b324238
Summary:
These comments were confusing since we don't use flow-typed.
cc bvaughn.
I have replaced our local types by flow-typed, removed metro custom stub and deleted `flow-github` directory.
As result, createReactClass, PropTypes and Metro types won't be distributed to RN users. If you need it, you should relay on flow-typed.
Pull Request resolved: https://github.com/facebook/react-native/pull/20320
Reviewed By: TheSavior
Differential Revision: D13517157
Pulled By: rickhanlonii
fbshipit-source-id: e52c0b6114114a706f6152b2031c600e3dece0d2
Summary:
Fixes two types of warnings that occur when running E2E tests:
1. A deprecation warning from Jest: 'Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.'
2. YellowBox warnings when running the app in debug mode, about components that are deprecated and that require main queue setup.
By fixing these warnings, we increase contributors' confidence that things are working correctly, and draw attention to any warnings that they _should_ pay attention to, if and when they arise.
I feel confident that we should hide the deprecated-component warnings; we _want_ to use these components because we want them to be tested, until they're removed entirely.
For the warning "Module RCTImagePickerManager requires main queue setup", if that's something that can be fixed with reasonable effort in the RNTester code then I think it would be better to do so. Otherwise, I think it is good to hide the warning, because this is a condition we expect: it's not something a contributor should pay attention to.
Pull Request resolved: https://github.com/facebook/react-native/pull/22621
Differential Revision: D13468553
Pulled By: hramos
fbshipit-source-id: 1a5952087dd6fcc9ba08ff7a60ad9f5b075bef57
Summary:
This diff removes the dependency of `metro` on `react-native` by using the newly created `metro-react-native-babel-transformer` package.
This package does not depend on any other internal metro logic and this will decouple RN from metro a bit more.
Reviewed By: cpojer
Differential Revision: D13434949
fbshipit-source-id: a02a3b327c71cef53111514b797f7d6bc9f9d71c
Summary: The current version of react-test-renderer is throwing an error when we use hooks. Upgrading to 16.7.0-alpha.2 fixes it.
Reviewed By: sahrens
Differential Revision: D13104634
fbshipit-source-id: ac7f8d603293907c8653e247563a4d12413b10b9
Summary:
By having this package we can remove the dependency from `react-native` to `metro` and then unblock the releases of metro to npm.
We cannot use this package yet from `react-native` since it hasn't been published, what I'm gonna do here is the following:
1. Land this diff
2. Publish manually a version of `metro-react-native-babel-transformer@0.50.0` once this diff lands.
3. Update the RN repo to depend on `metro-react-native-babel-transformer` instead of `metro`.
Then we should be able to publish versions of metro :)
Differential Revision: D13432231
fbshipit-source-id: 522152e32162cc5fc40aea2fa4c8fd53c528e2e3
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.
Reviewed By: TheSavior
Differential Revision: D13396218
fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
Summary: We are using babel 7 and should not be using babel 6 any longer, this removes some references to babel 6 modules.
Reviewed By: yungsters
Differential Revision: D13137326
fbshipit-source-id: 4a2db84522e5613f72a8005f0b1e9943e815f9ec
Summary:
Adds a Detox configuration and instructions for running the app in development mode in Detox. This speeds up developing tests, because changes to production code don't require a full rebuild.
Pull Request resolved: https://github.com/facebook/react-native/pull/22572
Differential Revision: D13396883
Pulled By: cpojer
fbshipit-source-id: 186cc8d75eccae411b602cb0f68f0e11856e0743
Summary: This diff moves the React Native template from `local-cli/templates/HelloWorld` to `template`. Keeping it in the react-native repo will allow us to make changes to the template and version it together with react-native, instead of moving it out into a separate repo and trying to keep the template in sync with RN.
Reviewed By: TheSavior
Differential Revision: D13372949
fbshipit-source-id: e68e267b4dcf6384535d7b48fc11e297a12e9676
Summary: This cleans up various configurations after the removal of this folder.
Reviewed By: hramos
Differential Revision: D13338515
fbshipit-source-id: 9d6877921e15a183e46861626af831231333f42a