Commit Graph

96 Commits

Author SHA1 Message Date
Brian Vaughn
fc33f12bde Remove unstable scheduler/tracing API (#20037) 2021-04-26 19:16:18 -04:00
Andrew Clark
6d3ecb70dc 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 Abramov
35f7441d37 Use Lanes instead of priority event constants (#20762) 2021-02-08 22:30:23 +00:00
Dan Abramov
b5bac18219 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 Abramov
4ecf11977c Remove the Fundamental internals (#20745) 2021-02-05 20:36:55 +00:00
Brian Vaughn
766a7a28a9 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 Gannaway
b61174fb7b Remove the deprecated React Flare event system (#19520) 2020-08-05 15:13:29 +01:00
Dominic Gannaway
aa88589d0b Refine experimental Scopes API (#18778)
* Refine experimental Scopes API
2020-05-01 19:01:43 +01:00
Sebastian Markbåge
64ed221c3d 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 Gannaway
8b155d2613 Flow type ReactDOMComponentTree (#18280) 2020-03-11 19:38:23 +00:00
Brian Vaughn
322cdcd3ab 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 Vaughn
d2158d6ccb 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 Gannaway
9e075d16b2 [react-interactions] Remove deprecated Scope APIs + update Focus components/docs (#17859) 2020-01-17 12:16:39 +00:00
Dominic Gannaway
b6173e643a [react-interactions] Add DO_NOT_USE to Scope methods (#17835) 2020-01-15 09:50:09 +00:00
Dan Abramov
e706721490 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 Gannaway
2afeebdcc4 [react-interactions] Remove responder root event types + revert commit phase change (#17577) 2019-12-11 16:48:46 +00:00
Dominic Gannaway
6cff70a740 [react-interactions] Expost host instance to Scope Query function (#17341) 2019-11-11 13:51:46 +00:00
Dominic Gannaway
ce4b3e9981 [react-interactions] Add optional searchNodes to Scope.queryAllNodes (#17293) 2019-11-06 22:52:59 +00:00
Dominic Gannaway
4cb399a433 [react-interactions] Modify Scope query mechanism (#17095) 2019-10-15 15:57:02 +02:00
Dominic Gannaway
b71ab61c8f [react-interactions] Adds more experimental Scope API methods (#17042) 2019-10-08 19:32:53 +02:00
Dominic Gannaway
d6d83d7060 [react-interactions] Add Portal propagation configuration (#16889) 2019-09-25 16:56:51 +02:00
Dominic Gannaway
f40ceb0010 [react-ui] FocusGrid -> ReactFocusTable + tweaks and fixes (#16806) 2019-09-17 19:22:10 +02:00
Dominic Gannaway
4b0b556dcf [react-interactions] Refactor TabFocusController (#16768) 2019-09-12 22:28:07 +02:00
Dominic Gannaway
3717c25a7e [react-interactions] More Tab Focus control handling (#16751) 2019-09-11 22:35:33 +02:00
Dominic Gannaway
539640d89f [react-events] Various core tweaks for event responder system (#16654) 2019-09-04 18:05:56 +01:00
Dominic Gannaway
bd79be9b68 [react-core] Add experimental React Scope component API (#16587) 2019-08-29 12:06:51 +01:00
Dominic Gannaway
dce430ad92 [Flare] Rework the responder dispatching/batching mechanism (#16334) 2019-08-19 19:22:46 +01:00
Dominic Gannaway
42794557ca [Flare] Tweaks to Flare system design and API (#16264) 2019-08-01 19:08:54 +01:00
Dominic Gannaway
ed72f40257 [Flare] Remove references to EventComponent (#16206) 2019-07-25 16:41:26 +01:00
Dominic Gannaway
5098891193 [Flare] Redesign core event system (#16163) 2019-07-23 23:46:44 +01:00
Dominic Gannaway
2c4d61e102 Adds experimental fundamental interface (#16049) 2019-07-19 22:20:28 +01:00
Dominic Gannaway
23b8a25345 [Flare] Remove responder flags to simplify logic (#16084) 2019-07-09 15:05:45 +01:00
Dominic Gannaway
67e3f3fb6e [Flare] Revise responder event types (#16081) 2019-07-08 14:35:59 +01:00
Dominic Gannaway
c40075a72c [Flare] Remove capture phase Flare events (#16054) 2019-07-04 21:30:46 +01:00
Dominic Gannaway
786186c692 [Flare] createInitialState -> getInitialState (#16051) 2019-07-04 18:06:18 +01:00
Dominic Gannaway
c64f40d718 [Flare] Remove dead event target code (#16063) 2019-07-04 13:10:55 +01:00
Dominic Gannaway
dc298fdf91 [Flare] Refinements to useEvent hook (#15955) 2019-06-21 23:10:55 +01:00
Dominic Gannaway
34ce57ae75 [Flare] Refine flow type annotations (#15950) 2019-06-21 12:32:43 +01:00
Dominic Gannaway
720db4cbe6 [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 Gannaway
4a7a39b594 [Flare] Add RN build step for ReactTypes (#15926) 2019-06-19 13:27:10 +01:00
Dominic Gannaway
689beef6f5 [Flare] Move unstable_createEventComponent to ReactDOM (#15890) 2019-06-18 23:41:00 +01:00
Dominic Gannaway
353e0ee474 [Flare] remove stopLocalPropagation option + modify responder ownership (#15889) 2019-06-14 23:11:54 +01:00
Dominic Gannaway
a146c1f9ed [Flare] Refactor of Press to fix various issues (#15878) 2019-06-14 22:52:26 +01:00
Dominic Gannaway
425473f43f [Flare] Improve runtime performance of hit target intersection (#15836) 2019-06-07 15:57:10 +01:00
Dominic Gannaway
8cfcfe0fcb [Flare] Fix ES6 issues with IE11 (#15834) 2019-06-06 18:38:46 +01:00
Andrew Clark
7b28ad119e [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 Gannaway
287ef30bba [Flare] Deeply prevent default on anchor elements (#15750) 2019-05-28 12:46:07 +01:00
Dominic Gannaway
b962adfc2b [Flare] event component displayName is now mandatory (#15717) 2019-05-23 01:29:07 +01:00
Dominic Gannaway
121acae090 Flare: simplify dispatchEvent discrete argument (#15694) 2019-05-21 16:06:17 +01:00
Dominic Gannaway
1160b37691 Event API: Add responder allowMultipleHostChildren flag (#15646) 2019-05-16 19:03:38 +01:00