Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify React DevTools for Replay integration #2

Closed
wants to merge 2,918 commits into from
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Apr 26, 2024

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

Commits on Apr 27, 2024

  1. Configuration menu
    Copy the full SHA
    8090457 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    190cc99 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. [react-native] Add unit test to ReactNativeAttributePayload (facebook…

    …#28955)
    
    ## Summary
    
    I'm looking at cleaning up some unnecessary manual property flattening
    in React Native and wanted to verify this behaviour is working as
    expected, where properties from nested objects will always overwrite
    properties from the base object.
    
    ## How did you test this change?
    
    Unit tests
    javache authored Apr 30, 2024
    Configuration menu
    Copy the full SHA
    d779eba View commit details
    Browse the repository at this point in the history
  2. Move useMemoCache hook to react/compiler-runtime (facebook#28954)

    Move useMemoCache hook to react/compiler-runtime
    
    For Meta-internal purposes, we keep the export on `react` itself to
    reduce churn.
    kassens authored Apr 30, 2024
    Configuration menu
    Copy the full SHA
    4508873 View commit details
    Browse the repository at this point in the history
  3. Dynamically detect reanimated plugin

    Enables the Reanimated flag automatically if we find reanimated in the
    user's list of plugins
    
    ghstack-source-id: 20e83374612362a30d6c8cc7a903d9320e8cc23a
    Pull Request resolved: facebook/react-forget#2915
    poteto committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    86e0f87 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Remove duplicated hermes-parser

    ghstack-source-id: 79f3319d87909d05731ef821d0ffe86cb01b0432
    Pull Request resolved: facebook/react-forget#2920
    poteto committed May 1, 2024
    Configuration menu
    Copy the full SHA
    fddc015 View commit details
    Browse the repository at this point in the history
  2. [healthcheck] Add status message

    Show compiling status message and not just block
    UI.
    
    ghstack-source-id: 67761c5d32216e105c4aa6404dfa07d76ae22583
    Pull Request resolved: https://github.com/facebook/react-forget/pull/2921
    gsathya committed May 1, 2024
    Configuration menu
    Copy the full SHA
    c88d356 View commit details
    Browse the repository at this point in the history
  3. [healthcheck] Check for StrictMode

    ghstack-source-id: f05222073be785b77346c4e8760bf4d0bb4d658e
    Pull Request resolved: https://github.com/facebook/react-forget/pull/2922
    gsathya committed May 1, 2024
    Configuration menu
    Copy the full SHA
    36d7755 View commit details
    Browse the repository at this point in the history
  4. [healthcheck] Check for incompatible libraries

    Add a configurable list of known incompatible libraries.
    
    Check all package.jsons for any uses of known incompatible libraries and
    warn if found.
    
    ghstack-source-id: 7329e3792b57458e681780cba3140a14a9b1a60d
    Pull Request resolved: https://github.com/facebook/react-forget/pull/2923
    gsathya committed May 1, 2024
    Configuration menu
    Copy the full SHA
    c464445 View commit details
    Browse the repository at this point in the history
  5. [healthcheck] Refactor checks into separate files

    Makes it easier to extend later, if we want to add more checks.
    
    ghstack-source-id: 6fb3435555f1b988e1a185bfda8be9418eb622c5
    Pull Request resolved: https://github.com/facebook/react-forget/pull/2924
    gsathya committed May 1, 2024
    Configuration menu
    Copy the full SHA
    4ce5c56 View commit details
    Browse the repository at this point in the history
  6. [hir] Mark MethodCalls as escaping

    Treat MethodCalls similar to general CallExpressions and mark them
    as escaping in PruneNonEscapingScopes pass.
    
    ghstack-source-id: 3c81bdb17f58fbeef8be24e7cb363172d1867217
    Pull Request resolved: https://github.com/facebook/react-forget/pull/2925
    gsathya committed May 1, 2024
    Configuration menu
    Copy the full SHA
    85e6e9b View commit details
    Browse the repository at this point in the history
  7. Update babel plugin to use runtime from react/compiler-runtime (faceb…

    …ook#2918)
    
    This uses the compiler runtime from `react/compiler-runtime` by default unless `compilerRuntime` is specifified in the Babel options which then imports the runtime from there. The `useMemoCache` hook is now named `c` in accordance with facebook@4508873
    
    Unfortunately, I couldn't figure out how to import `react@beta` which already has that import as various react verstions were conflicting. If someone can figure this out it'd be fantastic. As a result, I had to update the default for the test runner to default the `compilerRuntime` option to `react` to preserve the previous behavior to import from `react`. Once upgraded to React 19, we should be able to remove that override.
    kassens committed May 1, 2024
    Configuration menu
    Copy the full SHA
    ebe58ee View commit details
    Browse the repository at this point in the history
  8. Don't compile node_modules by default

    To make a first time setup of the compiler truly config-less, default to
    not compiling node_modules unless a user provided `sources` (advanced
    option) is provided
    
    ghstack-source-id: b0798052404d772ce6ee471e577699d4b0871d56
    Pull Request resolved: facebook/react-forget#2919
    poteto committed May 1, 2024
    Configuration menu
    Copy the full SHA
    f93529e View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Configuration menu
    Copy the full SHA
    29d3c83 View commit details
    Browse the repository at this point in the history
  2. [Tooling] Update critical artifact list (facebook#28966)

    When a React PR is opened CI will report large size changes. But for
    critical packages like react-dom it reports always. In React 19 we moved
    the build for react-dom the client reconciler from react-dom to
    react-dom/client
    
    This change adds react-dom-client artifacts for stable and oss channels
    since that is originally what was being tracked. But since
    react-dom/client always imports react-dom I left the original react-dom
    packages as critical as well. They are small but it would be good to
    keep an eye on them
    gnoff authored May 2, 2024
    Configuration menu
    Copy the full SHA
    c7b1ae5 View commit details
    Browse the repository at this point in the history
  3. Introduce a faster version of the addProperties function (facebook#28969

    )
    
    ## Summary
    
    This PR introduces a faster version of the `addProperties` function.
    This new function is basically the `diffProperties` with `prevProps` set
    to `null`, propagated constants, and all the unreachable code paths
    collapsed.
    
    ## How did you test this change?
    
    I've tested this change with [the benchmark
    app](https://github.com/react-native-community/RNNewArchitectureApp/tree/new-architecture-benchmarks)
    and got ~4.4% improvement in the view creation time.
    dmytrorykun authored May 2, 2024
    Configuration menu
    Copy the full SHA
    73bcdfb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c44e9d1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    14f71db View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f5f2799 View commit details
    Browse the repository at this point in the history
  7. Rename babel plugin

    ghstack-source-id: bb66913e2d3c814696311371ed655f3da03d1199
    Pull Request resolved: facebook/react-forget#2926
    josephsavona committed May 2, 2024
    Configuration menu
    Copy the full SHA
    48e0c70 View commit details
    Browse the repository at this point in the history
  8. Update references to Forget to React Compiler

    ghstack-source-id: cce73f26b7b3903b8d79b70dbc24cbee09693d81
    Pull Request resolved: facebook/react-forget#2927
    josephsavona committed May 2, 2024
    Configuration menu
    Copy the full SHA
    b844766 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Rename {r,R}unReactForgetBabelPlugin

    ghstack-source-id: e7f00aab61dd749dc6ba11ce7e4d14603bfeeab9
    Pull Request resolved: facebook/react-forget#2928
    josephsavona committed May 3, 2024
    Configuration menu
    Copy the full SHA
    95e3cdc View commit details
    Browse the repository at this point in the history
  2. Rename ReactForgetBabelPlugin locals

    ghstack-source-id: 9cd5fe41ae322632dfeb3d5c7468268678006d94
    Pull Request resolved: facebook/react-forget#2929
    josephsavona committed May 3, 2024
    Configuration menu
    Copy the full SHA
    1c8f8bf View commit details
    Browse the repository at this point in the history
  3. Rename react-compiler-runtime

    ghstack-source-id: c6c825f5efdb4f9c413050b22b7713966871338c
    Pull Request resolved: facebook/react-forget#2931
    josephsavona committed May 3, 2024
    Configuration menu
    Copy the full SHA
    82137ec View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d618a9 View commit details
    Browse the repository at this point in the history
  5. Add flag to test fast jsx (facebook#28816)

    Following facebook#28768, add a path to testing Fast JSX on www.
    
    We want to measure the impact of Fast JSX and enable a path to testing
    before string refs are completely removed in www (which is a work in
    progress).
    
    Without `disableStringRefs`, we need to copy any object with a `ref` key
    so we can pass it through `coerceStringRef()` and copy it into the
    object. This de-opt path is what is gated behind
    `enableFastJSXWithStringRefs`.
    
    The additional checks should have no perf impact in OSS as the flags
    remain true there and the build output is not changed. For www, I've
    benchmarked the addition of the boolean checks with values cached at
    module scope. There is no significant change observed from our
    benchmarks and any latency will apply to test and control branches
    evenly. This added experiment complexity is temporary. We should be able
    to clean it up, along with the flag checks for `enableRefAsProp` and
    `disableStringRefs` shortly.
    jackpope authored May 3, 2024
    Configuration menu
    Copy the full SHA
    1beb73d View commit details
    Browse the repository at this point in the history
  6. [DevTools] Check in frontend.d.ts for react-devtools-fusebox, inclu…

    …de in build output (facebook#28970)
    
    ## Summary
    
    The `react-devtools-fusebox` private package is used in the React Native
    DevTools (Fusebox) frontend by checking build artifacts into RN's
    [fork]([`facebookexperimental/rn-chrome-devtools-frontend`](https://github.com/facebookexperimental/rn-chrome-devtools-frontend))
    of the Chrome DevTools (CDT) repo - see
    facebookexperimental/rn-chrome-devtools-frontend#22.
    
    Currently, the CDT fork also includes a [manually written TypeScript
    definition
    file](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/1d5f8d5209ac49de97aec16732169d47bf525474/front_end/third_party/react-devtools/package/frontend.d.ts)
    which describes `react-devtools-fusebox`'s API. This PR moves that file
    into the React repo, next to the implementation of
    `react-devtools-fusebox`, so we can update it atomically with changes to
    the package.
    
    As this is the first bit of TypeScript in this repo, the PR adds minimal
    support for formatting `.d.ts` files with Prettier. It also opts out
    `react-devtools-fusebox/dist/` from linting/formatting as a drive-by
    fix.
    
    For now, we'll just maintain the `.d.ts` file manually, but we could
    consider leveraging
    [`flow-api-translator`](https://www.npmjs.com/package/flow-api-translator)
    to auto-generate it in the future.
    
    ## How did you test this change?
    
    Build `react-devtools-fusebox`, observe that `dist/frontend.d.ts`
    exists.
    motiz88 authored May 3, 2024
    Configuration menu
    Copy the full SHA
    8f7dd55 View commit details
    Browse the repository at this point in the history
  7. [DevTools] Enable inspected element context menu in Fusebox (facebook…

    …#28972)
    
    ## Summary
    
    Enables the inspected element context menu in React Native DevTools
    (Fusebox).
    
    ## How did you test this change?
    
    1. `yarn build` in `react-devtools-fusebox`
    2. Copy artifacts to rn-chrome-devtools-frontend
    3. Manually test the context menu
    
    
    https://github.com/facebook/react/assets/2246565/b35cc20f-8d67-43b0-b863-7731e10fffac
    
    NOTE: The serialised values sometimes expose React internals (e.g. Hook
    data structures instead of just the values), but that seems to be a
    problem equally on web, so I'm going for native<->web parity here.
    motiz88 authored May 3, 2024
    Configuration menu
    Copy the full SHA
    e3fbb51 View commit details
    Browse the repository at this point in the history
  8. Expand the architecture doc

    ghstack-source-id: 6ab453a3c5e23677d0c178cf4ea464c7a9e7ebf6
    Pull Request resolved: facebook/react-forget#2932
    josephsavona committed May 3, 2024
    Configuration menu
    Copy the full SHA
    90863be View commit details
    Browse the repository at this point in the history
  9. Stop committing resources to an external repo (facebook#28963)

    This has been integrated into this repo (`builds/facebook-fbsource`) so
    we no longer need the extra repo
    bigfootjon authored May 3, 2024
    Configuration menu
    Copy the full SHA
    38cd73b View commit details
    Browse the repository at this point in the history
  10. Bundle config: inline internal hook wrapper (facebook#28978)

    Bundle config: inline internal hook wrapper
    
    Instead of reading this wrapper from 2 files for "start" and "end" and
    then string modifying the templates, just inline them like the other
    wrappers in this file.
    kassens authored May 3, 2024
    Configuration menu
    Copy the full SHA
    0a0a3af View commit details
    Browse the repository at this point in the history
  11. Support <fbs> in addition to <fbt>

    ghstack-source-id: 1ab99ebb5cef3f42399682a338feb12c4cf55f4c
    Pull Request resolved: facebook/react-forget#2933
    pieterv committed May 3, 2024
    Configuration menu
    Copy the full SHA
    738ddf7 View commit details
    Browse the repository at this point in the history
  12. [Flight] Track Owner on AsyncLocalStorage When Available (facebook#28807

    )
    
    Stacked on facebook#28798.
    
    Add another AsyncLocalStorage to the FlightServerConfig. This context
    tracks data on a per component level. Currently the only thing we track
    is the owner in DEV.
    
    AsyncLocalStorage around each component comes with a performance cost so
    we only do it DEV. It's not generally a particularly safe operation
    because you can't necessarily associate side-effects with a component
    based on execution scope. It can be a lazy initializer or cache():ed
    code etc. We also don't support string refs anymore for a reason.
    
    However, it's good enough for optional dev only information like the
    owner.
    sebmarkbage authored May 3, 2024
    Configuration menu
    Copy the full SHA
    d5c3034 View commit details
    Browse the repository at this point in the history
  13. Use undici polyfill for tests in old Node versions (facebook#28887)

    We currently don't test FormData / File dependent features in CI because
    we use an old Node.js version in CI. We should probably upgrade to 18
    since that's really the minimum version that supports all the features
    out of the box.
    
    JSDOM is not a faithful/compatible implementation of these APIs. The
    recommended way to use Flight together with FormData/Blob/File in older
    Node.js versions, is to polyfill using the `undici` library.
    
    However, even in these versions the Blob implementation isn't quite
    faithful so the Reply client needs a slight tweak for multi-byte typed
    arrays.
    sebmarkbage authored May 3, 2024
    Configuration menu
    Copy the full SHA
    5fcfd71 View commit details
    Browse the repository at this point in the history
  14. [Flight Reply] Encode ReadableStream and AsyncIterables (facebook#28893)

    Same as facebook#28847 but in the other direction.
    
    Like other promises, this doesn't actually stream in the outgoing
    direction. It buffers until the stream is done. This is mainly due to
    our protocol remains compatible with Safari's lack of outgoing streams
    until recently.
    
    However, the stream chunks are encoded as separate fields and so does
    support the busboy streaming on the receiving side.
    sebmarkbage authored May 3, 2024
    Configuration menu
    Copy the full SHA
    ec9400d View commit details
    Browse the repository at this point in the history
  15. Update compiled-rn destination paths to vendor/react (facebook#28989

    )
    
    I'm changing the destination paths in fbsource from `vendor/*` to
    `vendor/react/*`.
    yungsters authored May 3, 2024
    Configuration menu
    Copy the full SHA
    46abd7b View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. Add FB build for ReactReconcilerConstants (facebook#29003)

    In order to integrate the `react-reconciler` build created in facebook#28880
    with third party libraries, we need to have matching
    `react-reconciler/constants` to go with it.
    jackpope authored May 6, 2024
    Configuration menu
    Copy the full SHA
    5d29478 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e177154 View commit details
    Browse the repository at this point in the history
  3. Setup Wave 2 of Feature Flags for React Native (facebook#28990)

    ## Summary
    
    Sets up dynamic feature flags for `disableStringRefs`, `enableFastJSX`,
    and `enableRefAsProp` in React Native (at Meta).
    
    ## How did you test this change?
    
    ```
    $ yarn test
    $ yarn flow fabric
    ```
    yungsters authored May 6, 2024
    Configuration menu
    Copy the full SHA
    9b13002 View commit details
    Browse the repository at this point in the history
  4. Set enableUseMemoCacheHook to true everywhere (facebook#28964)

    Set enableUseMemoCacheHook to true everywhere for the next major releases.
    kassens authored May 6, 2024
    Configuration menu
    Copy the full SHA
    b498834 View commit details
    Browse the repository at this point in the history
  5. Update readme and other docs

    ghstack-source-id: b25cc2a481dc1508bbb710dff472f2d23667ec98
    Pull Request resolved: facebook/react-forget#2939
    josephsavona committed May 6, 2024
    Configuration menu
    Copy the full SHA
    95ba7dc View commit details
    Browse the repository at this point in the history
  6. Upgrade to React 19 beta (facebook#2938)

    - Updated all directly defined dependencies to the latest React 19 Beta
    - `package.json`: used `resolutions` to force React 19 for `react-is` transitive dependency
    - `package.json`: postinstall script to patch fbt for the React 19 element Symbol
    - Match on the message in Snap to exclude a React 19 warning that `act` should be imported from `react` instead (from inside `@testing-library/react`)
    - Some updated snapshots, I think due to now recovering behavior of `useMemoCache`, please review.
    
    In a next step, we can do the following. I excluded it since it from here as it made the PR unreviewable on GitHub.
    
    - Snapshots now use `react/compiler-runtime` as in prod, so the different default in Snap is no longer needed.
    kassens committed May 6, 2024
    Configuration menu
    Copy the full SHA
    e63d3d1 View commit details
    Browse the repository at this point in the history
  7. [easy] remove unstable_useMemoCache reference from a snapshot file (f…

    …acebook#2937)
    
    This file is intended to test that the test will skip if it was already compiled.
    
    This updates the import to remove the no longer used name `unstable_useMemoCache`.
    kassens committed May 6, 2024
    Configuration menu
    Copy the full SHA
    3708c36 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e2d4734 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Default to raising all errors in eslint plugin

    We control what gets reported via another function anyway so it's better
    to raise everything at the compiler config level. This lets us configure
    what level of diagnostic is reportable later
    
    ghstack-source-id: 996d3cbb8d8f3e1bbe943210b8d633420e0f3f3b
    Pull Request resolved: facebook/react-forget#2935
    poteto committed May 7, 2024
    Configuration menu
    Copy the full SHA
    84d28eb View commit details
    Browse the repository at this point in the history
  2. Allow eslint rule reportable severity to be set

    During the demo I might show an example of fixing a
    CannotPreserveMemoization error. But I don't want to make that
    reportable by default, so this PR allows configuration like so
    
    ```js
    module.exports = {
      root: true,
      plugins: [
        'eslint-plugin-react-compiler',
      ],
      rules: {
        'react-compiler/react-compiler': [
          'error', {
            reportableLevels: new Set([
              'InvalidJs',
              'InvalidReact',
              'CannotPreserveMemoization'
            ])
          }
         ]
      }
    }
    ```
    
    ghstack-source-id: 984c6d3cb7e19c8fea2bb88108dd26335c031573
    Pull Request resolved: facebook/react-forget#2936
    poteto committed May 7, 2024
    Configuration menu
    Copy the full SHA
    d0a51e7 View commit details
    Browse the repository at this point in the history
  3. Clarify how to address ValidateNoCapitalizedCalls errors

    Make it clearer how to address this error by allowlisting globals that
    are known to be safe
    
    ghstack-source-id: e7fa6464ebb561a7a1366ff70430842007c6552e
    Pull Request resolved: facebook/react-forget#2909
    poteto committed May 7, 2024
    Configuration menu
    Copy the full SHA
    b28c53d View commit details
    Browse the repository at this point in the history
  4. Add failing test for eslint-plugin false positive

    The eslint rule seems to false positive on this typescript syntax, but
    strangely the compiler does not
    
    ghstack-source-id: 19baa24ff7addd83f59e2b03fdb180af169a2794
    Pull Request resolved: facebook/react-forget#2913
    poteto committed May 7, 2024
    Configuration menu
    Copy the full SHA
    7caf071 View commit details
    Browse the repository at this point in the history
  5. Create Fabric-specific version of ReactNativeAttributesPayload (faceb…

    …ook#28841)
    
    ## Summary
    
    This PR introduces Fabric-only version of
    `ReactNativeAttributesPayload`. It is a copy-paste of
    `ReactNativeAttributesPayload.js`, and is called
    `ReactNativeAttributesPayloadFabric.js`.
    The idea behind this change is that certain optimizations in prop
    diffing may actually be a regression on the old architecture. For
    example, removing custom diffing may result in larger updateProps
    payloads. Which is, I guess, fine with JSI, but might be a problem with
    the bridge.
    
    ## How did you test this change?
    
    There should be no runtime effect of this change.
    dmytrorykun authored May 7, 2024
    Configuration menu
    Copy the full SHA
    7039834 View commit details
    Browse the repository at this point in the history
  6. CI: move .github directory back to root (facebook#2941)

    We need this in the root to run the steps. It should merge cleanly with the React repo as there is no file name overlap.
    
    Next step is to update the paths to make it work again.
    kassens authored May 7, 2024
    Configuration menu
    Copy the full SHA
    55d6c6e View commit details
    Browse the repository at this point in the history
  7. [DevTools] Expose "view source" options to Fusebox integration (faceb…

    …ook#28973)
    
    ## Summary
    
    Exposes the APIs needed by React Native DevTools (Fusebox) to implement
    the "view element source" and "view attribute source" features.
    
    ## How did you test this change?
    
    1. `yarn build` in `react-devtools-fusebox`
    2. Copy artifacts to rn-chrome-devtools-frontend
    3. Write some additional glue code to implement
    `viewElementSourceFunction` in our CDT fork.
    4. Test the feature manually.
    
    
    https://github.com/facebook/react/assets/2246565/12667018-100a-4b3f-957a-06c07f2af41a
    motiz88 authored May 7, 2024
    Configuration menu
    Copy the full SHA
    afe54bf View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0fc9c84 View commit details
    Browse the repository at this point in the history
  9. CI: fix Rust CI workflows (facebook#2942)

    - update paths
    - update working directory
    - rename files for clarity when merged into the main react repo
    kassens authored May 7, 2024
    Configuration menu
    Copy the full SHA
    90a5d48 View commit details
    Browse the repository at this point in the history
  10. fix[react-devtools]: add backwards compat with legacy element type sy…

    …mbol (facebook#28982)
    
    Follow-up to facebook#28813.
    
    RDT is using `typeOf` from `react-is` to determine the element display
    name, I've forked an implementation of this method, but will be using
    legacy element symbol.
    hoxyq authored May 7, 2024
    Configuration menu
    Copy the full SHA
    c32ff0f View commit details
    Browse the repository at this point in the history
  11. feat[react-devtools]: display forget badge for components in profilin…

    …g session (facebook#29014)
    
    # Summary
    - `compiledWithForget` field for nodes is now propagated from the
    backend to frontend profiler stores
    - Corresponding node with such field will have a `✨` prefix displayed
    before its displayName
    <img width="1728" alt="Screenshot 2024-05-07 at 15 05 37"
    src="https://github.com/facebook/react/assets/28902667/fe044d40-52cb-4169-867d-5a2d72e3275b">
    
    - Badges are now displayed on the right panel when some fiber is
    selected in a specific commit
    <img width="1728" alt="Screenshot 2024-05-07 at 15 05 50"
    src="https://github.com/facebook/react/assets/28902667/297ba5ca-404d-4172-b9bf-bfed7978afe5">
    
    - Badges are also displayed when user hovers over some node in the tree
    <img width="1728" alt="Screenshot 2024-05-07 at 15 25 22"
    src="https://github.com/facebook/react/assets/28902667/bee47884-61d1-46b6-a483-717fc148893a">
    hoxyq authored May 7, 2024
    Configuration menu
    Copy the full SHA
    e7d213d View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fd873e8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    257f22a View commit details
    Browse the repository at this point in the history
  14. CI: fix Compiler Playground workflow (facebook#2945)

    Also renamed the workflow to make more sense when merged into the main React repo.
    kassens authored May 7, 2024
    Configuration menu
    Copy the full SHA
    f4c12cc View commit details
    Browse the repository at this point in the history
  15. CI: remove react.yml integration test workflow (facebook#2947)

    This was used to run React CI tests compiled with the React Compiler. This is currently no longer used.
    kassens authored May 7, 2024
    Configuration menu
    Copy the full SHA
    5a1cbc7 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. [Flight Reply] Encode binary streams as a single collapsed Blob (face…

    …book#28986)
    
    Based on facebook#28893.
    
    For other streams we encode each chunk as a separate form field which is
    a bit bloated. Especially for binary chunks since they also have an
    indirection. We need some way to encode the chunks as separate anyway.
    This way the streaming using busboy actually allows each chunk to stream
    in over the network one at a time.
    
    For binary streams the actual chunking is not important. The chunks can
    be split and recombined in whatever size chunk makes sense.
    
    Since we buffer the entire content anyway we can combine the chunks to
    be consecutive. This PR does that with binary streams and also combine
    them into a single Blob. That way there's no extra overhead when passing
    through a binary stream.
    
    Ideally, we'd be able to just use the stream from that one Blob but
    Node.js doesn't return byob streams from Blob. Additionally, we don't
    actually stream the content of Blobs due to the layering with busboy
    atm. We could do that for binary streams in particular by replacing the
    File layering with a stream and resolving each chunk as it comes in.
    That could be a follow up.
    
    If we stop buffering in the future, this set up still allows us to split
    them and send other form fields in between while blocked since the
    protocol is still the same.
    sebmarkbage authored May 8, 2024
    Configuration menu
    Copy the full SHA
    826bf4e View commit details
    Browse the repository at this point in the history
  2. [Fizz] Fallback to client replaying actions if we're trying to serial…

    …ize a Blob (facebook#28987)
    
    This follows the same principle as in facebook#28611.
    
    We cannot serialize Blobs of a form data into HTML because you can't
    initialize a file input to some value. However the serialization of
    state in an Action can contain blobs. In this case we do error but
    outside the try/catch that recovers to error to client replaying instead
    of MPA mode. This errors earlier to ensure that this works.
    
    Testing this is a bit annoying because JSDOM doesn't have any of the
    Blob methods but the Blob needs to be compatible with FormData and the
    FormData needs to be compatible with `<form>` nodes in these tests. So I
    polyfilled those in JSDOM with some hacks.
    
    A possible future enhancement would be to encode these blobs in a base64
    mode instead and have some way to receive them on the server. It's just
    a matter of layering this. I think the RSC layer's `FORM_DATA`
    implementation can pass some flag to encode as base64 and then have
    decodeAction include some way to parse them. That way this case would
    work in MPA mode too.
    sebmarkbage authored May 8, 2024
    Configuration menu
    Copy the full SHA
    6bac4f2 View commit details
    Browse the repository at this point in the history
  3. [Flight Reply] Resolve outlined models async in Reply just like in Fl…

    …ight Client (facebook#28988)
    
    This is the same change as facebook#28780 but for the Flight Reply receiver.
    
    While it's not possible to create an "async module" reference in this
    case - resolving a server reference can still be async if loading it
    requires loading chunks like in a new server instance.
    
    Since extracting a typed array from a Blob is async, that's also a case
    where a dependency can be async.
    sebmarkbage authored May 8, 2024
    Configuration menu
    Copy the full SHA
    ec15267 View commit details
    Browse the repository at this point in the history
  4. fix[react-devtools/ci]: fix configurations for e2e testing (facebook#…

    …29016)
    
    This should fix failing DevTools e2e tests on `main`.
    
    With these changes, running tests locally successfully passes all cases.
    hoxyq authored May 8, 2024
    Configuration menu
    Copy the full SHA
    e150a32 View commit details
    Browse the repository at this point in the history
  5. Clean up fastAddProperties and make it more correct (facebook#29015)

    ## Summary
    
    This PR makes some fixes to the `fastAddProperties` function:
    - Use `if (!attributeConfig)` instead of `if (attributeConfig ===
    undefined)` to account for `null`.
    - If a prop has an Object `attributeConfig` with a `diff` function
    defined on it, treat it as an atomic value to keep the semantics of
    `diffProperties`.
    
    ## How did you test this change?
    
    Build and run RNTester app.
    dmytrorykun authored May 8, 2024
    Configuration menu
    Copy the full SHA
    b37e4b4 View commit details
    Browse the repository at this point in the history
  6. fix[react-devtools/InspectedElementView.css]: dont draw bottom border…

    … for empty badge list (facebook#29023)
    
    Forward fix to facebook#29014, the bug was
    discovered while testing v5.2.0.
    hoxyq authored May 8, 2024
    Configuration menu
    Copy the full SHA
    0e6ea69 View commit details
    Browse the repository at this point in the history
  7. React DevTools 5.1.0 -> 5.2.0 (facebook#29022)

    Full list of changes (not a public changelog):
    * fix[react-devtools/ci]: fix configurations for e2e testing
    ([hoxyq](https://github.com/hoxyq) in
    [facebook#29016](facebook#29016))
    * feat[react-devtools]: display forget badge for components in profiling
    session ([hoxyq](https://github.com/hoxyq) in
    [facebook#29014](facebook#29014))
    * fix[react-devtools]: add backwards compat with legacy element type
    symbol ([hoxyq](https://github.com/hoxyq) in
    [facebook#28982](facebook#28982))
    * Expose "view source" options to Fusebox integration
    ([motiz88](https://github.com/motiz88) in
    [facebook#28973](facebook#28973))
    * Enable inspected element context menu in Fusebox
    ([motiz88](https://github.com/motiz88) in
    [facebook#28972](facebook#28972))
    * Check in `frontend.d.ts` for react-devtools-fusebox, include in build
    output ([motiz88](https://github.com/motiz88) in
    [facebook#28970](facebook#28970))
    * Devtools: Fix build-for-devtools
    ([eps1lon](https://github.com/eps1lon) in
    [facebook#28976](facebook#28976))
    * Move useMemoCache hook to react/compiler-runtime
    ([kassens](https://github.com/kassens) in
    [facebook#28954](facebook#28954))
    * warn -> error for Test Renderer deprecation
    ([acdlite](https://github.com/acdlite) in
    [facebook#28904](facebook#28904))
    * [react-dom] move all client code to `react-dom/client`
    ([gnoff](https://github.com/gnoff) in
    [facebook#28271](facebook#28271))
    * Rename the react.element symbol to react.transitional.element
    ([sebmarkbage](https://github.com/sebmarkbage) in
    [facebook#28813](facebook#28813))
    * Rename Forget badge ([jbonta](https://github.com/jbonta) in
    [facebook#28858](facebook#28858))
    * Devtools: Add support for useFormStatus
    ([eps1lon](https://github.com/eps1lon) in
    [facebook#28413](facebook#28413))
    hoxyq authored May 8, 2024
    Configuration menu
    Copy the full SHA
    1717ab0 View commit details
    Browse the repository at this point in the history
  8. Cleanup enableServerComponentKeys flag (facebook#28743)

    Cleanup enableServerComponentKeys flag
    
    Flag is `true` everywhere but RN where it doesn't apply.
    kassens authored May 8, 2024
    Configuration menu
    Copy the full SHA
    6946ebe View commit details
    Browse the repository at this point in the history
  9. Facebook: merge react index.classic.fb and index.modern.fb (facebook#…

    …29025)
    
    Facebook: merge react index.classic.fb and index.modern.fb
    
    These export the same.
    
    NOTE: The 2 builds are still different based on flags and other forked
    files.
    kassens authored May 8, 2024
    Configuration menu
    Copy the full SHA
    b1d4096 View commit details
    Browse the repository at this point in the history
  10. Upgrade jest and jsdom (facebook#29026)

    ## Summary
    
    This brings:
     - jest* up from 29.4.2 -> 29.7.0
     - jsdom up from 20.0.0 -> 22.1.0
    
    While the latest version of jest-dom-environment still wants
    `jsdom@^20.0.0`, it can safely use at least up to `[email protected]`. See
    jestjs/jest#13825 (comment) for
    details.
    
    Upgrading to latest versions lets us improve some WheelEvent tests and
    will make it possible to test a much simpler FormData construction
    approach (see facebook#29018)
    
    ## How did you test this change?
    
    Ran `yarn test` and `yarn test --prod` successfully
    jenseng authored May 8, 2024
    Configuration menu
    Copy the full SHA
    04b0588 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Track Stack of JSX Calls (facebook#29032)

    This is the first step to experimenting with a new type of stack traces
    behind the `enableOwnerStacks` flag - in DEV only.
    
    The idea is to generate stacks that are more like if the JSX was a
    direct call even though it's actually a lazy call. Not only can you see
    which exact JSX call line number generated the erroring component but if
    that's inside an abstraction function, which function called that
    function and if it's a component, which component generated that
    component. For this to make sense it really need to be the "owner" stack
    rather than the parent stack like we do for other component stacks. On
    one hand it has more precise information but on the other hand it also
    loses context. For most types of problems the owner stack is the most
    useful though since it tells you which component rendered this
    component.
    
    The problem with the platform in its current state is that there's two
    ways to deal with stacks:
    
    1) `new Error().stack` 
    2) `console.createTask()`
    
    The nice thing about `new Error().stack` is that we can extract the
    frames and piece them together in whatever way we want. That is great
    for constructing custom UIs like error dialogs. Unfortunately, we can't
    take custom stacks and set them in the native UIs like Chrome DevTools.
    
    The nice thing about `console.createTask()` is that the resulting stacks
    are natively integrated into the Chrome DevTools in the console and the
    breakpoint debugger. They also automatically follow source mapping and
    ignoreLists. The downside is that there's no way to extract the async
    stack outside the native UI itself so this information cannot be used
    for custom UIs like errors dialogs. It also means we can't collect this
    on the server and then pass it to the client for server components.
    
    The solution here is that we use both techniques and collect both an
    `Error` object and a `Task` object for every JSX call.
    
    The main concern about this approach is the performance so that's the
    main thing to test. It's certainly too slow for production but it might
    also be too slow even for DEV.
    
    This first PR doesn't actually use the stacks yet. It just collects them
    as the first step. The next step is to start utilizing this information
    in error printing etc.
    
    For RSC we pass the stack along across over the wire. This can be
    concatenated on the client following the owner path to create an owner
    stack leading back into the server. We'll later use this information to
    restore fake frames on the client for native integration. Since this
    information quickly gets pretty heavy if we include all frames, we strip
    out the top frame. We also strip out everything below the functions that
    call into user space in the Flight runtime. To do this we need to figure
    out the frames that represents calling out into user space. The
    resulting stack is typically just the one frame inside the owner
    component's JSX callsite. I also eagerly strip out things we expect to
    be ignoreList:ed anyway - such as `node_modules` and Node.js internals.
    sebmarkbage authored May 9, 2024
    Configuration menu
    Copy the full SHA
    151cce3 View commit details
    Browse the repository at this point in the history
  2. Support useFormStatus in progressively-enhanced forms (facebook#29019)

    Before this change, `useFormStatus` is only activated if a form is
    submitted by an action function (either `<form action={actionFn}>` or
    `<button formAction={actionFn}>`).
    
    After this change, `useFormStatus` will also be activated if you call
    `startTransition(actionFn)` inside a submit event handler that is
    `preventDefault`-ed.
    
    This is the last missing piece for implementing a custom `action` prop
    that is progressively enhanced using `onSubmit` while maintaining the
    same behavior as built-in form actions.
    
    Here's the basic recipe for implementing a progressively-enhanced form
    action. This would typically be implemented in your UI component
    library, not regular application code:
    
    ```js
    import {requestFormReset} from 'react-dom';
    
    // To implement progressive enhancement, pass both a form action *and* a
    // submit event handler. The action is used for submissions that happen
    // before hydration, and the submit handler is used for submissions that
    // happen after.
    <form
      action={action}
      onSubmit={(event) => {
        // After hydration, we upgrade the form with additional client-
        // only behavior.
        event.preventDefault();
    
        // Manually dispatch the action.
        startTransition(async () => {
          // (Optional) Reset any uncontrolled inputs once the action is
          // complete, like built-in form actions do.
          requestFormReset(event.target);
    
          // ...Do extra action-y stuff in here, like setting a custom
          // optimistic state...
    
          // Call the user-provided action
          const formData = new FormData(event.target);
          await action(formData);
        });
      }}
    />
    ```
    acdlite authored May 9, 2024
    Configuration menu
    Copy the full SHA
    c334563 View commit details
    Browse the repository at this point in the history
  3. Support HMR

    Adds supports for hot module reloading (HMR) by resetting the cache if a hash of the source file changes. This is enabled via a compiler flag, but also enabled automatically via the babel plugin when NODE_ENV=development.
    
    ghstack-source-id: 5cd1ad5c893533c93275c2d78b57ec0c8f1d24e7
    Pull Request resolved: facebook/react-forget#2951
    josephsavona committed May 9, 2024
    Configuration menu
    Copy the full SHA
    6b23c25 View commit details
    Browse the repository at this point in the history
  4. [Flight] Encode references to existing objects by property path (face…

    …book#28996)
    
    Instead of forcing an object to be outlined to be able to refer to it
    later we can refer to it by the property path inside another parent
    object.
    
    E.g. this encodes such a reference as `'$123:props:children:foo:bar'`.
    
    That way we don't have to preemptively outline object and we can dedupe
    after the first time we've found it.
    
    There's no cost on the client if it's not used because we're not storing
    any additional information preemptively.
    
    This works mainly because we only have simple JSON objects from the root
    reference. Complex objects like Map, FormData etc. are stored as their
    entries array in the look up and not the complex object. Other complex
    objects like TypedArrays or imports don't have deeply nested objects in
    them that can be referenced.
    
    This solves the problem that we only dedupe after the third instance.
    This dedupes at the second instance. It also solves the problem where
    all nested objects inside deduped instances also are outlined.
    
    The property paths can get pretty large. This is why a test on payload
    size increased. We could potentially outline the reference itself at the
    first dupe. That way we get a shorter ID to refer to in the third
    instance.
    sebmarkbage authored May 9, 2024
    Configuration menu
    Copy the full SHA
    7a78d03 View commit details
    Browse the repository at this point in the history
  5. [Flight Reply] Dedupe Objects and Support Cyclic References (facebook…

    …#28997)
    
    Uses the same technique as in facebook#28996 to encode references to already
    emitted objects. This now means that Reply can support cyclic objects
    too for parity.
    sebmarkbage authored May 9, 2024
    Configuration menu
    Copy the full SHA
    38d9f15 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. [Flight Reply] Encode Objects Returned to the Client by Reference (fa…

    …cebook#29010)
    
    Stacked on facebook#28997.
    
    We can use the technique of referencing an object by its row + property
    name path for temporary references - like we do for deduping. That way
    we don't need to generate an ID for temporary references. Instead, they
    can just be an opaque marker in the slot and it has the implicit ID of
    the row + path.
    
    Then we can stash all objects, even the ones that are actually available
    to read on the server, as temporary references. Without adding anything
    to the payload since the IDs are implicit. If the same object is
    returned to the client, it can be referenced by reference instead of
    serializing it back to the client. This also helps preserve object
    identity.
    
    We assume that the objects are immutable when they pass the boundary.
    
    I'm not sure if this is worth it but with this mechanism, if you return
    the `FormData` payload from a `useActionState` it doesn't have to be
    serialized on the way back to the client. This is a common pattern for
    having access to the last submission as "default value" to the form
    fields. However you can still control it by replacing it with another
    object if you want. In MPA mode, the temporary references are not
    configured and so it needs to be serialized in that case. That's
    required anyway for hydration purposes.
    
    I'm not sure if people will actually use this in practice though or if
    FormData will always be destructured into some other object like with a
    library that turns it into typed data, and back. If so, the object
    identity is lost.
    sebmarkbage authored May 10, 2024
    Configuration menu
    Copy the full SHA
    6c409ac View commit details
    Browse the repository at this point in the history
  2. [Flight] Enable Binary and ReadableStreams in Stable (facebook#29035)

    These are ready to ship in stable.
    sebmarkbage authored May 10, 2024
    Configuration menu
    Copy the full SHA
    6ef0dd4 View commit details
    Browse the repository at this point in the history
  3. Clean up the enableEarlyReturnForPropDiffing experiment (facebook#29041)

    ## Summary
    
    The experiment has shown no significant performance changes. This PR
    removes it.
    
    ## How did you test this change?
    ```
    yarn flow native
    yarn lint
    ```
    dmytrorykun authored May 10, 2024
    Configuration menu
    Copy the full SHA
    2c022b8 View commit details
    Browse the repository at this point in the history
  4. [Flight] Error if a legacy React Element is attempted to be rendered (f…

    …acebook#29043)
    
    This errors on the client normally but in the case the `type` is a
    function - i.e. a Server Component - it wouldn't be transferred to error
    on the client so you end up with a worse error message. So this just
    implements the same check as ChildFiber.
    sebmarkbage authored May 10, 2024
    Configuration menu
    Copy the full SHA
    9d76c95 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2024

  1. ReAnimated -> Reanimated

    Fixes a small typo by request
    
    ghstack-source-id: 00889150a952308f00d89472c864726222e835d3
    Pull Request resolved: facebook/react-forget#2952
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    c58142b View commit details
    Browse the repository at this point in the history
  2. Better detection for reanimated

    We found this issue through enabling the compiler on the React Conf app.
    
    `babel-preset-expo` automatically adds the `react-native-animated`
    plugin to apps that use the preset. This means that Expo apps sometimes
    omit the react-native-animated plugin from their config, which was
    failing our existing check. This PR copies the same detection that Expo
    does for adding reanimated as a fallback
    
    ghstack-source-id: 46f7aec0bc3035a92369f65b0842bafab0089a9e
    Pull Request resolved: facebook/react-forget#2953
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    9b0044e View commit details
    Browse the repository at this point in the history
  3. [healthcheck] Build with rollup

    ghstack-source-id: cd40da2ddce047838ed031eed1c1f8e605648a78
    Pull Request resolved: facebook/react-forget#2954
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    db34843 View commit details
    Browse the repository at this point in the history
  4. [healthcheck] Fix build

    runReactBabelPluginReactCompiler brings in fbt which is unnecessary for
    OSS so I removed it.
    
    Also makes it so healthckeck is installed as an executable
    
    ghstack-source-id: ec6c76f8be01483d4ca75d9d74037b3966fccbdb
    Pull Request resolved: facebook/react-forget#2955
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    9a6ce33 View commit details
    Browse the repository at this point in the history
  5. [healthcheck] Rename to react-compiler-healthcheck

    Don't really have time to implement the react-compiler/healthcheck
    version of this script, so for now i propose we just publish this as
    react-compiler-healthcheck
    
    the command for running this would be
    
    ```
    $ npx react-compiler-healthcheck --src 'whatever/**/*.*'
    ```
    
    ghstack-source-id: e2c443a91257433d80dd51c8c855e4aa0bd99a37
    Pull Request resolved: facebook/react-forget#2956
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    63e5330 View commit details
    Browse the repository at this point in the history
  6. [healthcheck] Only glob files with certain extensions by default

    ghstack-source-id: b8db17266992a705645c86916966e06404709fa0
    Pull Request resolved: facebook/react-forget#2957
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    76b7331 View commit details
    Browse the repository at this point in the history
  7. [healthcheck] Remove console.error

    ghstack-source-id: c06d44960cfb831e3dc8162858977c4ef619309d
    Pull Request resolved: facebook/react-forget#2958
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    78da5be View commit details
    Browse the repository at this point in the history
  8. [healthcheck] Don't compile mjs

    ghstack-source-id: 087985cd23baeefc0e2fb9478cd9a162b4e2e023
    Pull Request resolved: facebook/react-forget#2959
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    9ef7557 View commit details
    Browse the repository at this point in the history
  9. [healthcheck] Refine glob pattern

    ghstack-source-id: 6f9e7f95348ab66c699c38f3625a654d91c856c4
    Pull Request resolved: facebook/react-forget#2960
    poteto committed May 11, 2024
    Configuration menu
    Copy the full SHA
    669e8d0 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Use unique name for c import local identifier

    ghstack-source-id: 93055b972fd91572edf8ba51c980006dfdfcd314
    Pull Request resolved: facebook/react-forget#2961
    josephsavona committed May 13, 2024
    Configuration menu
    Copy the full SHA
    7e3be12 View commit details
    Browse the repository at this point in the history
  2. CI: remove non-functional Rust compiler benchmark workflow (facebook#…

    …2948)
    
    `forget_napi` doesn't exist and given we're not currently working on the Rust compiler, I'm not sure we need to keep this around until we know that we do want to invest into this area again.
    kassens authored May 13, 2024
    Configuration menu
    Copy the full SHA
    4cf7ee2 View commit details
    Browse the repository at this point in the history
  3. [healthcheck] Clean up ignorelist and check if deps exist

    ghstack-source-id: b6d58988eeb86e657a6db2a481b6c2fe2fba0344
    Pull Request resolved: facebook/react-forget#2962
    poteto committed May 13, 2024
    Configuration menu
    Copy the full SHA
    ce0c08e View commit details
    Browse the repository at this point in the history
  4. Fix Jest tests

    ghstack-source-id: e2507b7285bb52ee02d2cece35aa16eb0bc0baa5
    Pull Request resolved: facebook/react-forget#2963
    josephsavona committed May 13, 2024
    Configuration menu
    Copy the full SHA
    b956024 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2024

  1. Enable enableUnifiedSyncLane for React Native (Meta) (facebook#29052)

    ## Summary
    
    Enables the `enableUnifiedSyncLane` feature flag for React Native
    (Meta).
    
    ## How did you test this change?
    
    ```
    $ yarn test
    $ yarn flow fabric
    ```
    yungsters authored May 14, 2024
    Configuration menu
    Copy the full SHA
    5f28f51 View commit details
    Browse the repository at this point in the history
  2. Remove 2 no longer existing files from inlinedHostConfig (facebook#29027

    )
    
    Remove 2 no longer existing files from inlinedHostConfig
    
    While looking for `.classic` forks, I noticed these files no longer
    exist.
    kassens authored May 14, 2024
    Configuration menu
    Copy the full SHA
    26f2496 View commit details
    Browse the repository at this point in the history
  3. Fix healthcheck package.json bin field

    ghstack-source-id: 28045c6edb342dea125ea8fcea564ce90626f21d
    Pull Request resolved: facebook/react-forget#2964
    poteto committed May 14, 2024
    Configuration menu
    Copy the full SHA
    5a842db View commit details
    Browse the repository at this point in the history
  4. [publish] Fix files field for packages, invalid version range

    The [`files` field](https://docs.npmjs.com/cli/v10/commands/npm-publish#files-included-in-package)
    controls what files get included in the published package.
    
    This PR specifies the `files` field on our publishable packages to only
    include the `dist` directory, since we don't need to ship any types or
    sourcemaps with 3 of them.
    
    react-compiler-runtime is a runtime package which has sourcemaps, so we
    also include the `src` directory in the published package.
    
    Also fixes an invalid version range for the react peer dependency in
    react-compiler-runtime, tested that it works via https://semver.npmjs.com/
    
    ghstack-source-id: 12b36c203fc9fd8d72a1995fb3fba2312de4aa51
    Pull Request resolved: facebook/react-forget#2965
    poteto committed May 14, 2024
    Configuration menu
    Copy the full SHA
    67ea821 View commit details
    Browse the repository at this point in the history
  5. [publish] Add script to publish packages

    Adds a script to publish babel-plugin-react-compiler,
    eslint-plugin-react-compiler, and react-compiler-healthcheck to npm.
    
    Instructions are in a comment in scripts/publish.js, please read
    carefully before using this script!
    
    Test plan:
    
    ```
    $ yarn npm:publish
    
    yarn run v1.22.10
    $ node scripts/publish
    ℹ Preparing to publish (dry run) [debug=false]
    ℹ Building packages
    ✔ Successfully built babel-plugin-react-compiler
    ✔ Successfully built eslint-plugin-react-compiler
    ✔ Successfully built react-compiler-healthcheck
    ℹ Dry run: Report tarball contents
    
    ========== babel-plugin-react-compiler ==========
    
    ⠴ Running npm pack --dry-run
    npm WARN config init.author.name Use `--init-author-name` instead.
    npm WARN config init.author.email Use `--init-author-email` instead.
    ⠦ Running npm pack --dry-run
    npm notice
    npm notice 📦  [email protected]
    npm notice === Tarball Contents ===
    npm notice 11B    dist/__tests__/DisjointSet-test.d.ts
    npm notice 11B    dist/__tests__/envConfig-test.d.ts
    npm notice 11B    dist/__tests__/Logger-test.d.ts
    npm notice 11B    dist/__tests__/parseConfigPragma-test.d.ts
    npm notice 11B    dist/__tests__/Result-test.d.ts
    npm notice 145B   dist/__tests__/test-utils/validateNoUseBeforeDefine.d.ts
    npm notice 144B   dist/Babel/BabelPlugin.d.ts
    npm notice 350B   dist/Babel/RunReactCompilerBabelPlugin.d.ts
    npm notice 2.4kB  dist/CompilerError.d.ts
    npm notice 455B   dist/Entrypoint/Gating.d.ts
    npm notice 376B   dist/Entrypoint/Imports.d.ts
    npm notice 166B   dist/Entrypoint/index.d.ts
    npm notice 1.8kB  dist/Entrypoint/Options.d.ts
    npm notice 1.3kB  dist/Entrypoint/Pipeline.d.ts
    npm notice 819B   dist/Entrypoint/Program.d.ts
    npm notice 295B   dist/Entrypoint/Reanimated.d.ts
    npm notice 753B   dist/Entrypoint/Suppression.d.ts
    npm notice 113B   dist/HIR/AssertConsistentIdentifiers.d.ts
    npm notice 115B   dist/HIR/AssertTerminalSuccessorsExist.d.ts
    npm notice 529B   dist/HIR/AssertValidBlockNesting.d.ts
    npm notice 110B   dist/HIR/AssertValidMutableRanges.d.ts
    npm notice 585B   dist/HIR/BuildHIR.d.ts
    npm notice 116B   dist/HIR/BuildReactiveScopeTerminalsHIR.d.ts
    npm notice 125B   dist/HIR/ComputeUnconditionalBlocks.d.ts
    npm notice 602B   dist/HIR/Dominator.d.ts
    npm notice 12.7kB dist/HIR/Environment.d.ts
    npm notice 184B   dist/HIR/FindContextIdentifiers.d.ts
    npm notice 401B   dist/HIR/Globals.d.ts
    npm notice 22.2kB dist/HIR/HIR.d.ts
    npm notice 2.8kB  dist/HIR/HIRBuilder.d.ts
    npm notice 1.1kB  dist/HIR/index.d.ts
    npm notice 108B   dist/HIR/MergeConsecutiveBlocks.d.ts
    npm notice 115B   dist/HIR/MergeOverlappingReactiveScopesHIR.d.ts
    npm notice 2.2kB  dist/HIR/ObjectShape.d.ts
    npm notice 1.4kB  dist/HIR/PrintHIR.d.ts
    npm notice 106B   dist/HIR/PruneUnusedLabelsHIR.d.ts
    npm notice 1.1kB  dist/HIR/Types.d.ts
    npm notice 1.9kB  dist/HIR/visitors.d.ts
    npm notice 776B   dist/index.d.ts
    npm notice 5.4MB  dist/index.js
    npm notice 429B   dist/Inference/AnalyseFunctions.d.ts
    npm notice 324B   dist/Inference/DropManualMemoization.d.ts
    npm notice 436B   dist/Inference/index.d.ts
    npm notice 224B   dist/Inference/InferAlias.d.ts
    npm notice 204B   dist/Inference/InferAliasForPhis.d.ts
    npm notice 206B   dist/Inference/InferAliasForStores.d.ts
    npm notice 115B   dist/Inference/InferMutableContextVariables.d.ts
    npm notice 151B   dist/Inference/InferMutableLifetimes.d.ts
    npm notice 109B   dist/Inference/InferMutableRanges.d.ts
    npm notice 212B   dist/Inference/InferMutableRangesForAlias.d.ts
    npm notice 106B   dist/Inference/InferReactivePlaces.d.ts
    npm notice 368B   dist/Inference/InferReferenceEffects.d.ts
    npm notice 201B   dist/Inference/InferTryCatchAliases.d.ts
    npm notice 130B   dist/Inference/InlineImmediatelyInvokedFunctionExpressions.d.ts
    npm notice 106B   dist/Optimization/ConstantPropagation.d.ts
    npm notice 258B   dist/Optimization/DeadCodeElimination.d.ts
    npm notice 177B   dist/Optimization/index.d.ts
    npm notice 103B   dist/Optimization/PruneMaybeThrows.d.ts
    npm notice 108B   dist/ReactiveScopes/AlignMethodCallScopes.d.ts
    npm notice 110B   dist/ReactiveScopes/AlignObjectMethodScopes.d.ts
    npm notice 133B   dist/ReactiveScopes/AlignReactiveScopesToBlockScopes.d.ts
    npm notice 126B   dist/ReactiveScopes/AlignReactiveScopesToBlockScopesHIR.d.ts
    npm notice 132B   dist/ReactiveScopes/AssertScopeInstructionsWithinScope.d.ts
    npm notice 125B   dist/ReactiveScopes/AssertWellFormedBreakTargets.d.ts
    npm notice 363B   dist/ReactiveScopes/BuildReactiveBlocks.d.ts
    npm notice 142B   dist/ReactiveScopes/BuildReactiveFunction.d.ts
    npm notice 759B   dist/ReactiveScopes/CodegenReactiveFunction.d.ts
    npm notice 154B   dist/ReactiveScopes/CollectReactiveIdentifiers.d.ts
    npm notice 128B   dist/ReactiveScopes/CollectReferencedGlobals.d.ts
    npm notice 698B   dist/ReactiveScopes/DeriveMinimalDependencies.d.ts
    npm notice 138B   dist/ReactiveScopes/ExtractScopeDeclarationsFromDestructuring.d.ts
    npm notice 121B   dist/ReactiveScopes/FlattenReactiveLoops.d.ts
    npm notice 124B   dist/ReactiveScopes/FlattenScopesWithHooksOrUse.d.ts
    npm notice 2.1kB  dist/ReactiveScopes/index.d.ts
    npm notice 370B   dist/ReactiveScopes/InferReactiveScopeVariables.d.ts
    npm notice 217B   dist/ReactiveScopes/MemoizeFbtOperandsInSameScope.d.ts
    npm notice 127B   dist/ReactiveScopes/MergeOverlappingReactiveScopes.d.ts
    npm notice 138B   dist/ReactiveScopes/MergeReactiveScopesThatInvalidateTogether.d.ts
    npm notice 1.0kB  dist/ReactiveScopes/PrintReactiveFunction.d.ts
    npm notice 123B   dist/ReactiveScopes/PromoteUsedTemporaries.d.ts
    npm notice 118B   dist/ReactiveScopes/PropagateEarlyReturns.d.ts
    npm notice 127B   dist/ReactiveScopes/PropagateScopeDependencies.d.ts
    npm notice 123B   dist/ReactiveScopes/PruneAllReactiveScopes.d.ts
    npm notice 126B   dist/ReactiveScopes/PruneAlwaysInvalidatingScopes.d.ts
    npm notice 117B   dist/ReactiveScopes/PruneHoistedContexts.d.ts
    npm notice 227B   dist/ReactiveScopes/PruneNonEscapingScopes.d.ts
    npm notice 125B   dist/ReactiveScopes/PruneNonReactiveDependencies.d.ts
    npm notice 122B   dist/ReactiveScopes/PruneTemporaryLValues.d.ts
    npm notice 118B   dist/ReactiveScopes/PruneUnusedLabels.d.ts
    npm notice 118B   dist/ReactiveScopes/PruneUnusedScopes.d.ts
    npm notice 123B   dist/ReactiveScopes/RenameVariables.d.ts
    npm notice 114B   dist/ReactiveScopes/StabilizeBlockIds.d.ts
    npm notice 3.1kB  dist/ReactiveScopes/visitors.d.ts
    npm notice 170B   dist/SSA/EliminateRedundantPhi.d.ts
    npm notice 101B   dist/SSA/EnterSSA.d.ts
    npm notice 154B   dist/SSA/index.d.ts
    npm notice 99B    dist/SSA/LeaveSSA.d.ts
    npm notice 63.5kB dist/tsconfig.tsbuildinfo
    npm notice 43B    dist/TypeInference/index.d.ts
    npm notice 103B   dist/TypeInference/InferTypes.d.ts
    npm notice 352B   dist/Utils/ComponentDeclaration.d.ts
    npm notice 256B   dist/Utils/DisjointSet.d.ts
    npm notice 322B   dist/Utils/HookDeclaration.d.ts
    npm notice 613B   dist/Utils/logger.d.ts
    npm notice 2.3kB  dist/Utils/Result.d.ts
    npm notice 119B   dist/Utils/RuntimeDiagnosticConstants.d.ts
    npm notice 1.1kB  dist/Utils/Stack.d.ts
    npm notice 149B   dist/Utils/todo.d.ts
    npm notice 782B   dist/Utils/utils.d.ts
    npm notice 603B   dist/Validation/index.d.ts
    npm notice 117B   dist/Validation/ValidateContextVariableLValues.d.ts
    npm notice 109B   dist/Validation/ValidateHooksUsage.d.ts
    npm notice 214B   dist/Validation/ValidateMemoizedEffectDependencies.d.ts
    npm notice 113B   dist/Validation/ValidateNoCapitalizedCalls.d.ts
    npm notice 114B   dist/Validation/ValidateNoRefAccesInRender.d.ts
    npm notice 113B   dist/Validation/ValidateNoSetStateInRender.d.ts
    npm notice 131B   dist/Validation/ValidatePreservedManualMemoization.d.ts
    npm notice 102B   dist/Validation/ValidateUseMemo.d.ts
    npm notice 2.3kB  package.json
    npm notice === Tarball Details ===
    npm notice name:          babel-plugin-react-compiler
    npm notice version:       0.0.1
    npm notice filename:      babel-plugin-react-compiler-0.0.1.tgz
    npm notice package size:  1.1 MB
    npm notice unpacked size: 5.5 MB
    npm notice shasum:        9a0fb71bdc904d6ab92432a506b0e037f10dd7ce
    npm notice integrity:     sha512-hXtObyIEP4MbO[...]jstRbpztyLf4g==
    npm notice total files:   119
    npm notice
    
    ========== eslint-plugin-react-compiler ==========
    
    ⠴ Running npm pack --dry-run
    npm WARN config init.author.name Use `--init-author-name` instead.
    npm WARN config init.author.email Use `--init-author-email` instead.
    ⠋ Running npm pack --dry-run
    npm notice
    npm notice 📦  [email protected]
    npm notice === Tarball Contents ===
    npm notice 827B  README.md
    npm notice 2.1MB dist/index.js
    npm notice 968B  package.json
    npm notice === Tarball Details ===
    npm notice name:          eslint-plugin-react-compiler
    npm notice version:       0.0.0
    npm notice filename:      eslint-plugin-react-compiler-0.0.0.tgz
    npm notice package size:  300.5 kB
    npm notice unpacked size: 2.1 MB
    npm notice shasum:        f24dab544b03d36d9bb676a16256f114bd5e0ed6
    npm notice integrity:     sha512-8PcKZXZ+RVBDP[...]D7jFmkvHJoBeA==
    npm notice total files:   3
    npm notice
    
    ========== react-compiler-healthcheck ==========
    
    ⠼ Running npm pack --dry-run
    npm WARN config init.author.name Use `--init-author-name` instead.
    npm WARN config init.author.email Use `--init-author-email` instead.
    ⠏ Running npm pack --dry-run
    npm notice
    npm notice 📦  [email protected]
    npm notice === Tarball Contents ===
    npm notice 2.1MB dist/index.js
    npm notice 677B  package.json
    npm notice 1.8kB rollup.config.js
    npm notice 1.1kB src/checks/libraryCompat.ts
    npm notice 3.2kB src/checks/reactCompiler.ts
    npm notice 759B  src/checks/strictMode.ts
    npm notice 67B   src/config.ts
    npm notice 1.5kB src/index.ts
    npm notice 602B  tsconfig.json
    npm notice === Tarball Details ===
    npm notice name:          react-compiler-healthcheck
    npm notice version:       0.0.0
    npm notice filename:      react-compiler-healthcheck-0.0.0.tgz
    npm notice package size:  290.4 kB
    npm notice unpacked size: 2.1 MB
    npm notice shasum:        55c0eb57aebc7305270a29e78ebf6c056044bae0
    npm notice integrity:     sha512-nPVhGyh8i9PoO[...]v52c3U0tKGpzA==
    npm notice total files:   9
    npm notice
    ✔ Please confirm contents of packages before publishing. You can run this command again with --for-real to publish to npm
    ✨  Done in 61.19s.
    ```
    
    ```
    $ yarn npm:publish --debug --for-real
    
    yarn run v1.22.10
    $ node scripts/publish --debug --for-real
    ℹ Preparing to publish (for real) [debug=true]
    ℹ Building packages
    ✔ Successfully built babel-plugin-react-compiler
    ✔ Successfully built eslint-plugin-react-compiler
    ✔ Successfully built react-compiler-healthcheck
    ✔ Bumped babel-plugin-react-compiler to 0.0.0-experimental-2769f7a-20240513
    ✔ Bumped eslint-plugin-react-compiler to 0.0.0-experimental-e04a001-20240513
    ✔ Bumped react-compiler-healthcheck to 0.0.0-experimental-410375f-20240513
    
    ========== babel-plugin-react-compiler ==========
    
    ⠋ Publishing babel-plugin-react-compiler to npm
    Command that would have run: npm publish --dry-run
    /Users/lauren/code/react-forget/compiler/scripts/publish.js:188
          throw new Error(
                ^
    
    Error: This error is intentional, please double check scripts/publish.js and remove this error prior to publishing
        at main (/Users/lauren/code/react-forget/compiler/scripts/publish.js:188:13)
    
    Node.js v20.11.0
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    ```
    
    On the day of launch, remove the hardcoded error, then run `yarn
    npm:publish --debug --for-real` first as a sanity check. Confirm the
    contents are correct.
    
    Then when you are certain, run `yarn npm:publish --for-real`, and push
    the commited version bumps to GitHub so the hashes that the packages
    originate from are public.
    
    ghstack-source-id: 403bc22d4b340056fd112fcfc38580f28ed6c986
    Pull Request resolved: facebook/react-forget#2966
    poteto committed May 14, 2024
    Configuration menu
    Copy the full SHA
    6948639 View commit details
    Browse the repository at this point in the history
  6. Don't emit types for babel-plugin-react-compiler

    ghstack-source-id: a1776f97d5f7d4d8e02886906eb001e358628fc8
    Pull Request resolved: facebook/react-forget#2967
    poteto committed May 14, 2024
    Configuration menu
    Copy the full SHA
    6457343 View commit details
    Browse the repository at this point in the history
  7. Fix CI for compiler paths

    ghstack-source-id: 43bb0c8c957fc550203445868c90fa706e3a8d11
    Pull Request resolved: facebook/react-forget#2968
    poteto committed May 14, 2024
    Configuration menu
    Copy the full SHA
    ecccaf6 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. Bump React 19 beta to RC (facebook#29060)

    This updates the Canary label from "beta" to "rc".
    
    We will publish an actual RC (e.g. 19.0.0-rc.0) too; this only changes
    the label in the canary releases.
    acdlite authored May 15, 2024
    Configuration menu
    Copy the full SHA
    915b914 View commit details
    Browse the repository at this point in the history
  2. Unthrow publish script

    poteto committed May 15, 2024
    Configuration menu
    Copy the full SHA
    41142f3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d794e4a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5501ebc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    740b7c1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    575477a View commit details
    Browse the repository at this point in the history
  7. Merge pull request facebook#29061 from facebook/compiler

    Open-source React Compiler
    josephsavona authored May 15, 2024
    Configuration menu
    Copy the full SHA
    71565a9 View commit details
    Browse the repository at this point in the history
  8. Add a main field to eslint-plugin-react-compiler, fixes facebook#…

    …29068. (facebook#29072)
    
    ## Summary
    
    The main field is missing, this fixes it.
    
    Fixes facebook#29068.
    
    ## How did you test this change?
    
    Manually patched the package and tried it in my codebase.
    cpojer authored May 15, 2024
    Configuration menu
    Copy the full SHA
    cfeb491 View commit details
    Browse the repository at this point in the history
  9. Fix ESLint and Prettier configs for React Compiler (facebook#29073)

    Fixes the top-level ESLint and Prettier configs to ignore the compiler.
    For now the compiler has its own prettier and linting setup with
    different versions/configs.
    josephsavona authored May 15, 2024
    Configuration menu
    Copy the full SHA
    c93c30f View commit details
    Browse the repository at this point in the history
  10. [heathcheck] Check for namespaced StrictMode (facebook#29076)

    Previously, we only checked for StrictMode by searching for
    `<StrictMode>` but we should also check for the namespaced version,
    `<React.StrictMode>`.
    
    Fixes facebook#29075
    gsathya authored May 15, 2024
    Configuration menu
    Copy the full SHA
    5e11e7f View commit details
    Browse the repository at this point in the history
  11. compiler: fix jsx text attributes with double quotes (facebook#29079)

    Fixes facebook#29069 by detecting the presence of double-quotes in JSX attribute
    strings and falling back to using an expression container.
    josephsavona authored May 15, 2024
    Configuration menu
    Copy the full SHA
    3adca7a View commit details
    Browse the repository at this point in the history
  12. [compiler:eslint] Fix false positive with TS type param syntax

    Previously we would attempt to parse code in the eslint plugin with the
    HermesParser first as it can handle some TS syntax. However, this was
    leading to a mis-parse of React hook calls with type params (eg,
    `useRef<null>()` as a BinaryExpression rather than a CallExpression with
    a type param. This triggered our validation that Hooks should not be
    used as normal values.
    
    To fix this, we now try to parse with the babel parser (with TS support)
    for filenames that end with ts/tsx, and fallback to HermesParser for
    regular JS files.
    
    ghstack-source-id: 5b7231031cace749a6e689412b3e8b5c9d03ed4b
    Pull Request resolved: facebook#29081
    poteto committed May 15, 2024
    Configuration menu
    Copy the full SHA
    cf7d895 View commit details
    Browse the repository at this point in the history
  13. [compiler] Various fixes for publishing script

    - Specify a registry for npm publish because otherwise it tries to use
      the yarn registry
    - `packages` option actually works
    
    This _should_ work now (note last line of output), will test it once we
    land this since i want to publish a new version of the eslint plugin
    with some important fixes.
    
    ```
    npm notice
    npm notice 📦  [email protected]
    npm notice === Tarball Contents ===
    npm notice 827B  README.md
    npm notice 2.1MB dist/index.js
    npm notice 1.0kB package.json
    npm notice === Tarball Details ===
    npm notice name:          eslint-plugin-react-compiler
    npm notice version:       0.0.0-experimental-53bb89e-20240515
    npm notice filename:      eslint-plugin-react-compiler-0.0.0-experimental-53bb89e-20240515.tgz
    npm notice package size:  300.9 kB
    npm notice unpacked size: 2.1 MB
    npm notice shasum:        cb99823f3a483c74f470085cac177bd020f7a85a
    npm notice integrity:     sha512-L3HV9qja1dnCl[...]IaRSZJ3P/v6yQ==
    npm notice total files:   3
    npm notice
    npm notice Publishing to http://registry.npmjs.org/ with tag latest and default access (dry-run)
    ```
    
    ghstack-source-id: 63067ef772c780a665fc04e642b0f533aaacbe44
    Pull Request resolved: facebook#29082
    poteto committed May 15, 2024
    Configuration menu
    Copy the full SHA
    5572edc View commit details
    Browse the repository at this point in the history
  14. [compiler] Check if current branch is main

    This script needs to run from `main` since it commits version bumps for
    packages, and those need to point to publicly available hashes. So,
    throw an error if we're not already on main.
    
    ghstack-source-id: ce0168e826b990fd55733e777ee8effe4f35400a
    Pull Request resolved: facebook#29083
    poteto committed May 15, 2024
    Configuration menu
    Copy the full SHA
    a0eb265 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. [compiler] Add readme for babel plugin

    Adds a simple readme for the babel plugin with links to the docs.
    
    ghstack-source-id: 4dac0b2a4b2e2114e369dd8f63eea55909f668c1
    Pull Request resolved: facebook#29084
    poteto committed May 16, 2024
    Configuration menu
    Copy the full SHA
    50c999e View commit details
    Browse the repository at this point in the history
  2. chore(docs): fix typo (plugion => plugin) in DESIGN_GOALS.md (faceboo…

    …k#29086)
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    This PR fixes a typo in `./compiler/docs/DESIGN_GOALS.md`.
    
    I believe `plugion` should be `plugin`.
    
    ## How did you test this change?
    
    Rendered the markdown to html.
    styfle authored May 16, 2024
    Configuration menu
    Copy the full SHA
    5052bfb View commit details
    Browse the repository at this point in the history
  3. [compiler:publish] Specify https for registry

    Uses https for the npm registry so the publishing script isn't rejected.
    Fixes:
    
    ```
    Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
    ```
    
    ghstack-source-id: b247d044ea48f3007cf8bd13445fb7ece0f5b02f
    Pull Request resolved: facebook#29087
    poteto committed May 16, 2024
    Configuration menu
    Copy the full SHA
    7f22c52 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f470ba3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c912057 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    149b917 View commit details
    Browse the repository at this point in the history
  7. [React Compiler] use filename instead of context.filename in ESLi…

    …nt plugin (facebook#29104)
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    Use `filename` instead of `context.filename` in eslint compiler.
    
    The problem is that in `react-native` + `typescript` project the context
    may not have `filename`:
    
    <img width="384" alt="image"
    src="https://github.com/facebook/react/assets/22820318/e5d184fa-5ac9-4512-96b9-644baa3d5f25">
    
    And eslint will crash with:
    
    ```bash
    TypeError: Error while loading rule 'react-compiler/react-compiler': Cannot read properties of undefined (reading 'endsWith')
    ```
    
    But in fact we already derive `filename` variable earlier so we can
    simply reuse the variable (I guess).
    
    ## How did you test this change?
    
    - add `eslint` plugin to RN project;
    - run eslint
    kirillzyusko authored May 16, 2024
    Configuration menu
    Copy the full SHA
    e8779a9 View commit details
    Browse the repository at this point in the history
  8. [React Compiler] Fix rule name for ESLint plugin (facebook#29096)

    /cc @poteto
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    Seems like the README of the package was outdated.
    
    ## How did you test this change?
    
    Tried this configuration in a project of mine.
    
    <!--
    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.
    -->
    amannn authored May 16, 2024
    Configuration menu
    Copy the full SHA
    94896cb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    91e88f9 View commit details
    Browse the repository at this point in the history
  10. docs: fix typo DESIGN_GOALS.md (facebook#29102)

    ## Summary
    Fixes typo  DESIGN_GOALS.md  in react compiler docs
    
    ## How did you test this change?
    it's document fix, so no tests needed.
    skyt-a authored May 16, 2024
    Configuration menu
    Copy the full SHA
    7a149aa View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. compiler: merge reactive scopes across const StoreLocal (facebook#29095)

    @jbonta nerd-sniped me into making this optimization during conference
    prep, posting this as a PR now that keynote is over.
    
    Consider these two cases:
    
    ```javascript
    export default function MyApp1({ count }) {
      const cb = () => count;
      return <div onclick={cb}>Hello World</div>;
    }
    
    export default function MyApp2({ count }) {
      return <div onclick={() => count}>Hello World</div>;
    }
    ```
    
    Previously, the former would create two reactive scopes (one for `cb`,
    one for the div) while the latter would only have a single scope for the
    `div` and its inline callback. The reason we created separate scopes
    before is that there's a `StoreLocal 'cb' = t0` instruction in-between,
    and i had conservatively implemented the merging pass to not allow
    intervening StoreLocal instructions.
    
    The observation is that intervening StoreLocals are fine _if_ the
    assigned variable's last usage is the next scope. We already have a
    check that the intervening lvalues are last-used at/before the next
    scope, so it's trivial to extend this to support StoreLocal.
    
    Note that we already don't merge scopes if there are intervening
    terminals, so we don't have to worry about things like conditional
    StoreLocal, conditional access of the resulting value, etc.
    josephsavona authored May 17, 2024
    Configuration menu
    Copy the full SHA
    5ab5471 View commit details
    Browse the repository at this point in the history
  2. [compiler:playground] Fix broken builds

    Now that the compiler is public, the `*` version was grabbing the latest
    version of the compiler off of npm and was resolving to my very first
    push to npm (an empty package containing only a single package.json).
    This was breaking the playground as it would attempt to load the
    compiler but then crash the babel pipeline due to the node module not
    being found.
    
    ghstack-source-id: 695fd9caac64d15edfa095b8c871e75520381fcb
    Pull Request resolved: facebook#29122
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    3f1436c View commit details
    Browse the repository at this point in the history
  3. [compiler] Todo for for-await loops

    ghstack-source-id: 13f11edfbef2af2e2a9ab876c18b0a4013a3eae0
    Pull Request resolved: facebook#29118
    josephsavona committed May 17, 2024
    Configuration menu
    Copy the full SHA
    477a3d1 View commit details
    Browse the repository at this point in the history
  4. Lazily freeze in case anything in the currently initializing chunk is…

    … blocked (facebook#29139)
    
    Fixed facebook#29129.
    
    ---------
    
    Co-authored-by: Hendrik Liebau <[email protected]>
    sebmarkbage and unstubbable authored May 17, 2024
    Configuration menu
    Copy the full SHA
    af3a55e View commit details
    Browse the repository at this point in the history
  5. compiler: Workaround Babel bug with unicode in jsx string attrs

    Workaround for a bug in older versions of Babel, where strings with unicode are incorrectly escaped when emitted as JSX attributes, causing double-escaping by later processing.
    
    Closes facebook#29120
    Closes facebook#29124
    
    ghstack-source-id: 065440d4fb97e164beb8a8f15f252f372a59c5a0
    Pull Request resolved: facebook#29141
    josephsavona committed May 17, 2024
    Configuration menu
    Copy the full SHA
    be6712f View commit details
    Browse the repository at this point in the history
  6. Add issue template for React Compiler

    Adds a GitHub issue template form so we can automatically categorize
    issues and get more information upfront. I mostly referenced the
    DevTools bug report template and made some tweaks.
    
    ghstack-source-id: 5bfc728a625f367932fc21263e82681079d3ac65
    Pull Request resolved: facebook#29140
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ecddf3c View commit details
    Browse the repository at this point in the history
  7. compiler: update comment on memo cache import code

    ghstack-source-id: b6c98c78854c9125bef504731515b9854c01960d
    Pull Request resolved: facebook#29142
    josephsavona committed May 17, 2024
    Configuration menu
    Copy the full SHA
    6400172 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1d6eebf View commit details
    Browse the repository at this point in the history
  9. [compiler:playground] Resizable tabs (facebook#29133)

    ## Summary
    
    Every tab wraps the text around but there is no way to resize it. It was
    also hard to use the source map tab. It doesn't occupy the full height
    nor is the tab resizable. So I made all the tabs resizable.
    > Also,
    > * make the source map tab occupy full height
    > * make it a teeny tiny bit easier to work with the compiler playground
    (especially source map)
    
    ## How did you test this change?
    
    
    https://github.com/facebook/react/assets/91976421/cdec30e8-cadb-4958-8786-31c54ea83bd6
    
    Signed-off-by: abizek <[email protected]>
    abizek authored May 17, 2024
    Configuration menu
    Copy the full SHA
    541e3c5 View commit details
    Browse the repository at this point in the history
  10. compiler: workaround babel issue with html entity escaping

    Babel doesn't seem to properly preserve escaping of HTML entities when emitting JSX text children, so this commit works around the issue by emitting a JsxExpressionContainer for JSX children that contain ">", "<", or "&" characters.
    
    Closes facebook#29100
    
    ghstack-source-id: 2d0622397cc067c6336f3635073e07daef854084
    Pull Request resolved: facebook#29143
    josephsavona committed May 17, 2024
    Configuration menu
    Copy the full SHA
    5a12a0d View commit details
    Browse the repository at this point in the history
  11. [compiler:publish] Rename publish script

    ghstack-source-id: 1cccc91b5d0e69240b2f4f539c60eab0f156e15f
    Pull Request resolved: facebook#29148
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    e7673e4 View commit details
    Browse the repository at this point in the history
  12. [compiler:publish] Don't hash node_modules

    ghstack-source-id: 4ac2ecc8654b1a8c149ab9d00c06cb4c401473da
    Pull Request resolved: facebook#29147
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    4fbc3a3 View commit details
    Browse the repository at this point in the history
  13. [compiler:publish] Prompt for OTP

    Makes running the script a little more ergonomic by prompting for OTP
    upfront.
    
    ghstack-source-id: e9967bfde1ab01ff9417a848154743ae1926318d
    Pull Request resolved: facebook#29149
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    b195a94 View commit details
    Browse the repository at this point in the history
  14. [compiler:publish] Bump time to reconsider to 3s

    ghstack-source-id: afc8976a8956db79ed824f30cf575d3f5cf93cfe
    Pull Request resolved: facebook#29150
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    38d961f View commit details
    Browse the repository at this point in the history
  15. [compiler:publish] Don't check branch in debug mode

    ghstack-source-id: 465f5a358096c55310ebf5a0beef581646ab553e
    Pull Request resolved: facebook#29153
    poteto committed May 17, 2024
    Configuration menu
    Copy the full SHA
    1052a5f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c2a64b0 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    630c6fb View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    597ad74 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2024

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

Commits on May 19, 2024

  1. Add hyperlink for Good First Issues header (facebook#29103)

    ## Summary
    
    The "Good First Issues" header in the README was missing a hyperlink
    where the other similar headlines had one.
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    ## How did you test this change?
    
    N/A
    
    <!--
    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.
    -->
    NickeSteenen authored May 19, 2024
    Configuration menu
    Copy the full SHA
    ccb06b0 View commit details
    Browse the repository at this point in the history
  2. feat(hyperlink): added a hyperlink to Node in README.md file (faceboo…

    …k#28940)
    
    As a fellow beginner to React, I didn't even know React runs on top of
    Node when I started.
    
    So, some beginners might get confused about what is Node and how to find
    details about it or how to download it.
    
    So, I thought to add a hyperlink to Node replacing the word Node in the
    README.md file. I think this might be a valuable contribution.
    
    - Januda
    itzzjb authored May 19, 2024
    Configuration menu
    Copy the full SHA
    f74c5cc View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. compiler: Improve ValidateNoRefAccessInRender to ignore access in eff…

    …ects
    
    Improves ValidateNoRefAccessInRender (still disabled by default) to properly ignore ref access within effects. This includes allowing ref access within functions that are only transitively called from an effect.
    
    While I was here I also added some extra test fixtures for allowing global mutation in effects.
    
    ghstack-source-id: fb6352a1788b7bdbebb40d5b844b711ef87d6771
    Pull Request resolved: facebook#29151
    josephsavona committed May 20, 2024
    Configuration menu
    Copy the full SHA
    8592369 View commit details
    Browse the repository at this point in the history
  2. compiler: fix accidental propagation of function effects from StartMe…

    …moize/FinishMemoize
    
    By default, React Compiler will skip compilation if it cannot preserve existing memoization. Ie, if the code has an existing `useMemo()` or `useCallback()` and the compiler cannot determine that it is safe to keep that memoization — or do even better — then we'll leave the code alone. The actual compilation doesn't use any hints from existing memo calls, this is purely to check and avoid regressing any specific memoization that developers may have already applied.
    
    However, we were accidentally reporting some false-positive _validation_ errors due to the StartMemoize and FinishMemoize instructions that we emit to track where the memoization was in the source code. This is now fixed.
    
    Fixes facebook#29131
    Fixes facebook#29132
    
    ghstack-source-id: 9f6b8dbc5074ccc96e6073cf11c4920b5375faf6
    Pull Request resolved: facebook#29154
    josephsavona committed May 20, 2024
    Configuration menu
    Copy the full SHA
    cca15a2 View commit details
    Browse the repository at this point in the history
  3. [compiler:chore] fix SSA pdf reference link (facebook#29162)

    ## Summary
    
    This PR fixes the deadlink in the SSA comment. Previously the attached
    link is down now.
    
    ## How did you test this change?
    
    1. I can confirm the PDF in the new link is the same as the old now.
    Reference: https://www.recompiled.dev/blog/ssa/
    2. I can confirm the old link is down, and it is [not just
    me](https://downforeveryoneorjustme.com/pp.info.uni-karlsruhe.de?proto=https)
    
    <img width="580" alt="image"
    src="https://github.com/facebook/react/assets/2883231/eeca5eda-6f61-4ac4-a113-1b04370533d9">
    
    ---------
    
    Co-authored-by: Jan Kassens <[email protected]>
    HerringtonDarkholme and kassens authored May 20, 2024
    Configuration menu
    Copy the full SHA
    68de7d0 View commit details
    Browse the repository at this point in the history
  4. Bump postcss from 8.4.24 to 8.4.31 in /compiler (facebook#29063)

    Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to
    8.4.31.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/postcss/postcss/releases">postcss's
    releases</a>.</em></p>
    <blockquote>
    <h2>8.4.31</h2>
    <ul>
    <li>Fixed <code>\r</code> parsing to fix CVE-2023-44270.</li>
    </ul>
    <h2>8.4.30</h2>
    <ul>
    <li>Improved source map performance (by <a
    href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
    </ul>
    <h2>8.4.29</h2>
    <ul>
    <li>Fixed <code>Node#source.offset</code> (by <a
    href="https://github.com/idoros"><code>@​idoros</code></a>).</li>
    <li>Fixed docs (by <a
    href="https://github.com/coliff"><code>@​coliff</code></a>).</li>
    </ul>
    <h2>8.4.28</h2>
    <ul>
    <li>Fixed <code>Root.source.end</code> for better source map (by <a
    href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
    <li>Fixed <code>Result.root</code> types when <code>process()</code> has
    no parser.</li>
    </ul>
    <h2>8.4.27</h2>
    <ul>
    <li>Fixed <code>Container</code> clone methods types.</li>
    </ul>
    <h2>8.4.26</h2>
    <ul>
    <li>Fixed clone methods types.</li>
    </ul>
    <h2>8.4.25</h2>
    <ul>
    <li>Improve stringify performance (by <a
    href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
    <li>Fixed docs (by <a
    href="https://github.com/vikaskaliramna07"><code>@​vikaskaliramna07</code></a>).</li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Changelog</summary>
    <p><em>Sourced from <a
    href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
    changelog</a>.</em></p>
    <blockquote>
    <h2>8.4.31</h2>
    <ul>
    <li>Fixed <code>\r</code> parsing to fix CVE-2023-44270.</li>
    </ul>
    <h2>8.4.30</h2>
    <ul>
    <li>Improved source map performance (by Romain Menke).</li>
    </ul>
    <h2>8.4.29</h2>
    <ul>
    <li>Fixed <code>Node#source.offset</code> (by Ido Rosenthal).</li>
    <li>Fixed docs (by Christian Oliff).</li>
    </ul>
    <h2>8.4.28</h2>
    <ul>
    <li>Fixed <code>Root.source.end</code> for better source map (by Romain
    Menke).</li>
    <li>Fixed <code>Result.root</code> types when <code>process()</code> has
    no parser.</li>
    </ul>
    <h2>8.4.27</h2>
    <ul>
    <li>Fixed <code>Container</code> clone methods types.</li>
    </ul>
    <h2>8.4.26</h2>
    <ul>
    <li>Fixed clone methods types.</li>
    </ul>
    <h2>8.4.25</h2>
    <ul>
    <li>Improve stringify performance (by Romain Menke).</li>
    <li>Fixed docs (by <a
    href="https://github.com/vikaskaliramna07"><code>@​vikaskaliramna07</code></a>).</li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/postcss/postcss/commit/90208de8805dd762596c0028b8637ffbed23e371"><code>90208de</code></a>
    Release 8.4.31 version</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/58cc860b4c1707510c9cd1bc1fa30b423a9ad6c5"><code>58cc860</code></a>
    Fix carrier return parsing</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/4fff8e4cdc237619df1d73a444c0a8329701c1e2"><code>4fff8e4</code></a>
    Improve pnpm test output</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/cd43ed123274a92ebc13a1e8cccf1d65b8198f84"><code>cd43ed1</code></a>
    Update dependencies</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/caa916bdcbf66c51321574e2dde112ab13e8b306"><code>caa916b</code></a>
    Update dependencies</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/8972f76923e921a3c9655822382039b31b1c8e1a"><code>8972f76</code></a>
    Typo</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/11a5286f781d2a637f2c545c5e9cd661055acaab"><code>11a5286</code></a>
    Typo</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/45c55017776fc61f7815d1ea8e92d5291ca5d6c8"><code>45c5501</code></a>
    Release 8.4.30 version</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/bc3c341f589f9c15f1b56838a33d908374e537e0"><code>bc3c341</code></a>
    Update linter</li>
    <li><a
    href="https://github.com/postcss/postcss/commit/b2be58a2eb788d12474ee1335f8ecdb9fa6225aa"><code>b2be58a</code></a>
    Merge pull request <a
    href="https://redirect.github.com/postcss/postcss/issues/1881">#1881</a>
    from romainmenke/improve-sourcemap-performance--phil...</li>
    <li>Additional commits viewable in <a
    href="https://github.com/postcss/postcss/compare/8.4.24...8.4.31">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=postcss&package-manager=npm_and_yarn&previous-version=8.4.24&new-version=8.4.31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/facebook/react/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 20, 2024
    Configuration menu
    Copy the full SHA
    8287cb9 View commit details
    Browse the repository at this point in the history
  5. Bump rustix from 0.37.22 to 0.37.27 in /compiler (facebook#29173)

    Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.37.22
    to 0.37.27.
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/b38dc512628b5db8d08c26449ee2beed7ed51dcc"><code>b38dc51</code></a>
    chore: Release rustix version 0.37.27</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/a2d9c8ee1a0c1548f17e5ec6096f3a005111d481"><code>a2d9c8e</code></a>
    Fix p{read,write}v{,v2}'s encoding of the offset argument on Linux. (<a
    href="https://redirect.github.com/bytecodealliance/rustix/issues/896">#896</a>)
    (#...</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/dce277762238d5fd40c57ccf0151645d8de3d33d"><code>dce2777</code></a>
    chore: Release rustix version 0.37.26</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/06dbe83c60cbfa603c9437aef9dfd119f068b1df"><code>06dbe83</code></a>
    Fix <code>sendmsg_unix</code>'s address encoding. (<a
    href="https://redirect.github.com/bytecodealliance/rustix/issues/885">#885</a>)
    (<a
    href="https://redirect.github.com/bytecodealliance/rustix/issues/886">#886</a>)</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/00b84d6aac2364455eab2c68e42afee63d6e3ad3"><code>00b84d6</code></a>
    chore: Release rustix version 0.37.25</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/cad15a7076d493a0651fb0b7889bd5e5a72a8f17"><code>cad15a7</code></a>
    Fixes for <code>Dir</code> on macOS, FreeBSD, and WASI.</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/df3c3a192cf144af0da8a57417fb4addbdc611f6"><code>df3c3a1</code></a>
    Merge pull request from GHSA-c827-hfw6-qwvm</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/b78aeff1a271863ecc75ccca37f014d33b9f6705"><code>b78aeff</code></a>
    chore: Release rustix version 0.37.24</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/c0c3f01d7c8296ebadb23ad0b4f82a9a082252ae"><code>c0c3f01</code></a>
    Add GNU/Hurd support (<a
    href="https://redirect.github.com/bytecodealliance/rustix/issues/852">#852</a>)</li>
    <li><a
    href="https://github.com/bytecodealliance/rustix/commit/f416b6b27b8d0540e8be14f8d30153ea3e3d7476"><code>f416b6b</code></a>
    Fix the <code>test_ttyname_ok</code> test when /dev/stdin is
    inaccessable. (<a
    href="https://redirect.github.com/bytecodealliance/rustix/issues/821">#821</a>)</li>
    <li>Additional commits viewable in <a
    href="https://github.com/bytecodealliance/rustix/compare/v0.37.22...v0.37.27">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustix&package-manager=cargo&previous-version=0.37.22&new-version=0.37.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/facebook/react/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 20, 2024
    Configuration menu
    Copy the full SHA
    9abea0c View commit details
    Browse the repository at this point in the history
  6. Bump tough-cookie from 4.1.2 to 4.1.4 in /compiler (facebook#29065)

    Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from
    4.1.2 to 4.1.4.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/salesforce/tough-cookie/releases">tough-cookie's
    releases</a>.</em></p>
    <blockquote>
    <h2>v4.1.4</h2>
    <p><a
    href="https://www.npmjs.com/package/tough-cookie/v/4.1.4">https://www.npmjs.com/package/tough-cookie/v/4.1.4</a></p>
    <h2>What's Changed</h2>
    <ul>
    <li>Add local alias for <code>toString</code> by <a
    href="https://github.com/corvidism"><code>@​corvidism</code></a> in <a
    href="https://redirect.github.com/salesforce/tough-cookie/pull/409">salesforce/tough-cookie#409</a></li>
    <li>Fix incorrect string validation for URL by <a
    href="https://github.com/coditva"><code>@​coditva</code></a> in <a
    href="https://redirect.github.com/salesforce/tough-cookie/pull/261">salesforce/tough-cookie#261</a></li>
    </ul>
    <h2>New Contributors</h2>
    <ul>
    <li><a href="https://github.com/corvidism"><code>@​corvidism</code></a>
    made their first contribution in <a
    href="https://redirect.github.com/salesforce/tough-cookie/pull/409">salesforce/tough-cookie#409</a></li>
    <li><a href="https://github.com/coditva"><code>@​coditva</code></a> made
    their first contribution in <a
    href="https://redirect.github.com/salesforce/tough-cookie/pull/261">salesforce/tough-cookie#261</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/salesforce/tough-cookie/compare/v4.1.3...v4.1.4">https://github.com/salesforce/tough-cookie/compare/v4.1.3...v4.1.4</a></p>
    <h2>4.1.3</h2>
    <p>Security fix for Prototype Pollution discovery in <a
    href="https://redirect.github.com/salesforce/tough-cookie/issues/282">#282</a>.
    This is a minor release, although output from the <code>inspect</code>
    utility is affected by this change, we felt this change was important
    enough to be pushed into the next patch.</p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/cacbc37936bd4824693d885e1e65dca626ed3c8c"><code>cacbc37</code></a>
    Bump version to 4.1.4</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/a48fb3a6ba2bbce41595a20e1db56543d974057b"><code>a48fb3a</code></a>
    Add tests for url validation</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/50e69bf9372c13a1e573b77c179a879198a240e3"><code>50e69bf</code></a>
    Merge pull request <a
    href="https://redirect.github.com/salesforce/tough-cookie/issues/261">#261</a>
    from postmanlabs/fix/url-string-validation</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/1253d58825378c2327e3a71e2228b65812d1cf7c"><code>1253d58</code></a>
    Merge pull request <a
    href="https://redirect.github.com/salesforce/tough-cookie/issues/409">#409</a>
    from corvidism/validators-to-string</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/238367e2f1d8a2c72cc25cc80a6eeecb612983d6"><code>238367e</code></a>
    Add local alias for <code>toString</code></li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/4ff4d29f6cefd279a412b8d62a21142ebd410b36"><code>4ff4d29</code></a>
    4.1.3 release preparation, update the package and lib/version to 4.1.3.
    (<a
    href="https://redirect.github.com/salesforce/tough-cookie/issues/284">#284</a>)</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/12d474791bb856004e858fdb1c47b7608d09cf6e"><code>12d4747</code></a>
    Prevent prototype pollution in cookie memstore (<a
    href="https://redirect.github.com/salesforce/tough-cookie/issues/283">#283</a>)</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/f06b72d1d447f33dfa6222c0a3c0c5e063558248"><code>f06b72d</code></a>
    Fix documentation for store.findCookies, missing allowSpecialUseDomain
    proper...</li>
    <li><a
    href="https://github.com/salesforce/tough-cookie/commit/cf6debd15f16df43030f36719251fcce0ed27dfc"><code>cf6debd</code></a>
    Fix incorrect string validation for URL</li>
    <li>See full diff in <a
    href="https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.4">compare
    view</a></li>
    </ul>
    </details>
    <details>
    <summary>Maintainer changes</summary>
    <p>This version was pushed to npm by <a
    href="https://www.npmjs.com/~ccasey">ccasey</a>, a new releaser for
    tough-cookie since your current version.</p>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tough-cookie&package-manager=npm_and_yarn&previous-version=4.1.2&new-version=4.1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/facebook/react/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 20, 2024
    Configuration menu
    Copy the full SHA
    ba51ebe View commit details
    Browse the repository at this point in the history
  7. Bump word-wrap from 1.2.3 to 1.2.5 in /compiler (facebook#29064)

    Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3
    to 1.2.5.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/jonschlinkert/word-wrap/releases">word-wrap's
    releases</a>.</em></p>
    <blockquote>
    <h2>1.2.5</h2>
    <p><strong>Changes</strong>:</p>
    <p>Reverts default value for <code>options.indent</code> to two spaces
    <code>' '</code>.</p>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/jonschlinkert/word-wrap/compare/1.2.4...1.2.5">https://github.com/jonschlinkert/word-wrap/compare/1.2.4...1.2.5</a></p>
    <h2>1.2.4</h2>
    <h2>What's Changed</h2>
    <ul>
    <li>Remove default indent by <a
    href="https://github.com/mohd-akram"><code>@​mohd-akram</code></a> in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/24">jonschlinkert/word-wrap#24</a></li>
    <li>🔒fix: CVE 2023 26115 (2) by <a
    href="https://github.com/OlafConijn"><code>@​OlafConijn</code></a> in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/41">jonschlinkert/word-wrap#41</a></li>
    <li>:lock: fix: CVE-2023-26115 by <a
    href="https://github.com/aashutoshrathi"><code>@​aashutoshrathi</code></a>
    in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/33">jonschlinkert/word-wrap#33</a></li>
    <li>chore: publish workflow by <a
    href="https://github.com/OlafConijn"><code>@​OlafConijn</code></a> in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/42">jonschlinkert/word-wrap#42</a></li>
    </ul>
    <h2>New Contributors</h2>
    <ul>
    <li><a
    href="https://github.com/mohd-akram"><code>@​mohd-akram</code></a> made
    their first contribution in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/24">jonschlinkert/word-wrap#24</a></li>
    <li><a
    href="https://github.com/OlafConijn"><code>@​OlafConijn</code></a> made
    their first contribution in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/41">jonschlinkert/word-wrap#41</a></li>
    <li><a
    href="https://github.com/aashutoshrathi"><code>@​aashutoshrathi</code></a>
    made their first contribution in <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/pull/33">jonschlinkert/word-wrap#33</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4">https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/207044ebda1dd3809d15b6000a48409266536771"><code>207044e</code></a>
    1.2.5</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/98943154855b0dd79b707462b9202614990c7f61"><code>9894315</code></a>
    revert default indent</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/f64b188c7261d26b99e1e2075d6b12f21798e83a"><code>f64b188</code></a>
    run verb to generate README</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/03ea08256ba0c8e8b02b1b304f0f5bd2b1863207"><code>03ea082</code></a>
    Merge pull request <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/issues/42">#42</a>
    from jonschlinkert/chore/publish-workflow</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/420dce9a2412b21881202b73a3c34f0edc53cb2e"><code>420dce9</code></a>
    Merge pull request <a
    href="https://redirect.github.com/jonschlinkert/word-wrap/issues/41">#41</a>
    from jonschlinkert/fix/CVE-2023-26115-2</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/bfa694edf55bb84ff84512f13da6d68bf7593f06"><code>bfa694e</code></a>
    Update .github/workflows/publish.yml</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/ace0b3c78f81aaf43040bab3bc91d3c5546d3fd2"><code>ace0b3c</code></a>
    chore: bump version to 1.2.4</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/6fd727594676f3e1b196b08a320908bec2f4ca02"><code>6fd7275</code></a>
    chore: add publish workflow</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/30d6daf60fce429f5f559252fa86ee78200652c4"><code>30d6daf</code></a>
    chore: fix test</li>
    <li><a
    href="https://github.com/jonschlinkert/word-wrap/commit/655929cabea6299dddf3b4a21fc3713fca701b48"><code>655929c</code></a>
    chore: remove package-lock</li>
    <li>Additional commits viewable in <a
    href="https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=word-wrap&package-manager=npm_and_yarn&previous-version=1.2.3&new-version=1.2.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/facebook/react/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 20, 2024
    Configuration menu
    Copy the full SHA
    c325aec View commit details
    Browse the repository at this point in the history
  8. refactor[react-devtools]: rewrite context menus (facebook#29049)

    ## Summary
    - While rolling out RDT 5.2.0 on Fusebox, we've discovered that context
    menus don't work well with this environment. The reason for it is the
    context menu state implementation - in a global context we define a map
    of registered context menus, basically what is shown at the moment (see
    deleted Contexts.js file). These maps are not invalidated on each
    re-initialization of DevTools frontend, since the bundle
    (react-devtools-fusebox module) is not reloaded, and this results into
    RDT throwing an error that some context menu was already registered.
    - We should not keep such data in a global state, since there is no
    guarantee that this will be invalidated with each re-initialization of
    DevTools (like with browser extension, for example).
    - The new implementation is based on a `ContextMenuContainer` component,
    which will add all required `contextmenu` event listeners to the
    anchor-element. This component will also receive a list of `items` that
    will be displayed in the shown context menu.
    - The `ContextMenuContainer` component is also using
    `useImperativeHandle` hook to extend the instance of the component, so
    context menus can be managed imperatively via `ref`:
    `contextMenu.current?.hide()`, for example.
    - **Changed**: The option for copying value to clipboard is now hidden
    for functions. The reasons for it are:
    - It is broken in the current implementation, because we call
    `JSON.stringify` on the value, see
    `packages/react-devtools-shared/src/backend/utils.js`.
    - I don't see any reasonable value in doing this for the user, since `Go
    to definition` option is available and you can inspect the real code and
    then copy it.
    - We already filter out fields from objects, if their value is a
    function, because the whole object is passed to `JSON.stringify`.
    
    ## How did you test this change?
    ### Works with element props and hooks:
    - All context menu items work reliably for props items
    - All context menu items work reliably or hooks items
    
    
    https://github.com/facebook/react/assets/28902667/5e2d58b0-92fa-4624-ad1e-2bbd7f12678f
    
    ### Works with timeline profiler:
    - All context menu items work reliably: copying, zooming, ...
    - Context menu automatically closes on the scroll event
    
    
    https://github.com/facebook/react/assets/28902667/de744cd0-372a-402a-9fa0-743857048d24
    
    ### Works with Fusebox:
    - Produces no errors
    - Copy to clipboard context menu item works reliably
    
    
    https://github.com/facebook/react/assets/28902667/0288f5bf-0d44-435c-8842-6b57bc8a7a24
    hoxyq authored May 20, 2024
    Configuration menu
    Copy the full SHA
    d14ce51 View commit details
    Browse the repository at this point in the history
  9. [Compiler playground] bold changed passes (facebook#29159)

    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    In the playground, it's hard to see at a glance what compiler passes are
    involved in introducing changes.
    This PR bolds every pass that introduces a change.
    
    ## 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.
    -->
    
    Before:
    <img width="1728" alt="image"
    src="https://github.com/facebook/react/assets/5144292/803ca786-0726-4456-b0db-520dc90a6771">
    
    After:
    <img width="1728" alt="image"
    src="https://github.com/facebook/react/assets/5144292/38885644-00e9-4065-9c44-db533000d13a">
    JackYoustra authored May 20, 2024
    Configuration menu
    Copy the full SHA
    57fbe3b View commit details
    Browse the repository at this point in the history
  10. feat(compiler-healthcheck): Support strict mode check for nextjs apps (

    …facebook#29167)
    
    ## Summary
    
    Closes facebook#29130 
    
    ## How did you test this change?
    
    Run the healthcheck in the compiler playground and the nodejs.org repo
    for the next config with a `.mjs` extension. Sanity with Vite React
    template.
    
    Signed-off-by: abizek <[email protected]>
    abizek authored May 20, 2024
    Configuration menu
    Copy the full SHA
    d3ce0d3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6f90365 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    bf046e8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    55dd0b1 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Enable disableStringRefs and enableRefAsProp for React Native (Me…

    …ta) (facebook#29177)
    
    ## Summary
    
    Enables the `disableStringRefs` and `enableRefAsProp` feature flags for
    React Native (Meta).
    
    ## How did you test this change?
    
    ```
    $ yarn test
    $ yarn flow fabric
    ```
    yungsters authored May 21, 2024
    Configuration menu
    Copy the full SHA
    7621466 View commit details
    Browse the repository at this point in the history
  2. Fix assertConsoleErrorDev on message mismatch with withoutStack: true (

    …facebook#29198)
    
    ## Summary
    
    ```js
    assertConsoleErrorDev([
      ['Hello', {withoutStack: true}]
    ])
    ```
    
    now errors with a helpful diff message if the message mismatched. See
    first commit for previous behavior.
    
    ## How did you test this change?
    
    - `yarn test --watch
    packages/internal-test-utils/__tests__/ReactInternalTestUtils-test.js`
    eps1lon authored May 21, 2024
    Configuration menu
    Copy the full SHA
    5cc9f69 View commit details
    Browse the repository at this point in the history
  3. [Flight / Flight Reply] Don't clear pending listeners when entering b…

    …locked state (facebook#29201)
    
    Fixes facebook#29200
    
    The cyclic state might have added listeners that will still need to be
    invoked. This happens if we have a cyclic reference AND end up blocked.
    
    We have already cleared these before entering the parsing when we enter
    the CYCLIC state so we they already have the right type. If listeners
    are added during this phase they should carry over to the blocked state.
    
    ---------
    
    Co-authored-by: Hendrik Liebau <[email protected]>
    sebmarkbage and unstubbable authored May 21, 2024
    Configuration menu
    Copy the full SHA
    8f3c052 View commit details
    Browse the repository at this point in the history
  4. [compiler:playground] Wait for build before running playground

    Explicitly waits for the build to finish since the playground requires
    them to run
    
    ghstack-source-id: 0bd7d5272d7fa09dc3a140b82a962dc4a3ae585b
    Pull Request resolved: facebook#29180
    poteto committed May 21, 2024
    Configuration menu
    Copy the full SHA
    0a0a5c0 View commit details
    Browse the repository at this point in the history
  5. [Flight] don't overwrite existing chunk listeners in 'wakeChunkIfInit…

    …ialized' (facebook#29204)
    
    Follow up to facebook#29201. If a chunk
    had listeners attached already (e.g. because `.then` was called on the
    chunk returned from `createFromReadableStream`),
    `wakeChunkIfInitialized` would overwrite any listeners added during
    chunk initialization. This caused cyclic [path
    references](facebook#28996) within that
    chunk to never resolve. Fixed by merging the two arrays of listeners.
    lubieowoce authored May 21, 2024
    Configuration menu
    Copy the full SHA
    9b3f909 View commit details
    Browse the repository at this point in the history
  6. [compiler:playground] JS tab is expanded by default

    When using the playground you typically want to see what it outputs, so
    let's make the JS tab expanded by default.
    
    ghstack-source-id: 721bc4c381c50db008058b31e1f976e92eab8548
    Pull Request resolved: facebook#29203
    poteto committed May 21, 2024
    Configuration menu
    Copy the full SHA
    b759b71 View commit details
    Browse the repository at this point in the history
  7. [compiler:playground] Update babel.config.js

    Use new defaults
    
    ghstack-source-id: d2da1df69db9f1b01578af6d52ea4a2613769f9b
    Pull Request resolved: facebook#29205
    poteto committed May 21, 2024
    Configuration menu
    Copy the full SHA
    0f58454 View commit details
    Browse the repository at this point in the history
  8. [Fiber] render boundary in fallback if it contains a new stylesheet d…

    …uring sync update (facebook#28965)
    
    Updates Suspensey instances and resources to preload even during urgent
    updates and to potentially suspend.
    
    The current implementation is unchanged for transitions but for sync
    updates if there is a suspense boundary above the resource/instance it
    will be rendered in fallback mode instead.
    
    Note: This behavior is not what we want for images once we make them
    suspense enabled. We will need to have forked behavior here to
    distinguish between stylesheets which should never commit when not
    loaded and images which should commit after a small delay
    gnoff authored May 21, 2024
    Configuration menu
    Copy the full SHA
    217b2cc View commit details
    Browse the repository at this point in the history
  9. [Flight Reply] retain listeners when resolving models with existing l…

    …isteners (facebook#29207)
    
    In facebook#29201 a fix was made to ensure we don't "forget" about some
    listeners when handling cyclic chunks.
    In facebook#29204 another fix was made for a special case when the chunk already
    has listeners before it first resolves.
    
    This implements the followup fix for Flight Reply which was originally
    missed in facebook#29204
    
    Co-authored-by: Janka Uryga <[email protected]>
    gnoff and lubieowoce authored May 21, 2024
    Configuration menu
    Copy the full SHA
    81c5ff2 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Configuration menu
    Copy the full SHA
    3ac551e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f994737 View commit details
    Browse the repository at this point in the history
  3. compiler: Handle TSNonNullAssertion expressions (facebook#29218)

    ## Summary
    
    We ran React compiler against part of our codebase and collected
    compiler errors. One of the more common non-actionable errors is caused
    by usage of the `!` TypeScript non-null assertion operation:
    
    ```
    (BuildHIR::lowerExpression) Handle TSNonNullExpression expressions
    ```
    
    It seems like React Compiler _should_ be able to support this by just
    ignoring the syntax and using the underlying expression. I'm sure a lot
    of our non-null assertion usage should not exist and I understand if
    React Compiler does not want to support this syntax. It wasn't obvious
    to me if this omission was intentional or if there are future plans to
    use `TSNonNullExpression` as part of the compiler's analysis. If there
    are no future plans it seems like just ignoring it should be fine.
    
    ## How did you test this change?
    
    ```sh
    ❯ yarn snap --filter
    yarn run v1.17.3
    $ yarn workspace babel-plugin-react-compiler run snap --filter
    $ node ../snap/dist/main.js --filter
     PASS  non-null-assertion
    1 Tests, 1 Passed, 0 Failed
    ```
    henryqdineen authored May 22, 2024
    Configuration menu
    Copy the full SHA
    4c2e457 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Unify ReactFiberCurrentOwner and ReactCurrentFiber (facebook#29038)

    We previously had two slightly different concepts for "current fiber".
    
    There's the "owner" which is set inside of class components in prod if
    string refs are enabled, and sometimes inside function components in DEV
    but not other contexts.
    
    Then we have the "current fiber" which is only set in DEV for various
    warnings but is enabled in a bunch of contexts.
    
    This unifies them into a single "current fiber".
    
    The concept of string refs shouldn't really exist so this should really
    be a DEV only concept. In the meantime, this sets the current fiber
    inside class render only in prod, however, in DEV it's now enabled in
    more contexts which can affect the string refs. That was already the
    case that a string ref in a Function component was only connecting to
    the owner in prod. Any string ref associated with any non-class won't
    work regardless so that's not an issue. The practical change here is
    that an element with a string ref created inside a life-cycle associated
    with a class will work in DEV but not in prod. Since we need the current
    fiber to be available in more contexts in DEV for the debugging
    purposes. That wouldn't affect any old code since it would have a broken
    ref anyway. New code shouldn't use string refs anyway.
    
    The other implication is that "owner" doesn't necessarily mean
    "rendering" since we need the "owner" to track other debug information
    like stacks - in other contexts like useEffect, life cycles, etc.
    Internally we have a separate `isRendering` flag that actually means
    we're rendering but even that is a very overloaded concept. So anything
    that uses "owner" to imply rendering might be wrong with this change.
    
    This is a first step to a larger refactor for tracking current rendering
    information.
    
    ---------
    
    Co-authored-by: Sebastian Silbermann <[email protected]>
    sebmarkbage and eps1lon authored May 23, 2024
    Configuration menu
    Copy the full SHA
    2e3e6a9 View commit details
    Browse the repository at this point in the history
  2. Set the current fiber to the source of the error during error reporti…

    …ng (facebook#29044)
    
    This lets us expose the component stack to the error reporting that
    happens here as `console.error` patching. Now if you just call
    `console.error` in the error handlers it'll get the component stack
    added to the end by React DevTools.
    
    However, unfortunately this happens a little too late so the Fiber will
    be disconnected with its `.return` pointer set to null already. So it'll
    be too late to extract a parent component stack from but you can at
    least get the stack from source to error boundary. To work around this I
    manually add the parent component stack in our default handlers when
    owner stacks are off. We could potentially fix this but you can also
    just include it yourself if you're calling `console.error` and it's not
    a problem for owner stacks.
    
    This is not a problem for owner stacks because we'll still have those
    and so for those just calling `console.error` just works. However, the
    main feature is that by letting React add them, we can switch to using
    native error stacks when available.
    sebmarkbage authored May 23, 2024
    Configuration menu
    Copy the full SHA
    2e540e2 View commit details
    Browse the repository at this point in the history
  3. compiler: fixture for suboptimal jsx sibling memo block merging

    React Compiler attempts to merge consecutive reactive scopes in order to reduce overhead. The basic idea is that if two consecutive scopes would always invalidate together then we should merge them. It gets more complicated, though, because values produced by the earlier scope may not always invalidate when their inputs do. For example, a scope that produces `fn(x)` may not invalidate on all changes to `x` if the function is `Math.max(x, 10)` (changing x from 8 to 9 won't change the output).
    
    Previously we were conservative and only merged if either:
    * the two scopes had the same dependencies
    * the second scope's deps exactly matched the previous scope's outputs.
    
    You can see this in the new fixture, where the second `<button>` gets its own scope, which happens because the preceding scope has an extra output that isn't a dep of the `<button>`'s scope.
    
    ghstack-source-id: d869c8d4df5aa4105bbdae01b5dd7f106145b351
    Pull Request resolved: facebook#29155
    josephsavona committed May 23, 2024
    Configuration menu
    Copy the full SHA
    82a0a5f View commit details
    Browse the repository at this point in the history
  4. compiler: Improve merging of memo scopes that invalidate together

    Improves merging of consecutive scopes so that we now merge two scopes if the dependencies of the second scope are a subset of the previous scope's output *and* that dependency has a type that will always produce a new value (array, object, jsx, function) if it is re-evaluated.
    
    To make this easier, we extend the set of builtin types to include ones for function expressions and JSX and to infer these types in InferTypes. This allows using the already inferred types in MergeReactiveScopesThatInvalidateTogether.
    
    ghstack-source-id: e9119fc4e02b3665848113d71fdff0c5bac3348a
    Pull Request resolved: facebook#29156
    josephsavona committed May 23, 2024
    Configuration menu
    Copy the full SHA
    890896b View commit details
    Browse the repository at this point in the history
  5. compiler: Use types to decide which scopes are eligible for merging

    In MergeReactiveScopesThatInvalidateTogether when deciding which scopes were eligible for mergin at all, we looked specifically at the instructions whose lvalue produces the declaration. So if a scope declaration was `t0`, we'd love for the instruction where `t0` was the lvalue and look at the instruction type to decide if it is eligible for merging.
    
    Here, we use the inferred type instead (now that the inferred types support the same set of types of instructions we looked at before). This allows us to find more cases where scopes can be merged.
    
    ghstack-source-id: 0e3e05f24ea0ac6e3c43046bc3e114f906747a04
    Pull Request resolved: facebook#29157
    josephsavona committed May 23, 2024
    Configuration menu
    Copy the full SHA
    b687fd2 View commit details
    Browse the repository at this point in the history
  6. compiler: repro for unmerged scopes due to intermediates

    Repro of a case where we should ideally merge consecutive scopes, but where intermediate temporaries prevent the scopes from merging.
    
    We'd need to reorder instructions in order to merge these.
    
    ghstack-source-id: 4f05672604eeb547fc6c26ef99db6572843ac646
    Pull Request resolved: facebook#29197
    josephsavona committed May 23, 2024
    Configuration menu
    Copy the full SHA
    5fe8c0b View commit details
    Browse the repository at this point in the history
  7. Move createElement/JSX Warnings into the Renderer (facebook#29088)

    This is necessary to simplify the component stack handling to make way
    for owner stacks. It also solves some hacks that we used to have but
    don't quite make sense. It also solves the problem where things like key
    warnings get silenced in RSC because they get deduped. It also surfaces
    areas where we were missing key warnings to begin with.
    
    Almost every type of warning is issued from the renderer. React Elements
    are really not anything special themselves. They're just lazily invoked
    functions and its really the renderer that determines there semantics.
    
    We have three types of warnings that previously fired in
    JSX/createElement:
    
    - Fragment props validation.
    - Type validation.
    - Key warning.
    
    It's nice to be able to do some validation in the JSX/createElement
    because it has a more specific stack frame at the callsite. However,
    that's the case for every type of component and validation. That's the
    whole point of enableOwnerStacks. It's also not sufficient to do it in
    JSX/createElement so we also have validation in the renderers too. So
    this validation is really just an eager validation but also happens
    again later.
    
    The problem with these is that we don't really know what types are valid
    until we get to the renderer. Additionally, by placing it in the
    isomorphic code it becomes harder to do deduping of warnings in a way
    that makes sense for that renderer. It also means we can't reuse logic
    for managing stacks etc.
    
    Fragment props validation really should just be part of the renderer
    like any other component type. This also matters once we add Fragment
    refs and other fragment features. So I moved this into Fiber. However,
    since some Fragments don't have Fibers, I do the validation in
    ChildFiber instead of beginWork where it would normally happen.
    
    For `type` validation we already do validation when rendering. By
    leaving it to the renderer we don't have to hard code an extra list.
    This list also varies by context. E.g. class components aren't allowed
    in RSC but client references are but we don't have an isomorphic way to
    identify client references because they're defined by the host config so
    the current logic is flawed anyway. I kept the early validation for now
    without the `enableOwnerStacks` since it does provide a nicer stack
    frame but with that flag on it'll be handled with nice stacks anyway. I
    normalized some of the errors to ensure tests pass.
    
    For `key` validation it's the same principle. The mechanism for the
    heuristic is still the same - if it passes statically through a parent
    JSX/createElement call then it's considered validated. We already did
    print the error later from the renderer so this also disables the early
    log in the `enableOwnerStacks` flag.
    
    I also added logging to Fizz so that key warnings can print in SSR logs.
    
    Flight is a bit more complex. For elements that end up on the client we
    just pass the `validated` flag along to the client and let the client
    renderer print the error once rendered. For server components we log the
    error from Flight with the server component as the owner on the stack
    which will allow us to print the right stack for context. The factoring
    of this is a little tricky because we only want to warn if it's in an
    array parent but we want to log the error later to get the right debug
    info.
    
    Fiber/Fizz has a similar factoring problem that causes us to create a
    fake Fiber for the owner which means the logs won't be associated with
    the right place in DevTools.
    sebmarkbage authored May 23, 2024
    Configuration menu
    Copy the full SHA
    84239da View commit details
    Browse the repository at this point in the history
  8. [Fiber] clarify entry condition for suspensey commit recursion (faceb…

    …ook#29222)
    
    Previously Suspensey recursion would only trigger if the
    ShouldSuspendCommit flag was true. However there is a dependence on the
    Visibility flag embedded in this logic because these flags share a bit.
    To make it clear that the semantics of Suspensey resources require
    considering both flags I've added it to the condition even though this
    extra or-ing is a noop when the bit is shared
    gnoff authored May 23, 2024
    Configuration menu
    Copy the full SHA
    f55d172 View commit details
    Browse the repository at this point in the history
  9. Fix async batching in React.startTransition (facebook#29226)

    Note: Despite the similar-sounding description, this fix is unrelated to
    the issue where updates that occur after an `await` in an async action
    must also be wrapped in their own `startTransition`, due to the absence
    of an AsyncContext mechanism in browsers today.
    
    ---
    
    Discovered a flaw in the current implementation of the isomorphic
    startTransition implementation (React.startTransition), related to async
    actions. It only creates an async scope if something calls setState
    within the synchronous part of the action (i.e. before the first
    `await`). I had thought this was fine because if there's no update
    during this part, then there's nothing that needs to be entangled. I
    didn't think this through, though — if there are multiple async updates
    interleaved throughout the rest of the action, we need the async scope
    to have already been created so that _those_ are batched together.
    
    An even easier way to observe this is to schedule an optimistic update
    after an `await` — the optimistic update should not be reverted until
    the async action is complete.
    
    To implement, during the reconciler's module initialization, we compose
    its startTransition implementation with any previous reconciler's
    startTransition that was already initialized. Then, the isomorphic
    startTransition is the composition of every
    reconciler's startTransition.
    
    ```js
    function startTransition(fn) {
      return startTransitionDOM(() => {
        return startTransitionART(() => {
          return startTransitionThreeFiber(() => {
            // and so on...
            return fn();
          });
        });
      });
    }
    ```
    
    This is basically how flushSync is implemented, too.
    acdlite authored May 23, 2024
    Configuration menu
    Copy the full SHA
    ee5c194 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. compiler: distinguish globals/imports/module-locals

    We currently use `LoadGlobal` and `StoreGlobal` to represent any read (or write) of a variable defined outside the component or hook that is being compiled. This is mostly fine, but for a lot of things we want to do going forward (resolving types across modules, for example) it helps to understand the actual source of a variable.
    
    This PR is an incremental step in that direction. We continue to use LoadGlobal/StoreGlobal, but LoadGlobal now has a `binding:NonLocalBinding` instead of just the name of the global. The NonLocalBinding type tells us whether it was an import (and which kind, the source module name etc), a module-local binding, or a true global. By keeping the LoadGlobal/StoreGlobal instructions, most code that deals with "anything not declared locally" doesn't have to care about the difference. However, code that _does_ want to know the source of the value can figure it out.
    
    ghstack-source-id: e701d4ebc0fb5681a0197198ac2c2a03b3e8aae9
    Pull Request resolved: facebook#29188
    josephsavona committed May 24, 2024
    Configuration menu
    Copy the full SHA
    5061f31 View commit details
    Browse the repository at this point in the history
  2. compiler: getGlobalDeclaration() takes a NonLocalBinding

    No-op refactor to make Environment#getGlobalDeclaration() take a NonLocalBinding instead of just a name. The idea is that in subsequent PRs we can use information about the binding to resolve a type more accurately. For example, we can resolve `Array` differently if its an import or local and not the global Array. Similar for resolving local `useState` differently than the one from React.
    
    ghstack-source-id: c8063e6fb8acdd347a56477d6b06238dd54979b1
    Pull Request resolved: facebook#29189
    josephsavona committed May 24, 2024
    Configuration menu
    Copy the full SHA
    788ed90 View commit details
    Browse the repository at this point in the history
  3. compiler: only resolve globals and react imports

    Updates Environment#getGlobalDeclaration() to only resolve "globals" if they are a true global or an import from react/react-dom. We still keep the logic to resolve hook-like names as custom hooks. Notably, this means that a local `Array` reference won't get confused with our Array global declaration, a local `useState` (or import from something other than React) won't get confused as `React.useState()`, etc.
    
    I tried to write a proper fixture test to test that we react to changes to a custom setState setter function, but I think there may be an issue with snap and how it handles re-renders from effects. I think the tests are good here but open to feedback if we want to go down the rabbit hole of figuring out a proper snap test for this.
    
    ghstack-source-id: 5e9a8f6e0d23659c72a9d041e8d394b83d6e526d
    Pull Request resolved: facebook#29190
    josephsavona committed May 24, 2024
    Configuration menu
    Copy the full SHA
    935180c View commit details
    Browse the repository at this point in the history

Commits on May 25, 2024

  1. [Fiber] Use Owner/JSX Stack When Appending Stacks to Console (faceboo…

    …k#29206)
    
    This one should be fully behind the `enableOwnerStacks` flag.
    
    Instead of printing the parent Component stack all the way to the root,
    this now prints the owner stack of every JSX callsite. It also includes
    intermediate callsites between the Component and the JSX call so it has
    potentially more frames. Mainly it provides the line number of the JSX
    callsite. In terms of the number of components is a subset of the parent
    component stack so it's less information in that regard. This is usually
    better since it's more focused on components that might affect the
    output but if it's contextual based on rendering it's still good to have
    parent stack. Therefore, I still use the parent stack when printing DOM
    nesting warnings but I plan on switching that format to a diff view
    format instead (Next.js already reformats the parent stack like this).
    
    __Follow ups__
    
    - Server Components show up in the owner stack for client logs but logs
    done by Server Components don't yet get their owner stack printed as
    they're replayed. They're also not yet printed in the server logs of the
    RSC server.
    
    - Server Component stack frames are formatted as the server and added to
    the end but this might be a different format than the browser. E.g. if
    server is running V8 and browser is running JSC or vice versa. Ideally
    we can reformat them in terms of the client formatting.
    
    - This doesn't yet update Fizz or DevTools. Those will be follow ups.
    Fizz still prints parent stacks in the server side logs. The stacks
    added to user space `console.error` calls by DevTools still get the
    parent stacks instead.
    
    - It also doesn't yet expose these to user space so there's no way to
    get them inside `onCaughtError` for example or inside a custom
    `console.error` override.
    
    - In another follow up I'll use `console.createTask` instead and
    completely remove these stacks if it's available.
    sebmarkbage authored May 25, 2024
    Configuration menu
    Copy the full SHA
    d6cfa0f View commit details
    Browse the repository at this point in the history
  2. [Fiber] Replace setCurrentDebugFiberInDEV with runWithFiberInDEV (fac…

    …ebook#29221)
    
    Stacked on facebook#29044.
    
    To work with `console.createTask(...).run(...)` we need to be able to
    run a function in the scope of the task.
    
    The main concern with this, other than general performance, is that it
    might add more stack frames on very deep stacks that hit the stack
    limit. Such as with the commit phase where we recursively go down the
    tree. These callbacks aren't really necessary in the recursive part but
    only in the shallow invocation of the commit phase for each tag. So we
    could refactor the commit phase so that only the shallow part at each
    level is covered this way.
    sebmarkbage authored May 25, 2024
    Configuration menu
    Copy the full SHA
    b078c81 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2024

  1. [Fiber] Enable Native console.createTask Stacks When Available (faceb…

    …ook#29223)
    
    Stacked on facebook#29206 and facebook#29221.
    
    This disables appending owner stacks to console when
    `console.createTask` is available in the environment. Instead we rely on
    native "async" stacks that end up looking like this with source maps and
    ignore list enabled.
    
    <img width="673" alt="Screenshot 2024-05-22 at 4 00 27 PM"
    src="https://github.com/facebook/react/assets/63648/5313ed53-b298-4386-8f76-8eb85bdfbbc7">
    
    Unfortunately Chrome requires a string name for each async stack and,
    worse, a suffix of `(async)` is automatically added which is very
    confusing since it seems like it might be an async component or
    something which it is not.
    
    In this case it's not so bad because it's nice to refer to the host
    component which otherwise doesn't have a stack frame since it's
    internal. However, if there were more owners here there would also be a
    `<Counter> (async)` which ends up being kind of duplicative.
    
    If the Chrome DevTools is not open from the start of the app, then
    `console.createTask` is disabled and so you lose the stack for those
    errors (or those parents if the devtools is opened later). Unlike our
    appended ones that are always added. That's unfortunate and likely to be
    a bit of a DX issue but it's also nice that it saves on perf in DEV mode
    for those cases. Framework dialogs can still surface the stack since we
    also track it in user space in parallel.
    
    This currently doesn't track Server Components yet. We need a more
    clever hack for that part in a follow up.
    
    I think I probably need to also add something to React DevTools to
    disable its stacks for this case too. Since it looks for stacks in the
    console.error and adds a stack otherwise. Since we don't add them
    anymore from the runtime, the DevTools adds them instead.
    sebmarkbage authored May 26, 2024
    Configuration menu
    Copy the full SHA
    ea6e059 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. cleanup[react-devtools]: remove unused supportsProfiling flag from st…

    …ore config (facebook#29193)
    
    Looks like this is unused
    hoxyq authored May 28, 2024
    Configuration menu
    Copy the full SHA
    6f23540 View commit details
    Browse the repository at this point in the history
  2. Repro function expr hoisting (facebook#29615)

    Modified version of @mofeiZ's facebook#29232 with CI passing (had to run
    prettier)
    
    ---------
    
    Co-authored-by: Mofei Zhang <[email protected]>
    josephsavona and mofeiZ authored May 28, 2024
    Configuration menu
    Copy the full SHA
    4ec6a6f View commit details
    Browse the repository at this point in the history
  3. Throw if React and React DOM versions don't match (facebook#29236)

    Throw an error during module initialization if the version of the
    "react-dom" package does not match the version of "react".
    
    We used to be more relaxed about this, because the "react" package
    changed so infrequently. However, we now have many more features that
    rely on an internal protocol between the two packages, including Hooks,
    Float, and the compiler runtime. So it's important that both packages
    are versioned in lockstep.
    
    Before this change, a version mismatch would often result in a cryptic
    internal error with no indication of the root cause.
    
    Instead, we will now compare the versions during module initialization
    and immediately throw an error to catch mistakes as early as possible
    and provide a clear error message.
    acdlite authored May 28, 2024
    Configuration menu
    Copy the full SHA
    681a4aa View commit details
    Browse the repository at this point in the history
  4. Clean up disableDOMTestUtils (facebook#29610)

    `disableDOMTestUtils` and the FB build `ReactTestUtilsFB` allowed us to
    finish migrating internal callsites off of ReactTestUtils. Now that
    usage is cleaned up, we can remove the flag, build artifact, and test
    coverage for the deprecated utility methods.
    jackpope authored May 28, 2024
    Configuration menu
    Copy the full SHA
    2787eeb View commit details
    Browse the repository at this point in the history
  5. Fix: Use action implementation at time of dispatch (facebook#29618)

    Fixes the behavior of actions that are queued by useActionState to use
    the action function that was current at the time it was dispatched, not
    at the time it eventually executes.
    
    The conceptual model is that the action is immediately dispatched, as if
    it were sent to a remote server/worker. It's the remote worker that
    maintains the queue, not the client.
    
    This is another property of actions makes them more like event handlers
    than like reducers.
    acdlite authored May 28, 2024
    Configuration menu
    Copy the full SHA
    1631227 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    97722ca View commit details
    Browse the repository at this point in the history
  7. compiler: error on reassigning to const

    We currently don't report an error if the code attempts to reassign a const. Our thinking has been that we're not trying to catch all possible mistakes you could make in JavaScript — that's what ESLint, TypeScript, and Flow are for — and that we want to focus on React errors. However, accidentally reassigning a const is easy to catch and doesn't get in the way of other analysis so let's implement it.
    
    Note that React Compiler's ESLint plugin won't report these errors by default, but they will show up in playground.
    
    Fixes facebook#29598
    
    ghstack-source-id: a0af8b9a486d74a8991413322efddc3e3028c755
    Pull Request resolved: facebook#29619
    josephsavona committed May 28, 2024
    Configuration menu
    Copy the full SHA
    4633972 View commit details
    Browse the repository at this point in the history
  8. compiler: fix for calls on builtin jsx/function types

    When I added new builtin types for jsx and functions, i forget to add a shape definition. This meant that attempting to accesss a property or method on these types would cause an internal error with an unresolved shape. That wasn't obvious because we rarely call methods on these types.
    
    I confirmed that the new fixtures here fail without the fix.
    
    ghstack-source-id: aa8f8d75a302bb5bac126d3e963594545e71ec74
    Pull Request resolved: facebook#29624
    josephsavona committed May 28, 2024
    Configuration menu
    Copy the full SHA
    bd4bb32 View commit details
    Browse the repository at this point in the history
  9. [Flight] Check if a return value is a client reference before introsp…

    …ecting (facebook#29611)
    
    This didn't actually fail before but I'm just adding an extra check.
    
    Currently Client References are always "function" proxies so they never
    fall into this branch. However, we do in theory support objects as
    client references too depending on environment. We have checks
    elsewhere. So this just makes that consistent.
    sebmarkbage authored May 28, 2024
    Configuration menu
    Copy the full SHA
    1816476 View commit details
    Browse the repository at this point in the history
  10. feat(compiler): Implement constant string concat propagation (faceboo…

    …k#29621)
    
    ## Summary
    
    Resolves facebook#29617
    
    ## How did you test this change?
    I verified the implementation using the test.
    nikeee authored May 28, 2024
    Configuration menu
    Copy the full SHA
    a9a0106 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. [compiler] Fix up prettier

    Our prettier setup is all messed up after the merge, so this PR should
    fix things
    
    ghstack-source-id: f825460ea6637138db6ba08fd6136fac3f7aa001
    Pull Request resolved: facebook#29213
    poteto committed May 29, 2024
    Configuration menu
    Copy the full SHA
    61aa159 View commit details
    Browse the repository at this point in the history
  2. [compiler] Run prettier, fix snap

    After this is merged, I'll add it to .git-blame-ignore-revs. I can't do
    it now as the hash will change after ghstack lands this stack.
    
    ghstack-source-id: 054ca869b7839c589524c47d1962262f6b50f8ed
    Pull Request resolved: facebook#29214
    poteto committed May 29, 2024
    Configuration menu
    Copy the full SHA
    c998bb1 View commit details
    Browse the repository at this point in the history
  3. [compiler:babel] Don't read config files when not running as part of

    user's pipeline
    
    When the user app has a babel.config file that is missing the compiler,
    strange things happen as babel does some strange merging of options from
    the user's config and in various callsites like in our eslint rule and
    healthcheck script. To minimize odd behavior, we default to not reading
    the user's babel.config
    
    Fixes facebook#29135
    
    ghstack-source-id: d6fdc43c5c9107645f36718203873aa3f6228475
    Pull Request resolved: facebook#29211
    poteto committed May 29, 2024
    Configuration menu
    Copy the full SHA
    9d530e9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81c3775 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    84c47b3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bd30dc3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b44263a View commit details
    Browse the repository at this point in the history
  8. Fix "findNodeHandle inside its render()" False Positive Warning (face…

    …book#29627)
    
    This was missed in facebook#29038 when
    unifying the "owner" abstractions, causing `findNodeHandle` to warn even
    outside of `render()` invocations.
    yungsters authored May 29, 2024
    Configuration menu
    Copy the full SHA
    3b29ed1 View commit details
    Browse the repository at this point in the history
  9. Update .git-blame-ignore-revs

    - Moves the file as it needs to be in root git directory
    - Removes now unreachable commits due to repo merge
    - Add run prettier commit c998bb1 to ignored revs
    
    ghstack-source-id: d9dfa7099fbc7782fbce600af4caafd405c196cb
    Pull Request resolved: facebook#29630
    poteto committed May 29, 2024
    Configuration menu
    Copy the full SHA
    e2e12f3 View commit details
    Browse the repository at this point in the history
  10. compiler: Allow global mutation in jsx props

    Fixes https://x.com/raibima/status/1794395807216738792
    
    The issue is that if you pass a global-modifying function as prop to JSX, we currently report that it's invalid to modify a global during rendering. The problem is that we don't really know when/if the child component will actually call that function prop. It would be against the rules to call the function during render, but it's totally fine to call it during an event handler or from a useEffect.
    
    Since we don't know at the call-site how the child will use the function, we should allow such calls. In the future we could improve this in a few ways:
    * For all functions that modify globals, codegen an assertion or warning into the function that fires if it's called "during render". We'd have to precisely define what "during render" is, but this would at least help developers catch this dynamically.
    * Use the type system to distinguish "event/effect" and "render" functions to help developers avoid accidentally mutating globals during render.
    
    ghstack-source-id: 4aba4e6d214fd6c062e4029294efe9b8fe25cd83
    Pull Request resolved: facebook#29591
    josephsavona committed May 29, 2024
    Configuration menu
    Copy the full SHA
    49ed6f0 View commit details
    Browse the repository at this point in the history
  11. compiler: Add todo for getter/setter syntax

    We were missing a check that ObjectMethods are not getters or setters. In our experience this is pretty rare within React components and hooks themselves, so let's start with a todo.
    
    Closes facebook#29586
    
    ghstack-source-id: 03c6cce9a9368a4a4f4ba98bcdff3fa4729ceaf9
    Pull Request resolved: facebook#29592
    josephsavona committed May 29, 2024
    Configuration menu
    Copy the full SHA
    c272789 View commit details
    Browse the repository at this point in the history
  12. compiler: fixtures for fast-refresh mode (w todos)

    ghstack-source-id: 65dd14fe9b37328bd60fe791b23dde54da10b285
    Pull Request resolved: facebook#29175
    josephsavona committed May 29, 2024
    Configuration menu
    Copy the full SHA
    afb2c39 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    38e3b23 View commit details
    Browse the repository at this point in the history
  14. feat(compiler): Compiler Logical Negation Constant Propagation (faceb…

    …ook#29623)
    
    ## Summary
    
    Resolves facebook#29622
    
    ## How did you test this change?
    I verified the implementation using the test.
    
    Note:
    This PR was done without waiting for approval in facebook#29622, so feel free to
    just close it.
    nikeee authored May 29, 2024
    Configuration menu
    Copy the full SHA
    320da67 View commit details
    Browse the repository at this point in the history
  15. compiler: ValidateNoRefInRender detects writes of refs

    Improves ValidateNoRefAccessInRender, detecting modifications of refs during render.
    
    Fixes facebook#29161
    
    ghstack-source-id: 99078b3cea5b2d9019dbf77ede9c2e4cd9fbfd27
    Pull Request resolved: facebook#29170
    josephsavona committed May 29, 2024
    Configuration menu
    Copy the full SHA
    867edc6 View commit details
    Browse the repository at this point in the history
  16. feat(compiler): Implement constant folding for more binary expressions (

    facebook#29650)
    
    ## Summary
    
    There are already most arithmetic operators in constant propagation:
    `+`, `-`, `*`, `/`.
    We could add more, namely: `|`, `&`, `^`, `<<`, `>>`, `>>>` and `%`:
    
    Input:
    ```js
    function f() {
      return [
        123.45 | 0,
        123.45 & 0,
        123.45 ^ 0,
        123 << 0,
        123 >> 0,
        123 >>> 0,
        123.45 | 1,
        123.45 & 1,
        123.45 ^ 1,
        123 << 1,
        123 >> 1,
        123 >>> 1,
        3 ** 2,
        3 ** 2.5,
        3.5 ** 2,
        2 ** 3 ** 0.5,
        4 % 2,
        4 % 2.5,
        4 % 3,
        4.5 % 2,
      ];
    }
    ```
    Output:
    ```js
    function f() {
      return [
        123, 0, 123, 123, 123, 123, 123, 1, 122, 246, 61, 61, 9,
        15.588457268119896, 12.25, 3.3219970854839125, 0, 1.5, 1, 0.5,
      ];
    }
    ```
    
    Resolves facebook#29649
    
    ## How did you test this change?
    See tests.
    
    Note:
    This PR was done without waiting for approval in facebook#29649, so feel free to
    just close it without any comment.
    nikeee authored May 29, 2024
    Configuration menu
    Copy the full SHA
    c2b45ef View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. Add tests for ReactNativeAttributePayloadFabric.js (facebook#29608)

    ## Summary
    
    This PR add tests for `ReactNativeAttributePayloadFabric.js`.
    
    It introduces `ReactNativeAttributePayloadFabric-test.internal.js`,
    which is a copy-paste of `ReactNativeAttributePayload-test.internal.js`.
    
    On top of that, there is a bunch of new test cases for the
    `ReactNativeAttributePayloadFabric.create` function.
    
    ## How did you test this change?
    
    ```
    yarn test packages/react-native-renderer
    ```
    dmytrorykun authored May 30, 2024
    Configuration menu
    Copy the full SHA
    51dd096 View commit details
    Browse the repository at this point in the history
  2. Fix key Warning for Flattened Positional Children (facebook#29662)

    ## Summary
    
    facebook#29088 introduced a regression
    triggering this warning when rendering flattened positional children:
    
    > Each child in a list should have a unique "key" prop.
    
    The specific scenario that triggers this is when rendering multiple
    positional children (which do not require unique `key` props) after
    flattening them with one of the `React.Children` utilities (e.g.
    `React.Children.toArray`).
    
    The refactored logic in `React.Children` incorrectly drops the
    `element._store.validated` property in `__DEV__`. This diff fixes the
    bug and introduces a unit test to prevent future regressions.
    
    ## How did you test this change?
    
    ```
    $ yarn test ReactChildren-test.js
    ```
    yungsters authored May 30, 2024
    Configuration menu
    Copy the full SHA
    72644ef View commit details
    Browse the repository at this point in the history
  3. Revert Build Versions from Content Hash to Commit Hash (facebook#29663)

    facebook#29236 caused issues for internal
    syncs at Meta, because we were computing version numbers using file
    hashes (to eliminate "no-op" internal sync commits). The problem is that
    since version numbers may not be consistent across synced files (e.g. if
    some files have not changed in recent commits), the newly introduced
    version mismatch check fails.
    
    There's some more work that needs to be done here to restore the
    benefits of file-specific hashing, but for now this simply reverts the
    content hash changes from the following PRs:
    
    - facebook#28633
    (95319ab)
    - facebook#28590
    (37676ab)
    - facebook#28582
    (cb076b5)
    - facebook#26734
    (5dd90c5)
    - facebook#26331
    (3cad3a5)
    yungsters authored May 30, 2024
    Configuration menu
    Copy the full SHA
    5bd4031 View commit details
    Browse the repository at this point in the history
  4. fix[ReactDebugHooks/find-primitive-index]: remove some assumptions (f…

    …acebook#29652)
    
    Partially reverts facebook#28593.
    
    While rolling out RDT 5.2.0, I've observed some issues on React Native
    side: hooks inspection for some complex hook trees, like in
    AnimatedView, were broken. After some debugging, I've noticed a
    difference between what is in frame's source.
    
    The difference is in the top-most frame, where with V8 it will correctly
    pick up the `Type` as `Proxy` in `hookStack`, but for Hermes it will be
    `Object`. This means that for React Native this top most frame is
    skipped, since sources are identical.
    
    Here I am reverting back to the previous logic, where we check each
    frame if its a part of the wrapper, but also updated `isReactWrapper`
    function to have an explicit case for `useFormStatus` support.
    hoxyq authored May 30, 2024
    Configuration menu
    Copy the full SHA
    fb61a1b View commit details
    Browse the repository at this point in the history
  5. [Flight] Eval Fake Server Component Functions to Recreate Native Stac…

    …ks (facebook#29632)
    
    We have three kinds of stacks that we send in the RSC protocol:
    
    - The stack trace where a replayed `console.log` was called on the
    server.
    - The JSX callsite that created a Server Component which then later
    called another component.
    - The JSX callsite that created a Host or Client Component.
    
    These stack frames disappear in native stacks on the client since
    they're executed on the server. This evals a fake file which only has
    one call in it on the same line/column as the server. Then we call
    through these fake modules to "replay" the callstack. We then replay the
    `console.log` within this stack, or call `console.createTask` in this
    stack to recreate the stack.
    
    The main concern with this approach is the performance. It adds
    significant cost to create all these eval:ed functions but it should
    eventually balance out.
    
    This doesn't yet apply source maps to these. With source maps it'll be
    able to show the server source code when clicking the links.
    
    I don't love how these appear.
    
    - Because we haven't yet initialized the client module we don't have the
    name of the client component we're about to render yet which leads to
    the `<...>` task name.
    - The `(async)` suffix Chrome adds is still a problem.
    - The VMxxxx prefix is used to disambiguate which is noisy. Might be
    helped by source maps.
    - The continuation of the async stacks end up rooted somewhere in the
    bootstrapping of the app. This might be ok when the bootstrapping ends
    up ignore listed but it's kind of a problem that you can't clear the
    async stack.
    
    <img width="927" alt="Screenshot 2024-05-28 at 11 58 56 PM"
    src="https://github.com/facebook/react/assets/63648/1c9d32ce-e671-47c8-9d18-9fab3bffabd0">
    
    <img width="431" alt="Screenshot 2024-05-28 at 11 58 07 PM"
    src="https://github.com/facebook/react/assets/63648/52f57518-bbed-400e-952d-6650835ac6b6">
    <img width="327" alt="Screenshot 2024-05-28 at 11 58 31 PM"
    src="https://github.com/facebook/react/assets/63648/d311a639-79a1-457f-9a46-4f3298d07e65">
    
    <img width="817" alt="Screenshot 2024-05-28 at 11 59 12 PM"
    src="https://github.com/facebook/react/assets/63648/3aefd356-acf4-4daa-bdbf-b8c8345f6d4b">
    sebmarkbage authored May 30, 2024
    Configuration menu
    Copy the full SHA
    9d4fba0 View commit details
    Browse the repository at this point in the history
  6. [Flight] Try/Catch Eval (facebook#29671)

    Follow up to facebook#29632.
    
    It's possible for `eval` to throw such as if we're in a CSP environment.
    This is non-essential debug information. We can still proceed to create
    a fake stack entry. It'll still have the right name. It just won't have
    the right line/col number nor source url/source map. It might also be
    ignored listed since it's inside Flight.
    sebmarkbage authored May 30, 2024
    Configuration menu
    Copy the full SHA
    9710853 View commit details
    Browse the repository at this point in the history
  7. Add react-easy-state to list of known incompatible libraries. (facebo…

    …ok#29661)
    
    Like mobx, this library depends on mutating a Proxied store and breaks reference equality checks.
    joshwilsonvu authored May 30, 2024
    Configuration menu
    Copy the full SHA
    aa3d6c0 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Fix Missing key Validation in React.Children (facebook#29675)

    ## Summary
    
    In facebook#29088, the validation logic
    for `React.Children` inspected whether `mappedChild` — the return value
    of the map callback — has a valid `key`. However, this deviates from
    existing behavior which only warns if the original `child` is missing a
    required `key`.
    
    This fixes false positive `key` validation warnings when using
    `React.Children`, by validating the original `child` instead of
    `mappedChild`.
    
    This is a more general fix that expands upon my previous fix in
    facebook#29662.
    
    ## How did you test this change?
    
    ```
    $ yarn test ReactChildren-test.js
    ```
    yungsters authored May 31, 2024
    Configuration menu
    Copy the full SHA
    8fd963a View commit details
    Browse the repository at this point in the history
  2. Use both displayName and name in forwardRef/memo (facebook#29625)

    When defining a displayName on forwardRef/memo we forward that name to
    the inner function.
    
    We used to use displayName for this but in facebook#29206 I switched this to use
    `"name"`. That's because V8 doesn't use displayName, it only uses the
    overridden name in stack traces. This is the only thing covered by our
    tests for component stacks.
    
    However, I realized that Safari only uses displayName and not the name.
    So this sets both.
    sebmarkbage authored May 31, 2024
    Configuration menu
    Copy the full SHA
    63d673c View commit details
    Browse the repository at this point in the history
  3. Don't allow blank issues (facebook#29691)

    We're getting a ton of issues filed using the blank template, for
    example these airline support tickets:
    https://github.com/facebook/react/issues/29678
    
    
    I think someone somewhere is linking to our issues with pre-filled
    content. This fixes it by forcing a template to be used.
    rickhanlonii authored May 31, 2024
    Configuration menu
    Copy the full SHA
    6d3110b View commit details
    Browse the repository at this point in the history
  4. Create a root task for every Flight response (facebook#29673)

    This lets any element created from the server, to bottom out with a
    client "owner" which is the creator of the Flight request. This could be
    a Server Action being invoked or a router.
    
    This is similar to how a client element bottoms out in the creator of
    the root element without an owner. E.g. where the root app element was
    created.
    
    Without this, we inherit the task of whatever is currently executing
    when we're parsing which can be misleading.
    
    Before:
    <img width="507" alt="Screenshot 2024-05-30 at 12 06 57 PM"
    src="https://github.com/facebook/react/assets/63648/e234db7e-67f7-404c-958a-5c5500ffdf1f">
    
    After:
    <img width="555" alt="Screenshot 2024-05-30 at 4 59 04 PM"
    src="https://github.com/facebook/react/assets/63648/8ba6acb4-2ffd-49d4-bd44-08228ad4200e">
    
    The before/after doesn't show much of a difference here but that's just
    because our Flight parsing loop is an async, which maybe it shouldn't be
    because it can be unnecessarily deep, and it creates a hidden line for
    every loop. That's what the `Promise.then` is. If the element is lazily
    initialized it's worse because we can end up in an unrelated render task
    as the owner - although that's its own problem.
    sebmarkbage authored May 31, 2024
    Configuration menu
    Copy the full SHA
    8bc81ca View commit details
    Browse the repository at this point in the history
  5. [compiler] Option for preserving calls to useMemo/useCallback

    Summary: This adds a compiler option to not drop existing manual memoization and leaving useMemo/useCallback in the generated source. Why do we need this, given that we also have options to validate or ensure that existing memoization is preserved? It's because later diffs on this stack are designed to alter the behavior of the memoization that the compiler emits, in order to detect rules of react violations and debug issues. We don't want to change the behavior of user-level memoization, however, since doing so would be altering the semantics of the user's program in an unacceptable way.
    
    ghstack-source-id: 89dccdec9ccb4306b16e849e9fa2170bb5dd021f
    Pull Request resolved: facebook#29654
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    28fe581 View commit details
    Browse the repository at this point in the history
  6. [compiler] Option to always take the non-memo branch

    Summary: This adds a debugging mode to the compiler that simply adds a `|| true` to the guard on all memoization blocks, which results in the generated code never using memoized values and always recomputing them. This is designed as a validation tool for the compiler's correctness--every program *should* behave exactly the same with this option enabled as it would with it disabled, and so any difference in behavior should be investigated as either a compiler bug or a pipeline issue.
    
    (We add `|| true` rather than dropping the conditional block entirely because we still want to exercise the guard tests, in case the guards themselves are the source of an error, like reading a property from undefined in a guard.)
    
    ghstack-source-id: 955a47ec1689842da82552225a19a1008c57fe2c
    Pull Request resolved: facebook#29655
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    8b01a2e View commit details
    Browse the repository at this point in the history
  7. [compiler] Debug tool to emit change detection code rather than memoi…

    …zation
    
    Summary: The essential assumption of the compiler is that if the inputs to a computation have not changed, then the output should not change either--computation that the compiler optimizes is idempotent.
    
    This is, of course, known to be false in practice, because this property rests on requirements (the Rules of React) that are loosely enforced at best. When rolling out the compiler to a codebase that might have rules of react violations, how should developers debug any issues that arise?
    
    This diff attempts one approach to that: when the option is set, rather than simply skipping computation when dependencies haven't changed, we will *still perform the computation*, but will then use a runtime function to compare the original value and the resultant value. The runtime function can be customized, but the idea is that it will perform a structural equality check on the values, and if the values aren't structurally equal, we can report an error, including information about what file and what variable was to blame.
    
    This assists in debugging by narrowing down what specific computation is responsible for a difference in behavior between the uncompiled code and the program after compilation.
    
    ghstack-source-id: 50dad3dacfc7fef74be350431aa2ebf5e9cb0031
    Pull Request resolved: facebook#29656
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    5c420e3 View commit details
    Browse the repository at this point in the history
  8. [compiler] Prune dependencies that are only used by useRef or useState

    Summary: jmbrown215 recently had an observation that the arguments to useState/useRef are only used when a component renders for the first time, and never afterwards. We can skip more computation that we previously could, with reactive blocks that previously recomputed values when inputs changed now only ever computing them on the first render.
    
    ghstack-source-id: 5d044ef787a7da901c70990f4399aa90c9b96802
    Pull Request resolved: facebook#29653
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    c69211a View commit details
    Browse the repository at this point in the history
  9. [compiler] Recompute values every time

    Summary: This PR expands the analysis from the previous in the stack in order to also capture when a value can incorrectly change within a single render, rather than just changing between two renders. In the case where dependencies have changed and so a new value is being computed, we now compute the value twice and compare the results. This would, for example, catch when we call Math.random() in render.
    
    The generated code is a little convoluted, because we don't want to have to traverse the generated code and substitute variable names with new ones. Instead, we save the initial value to the cache as normal, then run the computation block again and compare the resulting values to the cached ones. Then, to make sure that the cached values are identical to the computed ones, we reassign the cached values into the output variables.
    
    ghstack-source-id: d0f11a4cb2a612cbffdfdcaa9e75efbd6e38019f
    Pull Request resolved: facebook#29657
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    522d22f View commit details
    Browse the repository at this point in the history
  10. [compiler] rfc: Include location information in identifiers and react…

    …ive scopes for debugging
    
    Summary: Using the change detection code to debug codebases that violate the rules of react is a lot easier when we have a source location corresponding to the value that has changed inappropriately. I didn't see an easy way to track that information in the existing data structures at the point of codegen, so this PR adds locations to identifiers and reactive scopes (the location of a reactive scope is the range of the locations of its included identifiers).
    
    I'm interested if there's a better way to do this that I missed!
    
    ghstack-source-id: aed5f7eddae7256f41da4389e8f16fcb3daaee49
    Pull Request resolved: facebook#29658
    mvitousek committed May 31, 2024
    Configuration menu
    Copy the full SHA
    ec6fe57 View commit details
    Browse the repository at this point in the history
  11. Fix: useTransition after use gets stuck in pending state (faceboo…

    …k#29670)
    
    When a component suspends with `use`, we switch to the "re-render"
    dispatcher during the subsequent render attempt, so that we can reuse
    the work from the initial attempt. However, once we run out of hooks
    from the previous attempt, we should switch back to the regular "update"
    dispatcher.
    
    This is conceptually the same fix as the one introduced in
    facebook#26232. That fix only accounted
    for initial mount, but the useTransition regression test added in
    f829733 illustrates that we need to
    handle updates, too.
    
    The issue affects more than just useTransition but because most of the
    behavior between the "re-render" and "update" dispatchers is the same
    it's hard to contrive other scenarios in a test, which is probably why
    it took so long for someone to notice.
    
    Closes facebook#28923 and facebook#29209
    
    ---------
    
    Co-authored-by: eps1lon <[email protected]>
    acdlite and eps1lon authored May 31, 2024
    Configuration menu
    Copy the full SHA
    adbec0c View commit details
    Browse the repository at this point in the history
  12. [compiler:eslint] Don't crash if hermes parser fails to parse

    Eslint rules should never throw, so if we fail to parse with Babel or
    Hermes, we should just ignore the error. This should fix issues such as
    trying to run the eslint rule on non tsx|ts|jsx|js files, Hermes parser
    not supporting certain JS syntax, etc.
    
    I didn't add a test for this as our eslint-rule-tester config uses
    hermes-eslint parser, so it wasn't possible to add a top level await as
    it would crash hermes-eslint before our rule was triggered. Similarly I
    couldn't add a test for non-JS files as it would not be parseable by
    hermes-eslint.
    
    Fixes facebook#29107
    
    ghstack-source-id: 60afcdb89ab4a8d2e4697cc50c5490803e7cbeac
    Pull Request resolved: facebook#29631
    poteto committed May 31, 2024
    Configuration menu
    Copy the full SHA
    113c8e7 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b17016c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c6b651b View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d77dd31 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2024

  1. [Flight] Add findSourceMapURL option to get a URL to load Server sour…

    …ce maps from (facebook#29708)
    
    This lets you click a stack frame on the client and see the Server
    source code inline.
    
    <img width="871" alt="Screenshot 2024-06-01 at 11 44 24 PM"
    src="https://github.com/facebook/react/assets/63648/581281ce-0dce-40c0-a084-4a6d53ba1682">
    
    <img width="840" alt="Screenshot 2024-06-01 at 11 43 37 PM"
    src="https://github.com/facebook/react/assets/63648/00dc77af-07c1-4389-9ae0-cf1f45199efb">
    
    We could do some logic on the server that sends a source map url for
    every stack frame in the RSC payload. That would make the client
    potentially config free. However regardless we need the config to
    describe what url scheme to use since that’s not built in to the bundler
    config. In practice you likely have a common pattern for your source
    maps so no need to send data over and over when we can just have a
    simple function configured on the client.
    
    The server must return a source map, even if the file is not actually
    compiled since the fake file is still compiled.
    
    The source mapping strategy can be one of two models depending on if the
    server’s stack traces (`new Error().stack`) are source mapped back to
    the original (`—enable-source-maps`) or represents the location in
    compiled code (like in the browser).
    
    If it represents the location in compiled code it’s actually easier. You
    just serve the source map generated for that file by the tooling.
    
    If it is already source mapped it has to generate a source map where
    everything points to the same location (as if not compiled) ideally with
    a segment per logical ast node.
    sebmarkbage authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    ba099e4 View commit details
    Browse the repository at this point in the history
  2. Skip empty sync commits (both repos) (facebook#29707)

    Requires facebook#29706
    
    The strategy here is to:
    - Checkout the builds/facebook-www branch
    - Read the current sync'd VERSION
    - Checkout out main and sync new build
    - sed/{new version string}/{old version string}
    - Run git status, skip sync if clean
    - Otherwise, sed/{old version string}/{new version string} and push
    commit
    
    This means that:
    - We're using the real version strings from the builds
    - We are checking the last commit on the branch for the real last
    version
    - We're skipping any commits that won't result in changes
    - ???
    - Profit!
    rickhanlonii authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    5ad2c37 View commit details
    Browse the repository at this point in the history
  3. Don't skip www commit

    rickhanlonii committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    b421783 View commit details
    Browse the repository at this point in the history
  4. [Fiber][Float] Error when a host fiber changes "flavor" (facebook#29693)

    Host Components can exist as four semantic types
    
    1. regular Components (Vanilla obv)
    2. singleton Components
    2. hoistable components
    3. resources
    
    Each of these component types have their own rules related to mounting
    and reconciliation however they are not direclty modeled as their own
    unique fiber type. This is partly for code size but also because
    reconciling the inner type of these components would be in a very hot
    path in fiber creation and reconciliation and it's just not practical to
    do this logic check here.
    
    Right now we have three Fiber types used to implement these 4 concepts
    but we probably need to reconsider the model and think of Host
    Components as a single fiber type with an inner implementation. Once we
    do this we can regularize things like transitioning between a resource
    and a regular component or a singleton and a hoistable instance. The
    cases where these transitions happen today aren't particularly common
    but they can be observed and currently the handling of these transitions
    is incomplete at best and buggy at worst. The most egregious case is the
    link type. This can be a regular component (stylesheet without
    precedence) a hoistable component (non stylesheet link tags) or a
    resource (stylesheet with a precedence) and if you have a single jsx
    slot that tries to reconcile transitions between these types it just
    doesn't work well.
    
    This commit adds an error for when a Hoistable goes from Instance to
    Resource. Currently this is only possible for `<link>` elements going to
    and from stylesheets with precedence. Hopefully we'll be able to remove
    this error and implement as an inner type before we encounter new
    categories for the Hoistable types
    
    detecting type shifting to and from regular components is harder to do
    efficiently because we don't want to reevaluate the type on every update
    for host components which is currently not required and would add
    overhead to a very hot path
    
    singletons can't really type shift in their one practical implementation
    (DOM) so they are only a problem in theroy not practice
    gnoff authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    47d0c30 View commit details
    Browse the repository at this point in the history
  5. Fix stylesheet typo in 29693 (facebook#29732)

    stylehsheet -> stylesheet
    gnoff authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    def67b9 View commit details
    Browse the repository at this point in the history
  6. useActionState: Transfer transition context (facebook#29694)

    Mini-refactor of useActionState to only wrap the action in a transition
    context if the dispatch is called during a transition. Conceptually, the
    action starts as soon as the dispatch is called, even if the action is
    queued until earlier ones finish.
    
    We will also warn if an async action is dispatched outside of a
    transition, since that is almost certainly a mistake. Ideally we would
    automatically upgrade these to a transition, but we don't have a great
    way to tell if the action is async until after it's already run.
    acdlite authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    67b05be View commit details
    Browse the repository at this point in the history
  7. useActionState: On error, cancel remaining actions (facebook#29695)

    Based on
    
    - facebook#29694 
    
    ---
    
    If an action in the useActionState queue errors, we shouldn't run any
    subsequent actions. The contract of useActionState is that the actions
    run in sequence, and that one action can assume that all previous
    actions have completed successfully.
    
    For example, in a shopping cart UI, you might dispatch an "Add to cart"
    action followed by a "Checkout" action. If the "Add to cart" action
    errors, the "Checkout" action should not run.
    
    An implication of this change is that once useActionState falls into an
    error state, the only way to recover is to reset the component tree,
    i.e. by unmounting and remounting. The way to customize the error
    handling behavior is to wrap the action body in a try/catch.
    acdlite authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    9598c41 View commit details
    Browse the repository at this point in the history
  8. Update build script to automatically generate RCs (facebook#29736)

    RC releases are a special kind of prerelease build because unlike
    canaries we shouldn't publish new RCs from any commit on `main`, only
    when we intentionally bump the RC number. But they are still prerelases
    — like canary and experimental releases, they should use exact version
    numbers in their dependencies (no ^).
    
    We only need to generate these builds during the RC phase, i.e. when the
    canary channel label is set to "rc".
    
    Example of resulting package.json output:
    
    ```json
    {
      "name": "react-dom",
      "version": "19.0.0-rc.0",
      "dependencies": {
        "scheduler": "0.25.0-rc.0"
      },
      "peerDependencies": {
        "react": "19.0.0-rc.0"
      }
    }
    ```
    
    
    https://react-builds.vercel.app/prs/29736/files/oss-stable-rc/react-dom/package.json
    acdlite authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    bf3a29d View commit details
    Browse the repository at this point in the history
  9. [Fiber] Prefix owner stacks with the current stack at the console call (

    facebook#29697)
    
    This information is available in the regular stack but since that's
    hidden behind an expando and our appended stack to logs is not hidden,
    it hides the most important frames like the name of the current
    component.
    
    This is closer to what happens to the native stack.
    
    We only include stacks if they're within a ReactFiberCallUserSpace call
    frame. This should be most that have a current fiber but this is
    critical to filtering out most React frames if the regular node_modules
    filter doesn't work.
    
    Most React warnings fire during the rendering phase and not inside a
    user space function but some do like hooks warnings and setState in
    render. This feature is more important if we port this to React DevTools
    appending stacks to all logs where it's likely to originate from inside
    a component and you want the line within that component to immediately
    part of the visible stack.
    
    One thing that kind sucks is that we don't have a reliable way to
    exclude React internal stack frames. We filter node_modules but it might
    not match. For other cases I try hard to only track the stack frame at
    the root of React (e.g. immediately inside createElement) until the
    ReactFiberCallUserSpace so we don't need the filtering to work. In this
    case it's hard to achieve the same thing though. This is easier in RDT
    because we have the start/end line and parsing of stack traces so we can
    use that to exclude internals but that's a lot of code/complexity for
    shipping within the library.
    
    For example in Safari:
    
    <img width="590" alt="Screenshot 2024-05-31 at 6 15 27 PM"
    src="https://github.com/facebook/react/assets/63648/2820c8c0-8a03-42e9-8678-8348f66b051a">
    
    Ideally warnOnUseFormStateInDev and useFormState wouldn't be included
    since they're React internals. Before this change, the Counter.js line
    also wasn't included though which points to exactly where the error is
    within the user code.
    
    (Note Server Components have V8 formatted lines and Client Components
    have JSC formatted lines.)
    sebmarkbage authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    4dcdf21 View commit details
    Browse the repository at this point in the history
  10. Fix xplat sync to ignore @generated header (facebook#29738)

    Use some clever git diffing to ignore lines that only change the
    `@generated` header. We can't do this for the version string because the
    version string can be embedded in lines with other changes, but this
    header is always on one line.
    rickhanlonii authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    8c3697a View commit details
    Browse the repository at this point in the history
  11. compiler: Allow opting out of installed library check

    ghstack-source-id: eedd024d36f66a68abe43ba0f679e2d462b77505
    Pull Request resolved: facebook#29742
    josephsavona committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    8b677b1 View commit details
    Browse the repository at this point in the history
  12. fix<compiler>: only call readTestFilter if the filter option is enabl…

    …ed (facebook#29720)
    
    Following the instructions in the compiler/docs/DEVELOPMENT_GUIDE.md, we are stuck on the command `yarn snap --watch` because it calls readTestFilter even though the filter option is not enabled.
    TrickyPi authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    4082582 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. www: set enableRefAsProp to true (facebook#29756)

    www: set enableRefAsProp to true
    kassens authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    a26e90c View commit details
    Browse the repository at this point in the history
  2. Remove startTransition and useActionState from react-server condition…

    … of react (facebook#29753)
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    Remove `startTransition` and `useActionState` from `react-server`
    condition of react, as they should only stay in client bundle.
    This will reduce the server bundle of react itself. 
    
    Found this while tracing where the `process.emit` was called.
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    ## 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.
    -->
    huozhi authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    9185b9b View commit details
    Browse the repository at this point in the history
  3. Add xplat test variants (facebook#29734)

    ## Overview
    
    We didn't have any tests that ran in persistent mode with the xplat
    feature flags (for either variant).
    
    As a result, invalid test gating like in
    facebook#29664 were not caught.
    
    This PR adds test flavors for `ReactFeatureFlag-native-fb.js` in both
    variants.
    rickhanlonii authored Jun 4, 2024
    Configuration menu
    Copy the full SHA
    eabb681 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e177f0b View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

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

Commits on Jul 1, 2024

  1. Merge pull request #14 from replayio/feature/PRO-467-update-rdt-fork

    Update RDT fork to support React 19
    markerikson authored Jul 1, 2024
    Configuration menu
    Copy the full SHA
    cc8b61c View commit details
    Browse the repository at this point in the history