The Wayback Machine - https://web.archive.org/web/20230520155142/https://github.com/facebook/react/commits/main
Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on May 20, 2023

  1. Updated copyright text to Copyright (c) Meta Platforms, Inc. and its … (

    #26830)
    
    …affiliates.
    
    ## Summary
    
    There were 8 different places where the copyright comment was wrong.
    Rewrote from "Copyright (c) Facebook, Inc. and its affiliates." to
    "Copyright (c) Meta Platforms, Inc. and its affiliates."
    
    ## How did you test this change?
    No code was changed. Comment was still a comment after changes.
    
    Co-authored-by: Dennis Moradkhani <denmo530@student.liu.se>
    denmo530 and Dennis Moradkhani committed May 20, 2023
  2. Updated Copyright comment from Facebook to Meta (#26833)

    ## Summary
    Changed the comment in react/packages/react
    /react.shared-subset.js saying 
    ```
    Copyright (c) Facebook, Inc. and affiliates ..
    ```
    To 
    ```
    Copyright (c) Meta Platforms, Inc. and affiliates ..
    ```
    as raised in the following issues:
    #26829
    
    Files Changed: 
    react/packages/react/react.shared-subset.js
    
    ## How did you test this change?
    
    Tests Required: No
    singhsanket143 committed May 20, 2023

Commits on May 18, 2023

  1. Remove Flight Relay DOM/Native (#26828)

    The bindings upstream in Relay has been removed so we don't need these
    builds anymore. The idea is to revisit an FB integration of Flight but
    it wouldn't use the Relay specific bindings. It's a bit unclear how it
    would look but likely more like the OSS version so not worth keeping
    these around.
    
    The `dom-relay` name also included the FB specific Fizz implementation
    of the streaming config so I renamed that to `dom-fb`. There's no Fizz
    implementation for Native yet so I just removed `native-relay`.
    
    We created a configurable fork for how to encode the output of Flight
    and the Relay implementation encoded it as JSON objects instead of
    strings/streams. The new implementation would likely be more stream-like
    and just encode it directly as string/binary chunks. So I removed those
    indirections so that this can just be declared inline in
    ReactFlightServer/Client.
    sebmarkbage committed May 18, 2023

Commits on May 17, 2023

  1. Fix strict mode badge URL (#26825)

    ## Summary
    Closes #26821
    
    [[Fix #26821]](#26821) Update
    strict mode badge URL
    
    
    Updated the URL in the strict mode badge to point to the correct React
    documentation for StrictMode. The previous URL was outdated. Now, when a
    component is not running in StrictMode, the badge links to
    https://react.dev/reference/react/StrictMode for more information.
    
    
    ## How did you test this change?
    
    I verified that the strict mode badge now correctly links to the updated
    URL. Previously, it pointed to the outdated URL
    (https://fb.me/devtools-strict-mode). After the update, it correctly
    points to the React Dev documentation for StrictMode
    (https://react.dev/reference/react/StrictMode).
    
    
    _Since its my first contribution here, i have completed the CLA_
    ibrahemid committed May 17, 2023
  2. React DevTools 4.27.7 -> 4.27.8 (#26823)

    Closes #26787,
    #26793
    
    Includes these changes:
    * fix[devtools]: fixed duplicated backend activation with multiple
    renderers ([hoxyq](https://github.com/hoxyq) in
    [#26807](#26807))
    hoxyq committed May 17, 2023

Commits on May 16, 2023

  1. Lower Suspense throttling heuristic to 300ms (#26803)

    Now that the throttling mechanism applies more often, we've decided to
    lower this a tad to ensure it's not noticeable. The idea is it should be
    just large enough to prevent jank when lots of different parts of the UI
    load in rapid succession, but not large enough to make the UI feel
    sluggish. There's no perfect number, it's just a heuristic.
    acdlite committed May 16, 2023
  2. Fix Suspense throttling mechanism (#26802)

    The throttling mechanism for fallbacks should apply to both their
    appearance _and_ disappearance.
    
    This was mostly addressed by #26611. See that PR for additional context.
    
    However, a flaw in the implementation is that we only update the the
    timestamp used for throttling when the fallback initially appears. We
    don't update it when the real content pops in. If lots of content in
    separate Suspense trees loads around the same time, you can still get
    jank.
    
    The issue is fixed by updating the throttling timestamp whenever the
    visibility of a fallback changes. Not just when it appears.
    acdlite committed May 16, 2023

Commits on May 12, 2023

  1. Fix uSES hydration in strict mode (#26791)

    Previously, we'd call and use getSnapshot on the second render resulting
    in `Warning: Text content did not match. Server: "Nay!" Client: "Yay!"`
    and then `Error: Text content does not match server-rendered HTML.`.
    
    Fixes #26095. Closes #26113. Closes #25650.
    
    ---------
    
    Co-authored-by: eps1lon <silbermann.sebastian@gmail.com>
    sophiebits and eps1lon committed May 12, 2023
  2. [react-native] Always set RN$stopSurface (#26808)

    ## Summary
    To support incremental adoption of bridgeless logic we want to default
    to using these globals whenever they're available.
    
    ## How did you test this change?
    facebook/react-native#37410
    javache committed May 12, 2023
  3. fix[devtools]: fixed duplicated backend activation with multiple rend…

    …erers (#26807)
    
    ## Summary
    Initially reported in #26797.
    Was not able to reproduce the exact same problem, but found this case:
    
    1. Open corresponding codepen from the issue in debug mode
    2. Open components tab of the extension
    3. Refresh the page
    
    Received multiple errors:
    - Warning in the Console tab: Invalid renderer id "2".
    - Error in the Components tab: Uncaught Error: Cannot add node "3"
    because a node with that id is already in the Store.
    
    This problem has occurred after landing a fix in
    #26779. Looks like Chrome is
    keeping the injected scripts (the backend in this case) and we start
    backend twice.
    hoxyq committed May 12, 2023

Commits on May 10, 2023

  1. [www] reduce dynamic SchedulerFeatureFlags (#26617)

    For these values we're not using dynamic values. We can statically
    compile in the values we're running.
    kassens committed May 10, 2023
  2. Fix nightly job to publish to "canary" channel (#26799)

    When I was renaming the next channel to canary, I updated the
    `publish_preleases` workflow correctly, but I skipped over
    `publish_preleases_nightly`. Oops.
    acdlite committed May 10, 2023
  3. Change yarn test to default to experimental (#26741)

    The idea is that the default `yarn test` command should be the one that
    includes the most bleeding edge features, because during development you
    probably want as many features enabled as possible.
    
    That used to be `www-modern` but nowadays it's `experimental` because
    we've landed a bunch of async actions stuff in experimental but it isn't
    yet being tested at Meta.
    
    So this switches the default to `experimental`.
    acdlite committed May 10, 2023

Commits on May 9, 2023

  1. Flow upgrade to 0.205.1 (#26796)

    Just a small upgrade to keep us current and remove unused suppressions
    (probably fixed by some upgrade since).
    
    - `*` is no longer allowed and has been an alias for `any` for a while
    now.
    kassens committed May 9, 2023

Commits on May 8, 2023

  1. Small flowconfig fixes (#26784)

    - The whole project root is included by default anyway, the include
    section should be redundant and just misleading.
    - The generated ignore paths ignore more than intended as they didn't
    escape the `.` for regex.
    
    Test Plan:
    - wait for CI
    - tested the ignore pattern change with renaming files and seeing the
    expected files ignored for flow
    kassens committed May 8, 2023

Commits on May 7, 2023

  1. Add useFormStatus to server rendering stub (#26788)

    This was an oversight when I set up the hook in #26719.
    acdlite committed May 7, 2023

Commits on May 5, 2023

  1. [Release Script] Print a hint where to get the token (#26783)

    I always forget where to get it.
    gaearon committed May 5, 2023
  2. Use native scheduler if defined in global scope (#26554)

    Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
    sammy-SC and gaearon committed May 5, 2023

Commits on May 4, 2023

  1. React DevTools 4.27.6 -> 4.27.7 (#26780)

    List of changes:
    * DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in
    [#26779](#26779))
    * fix[dynamic-scripts-injection]: unregister content scripts before
    registration ([hoxyq](https://github.com/hoxyq) in
    [#26765](#26765))
    hoxyq committed May 4, 2023
  2. DevTools: fix backend activation (#26779)

    ## Summary
    We have a case:
    1. Open components tab
    2. Close Chrome / Firefox devtools window completely
    3. Reopen browser devtools panel
    4. Open components tab
    
    Currently, in version 4.27.6, we cannot load the components tree.
    
    This PR contains two changes:
    - non-functional refactoring in
    `react-devtools-shared/src/devtools/store.js`: removed some redundant
    type castings.
    - fixed backend manager logic (introduced in
    #26615) to activate already
    registered backends. Looks like frontend of devtools also depends on
    `renderer-attached` event, without it component tree won't load.
    
    ## How did you test this change?
    This fixes the case mentioned prior. Currently in 4.27.6 version it is
    not working, we need to refresh the page to make it work.
    
    I've tested this in several environments: chrome, firefox, standalone
    with RN application.
    hoxyq committed May 4, 2023

Commits on May 3, 2023

  1. [Flight] Progressively Enhanced Server Actions (#26774)

    This automatically exposes `$$FORM_ACTIONS` on Server References coming
    from Flight. So that when they're used in a form action, we can encode
    the ID for the server reference as a hidden field or as part of the name
    of a button.
    
    If the Server Action is a bound function it can have complex data
    associated with it. In this case this additional data is encoded as
    additional form fields.
    
    To process a POST on the server there's now a `decodeAction` helper that
    can take one of these progressive posts from FormData and give you a
    function that is prebound with the correct closure and FormData so that
    you can just invoke it.
    
    I updated the fixture which now has a "Server State" that gets
    automatically refreshed. This also lets us visualize form fields.
    There's no "Action State" here for showing error messages that are not
    thrown, that's still up to user space.
    sebmarkbage committed May 3, 2023
  2. [Fizz] Gracefully handle suspending in DOM configs (#26768)

    E.g. if we suspend (throw a promise) in pushStartInstance today we might
    have already pushed some chunks (or even child segments potentially). We
    should revert back to where we were.
    
    This doesn't usually happen because when we suspend in a component it
    doesn't write anything itself, it'll always defer to som host instance
    to do the writing.
    
    There was a todo about this already but I'm not 100% sure it's always
    safe when suspending. It should be safe when suspending just regularly
    because it's just a noop. We might not even want "throwing a promise" in
    this mechanism to be supported longer term but for now that's how a
    suspend in internals.
    sebmarkbage committed May 3, 2023
  3. [Fizz] Check for nullish values on ReactCustomFormAction (#26770)

    Usually we don't have to do this since we only set these in the loop but
    the ReactCustomFormAction props are optional so they might be undefined.
    
    Also moved it to a general type since it's a semi-public API.
    sebmarkbage committed May 3, 2023
  4. useOptimisticState -> useOptimistic (#26772)

    Drop the "state". Just "useOptimistic". It's cleaner.
    
    This is still an experimental API. May not be the final name.
    acdlite committed May 3, 2023
  5. Add "canary" to list of allowed npm dist tags (#26767)

    Forgot this allowlist existed. It's an extra safeguard, in case we mess
    up the configuration somehow.
    acdlite committed May 3, 2023
  6. fix[dynamic-scripts-injection]: unregister content scripts before reg…

    …istration (#26765)
    
    ## Summary
    Fixes #26756.
    
    DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
    incognito mode. This is not happening straight-forward, but if extension
    is toggled on and off, the next time I try to open it I am receiving an
    error that content script was already registered.
    
    <img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
    src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">
    
    - Unregistering content scripts before attempting to register them
    again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
    so this should be expected behaviour.
    - Fixed error logging
     
    ## How did you test this change?
    Local build of extension for Chrome, trying the same steps, which
    resulted in an error.
    No regression in performance, tested on react.dev, still the same.
    hoxyq committed May 3, 2023
  7. Rename "next" prerelease channel to "canary" (#26761)

    The "next" prerelease channel represents what will be published the next
    time we do a stable release. We publish a new "next" release every day
    using a timed CI workflow.
    
    When we introduced this prerelease channel a few years ago, another name
    we considered was "canary". But I proposed "next" instead to create a
    greater distinction between this channel and the "experimental" channel
    (which is published at the same cadence, but includes extra experimental
    features), because some other projects use "canary" to refer to releases
    that are more unstable than how we would use it.
    
    The main downside of "next" is someone might mistakenly assume the name
    refers to Next.js. We were aware of this risk at the time but didn't
    think it would be an issue in practice.
    
    However, colloquially, we've ended up referring to this as the "canary"
    channel anyway to avoid precisely that confusion.
    
    So after further discussion, we've agreed to rename to "canary".
    
    This affects the label used in the version string (e.g.
    `18.3.0-next-a1c2d3e4` becomes `18.3.0-canary-a1c2d3e4`) as well as the
    npm dist tags used to publish the releases. For now, I've chosen to
    publish the canaries using both `@canary` and `@next` dist tags, so that
    downstream consumers who might depend on `@next` have time to adjust. We
    can remove that later after the change has been communicated.
    acdlite committed May 3, 2023

Commits on May 2, 2023

  1. Remove deprecated workflow key from Circle config (#26762)

    This key was only valid during the 2.0 beta period so we can remove it.
    acdlite committed May 2, 2023

Commits on May 1, 2023

  1. [Fizz] Allow an action provide a custom set of props to use for progr…

    …essive enhancement (#26749)
    
    Stacked on top of #26735.
    
    This allows a framework to add a `$$FORM_ACTION` property to a function.
    This lets the framework return a set of props to use in place of the
    function but only during SSR. Effectively, this lets you implement
    progressive enhancement of form actions using some other way instead of
    relying on the replay feature.
    
    This will be used by RSC on Server References automatically by
    convention in a follow up, but this mechanism can also be used by other
    frameworks/libraries.
    sebmarkbage committed May 1, 2023
  2. Allow forms to skip hydration of hidden inputs (#26735)

    This allows us to emit extra ephemeral data that will only be used on
    server rendered forms.
    
    First I refactored the shouldSkip functions to now just do that work
    inside the canHydrate methods. This makes the Config bindings a little
    less surface area but it also helps us optimize a bit since we now can
    look at the code together and find shared paths.
    
    canHydrate returns the instance if it matches, that used to just be
    there to refine the type but it can also be used to just return a
    different instance later that we find. If we don't find one, we'll bail
    out and error regardless so no need to skip past anything.
    sebmarkbage committed May 1, 2023
  3. [Fizz] Encode external fizz runtime into chunks eagerly (#26752)

    in #26738 we added nonce to the
    ResponseState. Initially it was used in a variety of places but the
    version that got merged only included it with the external fizz runtime.
    This PR updates the config for the external fizz runtime so that the
    nonce is encoded into the script chunks at request creation time.
    
    The rationale is that for live-requests, streaming is more likely than
    not so doing the encoding work at the start is better than during flush.
    For cases such as SSG where the runtime is not required the extra
    encoding is tolerable (not a live request). Bots are an interesting case
    because if you want fastest TTFB you will end up requiring the runtime
    but if you are withholding until the stream is done you have already
    sacrificed fastest TTFB and the marginal slowdown of the extraneous
    encoding is hopefully neglibible
    
    I'm writing this so later if we learn that this tradeoff isn't worth it
    we at least understand why I made the change in the first place.
    gnoff committed May 1, 2023
  4. Implement experimental_useOptimisticState (#26740)

    This adds an experimental hook tentatively called useOptimisticState.
    (The actual name needs some bikeshedding.)
    
    The headline feature is that you can use it to implement optimistic
    updates. If you set some optimistic state during a transition/action,
    the state will be automatically reverted once the transition completes.
    
    Another feature is that the optimistic updates will be continually
    rebased on top of the latest state.
    
    It's easiest to explain with examples; we'll publish documentation as
    the API gets closer to stabilizing. See tests for now.
    
    Technically the use cases for this hook are broader than just optimistic
    updates; you could use it implement any sort of "pending" state, such as
    the ones exposed by useTransition and useFormStatus. But we expect
    people will most often reach for this hook to implement the optimistic
    update pattern; simpler cases are covered by those other hooks.
    acdlite committed May 1, 2023
Older