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: react/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 280ff6fe
Choose a base ref
...
head repository: react/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b6c0aa88
Choose a head ref
  • 12 commits
  • 56 files changed
  • 6 contributors

Commits on Jun 7, 2025

  1. Configuration menu
    Copy the full SHA
    b3d5e90 View commit details
    Browse the repository at this point in the history
  2. [Fizz] Add Web Streams to Fizz Node entry point (#33475)

    New take on #33441.
    
    This uses a wrapper instead of a separate bundle.
    sebmarkbage authored Jun 7, 2025
    Configuration menu
    Copy the full SHA
    65ec57d View commit details
    Browse the repository at this point in the history
  3. [Flight] Add Web Stream support to the Flight Server in Node (#33474)

    This needs some tweaks to the implementation and a conversion but simple
    enough.
    
    ---------
    
    Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
    sebmarkbage and unstubbable authored Jun 7, 2025
    Configuration menu
    Copy the full SHA
    9666605 View commit details
    Browse the repository at this point in the history
  4. [Flight] Add "use ..." boundary after the change instead of before it (…

    …#33478)
    
    I noticed that the ThirdPartyComponent in the fixture was showing the
    wrong stack and the `"use third-party"` is in the wrong location.
    
    <img width="628" alt="Screenshot 2025-06-06 at 11 22 11 PM"
    src="https://github.com/user-attachments/assets/f0013380-d79e-4765-b371-87fd61b3056b"
    />
    
    When creating the initial JSX inside the third party server, we should
    make sure that it has no owner. In a real cross-server environment you
    get this by default by just executing in different context. But since
    the fixture example is inside the same AsyncLocalStorage as the parent
    it already has an owner which gets transferred. So we should make sure
    that were we create the JSX has no owner to simulate this.
    
    When we then parse a null owner on the receiving side, we replace its
    owner/stack with the owner/stack of the call to `createFrom...` to
    connect them. This worked fine with only two environments. The bug was
    that when we did this and then transferred the result to a third
    environment we took the original parsed stack trace. We should instead
    parse a new one from the replaced stack in the current environment.
    
    The second bug was that the `"use third-party"` badge ends up in the
    wrong place when we do this kind of thing. Because the stack of the
    thing entering the new environment is the call to `createFrom...` which
    is in the old environment even though the component itself executes in
    the new environment. So to see if there's a change we should be
    comparing the current environment of the task to the owner's environment
    instead of the next environment after the task.
    
    After:
    
    <img width="494" alt="Screenshot 2025-06-07 at 1 13 28 AM"
    src="https://github.com/user-attachments/assets/e2e870ba-f125-4526-a853-bd29f164cf09"
    />
    sebmarkbage authored Jun 7, 2025
    Configuration menu
    Copy the full SHA
    b367b60 View commit details
    Browse the repository at this point in the history
  5. [Flight] Clarify Semantics for Awaiting Cached Data (#33438)

    Technically the async call graph spans basically all the way back to the
    start of the app potentially, but we don't want to include everything.
    Similarly we don't want to include everything from previous components
    in every child component. So we need some heuristics for filtering out
    data.
    
    We roughly want to be able to inspect is what might contribute to a
    Suspense loading sequence even if it didn't this time e.g. due to a race
    condition.
    
    One flaw with the previous approach was that awaiting a cached promise
    in a sibling that happened to finish after another sibling would be
    excluded. However, in a different race condition that might end up being
    used so I wanted to include an empty "await" in that scenario to have
    some association from that component.
    
    However, for data that resolved fully before the request even started,
    it's a little different. This can be things that are part of the start
    up sequence of the app or externally cached data. We decided that this
    should be excluded because it doesn't contribute to the loading sequence
    in the expected scenario. I.e. if it's cached. Things that end up being
    cache misses would still be included. If you want to test externally
    cached data misses, then it's up to you or the framework to simulate
    those. E.g. by dropping the cache. This also helps free up some noise
    since static / cached data can be excluded in visualizations.
    
    I also apply this principle to forwarding debug info. If you reuse a
    cached RSC payload, then the Server Component render time and its awaits
    gets clamped to the caller as if it has zero render/await time. The I/O
    entry is still back dated but if it was fully resolved before we started
    then it's completely excluded.
    sebmarkbage authored Jun 7, 2025
    Configuration menu
    Copy the full SHA
    6c8bcda View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e4b88ae View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2025

  1. Configuration menu
    Copy the full SHA
    c0b5a0c View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2025

  1. feat(ReactNative): prioritize attribute config process function to …

    …allow processing function props (#32119)
    
    ## Summary
    
    In react-native props that are passed as function get converted to a
    boolean (`true`). This is the default pattern for event handlers in
    react-native.
    However, there are reasons for why you might want to opt-out of this
    behavior, and instead, pass along the actual function as the prop.
    Right now, there is no way to do this, and props that are functions
    always get set to `true`.
    The `ViewConfig` attributes already have the API for a `process`
    function. I simply moved the check for the process function up, so if a
    ViewConfig's prop attribute configured a process function this is always
    called first.
    This provides an API to opt out of the default behavior. 
    
    This is the accompanied PR for react-native:
    
    - react/react-native#48777
    
    ## How did you test this change?
    
    <!--
    Demonstrate the code is solid. Example: The exact commands you ran and
    their output, screenshots / videos if the pull request changes the user
    interface.
    How exactly did you verify that your PR solves the issue you wanted to
    solve?
      If you leave this empty, your PR will very likely be closed.
    -->
    
    I modified the code manually in a template react-native app and
    confirmed its working. This is a code path you only need in very special
    cases, thus it's a bit hard to provide a test for this. I recorded a
    video where you can see that the changes are active and the prop is
    being passed as native value.
    
    For this I created a custom native component with a view config that
    looked like this:
    
    ```js
    const viewConfig = {
      uiViewClassName: 'CustomView',
      bubblingEventTypes: {},
      directEventTypes: {},
      validAttributes: {
        nativeProp: {
          process: (nativeProp) => {
    		// Identity function that simply returns the prop function callback
            // to opt out of this prop being set to `true` as its a function
            return nativeProp
          },
        },
      },
    }
    ```
    
    
    
    https://github.com/user-attachments/assets/493534b2-a508-4142-a760-0b1b24419e19
    
    Additionally I made sure that this doesn't conflict with any existing
    view configs in react native. In general, this shouldn't be a breaking
    change, as for existing view configs it didn't made a difference if you
    simply set `myProp: true` or `myProp: { process: () => {...} }` because
    as soon as it was detected that the prop is a function the config
    wouldn't be used (which is what this PR fixes).
    Probably everyone, including the react-native core components use
    `myProp: true` for callback props, so this change should be fine.
    hannojg authored Jun 9, 2025
    Configuration menu
    Copy the full SHA
    911dbd9 View commit details
    Browse the repository at this point in the history
  2. Format ReactNativeAttributePayloadFabric.js with Prettier (#33486)

    The prettier check for this file is currently failing on `main`, after
    #32119 was merged.
    unstubbable authored Jun 9, 2025
    Configuration menu
    Copy the full SHA
    95bcf87 View commit details
    Browse the repository at this point in the history
  3. [compiler] Don't include useEffectEvent values in autodeps (#33450)

    Summary: useEffectEvent values are not meant to be added to the dep
    array
    jbrown215 authored Jun 9, 2025
    Configuration menu
    Copy the full SHA
    4df098c View commit details
    Browse the repository at this point in the history
  4. [Flight] Simulate fetch to third party in fixture (#33484)

    This adds some I/O to go get the third party thing to test how it
    overlaps.
    
    With #33482, this is what it looks like. The await gets cut off when the
    third party component starts rendering. I.e. after the latency to start.
    
    <img width="735" alt="Screenshot 2025-06-08 at 5 42 46 PM"
    src="https://github.com/user-attachments/assets/f68d9a84-05a1-4125-b3f0-8f3e4eaaa5c1"
    />
    
    This doesn't fully simulate everything because it should actually also
    simulate each chunk of the stream coming back too. We could wrap the
    ReadableStream to simulate that. In that scenario, it would probably get
    some awaits on the chunks at the end too.
    sebmarkbage authored Jun 9, 2025
    Configuration menu
    Copy the full SHA
    428ab82 View commit details
    Browse the repository at this point in the history
  5. [compiler]: fix link compiler & 4 broken tests from path containing s…

    …paces (#33409)
    
    ## Summary
    
    Problem #1: Running the `link-compiler.sh` bash script via `"prebuild"`
    script fails if a developer has cloned the `react` repo into a folder
    that contains _any_ spaces. 3 tests fail because of this.
    
    <img width="1003" alt="fail-1"
    src="https://github.com/user-attachments/assets/1fbfa9ce-4f84-48d7-b49c-b6e967b8c7ca"
    />
    <img width="1011" alt="fail-2"
    src="https://github.com/user-attachments/assets/0a8c6371-a2df-4276-af98-38f4784cf0da"
    />
    <img width="1027" alt="fail-3"
    src="https://github.com/user-attachments/assets/1c4f4429-800c-4b44-b3da-a59ac85a16b9"
    />
    
    For example, my current folder is:
    `/Users/wes/Development/Open Source Contributions/react`
    
    The link compiler error returns:
    `./scripts/react-compiler/link-compiler.sh: line 15: cd:
    /Users/wes/Development/Open: No such file or directory`
    
    Problem #2: 1 test in `ReactChildren-test.js` fails due the existing
    stack trace regex which should be lightly revised.
    
    `([^(\[\n]+)[^\n]*/g` is more robust for stack traces: it captures the
    function/class name (with dots) and does not break on spaces in file
    paths.
    `([\S]+)[^\n]*/g` is simpler but breaks if there are spaces and doesn't
    handle dotted names well.
    
    Additionally, we trim the whitespace off the name to resolve extra
    spaces breaking this test as well:
    
    ```
    -     in div (at **)
    +     in div  (at **)
    ```
    
    <img width="987" alt="fail-4"
    src="https://github.com/user-attachments/assets/56a673bc-513f-4458-95b2-224129c77144"
    />
    
    All of the above tests pass if I hyphenate my local folder:
    `/Users/wes/Development/Open-Source-Contributions/react`
    
    I selfishly want to keep spaces in my folder names. 🫣
    
    ## How did you test this change?
    
    **npx yarn prebuild**
    
    Before:
    <img width="896" alt="Screenshot at Jun 01 11-42-56"
    src="https://github.com/user-attachments/assets/4692775c-1e5c-4851-9bd7-e12ed5455e47"
    />
    
    After:
    <img width="420" alt="Screenshot at Jun 01 11-43-42"
    src="https://github.com/user-attachments/assets/4e303c00-02b7-4540-ba19-927b2d7034fb"
    />
    
    **npx yarn test**
    **npx yarn test
    ./packages/react/src/\_\_tests\_\_/ReactChildren-test.js**
    **npx yarn test -r=xplat --env=development --variant=true --ci
    --shard=3/5**
    
    Before:
    <img width="438" alt="before"
    src="https://github.com/user-attachments/assets/f5eedb22-18c3-4124-a04b-daa95c0f7652"
    />
    
    After:
    <img width="439" alt="after"
    src="https://github.com/user-attachments/assets/a94218ba-7c6a-4f08-85d3-57540e9d0029"
    />
    
    <img width="650" alt="Screenshot at Jun 02 18-03-39"
    src="https://github.com/user-attachments/assets/3eae993c-a56b-46c8-ae02-d249cb053fe7"
    />
    
    <img width="685" alt="Screenshot at Jun 03 12-53-47"
    src="https://github.com/user-attachments/assets/5b2caa33-d3dc-4804-981d-52cb10b6226f"
    />
    wlemahieu authored Jun 9, 2025
    Configuration menu
    Copy the full SHA
    b6c0aa8 View commit details
    Browse the repository at this point in the history
Loading