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: 7283a213
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79ddf5b5
Choose a head ref
  • 10 commits
  • 53 files changed
  • 6 contributors

Commits on Dec 9, 2024

  1. [compiler] Support for context variable loop iterators

    Summary:
    Fixing a compiler todo
    
    ghstack-source-id: c4d9226
    Pull Request resolved: #31709
    mvitousek committed Dec 9, 2024
    Configuration menu
    Copy the full SHA
    226b859 View commit details
    Browse the repository at this point in the history
  2. [compiler] Support for non-declatation for in/of iterators

    ghstack-source-id: a28801e
    Pull Request resolved: #31710
    mvitousek committed Dec 9, 2024
    Configuration menu
    Copy the full SHA
    76d603a View commit details
    Browse the repository at this point in the history
  3. [Flight] Extract special cases for Server Component return value posi…

    …tion (#31713)
    
    This is just moving some code into a helper.
    
    We have a bunch of special cases for the return value slot of a Server
    Component that's different from just rendering that inside an object.
    This was getting a little tricky to reason about inline with the rest of
    rendering.
    sebmarkbage authored Dec 9, 2024
    Configuration menu
    Copy the full SHA
    3d2ab01 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2024

  1. Update ReactDebugInfo types to declare timing info separately (#31714)

    This clarifies a few things by ensuring that there is always at least
    one required field. This can be used to refine the object to one of the
    specific types. However, it's probably just a matter of time until we
    make this tagged unions instead. E.g. it would be nice to rename the
    `name` field `ReactComponentInfo` to `type` and tag it with the React
    Element symbol because then it's just the same as a React Element.
    
    I also extract a time field. The idea is that this will advance (or
    rewind) the time to the new timestamp and then anything below would be
    defined as happening within that time stamp. E.g. to model the start and
    end for a server component you'd do something like:
    
    ```
    [
      {time: 123},
      {name: 'Component', ... },
      {time: 124},
    ]
    ```
    
    The reason this needs to be in the `ReactDebugInfo` is so that timing
    information from one environment gets transferred into the next
    environment. It lets you take a Promise from one world and transfer it
    into another world and its timing information is preserved without
    everything else being preserved.
    
    I've gone back and forth on if this should be part of each other Info
    object like `ReactComponentInfo` but since those can be deduped and can
    change formats (e.g. this should really just be a React Element) it's
    better to store this separately.
    
    The time format is relative to a `timeOrigin` which is the current
    environment's `timeOrigin`. When it's serialized between environments
    this needs to be considered.
    
    Emitting these timings is not yet implemented in this PR.
    
    ---------
    
    Co-authored-by: eps1lon <sebastian.silbermann@vercel.com>
    sebmarkbage and eps1lon authored Dec 10, 2024
    Configuration menu
    Copy the full SHA
    372ec00 View commit details
    Browse the repository at this point in the history
  2. Clean up findFiberByHostInstance from DevTools Hook (#31711)

    The need for this was removed in
    #30831
    
    Since the new DevTools version has been released for a while and we
    expect people to more or less auto-update. Future versions of React
    don't need this.
    
    Once we remove the remaining uses of `getInstanceFromNode` e.g. in the
    deprecated internal `findDOMNode`/`findNodeHandle` and the event system,
    we can completely remove the tagging of DOM nodes.
    sebmarkbage authored Dec 10, 2024
    Configuration menu
    Copy the full SHA
    3b597c0 View commit details
    Browse the repository at this point in the history
  3. [Flight] Don't call onError/onPostpone when halting and unify error b…

    …ranches (#31715)
    
    We shouldn't call onError/onPostpone when we halt a stream because that
    node didn't error yet. Its digest would also get lost.
    
    We also have a lot of error branches now for thenables and streams. This
    unifies them under erroredTask. I'm not yet unifying the cases that
    don't allocate a task for the error when those are outlined.
    sebmarkbage authored Dec 10, 2024
    Configuration menu
    Copy the full SHA
    4a8fc0f View commit details
    Browse the repository at this point in the history
  4. [Flight] rename prerender to unstable_prerender and include in s…

    …table channel (#31724)
    
    We added an experimental `prerender` API to flight. This change exposes
    this API in stable channels prefixed as `unstable_prerender`. We have
    high confidence this API should exist but because we have not yet
    settled on how to handle resuming/replaying of RSC streams we may need
    to change the API contract to suit future needs. This release will allow
    us to get more usage out of the existing implemented functionality
    without requiring you to use experimental builds which will open up
    greater adoption and opportunity for feedback.
    
    the `prerender` implementation is documented in the `react-server`
    package. As with all RSC APIs implemented in bundler specific binding
    packages these aren't intended to be called by end users but instead be
    used by frameworks implementing React Server Components.
    
    Previously `prerender` was exposed unprefixed and only in the
    experimental channel. This PR renames the export across all channels to
    `unstable_prerender` so users of this previously unprefixed api will
    need to update to the unstable form. This isn't a breaking change
    because it was only exposed in the experimental channel which does not
    follow semver. The reason we don't expose it under both names is that
    users may feature detect the unprefixed form and then when we finally do
    ship it as unprefixed we may change the function signature and break
    this code. Changing the name now is much safer.
    gnoff authored Dec 10, 2024
    Configuration menu
    Copy the full SHA
    7cb356e View commit details
    Browse the repository at this point in the history
  5. [compiler] Fix dropped ref with spread props in InlineJsxTransform (#…

    …31726)
    
    When supporting ref as prop in
    #31558, I missed fixing the
    optimization to pass a spread-props-only props object in without an
    additional object copy. In the case that we have only a ref along with a
    spread, we cannot return only the spread object. This results in
    dropping the ref.
    
    In this example
    ```javascript
    <Foo ref={ref} {...props} />
    ```
    
    The bugged output is:
    ```javascript
    {
      // ...
      props: props
    }
    ```
    
    With this change we now get the correct output:
    ```javascript
    {
      // ...
      props: {ref: ref, ...props}
    }
    ```
    jackpope authored Dec 10, 2024
    Configuration menu
    Copy the full SHA
    16367ce View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7c4a7c9 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2024

  1. [Flight] Track Timing Information (#31716)

    Stacked on #31715.
    
    This adds profiling data for Server Components to the RSC stream (but
    doesn't yet use it for anything). This is on behind
    `enableProfilerTimer` which is on for Dev and Profiling builds. However,
    for now there's no Profiling build of Flight so in practice only in DEV.
    It's gated on `enableComponentPerformanceTrack` which is experimental
    only for now.
    
    We first emit a timeOrigin in the beginning of the stream. This provides
    us a relative time to emit timestamps against for cross environment
    transfer so that we can log it in terms of absolute times. Using this as
    a separate field allows the actual relative timestamps to be a bit more
    compact representation and preserves floating point precision.
    
    We emit a timestamp before emitting a Server Component which represents
    the start time of the Server Component. The end time is either when the
    next Server Component starts or when we finish the task.
    
    We omit the end time for simple tasks that are outlined without Server
    Components.
    
    By encoding this as part of the debugInfo stream, this information can
    be forwarded between Server to Server RSC.
    sebmarkbage authored Dec 11, 2024
    Configuration menu
    Copy the full SHA
    79ddf5b View commit details
    Browse the repository at this point in the history
Loading