Commit Graph
217 Commits
Author SHA1 Message Date
Dan AbramovandGitHub f49e5bfacb Fix Flow type for React Native (#17992) 2020-02-06 18:31:13 +00:00
Nicolas GallagherandGitHub 77f7835a5f Update to [email protected] (#17842) 2020-01-22 10:02:30 -08:00
EmilyandBrian Vaughn a2677e9133 Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164) 2020-01-10 10:21:32 -08:00
Dan AbramovandGitHub fe1bbbae20 Update Flow to 0.84 (#17805)
* Update Flow to 0.84

* Fix violations

* Use inexact object syntax in files from fbsource

* Fix warning extraction to use a modern parser

* Codemod inexact objects to new syntax

* Tighten types that can be exact

* Revert unintentional formatting changes from codemod
2020-01-09 14:50:44 +00:00
Dan AbramovandGitHub 6e9c0d3038 Bump Prettier (#17811)
* Bump Prettier

* Reformat

* Use non-deprecated option
2020-01-09 13:54:11 +00:00
Eli WhiteandGitHub 17844ca3b8 Revert "Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232)" (#17799)
* Revert "Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232)"

This reverts commit c443904b55.

* Clean up another __DEV__ warning check
2020-01-07 16:47:19 -08:00
Eli WhiteandDan Abramov f7fe9fc238 Make HostComponent inexact (#17412) 2019-12-18 18:21:42 +00:00
Dominic GannawayandGitHub c711197b36 [react-interactions] Rename Flare APIs to deprecated and remove from RN (#17644) 2019-12-18 10:24:46 +00:00
Dan AbramovandGitHub 0809ba8020 Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605)
* Rename toWarnDev -> toErrorDev in tests

* Rename toWarnDev matcher implementation to toErrorDev

* Rename toLowPriorityWarnDev -> toWarnDev in tests and implementation
2019-12-16 12:48:16 +00:00
Dan AbramovandGitHub d90d691d4a Use console directly instead of warning() modules (#17599)
* Replace all warning/lowPriWarning with console calls

* Replace console.warn/error with a custom wrapper at build time

* Fail the build for console.error/warn() where we can't read the stack
2019-12-14 18:09:25 +00:00
Dan AbramovandGitHub 9463b12510 Add component stacks to (almost) all warnings (#17586) 2019-12-12 23:47:55 +00:00
Dominic GannawayandGitHub 78238afe96 [react-interactions] Remove responder root event types + revert commit phase change (#17577) 2019-12-11 16:48:46 +00:00
Laura bunsandDan Abramov 96b5edde35 Remove the condition argument from warning() (#17568)
* prep for codemod

* prep warnings

* rename lint rules

* codemod for ifs

* shim www functions

* Handle more cases in the transform

* Thanks De Morgan

* Run the codemod

* Delete the transform

* Fix up confusing conditions manually

* Fix up www shims to match expected API

* Also check for low-pri warning in the lint rule
2019-12-11 03:28:14 +00:00
Laura bunsandDan Abramov 0cee996ff7 Replace wrap-warning-with-env-check with an eslint plugin (#17540)
* Replace Babel plugin with an ESLint plugin

* Fix ESLint rule violations

* Move shared conditions higher

* Test formatting nits

* Tweak ESLint rule

* Bugfix: inside else branch, 'if' tests are not satisfactory

* Use a stricter check for exactly if (__DEV__)

This makes it easier to see what's going on and matches dominant style in the codebase.

* Fix remaining files after stricter check
2019-12-06 18:25:54 +00:00
Dominic GannawayandGitHub bba3bf6191 [react-interactions] Refine custom active element blur logic (#17354) 2019-11-13 20:46:00 +00:00
Eli WhiteandGitHub 25765919c4 [Native] If statement cleanup for null targets (#17346) 2019-11-11 12:58:30 -08:00
Eli WhiteandGitHub 4fa3f1fc48 [Native] Add FeatureFlag to dispatch events with instance currentTarget (#17345)
* [Native] Add FeatureFlag to dispatch events with instance targets

* Prettier

* [Native] Change currentTarget to be an instance behind a flag 2/2
2019-11-11 12:42:06 -08:00
Eli WhiteandGitHub b89260af5a [Native] Add FeatureFlag to dispatch events with instance targets (#17323)
* [Native] Add FeatureFlag to dispatch events with instance targets

* Prettier
2019-11-11 11:35:29 -08:00
Eli WhiteandGitHub 2c8430f1fd Change legacy-events plugin nativeEventTarget to allow null (#17344) 2019-11-11 11:22:41 -08:00
Moti ZilbermanandDan Abramov a7778dcb38 [RN] Hoist static deepDiffer options object (#17303) 2019-11-07 16:03:55 +00:00
Moti ZilbermanandGitHub 53c7208c33 Update deepDiffer usage in React Native renderer (#17282)
* Add RN prop diffing test with function values

* Update RN deepDiffer mock

* Explicitly ignore functions in RN prop differ
2019-11-07 04:00:20 -08:00
Eli WhiteandGitHub c72d0433bf Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>> (#17265)
* Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>>

* Prettier
2019-11-04 10:14:01 -08:00
Eli WhiteandGitHub c443904b55 Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232)
This reverts commit a90e32d1c2.
2019-10-30 18:03:37 -07:00
Eli WhiteandTimothy Yung f7f390580f Rename findHostInstance_deprecated to findHostInstance_DEPRECATED (#17228) 2019-10-30 13:10:16 -07:00
Eli WhiteandGitHub edc84bcbb0 Add findHostInstance_deprecated to the React Native Renderer (#17224) 2019-10-30 11:42:37 -07:00
Eli WhiteandGitHub a90e32d1c2 Dispatch commands to both UIManagers from both renderers (#17211)
* Dispatch commands to both UIManagers from both renderers

* Merge test files
2019-10-29 18:16:23 -07:00
Andrew ClarkandGitHub 1d8fcd7e8e Pass prod error messages directly to constructor (#17063)
* Remove "Invariant Violation" from dev errors

When I made the change to compile `invariant` to throw expressions, I
left a small runtime to set the error's `name` property to "Invariant
Violation" to maintain the existing behavior.

I think we can remove it. The argument for keeping it is to preserve
continuity in error logs, but this only affects development errors,
anyway: production error messages are replaced with error codes.

* Pass prod error messages directly to constructor

Updates the `invariant` transform to pass an error message string
directly to the Error constructor, instead of mutating the
message property.

Turns this code:

```js
invariant(condition, 'A %s message that contains %s', adj, noun);
```

into this:

```js
if (!condition) {
  throw Error(
    __DEV__
      ? `A ${adj} message that contains ${noun}`
      : formatProdErrorMessage(ERR_CODE, adj, noun)
  );
}
```
2019-10-11 09:10:40 -07:00
Eli WhiteandGitHub 82c9b97f6d Stop warning about setNativeProps being deprecated (#17045)
* Stop warning about setNativeProps being deprecated

* Remove ReactNative.setNativeProps

* Remove more Fabric tests
2019-10-08 11:21:20 -07:00
Dominic GannawayandGitHub 177752a7b3 [react-interactions] Adds more experimental Scope API methods (#17042) 2019-10-08 19:32:53 +02:00
Dominic GannawayandGitHub 95abd39733 [react-interactions] Remove context.setTimeout & context.clearTimeout (#17000) 2019-10-03 13:37:37 +02:00
Eli WhiteandGitHub 5771116472 Remove unused canonical check in fiber host component (#16914) 2019-10-02 11:07:20 -07:00
Nicolas GallagherandGitHub 47595258f0 Move eventSystemFlags to last argument in event plugin extractors (#16978)
Fix for necolas/react-native-web#1443
2019-10-02 10:31:15 -07:00
Sebastian MarkbågeandGitHub 3441db83f9 Remove enableUserBlockingEvents flag (#16882)
Seems like this worked out. We can clean up the flag now.
2019-09-27 19:46:56 -07:00
Eli WhiteandGitHub aa1db09ab5 Add HostComponent type to ReactNative (#16898)
* Add HostComponent type to ReactNative

* Use type alias imports instead of wildcard

* Fix forgotten Object in measureLayout type
2019-09-26 14:42:18 -07:00
Joshua GrossandEli White 5780faf4e5 [React Native] Improve errors for invalid ViewConfig getter functions (#16879)
* [React Native] Improve logging for missing view configs and invalid view config getter functions

* [React Native] Improve logging for missing view configs and invalid view config getter functions
2019-09-24 17:46:21 -07:00
Sebastian MarkbågeandGitHub d4c38a664d Event Replaying (#16725)
* Add Event Replaying Infra

* Wire up Roots and Suspense boundaries, to retry events, after they commit

* Replay discrete events in order in a separate scheduler callback

* Add continuous events

These events only replay their last target if the target is not yet
hydrated. That way we don't have to wait for a previously hovered
boundary before invoking the current target.

* Enable tests from before

These tests were written with replaying in mind and now we can properly
enable them.

* Unify replaying and dispatching

* Mark system flags as a replay and pass to legacy events

That way we can check if this is a replay and therefore needs a special
case. One such special case is "mouseover" where we check the
relatedTarget.

* Eagerly listen to all replayable events

To minimize breakages in a minor, I only do this for the new root APIs
since replaying only matters there anyway. Only if hydrating.

For Flare, I have to attach all active listeners since the current
system has one DOM listener for each. In a follow up I plan on optimizing
that by only attaching one if there's at least one active listener
which would allow us to start with only passive and then upgrade.

* Desperate attempt to save bytese

* Add test for mouseover replaying

We need to check if the "relatedTarget" is mounted due to how the old
event system dispatches from the "out" event.

* Fix for nested boundaries and suspense in root container

This is a follow up to #16673 which didn't have a test because it wasn't
observable yet. This shows that it had a bug.

* Rename RESPONDER_EVENT_SYSTEM to PLUGIN_EVENT_SYSTEM
2019-09-23 11:21:10 -07:00
RickyandGitHub d380e4b04a [React Native] Fix for view config registrations (#16821) 2019-09-18 15:31:00 +01:00
Dominic GannawayandGitHub 74ebc4f764 [react-events] Refactor getCurrentTarget to getResponderNode (#16660) 2019-09-04 20:04:35 +01:00
Dominic GannawayandGitHub 23c2df171a [react-events] Various core tweaks for event responder system (#16654) 2019-09-04 18:05:56 +01:00
Dominic GannawayandGitHub 9a14ccfa31 [react-events] Ensure updateEventListeners updates in commit phase (#16540) 2019-08-22 23:58:16 +01:00
Sebastian MarkbågeandGitHub 1cf7ffb812 Add "hydrationOptions" behind the enableSuspenseCallback flag (#16434)
This gets invoked when a boundary is either hydrated or if it is deleted
because it updated or got deleted before it mounted.
2019-08-19 13:26:39 -07:00
Dominic GannawayandGitHub 80ee845658 [Flare] Rework the responder dispatching/batching mechanism (#16334) 2019-08-19 19:22:46 +01:00
Brian VaughnandGitHub 0789574858 Rename legacy "events" package to "legacy-events" (#16388)
* Renamed 'events' package to 'legacy-events'
* Updated 'events' references to point to 'legacy-events'
2019-08-14 07:32:42 -07:00
Dan AbramovandGitHub 26eef8ffb8 Make component stack last argument for deprecation warnings (#16384) 2019-08-13 23:25:03 +01:00
Dominic GannawayandGitHub 520fc34334 [Flare] Tweaks to Flare system design and API (#16264) 2019-08-01 19:08:54 +01:00
Dominic GannawayandGitHub e86e6fc1b9 [Flare] Remove references to EventComponent (#16206) 2019-07-25 16:41:26 +01:00
Dominic GannawayandGitHub 44acf39c90 [Flare] Redesign core event system (#16163) 2019-07-23 23:46:44 +01:00
Dominic GannawayandGitHub 08ad2873c4 Adds experimental fundamental interface (#16049) 2019-07-19 22:20:28 +01:00
Moti ZilbermanandChristoph Nakazawa 0705df87a8 Move ReactFiberErrorDialog RN fork into RN itself (#16141) 2019-07-16 09:38:14 +01:00
Sebastian MarkbågeandGitHub 0d5d48af0c Use Map instead of object as map in ReactNativeComponentTree (#16107)
Real Maps should now be used in RN JS engines. In theory this should
be faster (but might not actually be in practice), and it avoids hitting
upper bounds of property max counts.

We don't use these types of Maps in Fabric.
2019-07-10 19:11:36 -07:00