-
Notifications
You must be signed in to change notification settings - Fork 48k
Comparing changes
Open a pull request
base repository: facebook/react
base: be229c5655074642ee664f532f2e7411dd7dccc7
head repository: facebook/react
compare: a87edf62d7d69705ddbcec9a24f0780b3db7535f
Commits on Jun 14, 2022
-
[Transition Tracing] Fix Cache and Transitions Pop Order (#24719)
We push the Cache before the transition so we should pop the transition before the cache. This PR fixes this issue.
Configuration menu - View commit details
-
Copy full SHA for 54f17e4 - Browse repository at this point
Copy the full SHA 54f17e4View commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 89bae8f - Browse repository at this point
Copy the full SHA 89bae8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cc2487 - Browse repository at this point
Copy the full SHA 5cc2487View commit details -
Move renderToString tests out of the streamable API tests (#24724)
ReactDOMFizzServer(Browser/Node)-test file is really meant to just be a very shallow tests of the Browser/Node specific streaming APIs. Most of the general streaming tests are in ReactDOMFizzServer-test instead of testing all streaming related things in each environment. The legacy renderToString APIs are mostly covered by ReactServerRendering-test et al for historical reasons.
Configuration menu - View commit details
-
Copy full SHA for 567500d - Browse repository at this point
Copy the full SHA 567500dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6522179 - Browse repository at this point
Copy the full SHA 6522179View commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 256aefb - Browse repository at this point
Copy the full SHA 256aefbView commit details
Commits on Jun 15, 2022
-
Move the Error creation to be lazy (#24728)
Creating an Error captures a stack trace which can be somewhat expensive. We shouldn't do tthat always for every render. This also ensures that the stack trace is more useful because you can follow through the Node.js code to see the cause.
Configuration menu - View commit details
-
Copy full SHA for 522f473 - Browse repository at this point
Copy the full SHA 522f473View commit details -
[Transition Tracing] Push Transition When Offscreen Becomes Visible (#…
…24718) This PR pushes all of a suspense boundary's transitions onto the transition stack when it goes from hidden to visible so we can pass it to any child suspense boundaries or tracing markers.
Configuration menu - View commit details
-
Copy full SHA for fcd720d - Browse repository at this point
Copy the full SHA fcd720dView commit details
Commits on Jun 16, 2022
-
Bugfix: Offscreen instance is null during setState (#24734)
* [FORKED] Bugfix: Offscreen instance is null during setState During a setState, we traverse up the return path and check if any parent Offscreen components are currently hidden. To do that, we must access the Offscreen fiber's `stateNode` field. On a mounted Offscreen fiber, the `stateNode` is never null, so usually we don't need to refine the type. When a fiber is unmounted, though, we null out its `stateNode` field to prevent memory cycles. However, we also null out its `return` field, so I had assumed that an unmounted Offscreen fiber would never be reachable. What I didn't consider is that it's possible to call `setState` on a fiber that never finished mounting. Because it never mounted, it was never deleted. Because it was never deleted, its `return` field was never disconnected. This pattern is always accompanied by a warning but we still need to account for it. There may also be other patterns where an unmounted Offscreen instance is reachable, too. The discovery also suggests it may be better for memory usage if we don't attach the `return` pointer until the commit phase, though in order to do that we'd need some other way to track the return pointer during initial render, like on the stack. The fix is to add a null check before reading the instance during setState. * Add previous commit to list of forked revisions
Configuration menu - View commit details
-
Copy full SHA for c3d7a7e - Browse repository at this point
Copy the full SHA c3d7a7eView commit details -
Revert "Land enableClientRenderFallbackOnTextMismatch" (#24738)
This reverts commit 327e4a1. Turns out we hadn't rolled this out internally yet — I mistook enableClientRenderFallbackOnHydrationMismatch for said enableClientRenderFallbackOnTextMismatch. Need to revert until we finish rolling out the change.
Configuration menu - View commit details
-
Copy full SHA for 229c86a - Browse repository at this point
Copy the full SHA 229c86aView commit details
Commits on Jun 17, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7cf9f5e - Browse repository at this point
Copy the full SHA 7cf9f5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a7c322c - Browse repository at this point
Copy the full SHA a7c322cView commit details -
[DevTools] fix useDeferredValue to match reconciler change (#24742)
* [DevTools] fix useDeferredValue to match reconciler change * fixup * update test to catch original issue * fix lint * add safer tests for other composite hooks
Configuration menu - View commit details
-
Copy full SHA for 72ebc70 - Browse repository at this point
Copy the full SHA 72ebc70View commit details -
[Transition Tracing] Add Support for Multiple Transitions on Root (#2…
…4732) We can think of transitions on the root as a bunch of tracing markers. Therefore, we can map each transition to a map of pending suspense boundaries. When a transition's pending suspense boundary map is empty, we know that it's complete. This PR: * Combines the `pendingSuspenseBoundaries` and `transitions` into one `incompleteTransitions` object. This object is a map from a `transition` to a map of `pendingSuspenseBoundaries` * Refactored code to make it so that every transition has its own `pendingSuspenseBoundaries` map rather than sharing just one. * Moves the transition complete callback to the root. Alternatively, we can also keep a map of pendingSuspenseBoundaries to transitions on the Offscreen marker, but it's simpler to just call the transition complete callback on the root instead. We also only do this if there are transitions pending, so it shouldn't make too big of a difference
Configuration menu - View commit details
-
Copy full SHA for 12a738f - Browse repository at this point
Copy the full SHA 12a738fView commit details
Commits on Jun 18, 2022
-
Aborting early should not infinitely suspend (#24751)
Before this change we weren't calling onError nor onFatalError if you abort before completing the shell. This means that the render never completes and hangs. Aborting early can happen before even creating the stream for AbortSignal, before rendering starts in Node since there's an setImmediate atm, or during rendering.
Configuration menu - View commit details
-
Copy full SHA for 0f0aca3 - Browse repository at this point
Copy the full SHA 0f0aca3View commit details -
Rename Segment to Task in Flight (#24753)
In Fizz this got split into Task and Segment. We don't have a concept of Segment in Flight yet because we don't inline multiple segments into one "Row". We just emit one "Row" for each Segment if something suspends. This makes Flight non-deterministic atm but that's something we'll want to address. Regardless, right now, this is more like a Task than a Segment.
Configuration menu - View commit details
-
Copy full SHA for f796fa1 - Browse repository at this point
Copy the full SHA f796fa1View commit details
Commits on Jun 19, 2022
-
Add entry points for "static" server rendering passes (#24752)
This will be used to add optimizations for static server rendering.
Configuration menu - View commit details
-
Copy full SHA for 0f216ae - Browse repository at this point
Copy the full SHA 0f216aeView commit details -
Add aborting to the Flight Server. This encodes the reason as an "error" row that gets thrown client side. These are still exposed in prod which is a follow up we'll still have to do to encode them as digests instead. The error is encoded once and then referenced by each row that needs to be updated.
Configuration menu - View commit details
-
Copy full SHA for 56389e8 - Browse repository at this point
Copy the full SHA 56389e8View commit details
Commits on Jun 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d6255f0 - Browse repository at this point
Copy the full SHA d6255f0View commit details
Commits on Jun 21, 2022
-
[DevTools] Refactor incompleteTransitions field from Root Fiber memoi…
…zed state to FiberRoot (#24765) `incompleteTransitions` persists across renders, so it should be part of the `fiber.stateNode` (ie FiberRoot) rather than `fiber.memoizedState`
Configuration menu - View commit details
-
Copy full SHA for cf665c4 - Browse repository at this point
Copy the full SHA cf665c4View commit details
Commits on Jun 23, 2022
-
[DevTools][Timeline Profiler] Component Stacks Backend (#24776)
This PR adds a component stack field to the `schedule-state-update` event. The algorithm is as follows: * During profiling, whenever a state update happens collect the parents of the fiber that caused the state update and store it in a map * After profiling finishes, post process the `schedule-state-update` event and using the parent fibers, generate the component stack by using`describeFiber`, a function that uses error throwing to get the location of the component by calling the component without props. --- Co-authored-by: Blake Friedman <blake.friedman@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9abe745 - Browse repository at this point
Copy the full SHA 9abe745View commit details -
[DevTools] Clean Up DevTools Code (#24782)
This PR cleans up the DevTools codebase by: * Consolidating `normalizeCodeLocInfo` into one place * Remove unused source argument in the DevTools component stacks code
Configuration menu - View commit details
-
Copy full SHA for 955cad9 - Browse repository at this point
Copy the full SHA 955cad9View commit details
Commits on Jun 25, 2022
-
[sizebot] Add link to diff view (#24790)
Updates the sizebot output so that the file names link to a diff view of the corresponding build artifact. Example diff view: https://react-builds.vercel.app/commits/955cad9bcc6d755b2a672f8038fe9754e0fe5108/files/oss-stable-semver/react-dom/cjs/react-dom.production.min.js?compare=c3d7a7e3d72937443ef75b7e29335c98ad0f1424 The diff view itself is rendered by a Next.js app that I built as a side project and is hosted at https://react-builds.vercel.app. If we find this useful enough I could move the app to a React-owned repo but since this isn't a critical feature it might be OK to leave it separate for now, so we don't need to commit to supporting it indefinitely.
Configuration menu - View commit details
-
Copy full SHA for 652e6c5 - Browse repository at this point
Copy the full SHA 652e6c5View commit details
Commits on Jun 26, 2022
-
fix hydration warning suppression in text comparisons (#24784)
* fix hydration warning suppression in text comparisons * lint * lowercase test
Configuration menu - View commit details
-
Copy full SHA for 1678530 - Browse repository at this point
Copy the full SHA 1678530View commit details
Commits on Jun 27, 2022
-
[Transition Tracing] Add Tracing Markers (#24686)
This PR adds support for Tracing Markers as well as onTracingMarkerComplete
Configuration menu - View commit details
-
Copy full SHA for a4bed46 - Browse repository at this point
Copy the full SHA a4bed46View commit details
Commits on Jun 28, 2022
-
Fix enableTransitionTracing flag (#24801)
Move `enableTransitionTracing` to `dynamicFeatureFlags` so it runs when you run `yarn test`
Configuration menu - View commit details
-
Copy full SHA for 88574c1 - Browse repository at this point
Copy the full SHA 88574c1View commit details -
[DevTools] front-end for profiling event stack (#24805)
* [DevTools] front-end for profiling event stack Adds a side-bar to the profiling tab. Users can now select an update event, and are shown the callstack from the originating component. When a source path is available there is now UI to jump to source. Add FB enabled feature flag: enableProfilerComponentTree for the side-bar. resolves #24170
Configuration menu - View commit details
-
Copy full SHA for 2e1c884 - Browse repository at this point
Copy the full SHA 2e1c884View commit details
Commits on Jun 29, 2022
-
[Transition Tracing] Fix excess calls to the transition start callback (
#24806) This PR fixes a bug where we would add a transition to the lanes map every time an update occurs. However, we didn't factor in that there might be multiple updates in a transition, which would cause the transition to be added multiple times to the transitionLanes map. This changes the transitionLanes object from an Array of Arrays to an Array of Sets so that we only add a transition if it hasn't been added before, avoiding duplicates
Configuration menu - View commit details
-
Copy full SHA for d1432ba - Browse repository at this point
Copy the full SHA d1432baView commit details -
[DevTools] Log page URL in internal build (#24799)
* test log * fix attribute name * fix lint * tabs can be empty * improve coding style per comments
Configuration menu - View commit details
-
Copy full SHA for f01e119 - Browse repository at this point
Copy the full SHA f01e119View commit details -
[DevTools] Add column number to viewSourceLineFunction (#24814)
Add column number for `viewSourceLineFunction` and renamed the function to `viewUrlSourceFunction` to match the other source function naming conventions
Configuration menu - View commit details
-
Copy full SHA for cd80d32 - Browse repository at this point
Copy the full SHA cd80d32View commit details -
[DevTools] Fix Bugs With Component Stacks (#24815)
This PR: * Simplifies the code in `SidebarEventInfo` by passing it the actual clicked event rather than an index. * Lightly refactored the `SidebarEventInfo` code so that it can be used for more than just `schedulingEvents` * Fixes bug. Previously, whenever a state update event was clicked, we updated the `selectedCommitIndex` in the `ProfilerContext`. However, this index is used for the selected commit in the Flamegraph profiler, which caused a bug where if you would change the contents of the event sidebar, the commit sidebar in the Flamegraph profiler would change too. This PR replaces this with the actual event info instead
Configuration menu - View commit details
-
Copy full SHA for 1974d08 - Browse repository at this point
Copy the full SHA 1974d08View commit details
Commits on Jun 30, 2022
-
[DevTools] Resign Timeline Profiler Sidebar (#24816)
This PR: * Redesigned the sidebar to resemble the flamegraph profiler sidebar and added title and timestamp to the sidebar * Added ability to copy the component stack (for places where you're unable to link to source) https://user-images.githubusercontent.com/2735514/176564897-5301d6d4-429a-4ea3-86cd-74427cff4ce6.mov
Configuration menu - View commit details
-
Copy full SHA for 4e1fcfa - Browse repository at this point
Copy the full SHA 4e1fcfaView commit details -
Land forked reconciler changes (#24817)
This applies forked changes from the "new" reconciler to the "old" one. Includes: - d410f0a [FORKED] Bugfix: Offscreen instance is null during setState - 58bb117 [FORKED] Check for infinite update loops even if unmounted - 31882b5 [FORKED] Bugfix: Revealing a hidden update - 17691ac [FORKED] Don't update childLanes until after current render
Configuration menu - View commit details
-
Copy full SHA for 6b6cf83 - Browse repository at this point
Copy the full SHA 6b6cf83View commit details -
Add test gate alias for Offscreen (#24749)
Offscreen is only enabled in the www and experimental channels. Instead of listing these on every Offscreen test, I added a test gate alias called `enableOffscreen`. Makes it easier to grep for these, and edit or remove the channels later.
Configuration menu - View commit details
-
Copy full SHA for a7b192e - Browse repository at this point
Copy the full SHA a7b192eView commit details -
Track nearest Suspense handler on stack (#24585)
* [FORKED] Add HiddenContext to track if subtree is hidden This adds a new stack cursor for tracking whether we're rendering inside a subtree that's currently hidden. This corresponds to the same place where we're already tracking the "base lanes" needed to reveal a hidden subtree — that is, when going from hidden -> visible, the base lanes are the ones that we skipped over when we deferred the subtree. We must includes all the base lanes and their updates in order to avoid an inconsistency with the surrounding content that already committed. I consolidated the base lanes logic and the hidden logic into the same set of push/pop calls. This is intended to replace the InvisibleParentContext that is currently part of SuspenseContext, but I haven't done that part yet. * Add previous commit to forked revisions * [FORKED] Track nearest Suspense handler on stack Instead of traversing the return path whenever something suspends to find the nearest Suspense boundary, we can push the Suspense boundary onto the stack before entering its subtree. This doesn't affect the overall algorithm that much, but because we already do all the same logic in the begin phase, we can save some redundant work by tracking that information on the stack instead of recomputing it every time. * Add previous commit to forked revisions
Configuration menu - View commit details
-
Copy full SHA for 1859329 - Browse repository at this point
Copy the full SHA 1859329View commit details -
[Transition Tracing] Refactor Transition Tracing Root Code (#24766)
This PR refactors the transition tracing root code by reusing the tracing marker code. Namely it: * Refactors the tracing marker code so that it takes a tracing marker instance instead of a tracing marker fiber and rename the stack to `markerInstance` instead of `tracingMarker` * Pushes the root code onto the stack * Moves the instantiation of `root.incompleteTransitions` to the begin phase when we are pushing the root to the stack rather than in the commit phase
Configuration menu - View commit details
-
Copy full SHA for 4012963 - Browse repository at this point
Copy the full SHA 4012963View commit details -
Revert "[Transition Tracing] Refactor Transition Tracing Root Code (#…
Configuration menu - View commit details
-
Copy full SHA for e61fd91 - Browse repository at this point
Copy the full SHA e61fd91View commit details -
Revert "Revert [Transition Tracing] Refactor Transition Tracing Root …
…Code" (#24830) * refactor root * old * Add comments and push actual marker instance in pushMarkerInstance * old * refactor pushRootMarkerInstance * old * fix test
Configuration menu - View commit details
-
Copy full SHA for 4cd788a - Browse repository at this point
Copy the full SHA 4cd788aView commit details
Commits on Jul 5, 2022
-
Add missing null checks to OffscreenInstance code (#24846)
`stateNode` is any-typed, so when reading from `stateNode` we should always cast it to the specific type for that type of work. I noticed a place in the commit phase where OffscreenInstance wasn't being cast. When I added the type assertion, it exposed some type errors where nullable values were being accessed without first being refined. I added the required null checks without verifying the logic of the existing code. If the existing logic was correct, then the extra null checks won't have any affect on the behavior, because all they do is refine from a nullable type to a non-nullable type in places where the type was assumed to already be non-nullable. But the result looks a bit fishy to me, so I also left behind some TODOs to follow up and verify it's correct.
Configuration menu - View commit details
-
Copy full SHA for c1f5884 - Browse repository at this point
Copy the full SHA c1f5884View commit details -
Suspending inside a hidden tree should not cause fallbacks to appear (#…
…24699) * [FORKED] Hidden trees should capture Suspense If something suspends inside a hidden tree, it should not affect anything in the visible part of the UI. This means that Offscreen acts like a Suspense boundary whenever it's in its hidden state. * Add previous commit to forked revisions
Configuration menu - View commit details
-
Copy full SHA for 82e9e99 - Browse repository at this point
Copy the full SHA 82e9e99View commit details
Commits on Jul 6, 2022
-
[Transition Tracing] Change Transition Type Passed Pending Transitions (
#24856) This PR changes the type of the object we store in the pending transitions callbacks map. Previously, we were recreating the transition object that we initially created during `startTransition`. However, we can actually reuse the object instead (and it also gives us a stable way to identify a transition). This PR changes the implementation to reuse the transition object instead of creating a new one
Configuration menu - View commit details
-
Copy full SHA for deab126 - Browse repository at this point
Copy the full SHA deab126View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e35b50 - Browse repository at this point
Copy the full SHA 8e35b50View commit details
Commits on Jul 7, 2022
-
[DevTools][Bugfix] Fix DevTools Perf Issue When Unmounting Large Reac…
…t Subtrees (#24863) We've recently had multiple reports where, if React DevTools was installed, unmounting large React subtrees would take a huge performance hit (ex. from 50ms to 7 seconds). Digging in more, we realized for every fiber that unmounts, we called `untrackFibers`, which calls `clearTimeout` (and does some work manipulating a set, but this wasn't the bulk of the time). We ten call `recordUnmount`, which adds the timer back. Adding and removing the timer so many times was taking upwards of 50ms per timer add/remove call, which was resulting in exorbitant amounts of time spent in DevTools deleting subtrees. It looks like we are calling `untrackFibers` so many times to avoid a race condition with Suspense children where we unmount them twice (first a "virtual" unmount when the suspense boundary is toggled from visible to invisible, and then an actual unmount when the new children are rendered) without modifying `fiberIDMap`. We can fix this race condition by using the `untrackFibersSet` as a lock and not calling `recordUnmount` if the fiber is in the set and hasn't been processed yet. This works because the only way fibers are added in the set is via `recordUnmount` anyway. This PR also adds a test to make sure this change doesn't regress the previous behavior. **Before**  **After** 
Configuration menu - View commit details
-
Copy full SHA for c3b1857 - Browse repository at this point
Copy the full SHA c3b1857View commit details -
Delete Partial Renderer SSR implementation (#24868)
This removes the old server rendering implementation (the "Partial Renderer"). It was replaced in React 18 with a new streaming implementation (Fizz). We hadn't removed it from the codebase yet because Facebook hadn't finished rolling out Fizz in production; it's been behind a feature flag while we run performance tests and migrate our internal infrastructure. The diff to land Fizz will land imminently, and once it does, we can merge this commit.
Configuration menu - View commit details
-
Copy full SHA for 95e22ff - Browse repository at this point
Copy the full SHA 95e22ffView commit details
Commits on Jul 8, 2022
-
Defer setState callbacks until component is visible (#24872)
A class component `setState` callback should not fire if a component is inside a hidden Offscreen tree. Instead, it should wait until the next time the component is made visible.
Configuration menu - View commit details
-
Copy full SHA for 5e4e2da - Browse repository at this point
Copy the full SHA 5e4e2daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 30eb267 - Browse repository at this point
Copy the full SHA 30eb267View commit details -
[Transition Tracing] Add onTransitionProgress Callback (#24833)
This PR adds support for `onTransitionProgress` (`onTransitionProgress(transitionName: string, startTime: number, currentTime: number, pending: Array<{name: null | string}>)`) We call this callback when: * When **a child suspense boundary of the transition commits in a fallback state**. Only the suspense boundaries that are triggered and commit in a fallback state when the transition first occurs (and all subsequent suspense boundaries in the initial suspense boundary's subtree) are considered a part of the transition * **A child suspense boundary of the transition resolves** When we call `onTransitionProgress`, we call the function with a `pending` array. This array contains the names of the transition's suspense boundaries that are still in a fallback state
Configuration menu - View commit details
-
Copy full SHA for 80208e7 - Browse repository at this point
Copy the full SHA 80208e7View commit details -
[Transition Tracing] Tracing Marker Name Change in Update Warning (#2…
…4873) We should only support Tracing Marker's name field during component mount. This PR adds a warning if the Tracing Marker's name changes during an update.
Configuration menu - View commit details
-
Copy full SHA for dd2d652 - Browse repository at this point
Copy the full SHA dd2d652View commit details
Commits on Jul 11, 2022
-
[Transition Tracing] Don't call transition callbacks if no transition…
… name specified (#24887) This PR checks to see if `transition.name` is defined before adding the transition so we avoid doing unnecessary work for transitions without a transition name
Configuration menu - View commit details
-
Copy full SHA for e225fa4 - Browse repository at this point
Copy the full SHA e225fa4View commit details
Commits on Jul 12, 2022
-
Move ref commit effects inside switch statement
Only certain fiber types can have refs attached to them, so this moves the Ref effect logic out of the common path and into the corresponding branch of the layout phase's switch statement. The types of fibers this affects are host components and class components. Function components are not affected because they can only have a ref via useImperativeHandle, which has a different implementation. The experimental Scope type attaches its refs in the mutation phase, not the layout phase.
Configuration menu - View commit details
-
Copy full SHA for b8c96b1 - Browse repository at this point
Copy the full SHA b8c96b1View commit details
There are no files selected for viewing