Summary:
This was introduced as part of a codemod a few months back. Hopefully this edit makes the example code clearer.
Closes https://github.com/facebook/react-native/pull/17189
Differential Revision: D6613378
Pulled By: hramos
fbshipit-source-id: da7263b3ce2b5c45d6e312807c88743fe10cd15d
Summary:
Fixes the Flow failure due to an undefined Ast type.
Before:
```
$ npm run flow -- check
> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"
Error: local-cli/__tests__/fs-mock-test.js:27
27: beforeEach(() => {
^^^^^^^^^^ beforeEach. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:53
53: expect(content).toEqual('beep');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:88
88: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:100
100: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: node_modules/metro/src/Bundler/util.js.flow:46
46: ): Ast {
^^^ Ast. Could not resolve name
Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283
283: const xp = (module.exports = (ast: Ast) =>
^^^ Ast. Could not resolve name
Error: node_modules/metro/src/assetTransformer.js.flow:29
29: ): Promise<{ast: Ast}> {
^^^ Ast. Could not resolve name
```
After
```
$ npm run flow -- check
> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"
Error: local-cli/__tests__/fs-mock-test.js:27
27: beforeEach(() => {
^^^^^^^^^^ beforeEach. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:53
53: expect(content).toEqual('beep');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:88
88: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
Error: local-cli/__tests__/fs-mock-test.js:100
100: expect(content).toEqual('hello, world!');
^^^^^^ expect. Could not resolve name
```
[ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules
Closes https://github.com/facebook/react-native/pull/17187
Differential Revision: D6572303
Pulled By: hramos
fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
Summary:
- [x] Explain the **motivation** for making this change.
It fixes#14313
Closes https://github.com/facebook/react-native/pull/14495
Differential Revision: D6042094
Pulled By: hramos
fbshipit-source-id: d70e42bfee0a22882bad91cb885fb0cfc91c7d38
Summary:
CI is currently failing because of a lint issue, this fixes it and a bunch of other warnings that are auto-fixable.
**Test plan**
Quick manual test, cosmetic changes only.
Closes https://github.com/facebook/react-native/pull/16229
Differential Revision: D6009748
Pulled By: TheSavior
fbshipit-source-id: cabd44fed99dd90bd0b35626492719c139c89f34
Summary:
gabelevi mroch: Can you make sure this flow config is also updated when upgrading flow, otherwise our Travis e2e tests fail.
Closes https://github.com/facebook/react-native/pull/15447
Differential Revision: D5601593
Pulled By: javache
fbshipit-source-id: 9dbaa3c1ff732b191452c2c2e56fcf0486fc44c8
Summary:
Currently the default way to setup _fastlane_ for ReactNative projects is to set it up in the `ios` or `android` subfolder. This PR updates the path and also the URL to the new fastlane docs page.
Closes https://github.com/facebook/react-native/pull/13261
Differential Revision: D5567604
Pulled By: hramos
fbshipit-source-id: 89c27328bb2748ff1772812786e2821963dc1779
Summary:
This change (initially discussed in https://github.com/react-community/create-react-native-app/issues/26) moves the HelloWorld project template from two nearly identical entry points (`index.android.js` and `index.ios.js`) to a single, minimal `index.js` entry point. The root component is created in `App.js`. This unifies the project structure between `react-native init` and Create React Native App and allows CRNA's eject to use the entry point from the HelloWorld template without any hacks to customize it. Also examples in the docs can be just copy-pasted to `App.js` the same way in both HelloWorld and CRNA apps without having to first learn about `AppRegistry.registerComponent`.
* Created a new project from the template using `./scripts/test-manual-e2e.sh` and verified that:
* The app builds, starts and runs both on Android and iOS.
* Editing and reloading changes works.
* The new files (`index.js`, `App.js`, `__tests__/App.js`) get created in the project folder.
<img width="559" alt="screen shot 2017-08-01 at 19 10 51" src="https://user-images.githubusercontent.com/497214/28835171-300a12b6-76ed-11e7-81b2-623639c3b8f6.png">
<img width="467" alt="screen shot 2017-08-01 at 19 09 12" src="https://user-images.githubusercontent.com/497214/28835180-33d285e0-76ed-11e7-8d68-2b3bc44bf585.png">
<!--
Thank you for sending the PR!
If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!
Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.
Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15312
Differential Revision: D5556276
Pulled By: hramos
fbshipit-source-id: 068fdf7e51381c2bc50321522f2be0db47296c5e
Summary:
Hi React Native folks! Love your work!
To make contributing easier, this sets the indentation settings of all the Xcode projects to 2 spaces to match their contents.
Closes https://github.com/facebook/react-native/pull/15275
Differential Revision: D5526462
Pulled By: javache
fbshipit-source-id: cbf0a8a87a1dbe31fceed2f0fffc53839cc06e59
Summary:
This is the first PR from a series of PRs grabbou and me will make to add blob support to React Native. The next PR will include blob support for XMLHttpRequest.
I'd like to get this merged with minimal changes to preserve the attribution. My next PR can contain bigger changes.
Blobs are used to transfer binary data between server and client. Currently React Native lacks a way to deal with binary data. The only thing that comes close is uploading files through a URI.
Current workarounds to transfer binary data includes encoding and decoding them to base64 and and transferring them as string, which is not ideal, since it increases the payload size and the whole payload needs to be sent via the bridge every time changes are made.
The PR adds a way to deal with blobs via a new native module. The blob is constructed on the native side and the data never needs to pass through the bridge. Currently the only way to create a blob is to receive a blob from the server via websocket.
The PR is largely a direct port of https://github.com/silklabs/silk/tree/master/react-native-blobs by philikon into RN (with changes to integrate with RN), and attributed as such.
> **Note:** This is a breaking change for all people running iOS without CocoaPods. You will have to manually add `RCTBlob.xcodeproj` to your `Libraries` and then, add it to Build Phases. Just follow the process of manual linking. We'll also need to document this process in the release notes.
Related discussion - https://github.com/facebook/react-native/issues/11103
- `Image` can't show image when `URL.createObjectURL` is used with large images on Android
The websocket integration can be tested via a simple server,
```js
const fs = require('fs');
const http = require('http');
const WebSocketServer = require('ws').Server;
const wss = new WebSocketServer({
server: http.createServer().listen(7232),
});
wss.on('connection', (ws) => {
ws.on('message', (d) => {
console.log(d);
});
ws.send(fs.readFileSync('./some-file'));
});
```
Then on the client,
```js
var ws = new WebSocket('ws://localhost:7232');
ws.binaryType = 'blob';
ws.onerror = (error) => {
console.error(error);
};
ws.onmessage = (e) => {
console.log(e.data);
ws.send(e.data);
};
```
cc brentvatne ide
Closes https://github.com/facebook/react-native/pull/11417
Reviewed By: sahrens
Differential Revision: D5188484
Pulled By: javache
fbshipit-source-id: 6afcbc4d19aa7a27b0dc9d52701ba400e7d7e98f
Summary: in order to prepare open sourcing React Native Packager, we have to move scripts specific to React Native to a directory that will continue to exist.
Reviewed By: javache
Differential Revision: D5112193
fbshipit-source-id: eac77d0d981aecef7ee52365a6856340420a5638
Summary:
This PR adds support for configurable devEnabled option when building an android app. This is currently hardcoded.
The reason for making this configurable is this: I have an app that uses code-push and 3 buildConfigs. I want to have a debugging version which has `devEnabled = true`, then a staging version which has `devEnabled = false` (this version of the app is used internally for testing and should behave just like a release version of the app, and when the tests succeed the changes are promoted into the release version to the users out there, using code-push). The last version is a standard release version with `devEnabled = false`.
Currently, `devEnabled` is hardwired like this: `!targetName.toLowerCase().contains("release")` so by default my `staging` buildConfig will have `devEnabled = true` but I'd like it to be false.
With this PR it'd be possible to configure this as follows, while not breaking the current behavior.
`'devDisabledIn${productFlavor}${buildType}'`
`'devDisabledIn${buildType
Closes https://github.com/facebook/react-native/pull/11438
Differential Revision: D4630513
Pulled By: hramos
fbshipit-source-id: b6817cf4c144fc948f76785e9cb5f93a13a6a6a2
Summary:
…th RCTSharedApplication()
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions
> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.
Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension
- [ ] Provide a **test plan** demonstrating that the code is solid.
I am not sure how to test such that all the features which touch the modified code are tested.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227
Differential Revision: D4816338
Pulled By: javache
fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
At the moment, if you uncomment the react specific code in `build.gradle` you'll get a compilation error. Adding a comma prevents this error.
No tests are necessary. This is a simple fix.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martink
Closes https://github.com/facebook/react-native/pull/13212
Differential Revision: D4802065
Pulled By: javache
fbshipit-source-id: 0ddfe16241381d7e4ac0e48be1bada21d9df2068
Summary:
Minor code formatting.
Each time I run `react-native init` I must reindent this file.
Closes https://github.com/facebook/react-native/pull/12850
Differential Revision: D4691374
fbshipit-source-id: dc02b021e2f320f1046e4e6d024ba675a4213de8