Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7deda941
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3958d5d8
Choose a head ref
  • 12 commits
  • 34 files changed
  • 4 contributors

Commits on Aug 5, 2025

  1. [DevTools] Reorder moved filtered Fibers with backing DevToolsInstance (

    #34104)
    
    Instead, we just continue to collect the unfiltered children.
    
    ---------
    
    Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
    sebmarkbage and eps1lon authored Aug 5, 2025
    Configuration menu
    Copy the full SHA
    99fd4f2 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2025

  1. [DevTools] Disconnect and Reconnect children of Suspense boundaries i…

    …nstead of Unmounting and Mounting (#34089)
    
    Stacked on #34082.
    
    This keeps the DevToolsInstance children alive inside Offscreen trees
    while they're hidden. However, they're sent as unmounted to the front
    end store.
    
    This allows DevTools state to be preserved between these two states.
    
    Such as it keeps the "suspended by" set on the SuspenseNode alive since
    the children are still mounted. So now you when you resuspend, you can
    see what in the children was suspended. This is useful when you're
    simulating a suspense but can also be a bit misleading when something
    suspended for real since it'll only show the previous suspended set and
    not what is currently suspending it since that hasn't committed yet.
    
    SuspenseNodes inside resuspended trees are now kept alive too. That way
    they can contribute to the timeline even when resuspended. We can choose
    whether to keep them visible in the rects while hidden or not.
    
    In the future we'll also need to add more special cases around Activity.
    Because right now if SuspenseNodes are kept alive in the Suspense tab UI
    while hidden, then they're also alive inside Activity that are hidden
    which maybe we don't want. Maybe simplest would be that they both
    disappear from the Suspense tab UI but can be considered for the
    timeline.
    
    Another case is that when Activity goes hidden, Fiber will no longer
    cause its content to suspend the parent but that's not modeled here. So
    hidden Activity will show up as "suspended by" in a parent Suspense.
    When they disconnect, they should really be removed from the "suspended
    by" set of the parent (and perhaps be shown only on the Activity
    boundary itself).
    sebmarkbage authored Aug 6, 2025
    Configuration menu
    Copy the full SHA
    c97ec75 View commit details
    Browse the repository at this point in the history
  2. [DevTools] Prefer I/O stack and show await stack after only if it's a…

    … different owner (#34101)
    
    Stacked on #34094.
    
    This shows the I/O stack if available. If it's not available or if it
    has a different owner (like if it was passed in) then we show the
    `"awaited at:"` stack below it so you can see where it started and where
    it was awaited. If it's the same owner this tends to be unnecessary
    noise. We could maybe be smarter if the stacks are very different then
    you might want to show both even with the same owner.
    
    <img width="517" height="478" alt="Screenshot 2025-08-04 at 11 57 28 AM"
    src="https://github.com/user-attachments/assets/2dbfbed4-4671-4a5f-8e6e-ebec6fe8a1b7"
    />
    
    Additionally, this adds an inferred await if there's no owner and no
    stack for the await. The inferred await of a function/class component is
    just the owner. No stack. Because the stack trace would be the return
    value. This will also be the case if you use throw-a-Promise. The
    inferred await in the child position of a built-in is the JSX location
    of that await like if you pass a promise to a child. This inference
    already happens when you pass a Promise from RSC so in this case it
    already has an await - so this is mainly for client promises.
    sebmarkbage authored Aug 6, 2025
    Configuration menu
    Copy the full SHA
    0825d01 View commit details
    Browse the repository at this point in the history
  3. [DevTools] Sort "Suspended By" view by the start time (#34105)

    or end time if they have the same start time.
    
    <img width="517" height="411" alt="Screenshot 2025-08-04 at 4 00 23 PM"
    src="https://github.com/user-attachments/assets/b99be67b-5727-4e24-98c0-ee064fb21e2f"
    />
    
    They would typically appear in this order naturally but not always.
    Especially in Suspense boundaries where the order can also be depended
    on when the components are discovered.
    sebmarkbage authored Aug 6, 2025
    Configuration menu
    Copy the full SHA
    66f09bd View commit details
    Browse the repository at this point in the history
  4. [DevTools] Source Map Stack Traces such in await locations (#34094)

    Stacked on #34093.
    
    Instead of using the original `ReactStackTrace` that has the call sites
    on the server, this parses the `Error` object which has the virtual call
    sites on the client. We'll need this technique for things stack traces
    suspending on the client anyway like `use()`.
    
    We can then use these callsites to source map in the front end.
    
    We currently don't source map function names but might be useful for
    this use case as well as getting original component names from prod.
    
    One thing this doesn't do yet is that it doesn't ignore list the stack
    traces on the client using the source map's ignore list setting. It's
    not super important since we expect to have already ignore listed on the
    server but this will become important for client stack traces like
    `use()`.
    sebmarkbage authored Aug 6, 2025
    Configuration menu
    Copy the full SHA
    b080063 View commit details
    Browse the repository at this point in the history
  5. [DevTools] Measure the Rectangle of Suspense boundaries as we reconci…

    …le (#34090)
    
    Stacked on #34089.
    
    This measures the client rects of the direct children of Suspense
    boundaries as we reconcile. This will be used by the Suspense tab to
    visualize the boundaries given their outlines.
    
    We could ask for this more lazily just in case we're currently looking
    at the Suspense tab. We could also do something like monitor the sizes
    using a ResizeObserver to cover when they change.
    
    However, it should be pretty cheap to this in the reconciliation phase
    since we're already mostly visiting these nodes on the way down. We have
    also already done all the layouts at this point since it was part of the
    commit phase and paint already. So we're just reading cached values in
    this phase. We can also infer that things are expected to change when
    parents or sibling changes. Similar technique as ViewTransitions.
    sebmarkbage authored Aug 6, 2025
    Configuration menu
    Copy the full SHA
    fa212fc View commit details
    Browse the repository at this point in the history
  6. [compiler] Upstream experimental flow integration (#34121)

    all credit on the Flood/ code goes to @mvitousek and @jbrown215, i'm
    just the one upstreaming it
    josephsavona authored Aug 6, 2025
    1 Configuration menu
    Copy the full SHA
    c403a7c View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2025

  1. Configuration menu
    Copy the full SHA
    f468d37 View commit details
    Browse the repository at this point in the history
  2. [DevTools] fix: handle store mutations synchronously in TreeContext (#…

    …34119)
    
    If there is a commit that removes the currently inspected (selected)
    elements in the Components tree, we are going to kick off the transition
    to re-render the Tree. The elements will be re-rendered with the
    previous inspectedElementID, which was just removed and all consecutive
    calls to store object with this id would produce errors, since this
    element was just removed.
    
    We should handle store mutations synchronously. Doesn't make sense to
    start a transition in this case, because Elements depend on the
    TreeState and could make calls to store in render function.
    
    Before:
    <img width="2286" height="1734" alt="Screenshot 2025-08-06 at 17 41 14"
    src="https://github.com/user-attachments/assets/97d92220-3488-47b2-aa6b-70fa39345f6b"
    />
    
    
    After:
    
    
    https://github.com/user-attachments/assets/3da36aff-6987-4b76-b741-ca59f829f8e6
    hoxyq authored Aug 7, 2025
    Configuration menu
    Copy the full SHA
    552a5da View commit details
    Browse the repository at this point in the history
  3. [Fiber] Try to give a stack trace to every entry in the Scheduler Per…

    …formance Track (#34123)
    
    For "render" and "commit" phases we don't give any specific stack atm.
    This tries to always provide something useful to say the cause of the
    render.
    
    For normal renders this will now show the same thing as the "Event" and
    "Update" entries already showed. We stash the task that was used for
    those and use them throughout the render and commit phases.
    
    For Suspense (Retry lane) and Idle (Offscreen lane), we don't have any
    updates. Instead for those there's a component that left work behind in
    previous passes. For those I use the debugTask of the `<Suspense>` or
    `<Activity>` boundary to indicate that this was the root of the render.
    
    Similarly when an Action is invoked on a `<form action={...}>` component
    using the built-in submit handler, there's no actionable stack in user
    space that called it. So we use the stack of the JSX for the form
    instead.
    sebmarkbage authored Aug 7, 2025
    Configuration menu
    Copy the full SHA
    4c9c109 View commit details
    Browse the repository at this point in the history
  4. [DevTools] Add Badge to Owners and sometimes stack traces (#34106)

    Stacked on #34101.
    
    This adds a badge to owners if they are different from the currently
    selected component's environment.
    
    <img width="590" height="566" alt="Screenshot 2025-08-04 at 5 15 02 PM"
    src="https://github.com/user-attachments/assets/e898254f-1b4c-498e-8713-978d90545340"
    />
    
    We also add one to the end of stack traces if the stack trace has a
    different environment than the owner which can happen when you call a
    function (without rendering a component) into a third party environment
    but the owner component was in the first party.
    
    One awkward thing is that Suspense boundaries are always in the client
    environment so their Server Components are always badged.
    sebmarkbage authored Aug 7, 2025
    Configuration menu
    Copy the full SHA
    738aebd View commit details
    Browse the repository at this point in the history
  5. [Flight] Copy the name field of a serialized function debug value (#3…

    …4085)
    
    This ensures that if the name is set manually after the declaration,
    then we get that name when we log the value. For example Node.js
    `Response` is declared as `_Response` and then later assigned a new
    name.
    
    We should probably really serialize all static enumerable properties but
    "name" is non-enumerable so it's still a special case.
    sebmarkbage authored Aug 7, 2025
    Configuration menu
    Copy the full SHA
    3958d5d View commit details
    Browse the repository at this point in the history
Loading