Commit Graph
13359 Commits
Author SHA1 Message Date
Dan Abramov ff283971ae [email protected] 2020-07-07 22:39:40 +01:00
e249c1cf4f [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 <[email protected]>

Co-authored-by: Ricky <[email protected]>
2020-07-07 21:34:16 +01:00
RickyandGitHub 6b21ed02fb Allow decoupleUpdatePriorityFromScheduler to be set (#19272) 2020-07-07 12:58:10 -04:00
Dan AbramovandGitHub 9e528acaaa [ESLint] Consistently treat optional chaining as regular chaining (#19273)
* Revert "Fix ExhaustiveDeps ESLint rule throwing with optional chaining (#19260)"

This reverts commit d242691529.

* 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 GannawayandGitHub 3e20503634 Update useEvent implementation (#19271) 2020-07-07 14:44:56 +01:00
Dominic GannawayandGitHub 894eeff0ea Refactor createEventHandle signature (#19174) 2020-07-07 13:05:06 +01:00
Dominic GannawayandGitHub d91e123a69 Fix event replaying logic (#19269) 2020-07-07 02:28:55 +01:00
RickyandGitHub cb72adf0a0 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 GannawayandGitHub 7574a62a79 Fix master tests (#19267) 2020-07-06 17:36:19 -04:00
Dominic GannawayandGitHub 4bbe79bcfa Handle test-cli failure case for CI (#19265) 2020-07-06 22:05:51 +01:00
Joe LencioniandGitHub d242691529 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 VaughnandGitHub 4b8295e658 Enable createEventHandle API for wWW test builds (#19262) 2020-07-06 15:19:50 -04:00
Dominic GannawayandGitHub 21cd8582f4 Refine event registration + event signatures (#19244)
* Refine event registration + event signatures

* Address feedback
2020-07-06 17:42:01 +01:00
09936459e9 Add SSL support to React devtools standalone (#19191)
Co-authored-by: Brian Vaughn <[email protected]>
2020-07-06 10:09:41 -04:00
Dominic GannawayandGitHub 38fe80ee97 Fix Flow from #19239 (#19242) 2020-07-02 16:37:10 +01:00
Son Ki-KyunandGitHub 26dcd60b54 Add some type detection (#19239) 2020-07-02 15:54:36 +01:00
Dan AbramovandGitHub a95719ea40 Remove event config (#19237) 2020-07-02 00:26:29 +01:00
Dan AbramovandGitHub 1fd17c9927 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 AbramovandGitHub b18cf92b3d Remove TestUtils dependency on event registry (#19235) 2020-07-01 22:54:28 +01:00
Dan AbramovandGitHub 865b3269da 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 GannawayandGitHub 426483668a Add Flow to ModernChangeEventPlugin (#19232) 2020-07-01 21:49:03 +01:00
Dan AbramovandGitHub 73b55e2beb 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 AbramovandGitHub e7bd4e2c09 Enable modern event system and delete dead code (#19230) 2020-07-01 17:43:34 +01:00
Dan AbramovandGitHub 20a1753cee Fork legacy-events folder into react-dom and react-native (#19228) 2020-07-01 16:37:13 +01:00
Dominic GannawayandGitHub 1edf6f1330 Fix responder logic in ReactDOMServerSelectiveHydration-test (#19227) 2020-07-01 16:28:49 +01:00
Dan AbramovandGitHub d8653ee0fc Move responder tests and remove dead code (#19226) 2020-07-01 16:20:49 +01:00
Dan AbramovandGitHub 4ce23e72f5 Run ReactBrowserEventEmitter test on bundles (#19225)
* Run ReactBrowserEventEmitter test on bundles

* Rm bad tests
2020-07-01 16:01:46 +01:00
Dominic GannawayandGitHub 96a726eeb4 Remove React Flare Keyboard responder (#19222) 2020-07-01 15:43:16 +01:00
Dan AbramovandGitHub 186c18f6b7 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
b60da33895 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 <[email protected]>
2020-06-30 22:06:46 +01:00
Shailendra GuptaandGitHub 374c49167e 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 AbramovandGitHub 455f1bd1cc Revert "Add regression test for #18497 (#18538)" (#19215)
This reverts commit 7ef0785791.
2020-06-30 13:38:31 +01:00
Vetrivel ChinnasamyandGitHub f247ad56ad make link https (#19147) 2020-06-30 12:43:52 +01:00
jddxfandGitHub 73824856db 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 82594bc30e [email protected] 2020-06-30 12:16:49 +01:00
Fred VollmerandGitHub aae140bdcf 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 AlpertandGitHub 7ef0785791 Add regression test for #18497 (#18538) 2020-06-30 12:09:05 +01:00
Brian VaughnandGitHub 62f46bed52 Fixed test script handling of unknown/additional args (#19209) 2020-06-29 15:36:45 -04:00
Dominic GannawayandGitHub 0acbf3c61b Move TOP_BEFORE_BLUR to bubble phase (#19197) 2020-06-26 20:35:21 +01:00
RickyandGitHub 8b1c33f50d 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 NakazawaandGitHub 858988850e 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
finicoandGitHub f4ac5a41f3 Remove unnecessary tag end from CommitRanked view (#19195) 2020-06-25 12:10:47 -04:00
Chen GangandGitHub 22a977648c use NoTimestamp instead of -1 (#19182) 2020-06-23 16:28:24 -04:00
Brian VaughnandGitHub 2fa148f95f 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 VaughnandGitHub bb6dff5b51 Updates the DevTools test script to make it easier to test other URLs. (#19179) 2020-06-23 11:48:35 -04:00
Brian VaughnandGitHub 40d126e179 Shutdown DevTools Bridge synchronously when unmounting (#19180) 2020-06-23 11:48:04 -04:00
Jack WorksandGitHub d072bd8063 fix: use define property to overwrite console, close #19099 (#19123)
* fix: use define property to overwrite console, close #19099

* fix: lint error
2020-06-23 10:34:53 -04:00
Andrew ClarkandGitHub 0f5d7c0aab Bugfix: Legacy Mode + DevTools "force fallback" (#19164)
DevTools has a feature to force a Suspense boundary to show a fallback.
This feature causes us to skip the first render pass (where we render
the primary children) and go straight to rendering the fallback.

There's a Legacy Mode-only codepath that failed to take this scenario
into account, instead assuming that whenever a fallback is being
rendered, it was preceded by an attempt to render the primary children.

SuspenseList can also cause us to skip the first pass, but the relevant
branch is Legacy Mode-only, and SuspenseList is not supported in
Legacy Mode.

Fixes a test that I had temporarily disabled when upstreaming the Lanes
implementation in #19108.
2020-06-19 11:06:42 -07:00
Luna RuanandGitHub 815cea683a Revert "Re-enabled DebugTracing feature for old reconciler fork (#19142)" (#19159)
This reverts commit 90f2297706.
2020-06-18 18:18:56 -07:00
YeonJuanandGitHub c68411da20 [eslint-plugin-react-hooks]: handling sparse array when no-inline callback (#19145) 2020-06-17 12:29:02 -04:00