Summary:
@public
While debugging a RN 0.57 blocking issue, we found that the `--reset-cache` cli arg is not being passed to Metro (more info: https://github.com/facebook/react-native/issues/20567#issuecomment-412513942).
This diff fixes this issue
Reviewed By: mjesun
Differential Revision: D9295634
fbshipit-source-id: a53ec7abff2b7e684a1fd88c3b53ff0b54a1c3c4
Summary:
The `hmrEnabled` flag was not passed to the metro runServer config which caused HMR to be broken.
Pull Request resolved: https://github.com/facebook/react-native/pull/20605
Differential Revision: D9272070
Pulled By: hramos
fbshipit-source-id: 3765031d9e7806be11781fba92663ce7c4ff2ffb
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done
allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.
Reviewed By: TheSavior
Differential Revision: D9004573
fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
Summary:
Just change gradle.properties version number to change gradle version is not the right way. Because sometimes the gradlew and gradlew.bat or even the jar need to be updated too.
I also add the wrapper task to `build.gradle`, so next time, we just need to change the version number and execute `gradlew wrapper`.
pass all current ci.
none
[GENERAL] [BUGFIX] [Android] - fix gradle wrapper issue
Pull Request resolved: https://github.com/facebook/react-native/pull/19976
Differential Revision: D9229655
Pulled By: hramos
fbshipit-source-id: 63d1ddea6174f87778612a4e6711baac5787b0f8
Summary: The controller you requested could not be found.
Reviewed By: pakoito
Differential Revision: D9174188
fbshipit-source-id: 4ec9ef5b6f802964a83b6bc0bd29db7f47b37c21
Summary:
Currently, when the cli tries to determine the package name, it accidentally trims out the entire package name. This makes it appear to the rest of the program as if `react-native link The controller you requested could not be found./my-package` was just `react-native link`. This adds a little regex to prevent that from happening, so that scopes can be passed as parts of packages.
Fixes#18766
Pull Request resolved: https://github.com/facebook/react-native/pull/19828
Differential Revision: D8704742
Pulled By: hramos
fbshipit-source-id: d8183f9b55e8656b8a0acae842e1361a1f428102
Summary:
Regarding [Add devDependenices support for templates](c4ab03a18e).
Once a project is created using the custom template command with devDependencies inside, the devDependenices.json file is also copied to the new projects directory.
By adding this to the ignore paths we stop the devDependenices being copied into the new projects directory.
Pull Request resolved: https://github.com/facebook/react-native/pull/20542
Differential Revision: D9182795
Pulled By: hramos
fbshipit-source-id: 543c8ca67612a981c22fc83c8d54a25ddc0ca5fc
Summary:
Follow up to a9792ac4c8 and #20516
This makes sure new projects typecheck properly since RN can use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20517
Differential Revision: D9169268
Pulled By: TheSavior
fbshipit-source-id: f2b08598bdc6979931e987c9a275d75f08751754
Summary:
Instead of overriding the config at the end we now do it right after applying default
config and before the user config is applied.
Reviewed By: rafeca
Differential Revision: D9131758
fbshipit-source-id: 15e575fc11a781187f3ee2fa7cf81c227cf6a088
Summary:
We ignore some `metro` flowtypes, which made `flow check` fail on `metro-config`. I now also added the `metro` stubs needed by `metro-config` to make `flow check` pass.
Closes https://github.com/facebook/react-native/issues/20431
Pull Request resolved: https://github.com/facebook/react-native/pull/20429
Reviewed By: hramos
Differential Revision: D9036903
Pulled By: CompuIves
fbshipit-source-id: 6e348e929b7c36520787bb860f5a18aa588455c3
Summary:
This adds `react-native-dom` to `hasteImpl.js` because it's not currently possible to configure it from an out of tree platform. Also adds the relevant `providesModuleNodeModules` and `platforms` values to the default RN CLI config. This should hopefully be able to be removed once better support for out of tree platforms is implemented.
Pull Request resolved: https://github.com/facebook/react-native/pull/20393
Differential Revision: D9007186
Pulled By: hramos
fbshipit-source-id: 67077860dc1fb191d80300fb980599ed76d5f91c
Summary: Change the internals of Metro to use the new configuration instead of `ServerOptions`.
Reviewed By: rafeca
Differential Revision: D8734685
fbshipit-source-id: 1215f799419fcaa0e5fb7814683da1cbba96795c
Summary: Change the public react-native CLI to use the new configuration of Metro.
Reviewed By: rafeca
Differential Revision: D8801217
fbshipit-source-id: 112e4812b430ebee1ed41489f803b90c182ccdb4
Summary: In this diff I change the internal react-native cli to use our new configuration. Another change here is that Metro starts using the new configuration already as its entry points (like `metro#runMetro`).
Reviewed By: rafeca
Differential Revision: D8728612
fbshipit-source-id: 9f43dee31ebaccd35cf6274d5c4dec0a227a6eec
Summary:
@public
Let's get rid of the "unbundle" terminology and instead use "RAM bundle", short for "Random Access Bundle" format. THIS IS A BREAKING CHANGE FOR OSS, as the command becomes `ram-bundle` instead of `unbundle`. It realy shouldn't be a command to start with (only a "format" specifier for the `bundle` command), but I don't want to do that change at this point.
Reviewed By: davidaurelio
Differential Revision: D8894433
fbshipit-source-id: 5565f9ae94c7c2d7f6b25f95ae45b64f27f6aec8
Summary:
This fixes some regressions with local-cli introduced in c4a66a89a2.
- We didn't pass `assetRegistryPath` which caused the following error when loading the bundle:
```
error: bundling failed: Error: Unable to resolve module `missing-asset-registry-path` from `/Users/janic/Developer/react-native/RNTester/js/uie_thumb_normal@2x.png`: Module `missing-asset-registry-path` does not exist in the Haste module map
```
- The middlewares were not added to the metro server. This causes some packager server features to fail. The one I noticed is that the /status endpoint didn't exist anymore which causes CI to fail and also Android to not load the bundle from the packager initially. The remote debugging feature was also broken.
Pull Request resolved: https://github.com/facebook/react-native/pull/20162
Differential Revision: D8867610
Pulled By: hramos
fbshipit-source-id: 8a08b7f3175692ab6ee73c0a7c25075091ae4792
Summary:
This is a very similar fix than D8858846, but done in the RN CLI (soon we'll be able to just call `Metro.runBuild()` from RN which will remove this duplication).
This actually fixes the issues in the integtration tests (t31612131). It's just funny that two unrelated problems that are caused by the same issue located in two different places have been reported at the same time.
Differential Revision: D8859276
fbshipit-source-id: 805e111a406f2a7c1b3df3ab02accf4c4041a464
Summary: This is a follow up to D8316215. That diff had a flaw in that once appExecuted was set to true it would never be reset back to false. This fixes that so if another bundle is loaded after the first one it will work.
Reviewed By: rafeca
Differential Revision: D8661523
fbshipit-source-id: 5f6024102248383f64952fd33b37368732d5f900
Summary: No new errors in this version. Just removed a bunch of unused suppressions
Reviewed By: TheSavior
Differential Revision: D8754160
fbshipit-source-id: 2f02240b6d65edecba5d9ed603c7703462547a7f
Summary:
Bump gradle to 4.4, version used by android studio 3.x and gradle plugin 3.x. This will help make migration easier and smoother.
CI: https://circleci.com/gh/dulmandakh/react-native/591
FYI: I found that gradle 4.8 works fine with gradle plugin 2.3, but gradle plugin 3.x displays warnings and asks to disable on demand configuration.
Closes https://github.com/facebook/react-native/pull/19899
Reviewed By: fkgozali
Differential Revision: D8697929
Pulled By: hramos
fbshipit-source-id: 21eb625ee1e4a1fa02aa22de4c36a07269ca467b
Summary: `morgan` produces non-json output, which affects `js1 run` when ran with the `--json` flag.
Reviewed By: Kureev
Differential Revision: D8724830
fbshipit-source-id: 11377f6ef39341c658a7f905383398423a721630
Summary:
Closes https://github.com/facebook/react-native/pull/20007
We removed support for providesModule annotations and maintained support for Haste names in installed modules via `providesModuleNodeModules`, but our default `hasteImpl` doesn't take them into account. We need to find a better way to override core components from plugins but meanwhile this adds an exception for react-native-windows in the default `hasteImpl` to unblock their upgrade to the latest RC.
Fixes https://github.com/facebook/metro/issues/188
Reviewed By: mjesun
Differential Revision: D8695207
fbshipit-source-id: 2ad6cb1e93e600880a148776ac45f6ebd7d205d3
Summary:
Scope of the diff:
1. Middleware
`react-native-github/local-cli` and `react-native-internal-cli` uses a very similar set of middlewares (internal cli extends github version), so I decided to move it to a standalone file (middleware manager) in order to remove duplications and increase readability.
2. Types
Seems that after Flow upgrade to version 0.68 there were many type issues to resolve, so all of them were auto-mocked. This is fine, but I'd like to see Flow assists me with `Metro.createServer` -> `Metro.runServer` migration. Hence, I decided to resolve flow mocks, related to runServer.
3. `runServer` signature
In `react-native-github` repo I cleaned up `runServer` signature by removing `startCallback` and `readyCallback` from the function parameters and moved them to `runServer` instead.
4. Replace `createServer` by `runServer`
In `react-native-github` repo, `createServer` has been replaced by `runServer`. __Some of arguments are not mapped__.
Note that this diff will partially break argument mapping. This is intentional. @[100000044482482:ives] will fix it with a new config package.
Reviewed By: mjesun
Differential Revision: D8711717
fbshipit-source-id: a843ab576360ff7242099910d8f25a9cb0a388c0
Summary:
Changed runAndroid.js to generate .packager.bat and launchPackager.ba…t to call it to setup the environment variable
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
Trying to use react-native on a Windows box with a virus killer that runs on port 8081...
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
1) Start an android emulator
2) on a react-native project (with the changes), run `react-native run-android --port 9988`.
3) When the packager starts, verify that it states the correct port in the terminal window.
4) verify that the application correctly starts in the Emulator.
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[INTERNAL] [BUGFIX] [./scripts] - Fixed runAndroid to enable the use of a package on port <> 8081 for Windows.
Closes https://github.com/facebook/react-native/pull/17498
Differential Revision: D8682067
Pulled By: hramos
fbshipit-source-id: 6604b827077b3a6a2da9914c1fd36dad6ef30e43
Summary:
Closes https://github.com/facebook/react-native/pull/19910
Because of the way react-native local-cli communicates with metro, getWatchFolders function was always returning an empty array that triggered an error.
Reviewed By: hramos
Differential Revision: D8650733
fbshipit-source-id: 502ca469cdbfa04dab5127c1e330dc1d34fc02f8
Summary:
Motivation: get more info from packager errors to easier debug them
add `throw new Error('error')` here 635f2740c2/local-cli/cliEntry.js (L116) and run
`react-native start` to see error stack
<!--
Required: Write your test plan here. If you changed any code, please provide us with
clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
[CLI] [ENHANCEMENT] [local-cli/cliEntry.js] - Show packager error stack
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19705
Differential Revision: D8628322
Pulled By: hramos
fbshipit-source-id: 531217addea122d9761e4f5dd5c666a3b4b56a38
Summary:
This will bump android build tools to 26.0.3, and will remove warning about newer version of build tools in Android Studio, thus improve developer experience.
Closes https://github.com/facebook/react-native/pull/19831
Differential Revision: D8620094
Pulled By: hramos
fbshipit-source-id: fa1c6739bb7556736c1b323acea88fe87e82f4d7
Summary:
This diff tries to fix an issue that started appearing in RN master when the latest metro version is used (more info here: c5ce762697 (commitcomment-29443117)).
The problem is that RN is still reading `projectRoots` from the Metro config and trying to call `concat()` on them. Latest Metro sets the default `projectRoots` to null, so this fails.
Also, a couple other things have been done:
* Make sure that the `projectRoot` and `watchFolder` objects from args are passed to Metro (so they contain the overrides from the CLI arguments).
* Add a `--projectRoot` CLI arg, replacing the `--root` one (this is not actually needed, since it does the same as `--watchFolders`
Differential Revision: D8567229
fbshipit-source-id: 3b76fd8e23d201a4097e9dfba3a512d64f348cb0
Summary:
We use projectRoots to limit crawling of jest-haste-map in large codebases. Since this implies multiple projects roots, it makes it very hard (or impossible) to reliably cache dependency resolutions.
If we can replace this with a single project root and a set of watch roots, we can have relative path resolutions for all dependencies which van be cached.
Reviewed By: rafeca
Differential Revision: D8450498
fbshipit-source-id: 830c21e847c3236e42d5414a8587508cb73864bd
Summary:
Fixes https://github.com/facebook/react-native/issues/19766
On a clean project flow was complaining about `Cannot resolve module X` because of the removal of `providesModule`. This resolves the errors.
Reviewed By: rubennorte
Differential Revision: D8500303
fbshipit-source-id: 4e129ee4382f8ff36ab126e9f6c6530254cd382e
Summary:
I started using Xcode 10 beta and spotted that even though react-native cli is using cli tools from Xcode 10 for building it tries to open simulator from Xcode 9.4. Turned out that path to simulator app is hardcoded and doesn’t care about active developer directory.
1. You have to have more than one Xcode version (ie. 9.4 and 10 beta).
2. Change active developer directory to Xcode beta (`xcode-select -s /Applications/Xcode-beta.app/Contents/Developer`).
3. Without fix `react-native run-ios` will open simulator from Xcode 9.4, with fix it'll open simulator from active developer directory.
[CLI][IOS] [BUGFIX] [./local-cli] - use simulator from active developer directory
Closes https://github.com/facebook/react-native/pull/19781
Differential Revision: D8475915
Pulled By: TheSavior
fbshipit-source-id: d607f1f9eb9e565d4a017c21de50b5e569d171f9
Summary:
bump gradle-plugin@2.3.3, gradle@3.5.1, gradle-download-task@3.4.3, as we landed build tools 26.0.2 with 065c5b6590
Will improve Android build performance.
Everything will work as normal, but build faster.
<!--
Required.
Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[ANDROID] [ENHANCEMENT] [TOOLS] - bump gradle-plugin@2.3.3, gradle@3.5.1, gradle-download-task@3.4.3
Closes https://github.com/facebook/react-native/pull/19697
Differential Revision: D8433743
Pulled By: hramos
fbshipit-source-id: da72aeb314bed7f63807a0c69bebd24c633cc807
Summary:
This PR will add Google maven repo to RN project template that contains com.android.support:appcompat-v7:26.1.0, thus fixes `react-native run-android` using version 0.56.0-rc.1
CI is Green - https://circleci.com/gh/dulmandakh/react-native/235
new Android projects will build and run just fine.
Closes https://github.com/facebook/react-native/pull/19712
Differential Revision: D8433730
Pulled By: hramos
fbshipit-source-id: b7d5a1cd5a97b1c4aad2a307158d6dbfcf9a42a5
Summary:
Android Target API Level 26 will be required starting from August 2018, it's so soon 😄.Read https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
This PR uses android build tools 26.0.2, support library 26.1.0 (with android lifecycle) and setting compileSdkVersion to 26, but leaving minSdkVersion and targetSdkVersion intact, which will make targeting 26 easy.
Circle CI: https://circleci.com/gh/dulmandakh/react-native/209
Everything will build and work just fine.
[ANDROID] [ENHANCEMENT] [TOOLS] - Use android build-tools 26.0.2 and set compileSdk to 26, and use support library version 26.1.0.
Closes https://github.com/facebook/react-native/pull/19662
Differential Revision: D8398855
Pulled By: hramos
fbshipit-source-id: a4066eb04cb5f947efe1f3202b638c1092b79aae
Summary:
We opt in to version ^5 of the React Native Babel Preset, as required after the bump to Babel 7. This fixes the Objective-C end-to-end test failure in master. (Fixes#19538)
See 34bd776af2 (commitcomment-29024085) for prior discussion.
There have already been several changes made to the repo during the transition to Babel 7. This PR brings all tests back to green and allows us to move forward with the 0.56 branch cut.
We also bump our tests to use Xcode 9.4.0 and iOS 11.4, the latest stable versions of both.
Once the 0.56 branch makes it to stable, we can change `react-native-babel-preset@latest` on npm to point to `react-native-babel-preset@5.0.1` (or newer), and undo the change made to `init.js` we made as part of this diff.
Wait for Circle CI to run: https://circleci.com/workflow-run/e39a66d7-bf8a-4b31-a22f-eef30a2c53bc
[GENERAL] [BREAKING] [Babel] - Bump React Native Babel Preset version used by RN CLI to Babel v7 compliant release
Closes https://github.com/facebook/react-native/pull/19625
Reviewed By: TheSavior
Differential Revision: D8343861
Pulled By: hramos
fbshipit-source-id: 42644d5b0bfb40a8bc592ae3461c5008deef8232