Commit Graph

13513 Commits

Author SHA1 Message Date
Dominic Gannaway f5ea39c182
Modern Event System: make on*Capture events use capture phase (#19221) 2020-07-08 17:10:06 +01:00
falguniraina e18fb91852
Text improvement (#19167)
text improvement in README.md
2020-07-08 17:07:27 +01:00
E-Liang Tan 40cddfeeb1
Add user timing marks for scheduling profiler tool (#19223)
High level breakdown of this commit:

* Add a enableSchedulingProfiling feature flag.
* Add functions that call User Timing APIs to a new SchedulingProfiler file. The file follows DebugTracing's structure.
* Add user timing marks to places where DebugTracing logs.
* Add user timing marks to most other places where @bvaughn's original draft DebugTracing branch marks.
* Tests added
* More context (and discussions with @bvaughn) available at our internal PR MLH-Fellowship#11 and issue MLH-Fellowship#5.

Similar to DebugTracing, we've only added scheduling profiling calls to the old reconciler fork.

Co-authored-by: Kartik Choudhary <kartik.c918@gmail.com>
Co-authored-by: Kartik Choudhary <kartikc.918@gmail.com>
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
2020-07-08 10:36:02 -04:00
Phil MacCart b85b47630b
Fix state leaking when a function component throws on server render (#19212)
* add unit test asserting internal hooks state is reset

* Reset internal hooks state before rendering

* reset hooks state on error

* Use expect...toThrow instead of try/catch in test

* reset dev-only hooks state inside resetHooksState

* reset currentlyRenderingComponent to null
2020-07-08 03:10:23 +01:00
Dan Abramov 6fd4321135 eslint-plugin-react-hooks@4.0.6 2020-07-07 22:39:40 +01:00
Dan Abramov 7c35cb20ef
[ESLint] Handle optional member chains (#19275)
* Rename internal variables

This disambiguates "optional"/"required" because that terminology is taken by optional chaining.

* Handle optional member chains

* Update comment

Co-authored-by: Ricky <rickhanlonii@gmail.com>

Co-authored-by: Ricky <rickhanlonii@gmail.com>
2020-07-07 21:34:16 +01:00
Ricky dccf541ec5
Allow decoupleUpdatePriorityFromScheduler to be set (#19272) 2020-07-07 12:58:10 -04:00
Dan Abramov 7ca1d861e8
[ESLint] Consistently treat optional chaining as regular chaining (#19273)
* Revert "Fix ExhaustiveDeps ESLint rule throwing with optional chaining (#19260)"

This reverts commit 0f84b0f02b.

* Re-add a test from #19260

* Remove all code for optional chaining support

* Consistently treat optional chaining as regular chaining

This is not ideal because our suggestions use normal chaining. But it gets rid of all current edge cases.

* Add more tests

* More consistency in treating normal and optional expressions

* Add regression tests for every occurrence of Optional*
2020-07-07 17:38:44 +01:00
Dominic Gannaway 98390f11f6
Update useEvent implementation (#19271) 2020-07-07 14:44:56 +01:00
Dominic Gannaway 4eb9b1d2b4
Refactor createEventHandle signature (#19174) 2020-07-07 13:05:06 +01:00
Dominic Gannaway 97b96da295
Fix event replaying logic (#19269) 2020-07-07 02:28:55 +01:00
Ricky 91a2e8173f
Decouple update priority tracking from Scheduler package (#19121)
* Initial currentLanePriority implementation

* Minor updates from review

* Fix typos and enable flag

* Fix feature flags and lint

* Fix simple event tests by switching to withSuspenseConfig

* Don't lower the priority of setPending in startTransition below InputContinuous

* Move currentUpdateLanePriority in commit root into the first effect block

* Refactor requestUpdateLane to log for priority mismatches

Also verifies that the update lane priority matches the scheduler lane priority before using it

* Fix four tests by adding ReactDOM.unstable_runWithPriority

* Fix partial hydration when using update lane priority

* Fix partial hydration when using update lane priority

* Rename feature flag and only log for now

* Move unstable_runWithPriority to ReactFiberReconciler

* Add unstable_runWithPriority to ReactNoopPersistent too

* Bug fixes and performance improvements

* Initial currentLanePriority implementation

* Minor updates from review

* Fix typos and enable flag

* Remove higherLanePriority from ReactDOMEventReplaying.js

* Change warning implementation and startTransition update lane priority

* Inject reconciler functions to avoid importing src/

* Fix feature flags and lint

* Fix simple event tests by switching to withSuspenseConfig

* Don't lower the priority of setPending in startTransition below InputContinuous

* Move currentUpdateLanePriority in commit root into the first effect block

* Refactor requestUpdateLane to log for priority mismatches

Also verifies that the update lane priority matches the scheduler lane priority before using it

* Fix four tests by adding ReactDOM.unstable_runWithPriority

* Fix partial hydration when using update lane priority

* Fix partial hydration when using update lane priority

* Rename feature flag and only log for now

* Move unstable_runWithPriority to ReactFiberReconciler

* Bug fixes and performance improvements

* Remove higherLanePriority from ReactDOMEventReplaying.js

* Change warning implementation and startTransition update lane priority

* Inject reconciler functions to avoid importing src/

* Fixes from bad rebase
2020-07-06 18:53:42 -04:00
Dominic Gannaway c3e42a962b
Fix master tests (#19267) 2020-07-06 17:36:19 -04:00
Dominic Gannaway 0c0aaeb6bc
Handle test-cli failure case for CI (#19265) 2020-07-06 22:05:51 +01:00
Joe Lencioni 0f84b0f02b
Fix ExhaustiveDeps ESLint rule throwing with optional chaining (#19260)
Certain code patterns using optional chaining syntax causes
eslint-plugin-react-hooks to throw an error.

We can avoid the throw by adding some guards. I didn't read through the
code to understand how it works, I just added a guard to every place
where it threw, so maybe there is a better fix closer to the root cause
than what I have here.

In my test case, I noticed that the optional chaining that was used in
the code was not included in the suggestions description or output,
but it seems like it should be. This might make a nice future
improvement on top of this fix, so I left a TODO comment to that effect.

Fixes #19243
2020-07-06 15:52:14 -04:00
Brian Vaughn 670c0376ea
Enable createEventHandle API for wWW test builds (#19262) 2020-07-06 15:19:50 -04:00
Dominic Gannaway 26071abbe1
Refine event registration + event signatures (#19244)
* Refine event registration + event signatures

* Address feedback
2020-07-06 17:42:01 +01:00
Ittai Baratz 1cbaf48889
Add SSL support to React devtools standalone (#19191)
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
2020-07-06 10:09:41 -04:00
Dominic Gannaway 65c137768a
Fix Flow from #19239 (#19242) 2020-07-02 16:37:10 +01:00
Son Ki-Kyun cd9046f815
Add some type detection (#19239) 2020-07-02 15:54:36 +01:00
Dan Abramov b6df4417c7
Remove event config (#19237) 2020-07-02 00:26:29 +01:00
Dan Abramov 991c3b8193
Make event config an implementation detail of each plugin (#19236)
* Merge two variables with same purpose

* Replace dispatchConfig with _reactName on event object
2020-07-02 00:03:17 +01:00
Dan Abramov b683c07ccc
Remove TestUtils dependency on event registry (#19235) 2020-07-01 22:54:28 +01:00
Dan Abramov 9e7f5c02ca
Make event plugin injection statically resolvable (#19234)
* Make plugins ESM

* Resolve extractEvents statically

* Resolve eventTypes statically

* Fix flow types and inconsistent naming

* Move injection into the plugin system itself

* Fix Flow
2020-07-01 22:11:05 +01:00
Dominic Gannaway 67eb6ff4a8
Add Flow to ModernChangeEventPlugin (#19232) 2020-07-01 21:49:03 +01:00
Dan Abramov 75b6921d64
Remove dead code from modern event system (#19233)
* Remove dead code from modern event system

* Remove SSR dependency on EventPluginRegistry
2020-07-01 21:04:14 +01:00
Dan Abramov 9fba65efa5
Enable modern event system and delete dead code (#19230) 2020-07-01 17:43:34 +01:00
Dan Abramov e3f4eb7272
Fork legacy-events folder into react-dom and react-native (#19228) 2020-07-01 16:37:13 +01:00
Dominic Gannaway cd0275dcb2
Fix responder logic in ReactDOMServerSelectiveHydration-test (#19227) 2020-07-01 16:28:49 +01:00
Dan Abramov b231445f96
Move responder tests and remove dead code (#19226) 2020-07-01 16:20:49 +01:00
Dan Abramov 5707eeb2d2
Run ReactBrowserEventEmitter test on bundles (#19225)
* Run ReactBrowserEventEmitter test on bundles

* Rm bad tests
2020-07-01 16:01:46 +01:00
Dominic Gannaway b2bac7311a
Remove React Flare Keyboard responder (#19222) 2020-07-01 15:43:16 +01:00
Dan Abramov f918b0eb41
Fix development mode hang when iframe is removed (#19220)
* Fix development mode hang when iframe is removed

* Also fix #16734
2020-07-01 15:33:29 +01:00
Dan Abramov 8bff8987e5
Don't bailout after Suspending in Legacy Mode (#19216)
* Add a failing test for legacy Suspense blocking context updates in memo

* Add more test case coverage for variations of #17356

* Don't bailout after Suspending in Legacy Mode

Co-authored-by: Tharuka Devendra <tsdevendra1@gmail.com>
2020-06-30 22:06:46 +01:00
Shailendra Gupta f4097c1aef
Added warning to <Context.Provider> in case no value prop is provided (#19054)
* added warning to context.provider in case no value prop

* update message

* updated message and pass undefined
2020-06-30 19:50:55 +01:00
Dan Abramov 47ff31a77a
Revert "Add regression test for #18497 (#18538)" (#19215)
This reverts commit e9c1445ba0.
2020-06-30 13:38:31 +01:00
Vetrivel Chinnasamy b621dab5d4
make link https (#19147) 2020-06-30 12:43:52 +01:00
jddxf fa32cf299f
Add regression tests where sync render causes later concurrent render to expire soon (#18608)
* Add a failing test for #17911

* Add more test cases where sync render causes later concurrent render to expire soon
2020-06-30 12:42:59 +01:00
Dan Abramov 1887c5d946 eslint-plugin-react-hooks@4.0.5 2020-06-30 12:16:49 +01:00
Fred Vollmer b0533fe33c
fix(eslint-plugin-react-hooks): Support optional chaining when accessing prototype method inside useCallback and useMemo #19061 (#19062)
* fix(eslint-plugin-react-hooks): Support optional chaining when accessing prototype method #19061

* run prettier

* Add fix for #19043
2020-06-30 12:14:00 +01:00
Sophie Alpert e9c1445ba0
Add regression test for #18497 (#18538) 2020-06-30 12:09:05 +01:00
Brian Vaughn 9d9cf383c9
Fixed test script handling of unknown/additional args (#19209) 2020-06-29 15:36:45 -04:00
Dominic Gannaway 3c1a7ac87c
Move TOP_BEFORE_BLUR to bubble phase (#19197) 2020-06-26 20:35:21 +01:00
Ricky 72bbcad160
Add new test cli (#19184)
* Add new test cli

* Remove --variant accidentally added to test-persist

* s/test/tests

* Updates from review

* Update package.json tests

* Missed a release channel in circle.yaml

* Update config.yml to use just run: with test commands

* Update release-channel options and add build dir checks

* Update test args to use the new release-channel options

* Fix error in circle config.yml

* Fix a wrong condition for the --variant check

* Fix a wrong condition for the --persistent check

* Prettier

* Require build check for devtool tests as well
2020-06-25 20:39:50 -04:00
Christoph Nakazawa 7d0e4150aa
Fix react-runtime `main` field (#19193)
The "main" field in this package points to a non-existent file. This fixes it.
2020-06-25 12:17:42 -04:00
finico ed94600fc6
Remove unnecessary tag end from CommitRanked view (#19195) 2020-06-25 12:10:47 -04:00
Chen Gang ffe516f3bf
use NoTimestamp instead of -1 (#19182) 2020-06-23 16:28:24 -04:00
Brian Vaughn 1425fcbb86
Re-enabled DebugTracing feature for old reconciler fork (#19161)
* Re-enabled DebugTracing feature for old reconciler fork

It was temporarily removed by @sebmarkbage via PR #18697. Newly re-added tracing is simplified, since the lane(s) data type does not require the (lossy) conversion between priority and expiration time values.

@sebmarkbage mentioned that he removed this because it might get in the way of his planned discrete/sync refactor. I'm not sure if that concern still applies, but just in case- I have only re-added it to the old reconciler fork for now.

* Force Code Sandbox CI to re-run
2020-06-23 12:16:23 -04:00
Brian Vaughn 0836f62a5b
Updates the DevTools test script to make it easier to test other URLs. (#19179) 2020-06-23 11:48:35 -04:00
Brian Vaughn 1cfd332fd7
Shutdown DevTools Bridge synchronously when unmounting (#19180) 2020-06-23 11:48:04 -04:00