Commit Graph

4095 Commits

Author SHA1 Message Date
Jay Phelps baa61ddc9c Trigger onFocus/onBlur instead of onPressIn/onPressOut (eventually, but for now just deprecate) (#18470)
Summary:
Currently on iOS and Android focus/blur events trigger onPressIn/onPressOut. Based on discussions with people are several companies who use react-native we're proposing instead triggering new events onFocus/onBlur. Initial discussion on Slack with some from the core team on Slack seemed positive.

Couple reasons:

* The current API behavior overloads onPressIn/onPressOut. That means on platforms like react-native-web, if focus/blur support was added (as we're hoping for), even though onPressIn/onPressOut would be useful as the name describes, you wouldn't be able to distinguish between it and browser element focus/blur events.
* The names aren't as self-documenting/intuitive as onFocus/onBlur, especially for react-dom users.

There aren't any current tests around this, but I intend to add them if we solidify the API.

There's also an option question on the transition--do we deprecate the existing API with a warning? This PR just deprecates them, though it will on any TV platform when something becomes focused regardless of whether they use the API or not. This isn't ideal. It's not clear if there are alternatives or if just right away breaking the API for TV users is the correct solution, if we can get consensus between the few parties who are using it.

***

I'm interested to hear counter points or prior discussions.

Cc/ matthargett dlowder-salesforce rozele
Closes https://github.com/facebook/react-native/pull/18470

Differential Revision: D8368109

Pulled By: hramos

fbshipit-source-id: 22587b82e091645e748b6c2d721fdff06d54837f
2018-06-11 15:31:15 -07:00
Eli White a51e8b19cc Don't pass additional args to requireNativeComponent in .android.js files
Reviewed By: sahrens

Differential Revision: D8345921

fbshipit-source-id: 187048ad4c1b361f0b99b993052bdcaf47a266db
2018-06-10 15:38:32 -07:00
Eli White 6b1bb01804 Enable Flow for bezier
Reviewed By: sahrens

Differential Revision: D8346102

fbshipit-source-id: bb1a2eccb5472bf6f3fe113303ad96cf3f386cab
2018-06-10 15:16:15 -07:00
Eli White f50ce0850d Passing forwardedRef to Slider
Reviewed By: sahrens

Differential Revision: D8345883

fbshipit-source-id: d2affdba14d38593541e591fe72006c76fca166f
2018-06-10 14:28:37 -07:00
Eli White 160bf731e5 Switch to Platform.isTV to pass Android Flow
Reviewed By: sahrens

Differential Revision: D8345911

fbshipit-source-id: 9af7a25127e7c35844a6c59b267a77cf8adba535
2018-06-10 13:45:57 -07:00
Felix Yan 5fbb307e24 Fix some typos in dumpReactTree.js (#19636)
Summary:
Simple doc fixes
Closes https://github.com/facebook/react-native/pull/19636

Differential Revision: D8344481

Pulled By: TheSavior

fbshipit-source-id: b6fa064f70793bdaf1d6346b2775373b74c2ae3b
2018-06-09 20:27:42 -07:00
Eli White ad67f556fb Migrate PickerIOS to ES6 Class
Reviewed By: sahrens

Differential Revision: D8343380

fbshipit-source-id: 9432f0810c67034f20b44ba9f4955d4ffd2ef1d2
2018-06-09 18:16:22 -07:00
Héctor Ramos e79b945f75 Add MIT License Header
Summary: When a third party library is vendored, both the original copyright header as well as React Native's header are required.

Reviewed By: fkgozali

Differential Revision: D8284116

fbshipit-source-id: 1748eb011c843a87e9ed421597571b66334edfd2
2018-06-09 18:16:21 -07:00
Oleksandr Sokolov 078d6e3a9d QuickPerformanceLogger.js: markerPoint + iOS/Android JS binding
Reviewed By: alexeylang

Differential Revision: D8125546

fbshipit-source-id: bb02921c7d89faba64001bff3b9aaf13f64a7f8b
2018-06-08 08:32:05 -07:00
Keith Brown 02d1bcc047 Modified deepFreezeAndThrowOnMutationInDev to use Object.prototype.ha… (#19598)
Summary:
This PR fixes a bug in `deepFreezeAndThrowOnMutationInDev` which did not take into account that objects passed to it may have been created with `Object.create(null)` and thus may not have a prototype. Such objects don't have the methods `hasOwnProperty`, `__defineGetter__`, or `__defineSetter__` on the instance.

I ran into an unrecoverable error in React Native when passing this type of object across the bridge because `deepFreezeAndThrowOnMutationInDev` attempts to call `object.hasOwnProperty(key)`, `object.__defineGetter__` and `object__defineSetter__` on objects passed to it. But my object instance does not have these prototype methods.

Changes:
* Defined `Object.prototype.hasOwnProperty` as a `const` (pattern used elsewhere in React Native)
* Modified calls to `object.hasOwnProperty(key)` to use `hasOwnProperty.call(object, key)` (Per ESLint rule [here](https://eslint.org/docs/rules/no-prototype-builtins))
* Modified calls to deprecated methods `object.__defineGetter__` and `object.__defineSetter__` to instead use `Object.defineProperty` to define get and set methods on the object. (Per guidance on [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__))
* Added a new test to `deepFreezeAndThrowOnMutationInDev-test` to verify the fix.

I tried to create a reproducible example to post to Snack by passing prototype-less objects to a `Text` component, in various ways, but they appear to be converted to plain objects before crossing the bridge and therefore they do not throw an error.

However, I was able to create a new test to reproduce the issue. I added the following test to `deepFreezeAndThrowOnMutationInDev-test`:

```JavaScript
it('should not throw on object without prototype', () => {
    __DEV__ = true;
    var o = Object.create(null);
    o.key = 'Value';
    expect(() => deepFreezeAndThrowOnMutationInDev(o)).not.toThrow();
  });
```

The changes in this PR include this new test.

ESLint test produced no change in Error count (3) or Warnings (671)

N/A
Other areas with _possibly_ the same issue:
c6b96c0df7/Libraries/vendor/core/mergeInto.js (L50)
8dc3ba0444/Libraries/ReactNative/requireNativeComponent.js (L134)

 [GENERAL] [BUGFIX] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev] -Fix for compatibility with objects without a prototype.
Closes https://github.com/facebook/react-native/pull/19598

Differential Revision: D8310845

Pulled By: TheSavior

fbshipit-source-id: 020c414a1062a637e97f9ee99bf8e5ba2d1fcf4f
2018-06-07 02:44:27 -07:00
Michał Osadnik cb1bdf1e37 Change error message on interpolation (#19571)
Summary:
Change message in Animated.Interpolation to "inputRange must be monotonically non-decreasing" as it's allowed to give the same x's like in the test [example](4435f08771/Libraries/Animated/src/__tests__/Interpolation-test.js (L71))

Simply giving improper value of interpolation input

[GENERAL] [MINOR] [AnimatedInterpolation.js] - Change error message on interpolation improper range error
Closes https://github.com/facebook/react-native/pull/19571

Differential Revision: D8310791

Pulled By: TheSavior

fbshipit-source-id: 803ef55104ad2a36231c5f18c0c089bd14822bf3
2018-06-06 22:17:47 -07:00
Peter van der Zee 29fb2a8e90 Bump Prettier to 1.13.4 on xplat
Summary:
Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.

Reviewed By: ryanmce

Differential Revision: D8251255

fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:32:06 -07:00
Eli Perkins a8b74576da Use correct library reference for libfishhook.a in RCTWebSocket (#19579)
Summary:
This uses the reference for `libfishhook.a` from the Products, rather than
the reference from the Frameworks group.

This fixes the build for the new Xcode build system, on both Xcode 9 and
Xcode 10.

Fixes #19569

- Using Xcode 10:
	- Open `RNTester/RNTester.xcodeproj`
	- Build RNTester, noting build errors
- Using Xcode 9:
	- Open `RNTester/RNTester.xcodeproj`
	- Switch to using new build system in `File > Project Settings > Build System`, selecting `New Build System (Preview)`
	- Build RNTester, noting build errors

none

[IOS] [BUGFIX] [RCTWebSocket] - Fix build for new Xcode build system
Closes https://github.com/facebook/react-native/pull/19579

Differential Revision: D8287487

Pulled By: hramos

fbshipit-source-id: 5bfc9decb09ebc763824df8474b5897099d39ad7
2018-06-05 14:47:36 -07:00
Sokovikov de18dd2648 skip dismiss all if all rows are hidden (#19564)
Summary:
Small fix based on
https://github.com/facebook/react-native/pull/19501#issuecomment-394486884

No need to mention it

[GENERAL] [BUGFIX] [YellowBox] - Message
Closes https://github.com/facebook/react-native/pull/19564

Differential Revision: D8276808

Pulled By: hramos

fbshipit-source-id: 59832d3d6e60ae30afbeb7c9303405746e9eec45
2018-06-05 06:29:19 -07:00
Logan Daniels 4435f08771 Trigger nested VirtualizedLists to re-measure if their containing cell's onLayout fires
Reviewed By: sahrens

Differential Revision: D8272040

fbshipit-source-id: c490ffa875bfd0547ac54d214c5ebbeb23c99942
2018-06-04 21:18:01 -07:00
Eli White 970caa4552 Switch to ES6 Class
Reviewed By: yungsters

Differential Revision: D8246980

fbshipit-source-id: fbd6998429e6791000ea093d3fa15c1a486914bd
2018-06-02 22:43:21 -07:00
Eli White 5259450c14 Slider to ES6 Class
Reviewed By: yungsters

Differential Revision: D8246422

fbshipit-source-id: 1955ae87abe077115ac8f8ea105be85db8ea66b4
2018-06-02 22:43:19 -07:00
Eli White 615daeb68f Slider move prop comments to flow types
Reviewed By: yungsters

Differential Revision: D8246378

fbshipit-source-id: f62a77d64016f6502b3445ab6d0d1558034333e6
2018-06-02 22:43:18 -07:00
Eli White 1615f9d161 Slider remove $FlowFixMe #take2
Reviewed By: fkgozali

Differential Revision: D8246336

fbshipit-source-id: 21555a318bd823309ac2c285b49c2045338c2b28
2018-06-01 22:07:46 -07:00
Eli White 7498e5ce77 Revert D8234803: [RN] Slider remove $FlowFixMe
Differential Revision:
D8234803

Original commit changeset: cfc0466a54f3

fbshipit-source-id: 354fcc1853597cbcd518abaf4be5b11116f594b3
2018-06-01 20:17:58 -07:00
Peter Ammon ac9a3d0c99 normalizeColor to compute regexps lazily
Reviewed By: johnislarry

Differential Revision: D8241955

fbshipit-source-id: 0939f442bb1e51118207449e0b95c6da97b899da
2018-06-01 17:54:50 -07:00
Eli White e0db8ee645 Slider remove $FlowFixMe
Reviewed By: sahrens

Differential Revision: D8234803

fbshipit-source-id: cfc0466a54f3c219d8a2eadfebf840399a2abdd8
2018-06-01 17:54:50 -07:00
Sokovikov d29821278e better place for dismiss all button
Summary:
This pr makes a little bit simpler to dismiss all warnings (1 click instead of 2)
Sometimes you don't want to use `YellowBox.ignoreWarnings` to remember.

RNTester sceenshot:

<img width="322" alt="screen shot 2018-05-30 at 09 51 25" src="https://user-images.githubusercontent.com/1488195/40701475-1142506a-63ef-11e8-8fc9-ea1696d9cb65.png">
Or RNTester -> Native Animation Example -> Force JS Stalls (in the end of the list) also cause warning to test.

[GENERAL][ENHANCEMENT][YellowBox] - Move `Dismiss All` yellow box button to another place which makes a little bit simpler to dismiss warnings.
Closes https://github.com/facebook/react-native/pull/19501

Differential Revision: D8243823

Pulled By: hramos

fbshipit-source-id: 31887469cddb4adfd7b889ae0c29a3bf41e87b7b
2018-06-01 17:54:50 -07:00
Tim Yung 8dc3ba0444 RN: Remove Native Prop Validation
Summary:
As we migrate over to static typing solutions for props, we cannot rely on always having `propTypes` available at runtime.

This gets us started on that journey by removing the native prop validation that happens when we require native components.

bypass-lint

Reviewed By: TheSavior

Differential Revision: D7976854

fbshipit-source-id: f3ab579a7f0f8cfb716b0eb7fd4625f8168f3d96
2018-06-01 12:54:14 -07:00
Eli White f8c8231706 DatePickerIOS ES6 Class
Reviewed By: sahrens

Differential Revision: D8219657

fbshipit-source-id: cef48cf3ad24ad442f07df0edad55ab97d96c6f2
2018-06-01 10:25:30 -07:00
Eli White 3b53091869 DatePickerIOS add onChange event definition
Reviewed By: sahrens

Differential Revision: D8219622

fbshipit-source-id: 37f26d0981318b7eab9d3c734c44e7714fa6f0e8
2018-06-01 10:25:30 -07:00
Eli White edd7acbb1e ActivityIndicator ES6 Class
Reviewed By: yungsters

Differential Revision: D8219463

fbshipit-source-id: 7d252d15bb4a7345d156b1659b09be2a4a69ba6c
2018-06-01 10:25:30 -07:00
Eli White a35a238317 RefreshControl ES6 Class
Reviewed By: sahrens

Differential Revision: D8219221

fbshipit-source-id: 445243964d64dd5274c1e47bdc137645dc8eecaf
2018-06-01 10:25:30 -07:00
Eli White 2314c83258 Clamp typechecks -> Flow
Reviewed By: yungsters

Differential Revision: D8219220

fbshipit-source-id: e849d9dae573459e4b09e317cc6dc37bec9ce4e8
2018-06-01 10:25:30 -07:00
Alexey Lang ce7dd53dab Use timestamps from QPL by default
Differential Revision: D8207166

fbshipit-source-id: 1e43d6874ee400cb2e26a11cbcfb12ee32d28d3c
2018-05-31 02:39:21 -07:00
Ziqi Chen 5863b564f8 deleted UI Action Sheet Delegate Methods
Reviewed By: PeteTheHeat

Differential Revision: D8191111

fbshipit-source-id: 39867683cf5e0cdf8a94a76269d939b5ecf6bbd4
2018-05-30 10:40:39 -07:00
Héctor Ramos 95554add98 Update Jest snapshots
Summary:
Jest will now exclude undefined props from snapshots (https://github.com/facebook/jest/pull/6162). Updating the snapshots should fix the current `test_javascript` failures.

Circle CI

[INTERNAL][MINOR][Snapshots] - Update snapshots
Closes https://github.com/facebook/react-native/pull/19414

Differential Revision: D8125193

Pulled By: hramos

fbshipit-source-id: db8dcfcd8afbf9d6256f83c6e922680a7872d776
2018-05-29 17:30:16 -07:00
Janic Duplessis 122b3791ed Vendor fetch polyfill, remove default blob response type
Summary:
While investigating an issue about blobs (https://github.com/facebook/react-native/issues/18223), I noticed that the fetch polyfill (https://github.com/github/fetch) uses blobs as the response type by default if the module is available (https://github.com/github/fetch/blob/master/fetch.js#L454). This surfaced some issue with the blob implementation on iOS that has since been fixed.

However after further review of the fetch polyfill and the way Blobs work in RN, I noticed a major issue that causes blobs created by fetch to leak memory. This is because RN blobs are not deallocated automatically like in the browser (see comment https://github.com/facebook/react-native/blob/master/Libraries/Blob/Blob.js#L108) and the fetch polyfill does not deallocate them explicitly using the close method.

Ideally we should implement automatic blob cleanup when the instance is garbage collected but implementing that is probably somewhat complex as it requires integrating with JSC. For now I suggest disabling the default handling of requests as blobs in the fetch polyfill. This will mitigate the issue for people not using Blobs directly. I'm not sure how well documented the Blob module is but we should make it clear that they currently require explicit deallocation with the close method for people using them directly.

Run a simple http request using fetch and make sure it does not use the Blob module anymore.

[GENERAL] [BUGFIX] [fetch] - Do not use blobs to handle responses in the fetch polyfill, fixes potential memory leak.
Closes https://github.com/facebook/react-native/pull/19333

Differential Revision: D8125463

Pulled By: hramos

fbshipit-source-id: 8f4602190dfc2643606606886c698e8e9b1d91d1
2018-05-29 13:58:56 -07:00
Chirag Shah 84c965f085 Typo fixes
Summary:
Spotted a few typos while going through the source code

No tests are required

[INTERNAL] [MINOR] [Webview] - Fixed typos
Closes https://github.com/facebook/react-native/pull/19462

Differential Revision: D8176774

Pulled By: hramos

fbshipit-source-id: f1a9024b210e1a935dcdccd7e27daedb71d794bc
2018-05-26 21:01:37 -07:00
Spencer Ahrens a90d0e3614 fixup FlatList
Summary:
StrictMode compliance is important for Async Rendering and other Future Tech(tm).

Also clean up some lint.

== Test Plan ==
* No more StrictMode warnings for `FlatList` (`VirtualizedList` is another story....).
* props warnings still show up when appropriate.

Reviewed By: sophiebits

Differential Revision: D8026333

fbshipit-source-id: e6fa2f02d546b883df6f3cff8776c26c6ef91bc9
2018-05-25 15:10:41 -07:00
Spencer Ahrens 26a1eba1ce VirtualizedSectionList
Reviewed By: yungsters

Differential Revision: D8021463

fbshipit-source-id: 8b65585776cf41e194418d127bca85dbe47ea659
2018-05-25 15:10:41 -07:00
Spencer Ahrens 488a4c7e1c Fix VirtualizedSectionList:ItemWithSeparators
Reviewed By: yungsters

Differential Revision: D8021407

fbshipit-source-id: 480547d867eda476fe6ddf4af74072ad1851a427
2018-05-25 15:10:41 -07:00
Miguel Jimenez Esun 390ded871c Move out "genMockFunction" and "genMockFn" to "fn"
Summary: In the upcoming Jest version `genMockFunction` and `genMockFn` are deprecated, so we need to kill them.

Reviewed By: rafeca

Differential Revision: D8107155

fbshipit-source-id: 4f46ab58e6e34224eb95e9355385da44f005ea94
2018-05-23 13:40:06 -07:00
Peter van der Zee 7014a30baa Upgrade babel to beta.47 across xplat
Summary:
Upgrade Babel from beta.40 to beta.47

There are two important breaking changes here.

- If you want an AST from the Babel `transform` functions you must pass on `ast:true` in the options.
- The `sourceType` is now the only source of truth on whether to parse with the Script or Module goal. It defaults to `script` and can also be `module` or `unambiguous`. In the `unambiguous` case it will first try to parse with the Module goal and only if it crashes it will try again with the Script goal.

Beyond that there were some fixes and some smaller changes that may affect you. See the Babel changelogs for details (https://github.com/babel/babel/tags).

Also updated the way we generate the babel helpers file.

Reviewed By: rubennorte

Differential Revision: D8075280

fbshipit-source-id: 2bb902690e8a4b19d9cada2b7b0c94812b3d4f0f
2018-05-23 06:16:01 -07:00
Kevin Gozali 0ed8461f6d iOS: disable deprecation warning for Xcode 9.3.1+ for now
Summary:
This is to unbreak builds due to deprecated methods.
Cocoapods build seems unaffected.

Reviewed By: mmmulani

Differential Revision: D8060139

fbshipit-source-id: a4302d649dd75d29d293aeffdcc352bf09b0c504
2018-05-22 01:16:45 -07:00
Kevin Gozali f50df4f5ec iOS OSS: deployment target 8.0 => 9.0
Summary: Moving target deployment to iOS 9.0+ from now on, removing customization for iOS 8.

Reviewed By: shergin

Differential Revision: D8053439

fbshipit-source-id: 292c58f15c6e6caf8b28d15c1521812d6ed675c5
2018-05-22 01:16:45 -07:00
Tim Yung e2ce22b823 RN: Fix Reponder Logic in Text
Summary:
Fixes a bug I accidentally introduced in the responder logic for `Text`.

I forgot that I was using arrow functions to preserve `context` while still relying on the creation of `arguments`. Oops.

Differential Revision: D8077595

fbshipit-source-id: 1f7dc11ea90ca4d6bb2129823ba09c79fb5a32b0
2018-05-21 12:21:56 -07:00
Nurzhan Bakibayev 10814e2e61 Remove __fbUninstallRNGlobalErrorHandler
Reviewed By: pakoito

Differential Revision: D7831179

fbshipit-source-id: 6db9fe617d5a1a23a4aa46c9c3028db13a7a52a0
2018-05-21 11:12:46 -07:00
Spencer Ahrens 7d741d1119 Prettier
Reviewed By: bestander

Differential Revision: D8067792

fbshipit-source-id: 6ea8f46c3dce80afc3689ba55f348aa645af391e
2018-05-19 09:44:29 -07:00
Sebastian Markbage f59e5a8d28 React sync for revisions de84d5c...c0fe8d6
Reviewed By: acdlite

Differential Revision: D8066469

fbshipit-source-id: e228df105c3d9a887793595073ebfe8a1a1d4f3d
2018-05-18 20:22:45 -07:00
Peter van der Zee fbd1beaf66 Add automated script to update the babelHelpers file
Reviewed By: cpojer

Differential Revision: D8025371

fbshipit-source-id: 4811f16d882196bc32be7471b6a3ab4d834651c2
2018-05-18 06:09:26 -07:00
Jose Pereira b805172034 Clear _handlers on RCTNetworking invalidation
Summary:
This PR fixes a bug where in `RCTNetworking` not all tasks/handlers were not being cleared when invalidating the class.

I came across this issue when writing some unit tests for my native plugins, sometimes a test would finish running (and the bridge invalidated), and only afterwards a callback from RCTNetworking would come, resulting in this exception:

```
2018-05-07 15:23:34.264494-0700 Guardian[73794:10710945] *** Assertion failure in -[RCTEventEmitter sendEventWithName:body:](), /Users/.../app/node_modules/react-native/React/Modules/RCTEventEmitter.m:41
2018-05-07 15:23:34.276505-0700 Guardian[73794:10710945] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error when sending event: didCompleteNetworkResponse with body: (
    2,
    cancelled,
    0
). Bridge is not set. This is probably because you've explicitly synthesized the bridge in RCTNetworking, even though it's inherited from RCTEventEmitter.'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010d5b21e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x000000010be6f031 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010d5b7472 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x000000010b94864f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
	4   Guardian                            0x0000000106ff5227 -[RCTEventEmitter sendEventWithName:body:] + 567
	5   Guardian                            0x0000000106e9ebab __76-[RCTNetworking sendRequest:responseType:incrementalUpdates:responseSender:]_block_invoke.423 + 1115
	6   Guardian                            0x0000000106e8f48c __50-[RCTNetworkTask URLRequest:didCompleteWithError:]_block_invoke + 92
	7   Guardian                            0x0000000106e8ded1 -[RCTNetworkTask dispatchCallback:] + 113
	8   Guardian                            0x0000000106e8f37a -[RCTNetworkTask URLRequest:didCompleteWithError:] + 410
	9   Guardian                            0x0000000106ea1aa3 -[RCTHTTPRequestHandler URLSession:task:didCompleteWithError:] + 403
	10  CFNetwork                           0x000000010cf3a437 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 80
	11  Foundation                          0x000000010b885363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
	12  Foundation                          0x000000010b8851ca -[NSBlockOperation main] + 68
	13  Foundation                          0x000000010b8836b2 -[__NSOperationInternal _start:] + 766
	14  libdispatch.dylib                   0x0000000112457779 _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x000000011245c931 _dispatch_block_invoke_direct + 317
	16  libdispatch.dylib                   0x0000000112457779 _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x000000011245c931 _dispatch_block_invoke_direct + 317
	18  libdispatch.dylib                   0x000000011245c7d4 dispatch_block_perform + 109
	19  Foundation                          0x000000010b87f75b __NSOQSchedule_f + 337
	20  libdispatch.dylib                   0x0000000112457779 _dispatch_client_callout + 8
	21  libdispatch.dylib                   0x000000011245f1b2 _dispatch_queue_serial_drain + 735
	22  libdispatch.dylib                   0x000000011245f9af _dispatch_queue_invoke + 321
	23  libdispatch.dylib                   0x0000000112461cf8 _dispatch_root_queue_drain + 473
	24  libdispatch.dylib                   0x0000000112461ac1 _dispatch_worker_thread3 + 119
	25  libsystem_pthread.dylib             0x000000011297a169 _pthread_wqthread + 1387
	26  libsystem_pthread.dylib             0x0000000112979be9 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
```

Bug can be reproduced by making a `XMLHttpRequest` (uses `RCTNetworking` internally) that takes a couple seconds to perform, and issuing a RCTBridge reload command in the meantime.

You can add the following code to the react-native template project,

```
  componentDidMount() {
    var oReq = new XMLHttpRequest();
    oReq.addEventListener("load", () => console.log('Finished'));
    oReq.open("GET", "https://www.dropbox.com/s/o01hz0chqvjafhv/file.bin?dl=1");
    oReq.send();
    console.log('Request is being performed...')
  }
```
In my case I download a 1MB file.
Run the project and reload the a couple times. Bug is triggered.

 [INTERNAL] [BUGFIX] [RCTNetworking] - Clear handlers and tasks on RCTNetworking invalidation
Closes https://github.com/facebook/react-native/pull/19169

Differential Revision: D8053070

Pulled By: hramos

fbshipit-source-id: d8af54fecd99173905363f962ffc638ef8b85082
2018-05-17 19:10:48 -07:00
Janic Duplessis ce3b7b8204 Bring back TextInput.State, deprecate focusTextInput and blurTextInput
Summary:
a275eac56e removed TextInput.State but we should keep it as it was a public-ish API and we don't have any migration plan off it. Also bring back `focusTextInput` and `blurTextInput` with a deprecation warning.

Tested TextInput.State is back

[GENERAL][ENHANCEMENT][TextInput] - Bring back TextInput.State, deprecate focusTextInput and blurTextInput
Closes https://github.com/facebook/react-native/pull/18936

Differential Revision: D8044439

Pulled By: hramos

fbshipit-source-id: fde145f04bb1d46ef58b5954cb7963adf495b21c
2018-05-17 11:26:22 -07:00
Kevin Gozali 128c9343c4 iOS: fix up RNTesterPods
Summary:
A few fixes:
* missing include: folly/Optional.h
* switch folly::Optional's `has_value()` to `hasValue()` for now until folly is upgraded to newer version
* fix up import for RCTTextAttributes.h
* fix up includes for "conversions.h" to use namespaced includes

Reviewed By: mmmulani

Differential Revision: D8021149

fbshipit-source-id: d3955986d3ab6b1d9b61ac1e385767893ce57e5e
2018-05-16 14:14:41 -07:00
Tim Yung 2f4ca831bf React sync for revisions bde4b16...de84d5c
Reviewed By: bvaughn

Differential Revision: D8018924

fbshipit-source-id: 1092ad70ebe95aee70ec3ea9a8edfb6ac46a66c4
2018-05-15 16:48:49 -07:00