Commit Graph
15395 Commits
Author SHA1 Message Date
Ricky 8dcedba15a Add fallback shim for AbortController (#24285)
* Add fallback shim for AbortController

* Replace shim with a minimal stub

* replace-fork

* Better minification

* Fix flow

* Even smaller

* replace-fork

* Revert back to object constructor

* replace-fork
2022-04-08 15:53:40 -04:00
Ricky b86baa1cb7 Add back lost cache test (#24317) 2022-04-08 15:34:41 -04:00
Zhongjan a9add2fe08 Fix file path separator compatibility in scripts/babel (#24318)
The problem in scripts\babel\transform-object-assign.js is that file path separator has '/' and '\' between Linux, MacOS and Windows, which causes yarn build error. See https://github.com/facebook/react/issues/24103
2022-04-08 19:47:31 +01:00
Leo bafe912a5f update types for InputContinuousLane and DefaultLane (#24316) 2022-04-08 18:51:40 +01:00
Luna Ruan 4ebaeae40d moved mutation code to passive (#24251)
This PR moves the code for transition tracing in the mutation phase that adds transitions to the pending callbacks object (to be called sometime later after paint) from the mutation to the passive phase.

Things to think about:

Passive effects can be flushed before or after paint. How do we make sure that we get the correct end time for the interaction?
2022-04-08 09:28:20 -07:00
Brian Vaughn 5b2e7253f9 React DevTools 4.24.3 -> 4.24.4 (#24315) 2022-04-08 11:38:07 -04:00
Leo caa60e8fcc update types for NonIdleLanes and IdleLane (#24313) 2022-04-08 11:01:18 -04:00
Brian Vaughn 65f35035a6 Allow react-devtools-inline createStore() method to override Store config params (#24303) 2022-04-08 08:59:12 -04:00
1f7a901d7b Fix false positive lint error with large number of branches (#24287)
* Switched RulesOfHooks.js to use BigInt. Added test and updated .eslintrc.js to use es2020.

* Added BigInt as readonly global in eslintrc.cjs.js and eslintrc.cjs2015.js

* Added comment to RulesOfHooks.js that gets rid of BigInt eslint error

* Got rid of changes in .eslintrc.js and yarn.lock

* Move global down

Co-authored-by: stephen cyron <stephen.cyron@fdmgroup.com>
Co-authored-by: dan <dan.abramov@gmail.com>
2022-04-08 00:22:47 +01:00
dan f56dfe950b Warn on setState() in useInsertionEffect() (#24298)
* Warn on setState() in useInsertionEffect()

* Use existing DEV reset mechanism
2022-04-07 20:12:49 +01:00
Sebastian Silbermann 548b542b41 Update renderToPipeableStream#options.onShellError to match usage (#24299) 2022-04-07 20:06:54 +01:00
dan d68b09defc Fix warning about setState in useEffect (#24295)
* Fix warning about setState in useEffect

* Fix test

* Fix multiple roots
2022-04-07 18:06:35 +01:00
dan 0579154772 Update create-subscription README (#24294) 2022-04-07 16:41:38 +01:00
dan e8f4a6653d Fix import in example 2022-04-07 14:12:58 +01:00
dan 3e8c91c5f8 Fix import in README 2022-04-07 13:46:36 +01:00
dan bb49abea23 Update some READMEs (#24290)
* Update some READMEs

* Update README.md
2022-04-07 02:35:01 +01:00
Sebastian Markbåge 4bc465a16f Rename Controls to PipeableStream (#24286)
This type isn't exported so it's technically not public.

This object mimics a ReadableStream.

Currently this is safe to destructure and call separately but I'm not sure
that's even guaranteed. It should probably be treated as a class in docs.
2022-04-06 19:27:38 -04:00
zhoulixiang ece5295e5a Remove unnecessary flag check (#24284) 2022-04-06 17:42:53 +01:00
Sebastian Silbermann af730436c0 test: Update attribute fixture snapshot (#24083)
* test: Update attribute fixture snapshot

* Poke CircleCI

* Poke CircleCI
2022-04-05 02:59:26 +01:00
alireza molaee 1d1fa94a66 Fix false positive warning about react-dom/client with UMD builds (#24274) 2022-04-05 02:56:18 +01:00
dan 9ededef945 Don't mute hydration errors forcing client render (#24276)
* Don't mute hydration errors forcing client render

* Nits
2022-04-05 02:11:22 +01:00
dan 5f7f528083 Add more tests for suppressHydrationWarning (#24275)
* More tests for suppressHydrationWarning

* Move suppressHydration tests to new file

* Extract more tests

* Test name

* Test legacy behavior too
2022-04-05 00:04:15 +01:00
dan fc47cb1b61 Fix suppressHydrationWarning not working in production (#24271) 2022-04-04 16:23:58 +01:00
Hikari Hayashi 985272e268 Fix name mismatch in react-reconciler custom build. (#24272) 2022-04-04 09:47:36 +01:00
Noel Kim (김민혁) e912da964d Update Example render for React v18 (#24259) 2022-04-03 02:41:49 +01:00
Luna Ruan b8cfda15e1 changed Transitions type to Array<Transition> (#24249)
Changed the Transitions type to Array<Transition> because Transitions was confusing
2022-04-01 17:02:28 -04:00
Mengdi "Monday" Chen c89a15c716 [ReactDebugTools] wrap uncaught error from rendering user's component (#24216)
* [ReactDebugTools] wrap uncaught error from rendering user's component

* fix lint

* make error names more package specific

* update per review comments

* fix tests

* fix lint

* fix tests

* fix lint

* fix error name & nits

* try catch instead of mocking error

* fix test for older node.js version

* avoid false positive from try-catch in tests
2022-04-01 14:38:11 -04:00
dan ebd7ff65b6 Don't recreate the same fallback on the client if hydrating suspends (#24236)
* Delay showing fallback if hydrating suspends

* Fix up

* Include all non-urgent lanes

* Moar tests

* Add test for transitions
2022-04-01 02:49:54 +01:00
Kayanddan d352fd0931 Fix for SSR2 fixture not working locally (#24237)
* SS2 fixture not working locally fix

* Fix prettier issue

* prettier excess line fix

* Update render.js

* Update README.md

Co-authored-by: dan <dan.abramov@gmail.com>
2022-04-01 00:26:12 +01:00
dan 4db3ff6c1a Test suite for hydration diff warnings (#24229)
* Test suite for hydration diff warnings

* Test both variants

* Add more edge cases
2022-03-31 17:35:51 +01:00
Brian Vaughn aa05e73150 Add 4.4.0 release to eslint rules CHANGELOG (#24234) 2022-03-31 10:43:08 -04:00
dan b76103d66f Remove React 18 issue template (#24220)
React 18 is just React now.
2022-03-30 19:37:31 +01:00
Andrew Clark 77938881f4 Update @next version (#24218)
Now that 18.0 is out, the next minor is 18.1
2022-03-30 12:28:49 -04:00
Sebastian Silbermann 7e3121e1cf Remove unstable_createMutableSource from experimental build (#24209) 2022-03-30 17:05:07 +01:00
dan a0fb3cf37e Fix changelog typos 2022-03-30 17:00:29 +01:00
Mengdi "Monday" Chen 0415b18a10 [ReactDebugTools] add custom error type for future new hooks (#24168)
* [ReactDebugTools] add custom error type for future new hooks

* update per review comments

* remove unused argument
2022-03-30 11:07:12 -04:00
Brian Vaughn 8b95ea2cba Inline DevTools test snapshots and cleaned up tests (#24199) 2022-03-30 11:02:51 -04:00
Brian Vaughn c9100d95b9 DevTools release script: Show changelog before minor/patch prompt (#24200) 2022-03-30 09:26:33 -04:00
Mengdi "Monday" Chen 27199d7567 fix build script for react dev tools (#24193) 2022-03-30 09:26:14 -04:00
Strek cfc76b4658 Update CHANGELOG.md (#24206) 2022-03-30 07:48:32 +01:00
dan 8acc812c67 Add a missing breaking change to changelog 2022-03-29 23:13:50 +01:00
Mengdi "Monday" Chen adb8ebc927 React DevTools 4.24.2 -> 4.24.3 (#24198) 2022-03-29 14:44:32 -04:00
danandRick Hanlon 509d2d9065 Add React 18 changelog (#24195)
* Add React 18 to changelog

* Fix typo

Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com>
2022-03-29 18:13:05 +01:00
Andrew Clark b2b4bddeb8 Bump react-refresh version 2022-03-29 12:10:52 -04:00
Andrew Clark 3e997fdbaa Bump react-refresh version 2022-03-29 12:08:09 -04:00
Andrew Clark 34aa5cfe0d Update local package.jsons for 18 v18.0.0 2022-03-29 12:07:33 -04:00
Brian Vaughn eaa493e532 Profiler should only report stateful hooks that change between renders (#24189)
The Profiler has an advanced feature that shows why a component re-rendered. In the case of props and (class) state, it shows the names of props/state values that changed between renders. For hooks, DevTools tries to detect which ones may been related to the update by comparing prev/next internal hook structures.

My initial implementation tried to detect all changed hooks. In hindsight this is confusing, because only stateful hooks (e.g. useState, useReducer, and useSyncExternalStore) can schedule an update. (Other types of hooks can change between renders, but in a reactive way.) This PR changes the behavior to only report hooks that scheduled the update.
2022-03-29 11:11:31 -04:00
Andrew Clark fc46dba67f Remove rc suffix from versions (#24190)
* Remove rc suffix from versions

* Bump eslint-plugin-react-hooks version

I noticed this one was behind the latest published version
2022-03-29 10:53:46 -04:00
Yash Srivastav fe6e074128 Fix usage of console.error to prevent transform (#24188)
We were suppressing the `react-internals/warning-args` lint rule
for the call to `console.error` in `defaultOnRecoverableError`.

As far as I could tell, the lint rule exists because on dev builds,
we replace all calls to `console.error` with [this error
function](https://github.com/facebook/react/blob/main/packages/shared/consoleWithStackDev.js#L31-L37)
which expects a format string + args and nothing else. We were trying
to pass in an `Error` object directly. After this commit's change,
we will still be passing an `Error` but the transform won't occur.
2022-03-29 10:45:14 +01:00
Brian Vaughn ba0aee5d71 DevTools bugfix: Ignore duplicate welcome "message" events (#24186) 2022-03-28 14:25:30 -04:00