Commit Graph

13004 Commits

Author SHA1 Message Date
Miguel Jimenez Esun 46f4d3e1bc Upgrade Jest to v22.2.1
Reviewed By: rafeca

Differential Revision: D6923664

fbshipit-source-id: 0751ee6f0eb72193b0b22bb38d0398b3d83592a3
2018-02-07 08:32:12 -08:00
Dmitry Zakharov 0c49c1f332 Native Modules -> Native Extensions
Reviewed By: danzimm

Differential Revision: D6887988

fbshipit-source-id: 475c05f60a2e1ddcfaa9263ab363bff8a528236a
2018-02-07 08:07:13 -08:00
David Aurelio 06d8f96a64 Inline format strings in `DevServerHelper`
Summary: Having format strings and values to interpolate separated makes reading the respective calls difficult. It has also led to situations where format strings were reused with slightly different values, instead of creating a parameterized method.

Reviewed By: pakoito

Differential Revision: D6900905

fbshipit-source-id: 68b56af6a86c0b46bc8cf9c44fbe0fb93ee151ac
2018-02-07 06:31:16 -08:00
Jakub Grzmiel d3db764f38 Convert intent_binary_defs to Skylark
Reviewed By: ttsugriy

Differential Revision: D6910777

fbshipit-source-id: b661be9f2383ca93b940dc7b625f46ae9725ebd7
2018-02-06 22:32:41 -08:00
Kevin Gozali b1e5c01483 iOS: Added scaffolding for FabricUIManager native module
Summary: Experimental scaffolding for FabricUIManager.

Reviewed By: mdvacca

Differential Revision: D6908587

fbshipit-source-id: 646fcc72f54dce736378a7777e5753ed56efc2f6
2018-02-06 21:49:37 -08:00
Kevin Gozali 94dac23583 Added ReactFabric shim
Summary:
A simple shim just like ReactNative.js
Plus a fork of renderApplication that exclusively will call ReactFabric.

Reviewed By: mdvacca

Differential Revision: D6919080

fbshipit-source-id: 5807105a6c45dd99584eb92a5570c6076e2d56b9
2018-02-06 21:49:37 -08:00
Spencer Ahrens 8a882fe6d6 Fix adjustsFontSizeToFit to only shrink, not grow, text
Reviewed By: shergin

Differential Revision: D6913407

fbshipit-source-id: 3fdeeee1a28917f623fc9f804c1b28216cba5375
2018-02-06 21:19:09 -08:00
Moti Zilberman 6c38972327 Support non-integer modulus in ModulusAnimatedNode on Android
Summary:
`Animated.modulo(value, modulus)` supports a non-integer modulus in the iOS and JS implementations but crashes on Android when `useNativeDriver` is set to `true`.

Unfortunately, I'm not fluent enough with this codebase to add a Java test for this fix - especially as I couldn't find any analogous tests to extrapolate from. However, the fix itself seems straightforward enough.

None needed

[ANDROID] [BUGFIX] [Animated] - Support non-integer modulus in .modulo()
Closes https://github.com/facebook/react-native/pull/17860

Differential Revision: D6918799

Pulled By: hramos

fbshipit-source-id: 8d15e4bc881ed41a4123c6f811c0c72119f67be0
2018-02-06 16:59:30 -08:00
Héctor Ramos a1c479fb3b Declare HMRClient module to fix Flow issues in OSS
Summary: Closes https://github.com/facebook/react-native/pull/17881

Differential Revision: D6918186

Pulled By: hramos

fbshipit-source-id: ebcdbde1623eab497062fb50bccb393734b3578f
2018-02-06 16:01:23 -08:00
David Aurelio f88c9d6382 Remove unused method
Summary: Removes `BundleDownloader#cancelDownloadBundleFromURL`

Reviewed By: pakoito

Differential Revision: D6900903

fbshipit-source-id: d9297344d6296d79a984aeecb3e014c9ed23a165
2018-02-06 15:12:08 -08:00
David Aurelio 1019bda930 Extract delta client
Summary: Extracts the delta client from the bundle downloader. This will allow us to extract an interface, and provide a different implementation for C++ delta bundling (where we will pass deltas directly to native code).

Reviewed By: pakoito

Differential Revision: D6900904

fbshipit-source-id: 358705615eecc15afa0de3e50478468ad840d250
2018-02-06 15:12:08 -08:00
David Aurelio 6e44356c9b Clean up `DevServerHelper`
Summary:
- Makes methods private that are not used elsewhere
- Moves a method to `DevSupportManagerImpl`
- Removes unused methods

