Граф коммитов

1025 Коммитов

Автор SHA1 Сообщение Дата
Andrew Coates 1ff553228c Fix a bunch of flow errors 2019-06-04 12:45:50 -07:00
Christopher Hogan fedfabcecb facebook 59.0 merge- with conflicts 2019-04-22 10:37:26 -07:00
Christopher Hogan a9f4ec2bf7 lint fixes and merge conflict resolution for Mac 2019-03-28 10:56:16 -07:00
Andrew Coates (REDMOND) 1b12e2caaa merge master 2019-03-23 16:38:05 -07:00
Andrew Coates (REDMOND) baa51f2291 Resolve remaining merges 2019-03-23 16:00:16 -07:00
Christopher Hogan d884baec86 iOS 0.58.6 merge building, linking, running 2019-03-19 14:09:38 -07:00
Tom Underhill 0d619f87ea Fix Flow and ESLint errors. (#14)
* Fix Flow and ESLint errors.

* Fixed some warnings in code that is in the MS fork only.
2019-03-14 12:59:12 -07:00
Christopher Hogan 27381d39db facebook 0.58.6 merge with conflicts (although some iOS files had conflicts removed) 2019-03-11 13:49:58 -07:00
REDMOND\acoates 5c0c3d4084 Initial commit of internal changes. 2019-03-01 10:09:07 -08:00
Dulmandakh fbd31c5868 improve Android Network Security config (#23429)
Summary:
This PR is trying to improve Android Network Security configuration introduced in 84572c4051. I found that Android merges all manifest files into a single manifest file when building an app, so this PR provides AndroidManifest.xml with network security config in debug folder, that will be used only for debug builds. Also the network security configuration will be applied to only app that target API 28. Moved security config file to xml-v28, so that it'll only visible to API 28 and above.

See https://developer.android.com/studio/build/manifest-merge

[Android] [Changed] -  Android Network Security configuration.
Pull Request resolved: https://github.com/facebook/react-native/pull/23429

Differential Revision: D14065124

Pulled By: cpojer

fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
2019-02-18 14:53:38 +01:00
Salakar b5270e88f0 apply Network Security Config file (fixes #22375) (part 2 of #23105) (#23135)
Summary:
This is a follow-up PR for https://github.com/facebook/react-native/pull/23105 - as mentioned on discord.

 ---

This PR applies the network security config for the RN template project only. New RN projects started with the updated template will be able to connect to the packager on builds built with Android API 28 & above.

See https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted for more information about this newly required config, specifically:

![image](https://user-images.githubusercontent.com/5347038/52124287-b3de2580-2620-11e9-958d-bc2da15c6f01.png)

Changelog:
----------
[ANDROID] [Template] add Network Security Config file to allow access to packager via cleartext requests in Android API 28 and above. (fixes #22375)
Pull Request resolved: https://github.com/facebook/react-native/pull/23135

Differential Revision: D13917058

Pulled By: cpojer

fbshipit-source-id: 0e66f2cde712c1285d217e3625b73028c3770b65
2019-02-18 14:53:29 +01:00
cpojer 8bddcb6cb0 Backport fix from https://github.com/react-native-community/react-native-cli/pull/138 2019-02-06 10:14:38 +00:00
Ole-Kristian Sunnarvik 9a8c9596eb handles simulator where prefix is included 2019-02-05 13:56:57 +01:00
Mike Grabowski 9d19ab0c0c Bring missing changes to 0.58-stable branch
This reverts commit b864e7e63e.
2019-01-28 14:56:57 +01:00
Héctor Ramos d811d38823 Bump to Android Build Tools 28.0.3, Gradle 4.10.2, Gradle Plugin 3.2.1
Summary: Bump Android Build Tools to Version 28.0.3, Gradle to 4.10.2, and the Android Gradle Plugin to 3.2.1.

Reviewed By: mdvacca

Differential Revision: D13631120

fbshipit-source-id: 709aa25a7a8e1ff0bfc0a969ba6e7cd92850bc0f
2019-01-24 12:57:54 +01:00
Vladimir Timofeev 23cfa29ac7 Fix tests in template project (0.58-stable) (#23128)
* Restore __tests__ folder in HelloWorld template

PR #18019 Removed __tests__ and __fixtures__ folders from npm package.
But it also effectively removed __tests__ folder from initial project
template. This commit restores __tests__ in template application.

It applicable only to 0.58-stable branch because in master, templates
was moved to another location. I think we should recheck what is ignored
in master after this landed.

* Use babel.config.js in template HelloWorld application

* Add babel-core@^7.0.0-bridge.0 to jest dependencies when react-native init new project. This should fix tests with babel7.
2019-01-23 19:00:39 +01:00
Dulmandakh ec887c25a4 android support library 28.0.0 (#23109)
Summary:
Bump Android Support Library to 28.0.0. Therefore fix Android CI

Changelog:
----------
[Android] [Changed] - Bump Android Support Library to 28.0.0.
Pull Request resolved: https://github.com/facebook/react-native/pull/23109

Differential Revision: D13779835

Pulled By: mdvacca

fbshipit-source-id: 7645ffe2c04ca81424b2f9cfa43dc4ec30c50e25
2019-01-23 12:30:00 +01:00
Mike Grabowski 1af390be19 Update references to the CLI (#23052)
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
2019-01-21 09:13:08 -08:00
Dulmandakh 8e39451512 Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632)
Summary:
This PR is bumping compileSdkVersion to 28, buildToolsVersion to 28.0.2, Gradle to 4.7, Android Gradle plugin to 3.2.0.

Gradle 4.7 added support for Java 10 and 11.

allow-large-files

Release Notes:
--------------
[ANDROID] [ENHANCEMENT] [SDK] - bump to 28

Pull Request resolved: https://github.com/facebook/react-native/pull/21632

Reviewed By: mdvacca

Differential Revision: D13084836

Pulled By: hramos

fbshipit-source-id: e0f493881e80e87faf8c3ef1ac77044495966a49
2018-12-17 19:44:58 +01:00
Christoph Nakazawa 63a6bb7637 Remove remaining references to local-cli
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
2018-12-10 19:08:10 -08:00
Christoph Nakazawa 896bb8a21e Move react-native template
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
2018-12-07 07:49:19 -08:00
Christoph Nakazawa cd43fb8005 Remove local-cli
Summary:
This diff removes all files from the local-cli from react-native-github. The only leftover is the `cli.js` which redirects to `react-native-local-cli` and the templates folder which I'll move in a follow-up.

This diff simply removes all files, it makes no code changes. There will be a cleanup diff on top of this one.

Reviewed By: TheSavior

Differential Revision: D13338367

fbshipit-source-id: 1afabdb34202596fb13186d728df74482c9bc609
2018-12-07 07:49:18 -08:00
Christoph Nakazawa 983ddc78d0 Move middleware files into react-native-internal-cli
Summary: These files are used by `js1 run`. By copying them close to `runServer.js` we can soon remove `local-cli`.

Reviewed By: TheSavior

Differential Revision: D13337487

fbshipit-source-id: ef80317580d5a9b3e560ad1f27b681887cf50b6b
2018-12-06 20:15:46 -08:00
Christoph Nakazawa 2e5e9fa88a Move asset related modules into `metro-buck`
Summary:
These files are some of the few standalone files from the `local-cli` that are used internally. This diff copies them into the one place where they are used. Note that I am leaving the old files in `local-cli`. Even if they are unused, moving them would break flow (require module verification).

This diff also moves the `assetPathUtils` file into `Libraries/Image`, which is where it is used. This was previously part of D13337412 but I had to squash them to make buck happy.

Reviewed By: TheSavior

Differential Revision: D13337304

fbshipit-source-id: 2d501109ba7d4ba94ca7e8f2953258221947b90e
2018-12-06 20:15:46 -08:00
Radovan Šmitala a2ef5b85d8 Use main.jsbundle in iOS template for production build (#22531)
Summary:
Default HelloWorld template for iOS doesn't make production main.jsbundle. This is little bit confusing in compare with Android building app when everything works one first run.

Make it seamless, reduce confuse.
Based on docs https://facebook.github.io/react-native/docs/running-on-device#3-configure-app-to-use-static-bundle

Fixes #22335
Fixes #18562
Pull Request resolved: https://github.com/facebook/react-native/pull/22531

Differential Revision: D13372773

Pulled By: cpojer

fbshipit-source-id: 888c675b7d11b1a323445e092ec9ff83924c42f4
2018-12-06 19:29:52 -08:00
Dulmandakh 9d00d4d5bb Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632)
Summary:
This PR is bumping compileSdkVersion to 28, buildToolsVersion to 28.0.2, Gradle to 4.7, Android Gradle plugin to 3.2.0.

Gradle 4.7 added support for Java 10 and 11.

allow-large-files

Release Notes:
--------------
[ANDROID] [ENHANCEMENT] [SDK] - bump to 28

Pull Request resolved: https://github.com/facebook/react-native/pull/21632

Reviewed By: mdvacca

Differential Revision: D13084836

Pulled By: hramos

fbshipit-source-id: e0f493881e80e87faf8c3ef1ac77044495966a49
2018-12-05 09:06:31 -08:00
Mike Grabowski cb6eb03776 Extract out CLI (#22337)
Summary:
Continuation of https://github.com/facebook/react-native/pull/22174 with an exception that `local-cli` folder is left in React Native repository to keep Facebook internal and React Native calls still working.

Separate strategy should be developed to remove all uses of `local-cli` in favor of dedicated utilities.
Pull Request resolved: https://github.com/facebook/react-native/pull/22337

Reviewed By: TheSavior

Differential Revision: D13172898

Pulled By: cpojer

fbshipit-source-id: 0217867f9944648307475ebe629eb729da7bfaaf
2018-12-02 22:21:43 -08:00
Panagiotis Vekris ef2084c6bd 0.87.0 in xplat/js
Summary: allow-large-files

Reviewed By: samwgoldman

Differential Revision: D13230018

fbshipit-source-id: f07e2371a3b7382de0592cc7c7b20e7f4faa6889
2018-11-28 17:32:50 -08:00
Alexandre Kirszenberg e81adb99f3 DeltaClient: split DeltaBundle's modules into added and modified
Summary:
The reasoning behind this change is that right now, having both added and modified modules inside of a single `modules` field doesn't allow for basic operations like combining two deltas.

For instance, say I have three different bundle revisions: A, B and C.

Module 42 was added in B, and then removed in C.

A->B = `{modules: [42, "..."], deleted: []}`
B->C = `{modules: [], deleted: [42]}`
A->C = `{modules: [], deleted: []}`

However, were we to compute A->C as the combination of A->B and B->C, it would result in `{modules: [], deleted: [42]}` because we have no way of knowing that module 42 was only just added in B.

This means that the `deleted` field of delta X->Y might eventually contain module ids that were never present in revision X, because they were added and then removed between revisions X and Y.

The last time I changed the delta format, we had a few bug reports pop out from people who had desync issues between their version of React Native and their version of Metro. As such, I've tried to make this change backwards compatible in at least one direction (new RN, old Metro). However, this will still break if someone is using a newer version of Metro and an older version of RN. I created T37123645 to follow up on this.

Reviewed By: rafeca, fromcelticpark

Differential Revision: D13156514

fbshipit-source-id: 4a4ee3b6cc0cdff5dca7368a46d7bf663769e281
2018-11-28 02:50:56 -08:00
Tim Yung 51d983bfa4 flow-typed: Define minimist
Summary: Fixes a minor Flow type error when `minimist` is typed via `flow-typed`.

Reviewed By: TheSavior

Differential Revision: D13188680

fbshipit-source-id: 9ad35a3222c8937163a998a2751efd95945af3c7
2018-11-27 23:33:56 -08:00
Rubén Norte 2ae559a2a4 eslint: Disable jasmine env and only enable jest env for test files
Summary:
Modified the ESLint configuration to only enable the Jest environment for files we consider now tests, which are files with the `-test.js` suffix under `__tests__`. Also enabled some globals for test helpers (any file under `__tests__`).

This will allow us to catch misspelled tests, while allowing test helpers to use most Jest APIs.

Also disabled the Jasmine environment so people stop using Jasmine APIs and we can rollout Circus soon.

Reviewed By: aaronabramov

Differential Revision: D13199591

fbshipit-source-id: 12a32cf5835630b9987452b0c33d3f8085001689
2018-11-27 03:51:02 -08:00
Rubén Norte ffa9036252 jest: rename tests to follow the new convention
Summary:
Renamed test files to match `-test.js`, so people can add test helpers without blacklisting.

Codemod code: P60365841

Script executed:

```
cd xplat/js
./scripts/node/node rename-script.js > result.txt
```

Reviewed By: mjesun

Differential Revision: D13185673

fbshipit-source-id: 87451635aa538c2c1d1886e75574d0e5c889596e
2018-11-26 10:30:12 -08:00
Mike Grabowski b864e7e63e Revert "Merge branch 'master' into 0.58-stable"
This reverts commit 696bd89013, reversing
changes made to a525941ab6.
2018-11-22 17:53:44 +01:00
Radovan Šmitala 02a3517d0b Fix allocating Buffer in early commit (#22379)
Summary:
Commit d9c2cdae41 brings compatibility with Node 10, but replaced allocating buffer incorrectly.
dulmandakh made two comments and shows how to do it based on NodeJS documentation https://nodejs.org/api/buffer.html#buffer_new_buffer_size

This PR just fixes that commit.
Pull Request resolved: https://github.com/facebook/react-native/pull/22379

Differential Revision: D13166867

Pulled By: hramos

fbshipit-source-id: 207528739889c044021a4b97ef94c33d56de3e89
2018-11-22 00:50:03 -08:00
Panagiotis Vekris 8fb228f313 Flow v0.86.0 in xplat/js
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: yungsters

Differential Revision: D13081129

fbshipit-source-id: fbb0ccaf3c0a2f224a56f6f6ac6c26811ebba583
2018-11-16 10:43:16 -08:00
Tim Yung d9c2cdae41 JS: Switch from `new Buffer` to `Buffer.from`
Summary:
Constructing `Buffer` using the constructor [[https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/ | has been deprecated in Node 10 due to security considerations]].

This is a simple and straightforward conversion.

Reviewed By: mjesun

Differential Revision: D13080655

fbshipit-source-id: 100d8f28c3b255422b26e820aaadcc4f32f41e0d
2018-11-15 12:13:05 -08:00
Stephy Ma 984eef8f9e Revert D12994045: Flow v0.86.0 in xplat/js [3/n]
Differential Revision:
D12994045

Original commit changeset: 04552bf081ba

fbshipit-source-id: 062b367b88a966a6efc895c99e9911f0ec0fe8ff
2018-11-14 23:04:04 -08:00
Panagiotis Vekris 43ad3a64e6 Flow v0.86.0 in xplat/js [3/n]
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: avikchaudhuri

Differential Revision: D12994045

fbshipit-source-id: 04552bf081ba742de58e80fba08f8280cb86b1c3
2018-11-14 22:13:27 -08:00
Alexandre Kirszenberg bea57d871f DeltaPatcher: better support for the new Delta format
Summary: Adds support for the `deleted` key to remove modules from the bundle. Without this, source maps would break after removing a module, since it would still end up in the patched bundle but not in the source map.

Reviewed By: mjesun

Differential Revision: D12874011

fbshipit-source-id: 79239756854cb2c02f14ec8b0bb2b649766393fe
2018-11-12 08:41:06 -08:00
Tnarita0000 f8040ed16f Fix `no-shadow` eslint warning & remove var (#22124)
Summary:
Fixes `no-shadow` warning for `local-cli/link/ios/getGroup.js`  and remove `var` declaration keyword.
```
react-native/local-cli/link/ios/getGroup.js
  13:23  warning  'group' is already declared in the upper scope  no-shadow
```

- [x] Check `npm run flow`
- [x] Check `npm run flow-check-ios`
- [x] Check `npm run flow-check-android`
- [x] Check `npm run lint`

N/A
Pull Request resolved: https://github.com/facebook/react-native/pull/22124

Differential Revision: D12929717

Pulled By: TheSavior

fbshipit-source-id: 10f8269ae7a0e61f4d0ec6fe710889c3a7c90b3b
2018-11-05 14:02:02 -08:00
Ignacio Olaciregui 6ebee18d13 Remove unused variables (#22097)
Summary:
Fix unused variable ESLint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22097

Differential Revision: D12919249

Pulled By: TheSavior

fbshipit-source-id: f680fa7277c58cf685e70dfb911753a30fe01c1d
2018-11-04 10:41:46 -08:00
Spencer Ahrens 2486d12b81 lint autofixes
Summary: `find js/react-native-github | xargs arc lint -a`

Reviewed By: yungsters

Differential Revision: D12902940

fbshipit-source-id: fd1158f7a0ec322cf89bc4f727943bff4600b399
2018-11-02 12:44:59 -07:00
Sam Goldman adc8a33fcf Deploy Flow v0.85 to xplat/js
Reviewed By: fishythefish

Differential Revision: D12898653

fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a
2018-11-02 00:28:28 -07:00
Ignacio Olaciregui ae8ec39397 Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Ignacio Olaciregui 58732a88b6 Remove undefined value on init cli command (#22045)
Summary:
Fixes `undefined` description message when running `react-native init --help` on an existing React Native project.
Pull Request resolved: https://github.com/facebook/react-native/pull/22045

Differential Revision: D12878956

Pulled By: TheSavior

fbshipit-source-id: ede329ca88a02013a6c2f75f1b762d89eacdb34f
2018-10-31 21:12:31 -07:00
Dulmandakh 2a349f87f7 gradle repo priority (#22041)
Summary:
Changed gradle repo list to have consistent priority. mavenLocal is top priority because it requires manual setup, also won't conflict with other repos.
Pull Request resolved: https://github.com/facebook/react-native/pull/22041

Differential Revision: D12871549

Pulled By: hramos

fbshipit-source-id: c86730fde956dca77174c6454fdcb005a5eec8a9
2018-10-31 14:32:38 -07:00
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
Ely Alvarado ce860803a4 Prepend passed sourceExts to default ones and pass them to metro (#21855)
Summary:
Fixes react-native start not using passed --sourceExts #21854
Pull Request resolved: https://github.com/facebook/react-native/pull/21855

Differential Revision: D12840358

Pulled By: rafeca

fbshipit-source-id: 4ee09341b5128d83274a39d8d01c13749efaa78b
2018-10-30 15:18:34 -07:00
Alexandre Kirszenberg 1eedf05651 Update the Delta/HMR format
Summary:
Makes the delta bundle data structures more consistent.

The changes are as follows:
* There are now two types of JSON bundles that can be downloaded from the delta endpoint. Base bundles (`Bundle` type), and Delta bundles (`DeltaBundle` type).
* The `reset` boolean is renamed to `base`.
* `pre` and `post` properties are now strings.
* Only `Bundle` can define `pre` and `post` properties.
* The `delta` property is renamed to `modules`.
* Deleted modules are now listed inside of the `deleted` property, which is only defined by `DeltaBundle`.

Reviewed By: mjesun

Differential Revision: D10446831

fbshipit-source-id: 40e229a2811d48950f0bad8dd341ece189089e9b
2018-10-29 08:58:30 -07:00
Avik Chaudhuri 11552a7a7a @allow-large-files flow 0.84 xplat deploy
Reviewed By: samwgoldman

Differential Revision: D10851695

fbshipit-source-id: 951c628844bbbc7331d4e75f62485db88e5ba7c4
2018-10-25 18:16:30 -07:00