Commit Graph
96 Commits
Author SHA1 Message Date
Brian VaughnandGitHub 60228a0f7e Remove unstable scheduler/tracing API (#20037) 2021-04-26 19:16:18 -04:00
Andrew ClarkandGitHub 6120d9ad06 Remove unstable_changedBits (#20953)
We added this unstable feature a few years ago, as a way to opt out of
context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like
context selectors.

Since it was prefixed with `unstable_`, we should be able to remove it
without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization
only, so if they are using the API properly, it should not have any
semantic impact.
2021-03-19 15:36:51 -07:00
Dan AbramovandGitHub 18be5581fd Use Lanes instead of priority event constants (#20762) 2021-02-08 22:30:23 +00:00
Dan AbramovandGitHub d111c3bdb3 Align event group constant naming with lane naming (#20744)
* Rename ContinuousEvent to DefaultEvent

* Rename UserBlockingEvent to ContinuousEvent
2021-02-08 17:48:31 +00:00
Dan AbramovandGitHub 84054f55ca Remove the Fundamental internals (#20745) 2021-02-05 20:36:55 +00:00
Brian VaughnandGitHub 4d64630903 Improve React error message when mutable sources are mutated during render (#20665)
Changed previous error message from:
> Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.

To:
> Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue.

Also added a DEV only warning about the unsafe side effect:
> A mutable source was mutated while the %s component was rendering. This is not supported. Move any mutations into event handlers or effects.

I think this is the best we can do without adding production overhead that we'd probably prefer to avoid.
2021-01-29 10:22:55 -05:00
Dominic GannawayandGitHub cd2ab43b72 Remove the deprecated React Flare event system (#19520) 2020-08-05 15:13:29 +01:00
Dominic GannawayandGitHub 556083838f Refine experimental Scopes API (#18778)
* Refine experimental Scopes API
2020-05-01 19:01:43 +01:00
Sebastian MarkbågeandGitHub 5d2e145f3b Formalize the Wakeable and Thenable types (#18391)
* Formalize the Wakeable and Thenable types

We use two subsets of Promises throughout React APIs. This introduces
the smallest subset - Wakeable. It's the thing that you can throw to
suspend. It's something that can ping.

I also use a shared type for Thenable in the cases where we expect a value
so we can be a bit more rigid with our us of them.

* Make Chunks into Wakeables instead of using native Promises

This value is just going from here to React so we can keep it a lighter
abstraction throughout.

* Renamed thenable to wakeable in variable names
2020-03-25 16:49:37 -07:00
Dominic GannawayandGitHub 094928135a Flow type ReactDOMComponentTree (#18280) 2020-03-11 19:38:23 +00:00
Brian VaughnandGitHub 7d06efcece useMutableSource hook (#18000)
useMutableSource hook

useMutableSource() enables React components to safely and efficiently read from a mutable external source in Concurrent Mode. The API will detect mutations that occur during a render to avoid tearing and it will automatically schedule updates when the source is mutated.

RFC: reactjs/rfcs#147
2020-03-11 12:34:39 -07:00
Brian VaughnandGitHub c7e696b944 Fix flow types (#18204)
* Added missing @flow pragma to React.js

* Fixed useContext() return type definition

* Fixed previously masked Flow errors in DevTools and react-interactions packages

* Added displayName to internal Context Flow type

* Removed Flow generic annotations for createResponder

This seems to cause a parsing error. (Not sure why.) The API is deprecated anyway so I'm being lazy for now and just adding a .
2020-03-03 12:46:24 -08:00
Dominic GannawayandGitHub 58ce18a895 [react-interactions] Remove deprecated Scope APIs + update Focus components/docs (#17859) 2020-01-17 12:16:39 +00:00
Dominic GannawayandGitHub da36a2221c [react-interactions] Add DO_NOT_USE to Scope methods (#17835) 2020-01-15 09:50:09 +00: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
Dominic GannawayandGitHub 78238afe96 [react-interactions] Remove responder root event types + revert commit phase change (#17577) 2019-12-11 16:48:46 +00:00
Dominic GannawayandGitHub 3985adf42c [react-interactions] Expost host instance to Scope Query function (#17341) 2019-11-11 13:51:46 +00:00
Dominic GannawayandGitHub 14058e7062 [react-interactions] Add optional searchNodes to Scope.queryAllNodes (#17293) 2019-11-06 22:52:59 +00:00
Dominic GannawayandGitHub 6777721a07 [react-interactions] Modify Scope query mechanism (#17095) 2019-10-15 15:57:02 +02:00
Dominic GannawayandGitHub 177752a7b3 [react-interactions] Adds more experimental Scope API methods (#17042) 2019-10-08 19:32:53 +02:00
Dominic GannawayandGitHub d72d53dc1a [react-interactions] Add Portal propagation configuration (#16889) 2019-09-25 16:56:51 +02:00
Dominic GannawayandGitHub 907a00ad79 [react-ui] FocusGrid -> ReactFocusTable + tweaks and fixes (#16806) 2019-09-17 19:22:10 +02:00
Dominic GannawayandGitHub 5210f8eed7 [react-interactions] Refactor TabFocusController (#16768) 2019-09-12 22:28:07 +02:00
Dominic GannawayandGitHub 0589768550 [react-interactions] More Tab Focus control handling (#16751) 2019-09-11 22:35:33 +02:00
Dominic GannawayandGitHub 23c2df171a [react-events] Various core tweaks for event responder system (#16654) 2019-09-04 18:05:56 +01:00
Dominic GannawayandGitHub faf74b5b56 [react-core] Add experimental React Scope component API (#16587) 2019-08-29 12:06:51 +01:00
Dominic GannawayandGitHub 80ee845658 [Flare] Rework the responder dispatching/batching mechanism (#16334) 2019-08-19 19:22:46 +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
Dominic GannawayandGitHub 4e4bf7822a [Flare] Remove responder flags to simplify logic (#16084) 2019-07-09 15:05:45 +01:00
Dominic GannawayandGitHub 4e7f2c8f88 [Flare] Revise responder event types (#16081) 2019-07-08 14:35:59 +01:00
Dominic GannawayandGitHub 54a79bf26b [Flare] Remove capture phase Flare events (#16054) 2019-07-04 21:30:46 +01:00
Dominic GannawayandGitHub 815e342028 [Flare] createInitialState -> getInitialState (#16051) 2019-07-04 18:06:18 +01:00
Dominic GannawayandGitHub 1c500bf3de [Flare] Remove dead event target code (#16063) 2019-07-04 13:10:55 +01:00
Dominic GannawayandGitHub 8e16f11d59 [Flare] Refinements to useEvent hook (#15955) 2019-06-21 23:10:55 +01:00
Dominic GannawayandGitHub 3ae909dcd4 [Flare] Refine flow type annotations (#15950) 2019-06-21 12:32:43 +01:00
Dominic GannawayandAndrew Clark 498afc97c5 [Flare] Add useEvent hook implementation (#15927)
* [Flare] Add useEvent hook implementation

Validate hooks have decendent event components

Few fixes and displayName changes

Fix more responder bugs

Update error codes

* Add another test

* Address feedback
2019-06-20 19:12:40 -07:00
Dominic GannawayandGitHub 751d4b4363 [Flare] Add RN build step for ReactTypes (#15926) 2019-06-19 13:27:10 +01:00
Dominic GannawayandGitHub f01586ec26 [Flare] Move unstable_createEventComponent to ReactDOM (#15890) 2019-06-18 23:41:00 +01:00
Dominic GannawayandGitHub 5a9b7905bd [Flare] remove stopLocalPropagation option + modify responder ownership (#15889) 2019-06-14 23:11:54 +01:00
Dominic GannawayandGitHub 5ba77153c7 [Flare] Refactor of Press to fix various issues (#15878) 2019-06-14 22:52:26 +01:00
Dominic GannawayandGitHub 65a204c79c [Flare] Improve runtime performance of hit target intersection (#15836) 2019-06-07 15:57:10 +01:00
Dominic GannawayandGitHub 43e15a453a [Flare] Fix ES6 issues with IE11 (#15834) 2019-06-06 18:38:46 +01:00
Andrew ClarkandGitHub a50a107140 [Flare] EventPriority enum (#15823)
* Same as previous commit, but for Flare

I don't know what the public API for setting the event priority should
be. Right now it accepts a numeric enum, but is this what we want?
Maybe it should be a string enum? I've punted on this for now.

* Add test for hover events
2019-06-04 17:20:06 -07:00
Dominic GannawayandGitHub 25789d6ccd [Flare] Deeply prevent default on anchor elements (#15750) 2019-05-28 12:46:07 +01:00
Dominic GannawayandGitHub 6e1f3963be [Flare] event component displayName is now mandatory (#15717) 2019-05-23 01:29:07 +01:00
Dominic GannawayandGitHub 7265fe8827 Flare: simplify dispatchEvent discrete argument (#15694) 2019-05-21 16:06:17 +01:00
Dominic GannawayandGitHub ce7ca99646 Event API: Add responder allowMultipleHostChildren flag (#15646) 2019-05-16 19:03:38 +01:00