Reviewed By: pakoito

Differential Revision: D6900907

fbshipit-source-id: c8d9f748effd396fe610f0d4d87e0bc388e155d6
2018-02-06 15:12:08 -08:00
David Aurelio 644123aa6f Consolidate bundle URL creation
Summary:
`DevServerHelper` had multiple places that created bundle URLs.
This consolidates that logic into a single place, and uses an enum for different "bundle types" (bundle, bundle deltas, source maps).

Reviewed By: pakoito

Differential Revision: D6900906

fbshipit-source-id: 64ed9360ea85dc5755308d822d5fc55fe8cb5a55
2018-02-06 15:12:08 -08:00
Héctor Ramos 1ea3065feb Ignore dangerfile
Summary: Closes https://github.com/facebook/react-native/pull/17880

Differential Revision: D6915622

Pulled By: hramos

fbshipit-source-id: 1dff643575c206e51d7486b4bebfd9a6a23e0c14
2018-02-06 13:33:28 -08:00
Héctor Ramos fa11faecb6 Switch e2e to yarn
Summary:
Addresses CI build failures due to use of scoped packages by metro.
Closes https://github.com/facebook/react-native/pull/17878

Differential Revision: D6914937

Pulled By: hramos

fbshipit-source-id: e6ce97561035f4deb128cd1e30d81ab4edea3e4c
2018-02-06 13:04:50 -08:00
Héctor Ramos 613afbab7f Rename workflow steps
Summary:
Trivial - shorten the workflow steps to ease reading of current status when looking at workflows dashboard.
Closes https://github.com/facebook/react-native/pull/17874

Differential Revision: D6912599

Pulled By: hramos

fbshipit-source-id: c4bb08923eb790960b883a7a5f6e4652663982d8
2018-02-06 10:02:42 -08:00
Pritesh Nandgaonkar 62d01006a1 Moved margin axis function as a method in YGNode
Reviewed By: emilsjolander

Differential Revision: D6900003

fbshipit-source-id: a42da3bcd3126bf8c432c6740987b5ec0b572172
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 1475fc4856 Moved trailing padding and border function as a method on YGNode
Reviewed By: emilsjolander

Differential Revision: D6899571

fbshipit-source-id: 7f686e8771d5a94aae502191516557b20c557d7c
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 9daa17458a Moved out main axis justification logic to seperate function
Reviewed By: emilsjolander

Differential Revision: D6845997

fbshipit-source-id: fdb64e00de39427ce1d66d4fbfd06c23c0d32bcf
2018-02-06 08:46:05 -08:00
Pritesh Nandgaonkar 9658d9f82b Fixed failing snapshot test
Reviewed By: emilsjolander

Differential Revision: D6901242

fbshipit-source-id: 7391d6a34fa28e9f92f4ff834755a89dd876fdad
2018-02-06 07:16:03 -08:00
Valentin Shergin 114c258045 Enabling round-to-pixel Yoga feature for RN (iOS)
Summary:
This change enables built-in Yoga mechanism which rounds producing layout metrics to closest "pixel" values.
See previous diff for more context.

Reviewed By: fkgozali

Differential Revision: D6889762

fbshipit-source-id: bc2eea44704db4b377e2e14fab9f67be8c935719
2018-02-05 22:17:22 -08:00
Valentin Shergin ceb1d1ca5b Removing our own implementation of round-to-pixel algorithm
Summary:
> Okay, I don't remember where we first met
> But hey, admitting is the first step

This issue has a looong history.
The original algorithm was introduced by Nick Lockwood (nicklockwood Hey Nick! We miss you!) a while ago and from the very beginning this has one small error that basically makes it useless (try to find it yourself, it's fun!)
The problem was discovered and fixed twice (D4133643, D4983054), but every time we found that our <Text> infra was not ready for this, so we reverted and abandoned the change. As part of the last attempt to finally solve the issue, I ported the algorithm to Yoga where it lives today and works very well for Lytho and CK.
For now, the vision is clear:
 * The basic algorithm should live in Yoga for unification and performance reasons.
 * We still have to have `absolutePostion` as part of this API because it might be useful for some components which implement its own custom/non-Yoga-based layout.
 * We have to enable it in RN eventually.

So, this is the first step: Removing old, broken code which we don't plan to fix and use.

Make React Native crisp again!

Reviewed By: fkgozali

Differential Revision: D6888662

fbshipit-source-id: 2e5098d9935dcbe05d66c777dad3a9ec8ac87ec3
2018-02-05 22:17:22 -08:00
Valentin Shergin c19bc79688 `[RCTShadowView isHidden]` was removed
Summary:
It's unused.
Use `display` prop instead to control visiblity of the view.

Reviewed By: fkgozali

Differential Revision: D6888104

fbshipit-source-id: dd37a365033ec36bdfcfa305ec6a965a10dec2cd
2018-02-05 22:17:22 -08:00
Valentin Shergin 9dfa2e7f3c Removed `[ShadowView collectUpdatedFrames:]`
Summary: Another juicy leftover from old Text implementation.

Reviewed By: fkgozali

Differential Revision: D6887942

fbshipit-source-id: d0363d06d566554c03d0ae3293597daf9c387028
2018-02-05 22:17:22 -08:00
Valentin Shergin 0f9fc4b295 `processUpdatedProperties` & `collectUpdatedProperties` was removed from RCTShadowView
Summary: This is leftovers from last <Text> reimplementation; nobody uses it and it does not hooked up with UIManager.

Reviewed By: fkgozali

Differential Revision: D6887795

fbshipit-source-id: 9e2e29af4ba959270096eeb494666d1cacaeba32
2018-02-05 22:17:22 -08:00
Rafael Oleza ce50f25d22 Bump metro@0.25.0
Reviewed By: davidaurelio

Differential Revision: D6878299

fbshipit-source-id: cde26c9c9e56ee9a052f1915ad7772ae475b5e41
2018-02-05 22:01:34 -08:00
Marc Horowitz 816d417189 Delete RCTBatchedBridge
Summary:
I've talked to several major community users, and they're all ok with deleting this
code.  There's several doc fixes which will make it easier for third
party developers which should land about the same time this will.

Also buried along with it is RCTJSCExecutor.

Reviewed By: javache

Differential Revision: D6880781

fbshipit-source-id: b4cb1143def6fd23a96290e478fa728adbedacd3
2018-02-05 12:02:35 -08:00
David Aurelio 108f9664bf Do not expose `BundleDownloader` from `DevServerHelper`
Summary:
Adds `downloadBundleFromURL` as a delegating method to `DevServerHelper` rather than exposing the underlying `BundleDownloader`.

The additional encapsulation will allow futher factoring of `BundleDownloader` to make logic for different delta bundler clients easier to implement and maintain.

Reviewed By: pakoito

Differential Revision: D6871225

fbshipit-source-id: 6adcab5e69869a234baf38f1f1e60abd34d6b555
2018-02-05 11:47:03 -08:00
Pritesh Nandgaonkar d4517ddb9f Made a separate function for resolving flexible length
Reviewed By: emilsjolander

Differential Revision: D6834269

fbshipit-source-id: 954bc7fe8eb9256d353cdda27e5c64c076808e25
2018-02-05 07:04:54 -08:00
Pritesh Nandgaonkar ca91f0e3ac Seperate function for second pass
Reviewed By: emilsjolander

Differential Revision: D6833635

fbshipit-source-id: 7680a67db8bfe22f8fb86407159888882f3a3353
2018-02-05 07:04:54 -08:00
Pritesh Nandgaonkar fda861a889 Replaced first pass with a function
Reviewed By: emilsjolander

Differential Revision: D6819719

fbshipit-source-id: e5e77c21d1dca2255433da3388887d9db3f7b642
2018-02-05 07:04:53 -08:00
Pritesh Nandgaonkar 34b7ec82b5 Moved out logic to calculate size consumed on a line into seperate function
Reviewed By: emilsjolander

Differential Revision: D6797640

fbshipit-source-id: ad9757e7d603c0ce57f452b1e5c404037605bed9
2018-02-05 07:04:53 -08:00
Brian Vaughn 8235a49a33 Update react-devtools@3.1.0 in prep for React 16.3
Reviewed By: gaearon

Differential Revision: D6886480

fbshipit-source-id: 09ca9ea8e20bc050ba30ae4e5f73495cace426f5
2018-02-03 13:31:14 -08:00
allengleyzer 9e436d1439 Added progress updates for all XMLHttpRequest upload types / fix crash on closed connection
Summary:
This PR includes the same changes made in #16541, for addressing issues #11853/#15724. It adds upload progress updates for uploads with any request body type, and not just form-data.

Additionally, this PR also includes a commit for fixing an `IllegalStateException` when a user's connection gets closed or times out (issues #10423/#11016). Since this exception was occurring within the progress updates logic, it started being thrown more frequently as a result of adding progress updates to all uploads, which was why the original PR was reverted.

To test the upload progress updates, run the following JS to ensure events are now being dispatched:
```
const fileUri = 'file:///my_file.dat';
const url = 'http://my_post_url.com/';
const xhr = new XMLHttpRequest();

xhr.upload.onprogress = (event) => {
    console.log('progress: ' + event.loaded + ' / ' + event.total);
}

xhr.onreadystatechange = () => {if (xhr.readyState === 4) console.log('done');}

console.log('start');

xhr.open('POST', url);

// sending a file (wasn't sending progress)
xhr.setRequestHeader('Content-Type', 'image/jpeg');
xhr.send({ uri: fileUri });

// sending a string (wasn't sending progress)
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send("some big string");

// sending form data (was already working)
xhr.setRequestHeader('Content-Type', 'multipart/form-data');
const formData = new FormData(); formData.append('test', 'data');
xhr.send(formData);
```

To test the crash fix:
In the RN Android project, before this change, set a breakpoint at `mRequestBody.writeTo(mBufferedSink);` of `ProgressRequestBody`, and wait a short while for a POST request with a non-null body to time out before resuming the app. Once resumed, if the connection was closed (the `closed` variable will be set to true in `RealBufferedSink`), an `IllegalStateException` will be thrown, which crashes the app. After the changes, an `IOException` will get thrown instead, which is already being properly handled.

As mentioned above, includes the same changes as #16541, with an additional commit.

[ANDROID] [BUGFIX] [XMLHttpRequest] - Added progress updates for all XMLHttpRequest upload types / fix crash on closed connection

Previously, only form-data request bodies emitted upload progress updates. Now, other request body types will also emit updates. Also, Android will no longer crash on certain requests when user has a poor connection.

Addresses issues: 11853/15724/10423/11016
Closes https://github.com/facebook/react-native/pull/17312

Differential Revision: D6712377

Pulled By: mdvacca

fbshipit-source-id: bf5adc774703e7e66f7f16707600116f67201425
2018-02-02 18:16:24 -08:00
Oleg Lokhvitsky ef596dec49 Fix initialScrollIndex for Android
Reviewed By: sahrens

Differential Revision: D6885608

fbshipit-source-id: c153fcb5c2552982481d8af8b9755ae035e9b293
2018-02-02 16:02:12 -08:00
Valentin Shergin ebc98840e9 Improved documentation for <TextInput clearButtonMode=...>
Summary:
Documentation only. Actual behaviour was never changed.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: sahrens

Differential Revision: D6869466

fbshipit-source-id: 6e964433bb2b04b288736a3f01244285bc8c3fe8
2018-02-02 11:50:49 -08:00
Pritesh Nandgaonkar 9f7cedbe14 Remove the use of legacy flag and log the diff if its used
Reviewed By: emilsjolander

Differential Revision: D6856812

fbshipit-source-id: e4724d80702cc75c1894e348e137b24e663573d2
2018-02-02 07:40:25 -08:00
Maël Nison 752427b7b8 Uses findMetroConfig and fetchMetroConfig in the internal RN cli
Reviewed By: davidaurelio

Differential Revision: D6819226

fbshipit-source-id: 6436855cc5dce9ce7922d89df99c3cb90abb095e
2018-02-02 05:05:36 -08:00
Tim Yung d99ba70c49 RN: Add NativeImageSource Flow Type
Reviewed By: TheSavior

Differential Revision: D6869985

fbshipit-source-id: 836134ae0919d49b161d1a75d5743e977e6eb3f4
2018-02-01 23:45:09 -08:00
Valentin Shergin 6c4ef287ad Improved documentation for <TextInput caretHidden=...>
Summary:
Documentation only.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: sahrens

Differential Revision: D6878890

fbshipit-source-id: 23f58246625ab6664bc3dcd4490f24ee50e410c8
2018-02-01 23:20:29 -08:00
Valentin Shergin d7fa81f181 Fixed double `onChange` event triggering from <TextInput> on iOS
Summary:
The problem was recently introduced in the last refactoring of the Text module.
There are two problem actually:
(1) Compare this current code with stable version.
In the stable version the event is only triggered here:
https://github.com/facebook/react-native/blob/0.52-stable/Libraries/Text/RCTTextField.m#L132-L140
In the new version the event is triggered in two places (which is obviously wrong).

(2) Executing `[_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange:...]` and _onChange() actually do the same thing.
Historically, the single-line <TextInput> used the first approach and multi-line used second one. When we unify the logic, mixed both of them, which was apparenly wrong.
So, we have to remove another call of `[_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange:...]`.
The the future we have to completly remove usage of `_eventDispatcher` from this component.

Depends on D6854770.

Reviewed By: fkgozali

Differential Revision: D6869678

fbshipit-source-id: 6705ee8dda2681ae184ef6716238cc8b62efeff1
2018-02-01 14:16:40 -08:00
Nicolas Cuillery 7492860ffb Keep the ignored files during the upgrade process
Summary:
This PR fixes the issue #12237 relative to react-native-git-upgrade.

When the user adds new files to the .gitignore file, those files are deleted during the upgrade process because it starts by creating a fresh .gitignore file without user's modification, so the user's ignored files are no longer ignored and they are deleted during the upgrading process.

The best solution I've found to keep the user's ignored files... ignored, consists in appending the content of the .gitignore file in the `<TEMP DIR>/.git-rn/info/exclude` file.
The user's ignored files are now ignored at the repository level, they no longer interfere with the upgrade process.

Reminder: The tool uses a temporary local Git repository generated on the fly, so we can do whatever we want in it.

- Publish react-native-git-upgrade to sinopia
- `npm install -g react-native-git-upgrade`
- Init a new project with an old version: `react-native init MyApp --version=0.50.0`
- Create a new file named `dummy-ignored-file.json` in the project's root
- Append `dummy-ignored-file.json` to the `.gitignore` file
- Run `react-native-git-upgrade`

👉 The `dummy-ignored-file.json` is not deleted.

[CLI][BUGFIX][react-native-git-upgrade] - Keep the user's ignored files while upgrading
<!--
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
-->
Closes https://github.com/facebook/react-native/pull/17393

Differential Revision: D6839856

Pulled By: hramos

fbshipit-source-id: e4e9d759b59790e3cbc52408cef8314bf0a9c772
2018-02-01 14:16:40 -08:00
Brian Vaughn 13829751b1 React sync for revisions a7b9f98...4eed18d
Reviewed By: gaearon

Differential Revision: D6875052

fbshipit-source-id: 516f46f1b78bd8ca3323ba119d3afda491d76497
2018-02-01 14:06:55 -08:00
Spencer Ahrens e485cde187 use scrollview for lightbox on ios
Reviewed By: wwalser

Differential Revision: D6858376

fbshipit-source-id: a9ff9c71cb4ad56a4f5af73a4e86de52ddf75700
2018-02-01 12:13:07 -08:00
Valentin Shergin 74963eb945 Stub for `caretHidden` prop in RCTUITextView
Summary:
Even if we don't support this prop yet, we have to expose this in RCTUITextView to conform the contract between ViewManager and ShadowView.
Same story as D6842304.
Depends on D6842304.

Reviewed By: fmoo

Differential Revision: D6869750

fbshipit-source-id: 9b35f1a38040319ec66f1ec12f97ac739f8b204f
2018-02-01 11:03:27 -08:00
Héctor Ramos 9227ba73ab Update build-js-bundle run step
Summary:
Always build the JavaScript bundle, to ensure failures here are surfaced regardless of failures that may happen earlier in this workflow
Closes https://github.com/facebook/react-native/pull/17824

Differential Revision: D6872794

Pulled By: hramos

fbshipit-source-id: bab3b9cfa6cecb578e9a3cffae27e1ce355588d2
2018-02-01 10:48:25 -08:00
Kathy Gray 28be33ac34 Remove release from ReadableNativeArray and Map
Reviewed By: mhorowitz

Differential Revision: D6846268

fbshipit-source-id: 2f750a05ee63a744e7f64b3fe67736df3614ef3d
2018-02-01 07:30:07 -08:00
Ray Shih 88980f2ef7 Implement bundle sync status
Reviewed By: pakoito

Differential Revision: D6807480

fbshipit-source-id: d71f2cecd882c47e79bb71dfb9d03d3597fa4068
2018-02-01 06:18:13 -08:00
Mark Wang 9f57dedc17 Use delete instead of free
Reviewed By: richardjrossiii

Differential Revision: D6866064

fbshipit-source-id: a44828cedb5045b6c97179fb30ffd8c8dafcbfbe
2018-01-31 18:01:34 -08:00
Héctor Ramos 365a4d4b43 Run more checks in parallel
Summary: Closes https://github.com/facebook/react-native/pull/17808

Differential Revision: D6866937

Pulled By: hramos

fbshipit-source-id: 34c9aa93a5274b57da81eb5bbece2ce3e5296846
2018-01-31 17:17:52 -08:00