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

Update react monorepo (major) #412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 26, 2022

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@types/react (source) 18.3.3 -> 19.0.2 age adoption passing confidence
@types/react (source) 17.0.47 -> 19.0.2 age adoption passing confidence
@types/react-dom (source) 17.0.17 -> 19.0.2 age adoption passing confidence
eslint-plugin-react-hooks (source) 4.6.0 -> 5.1.0 age adoption passing confidence
react (source) ^17.0.2 -> ^19.0.0 age adoption passing confidence
react-dom (source) ^17.0.2 -> ^19.0.0 age adoption passing confidence
react-is (source) ^17.0.1 -> ^19.0.0 age adoption passing confidence

Release Notes

facebook/react (eslint-plugin-react-hooks)

v5.1.0

Compare Source

v5.0.0

Compare Source

  • New Violations: Component names now need to start with an uppercase letter instead of a non-lowercase letter. This means _Button or _component are no longer valid. (@​kassens) in #​25162

v4.6.2

Compare Source

v4.6.1

Compare Source

facebook/react (react)

v19.0.0

Compare Source

v18.3.1

Compare Source

v18.3.0

Compare Source

v18.2.0

Compare Source

React DOM
React DOM Server
Server Components (Experimental)

v18.1.0

Compare Source

React DOM
React DOM Server
ESLint Plugin: React Hooks
Use Subscription

v18.0.0

Compare Source

Below is a list of all new features, APIs, deprecations, and breaking changes.
Read React 18 release post and React 18 upgrade guide for more information.

New Features
React
  • useId is a new hook for generating unique IDs on both the client and server, while avoiding hydration mismatches. It is primarily useful for component libraries integrating with accessibility APIs that require unique IDs. This solves an issue that already exists in React 17 and below, but it’s even more important in React 18 because of how the new streaming server renderer delivers HTML out-of-order.
  • startTransition and useTransition let you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results).
  • useDeferredValue lets you defer re-rendering a non-urgent part of the tree. It is similar to debouncing, but has a few advantages compared to it. There is no fixed time delay, so React will attempt the deferred render right after the first render is reflected on the screen. The deferred render is interruptible and doesn't block user input.
  • useSyncExternalStore is a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. It removes the need for useEffect when implementing subscriptions to external data sources, and is recommended for any library that integrates with state external to React.
  • useInsertionEffect is a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you’ve already built a CSS-in-JS library we don’t expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout.
React DOM Client

These new APIs are now exported from react-dom/client:

  • createRoot: New method to create a root to render or unmount. Use it instead of ReactDOM.render. New features in React 18 don't work without it.
  • hydrateRoot: New method to hydrate a server rendered application. Use it instead of ReactDOM.hydrate in conjunction with the new React DOM Server APIs. New features in React 18 don't work without it.

Both createRoot and hydrateRoot accept a new option called onRecoverableError in case you want to be notified when React recovers from errors during rendering or hydration for logging. By default, React will use reportError, or console.error in the older browsers.

React DOM Server

These new APIs are now exported from react-dom/server and have full support for streaming Suspense on the server:

  • renderToPipeableStream: for streaming in Node environments.
  • renderToReadableStream: for modern edge runtime environments, such as Deno and Cloudflare workers.

The existing renderToString method keeps working but is discouraged.

facebook/react (react-dom)

v19.0.0

Compare Source

v18.3.1

Compare Source

v18.3.0

Compare Source

v18.2.0

Compare Source

React DOM
React DOM Server
Server Components (Experimental)

v18.1.0

Compare Source

React DOM
React DOM Server
ESLint Plugin: React Hooks
Use Subscription

v18.0.0

Compare Source

Below is a list of all new features, APIs, deprecations, and breaking changes.
Read React 18 release post and React 18 upgrade guide for more information.

New Features
React
  • useId is a new hook for generating unique IDs on both the client and server, while avoiding hydration mismatches. It is primarily useful for component libraries integrating with accessibility APIs that require unique IDs. This solves an issue that already exists in React 17 and below, but it’s even more important in React 18 because of how the new streaming server renderer delivers HTML out-of-order.
  • startTransition and useTransition let you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results).
  • useDeferredValue lets you defer re-rendering a non-urgent part of the tree. It is similar to debouncing, but has a few advantages compared to it. There is no fixed time delay, so React will attempt the deferred render right after the first render is reflected on the screen. The deferred render is interruptible and doesn't block user input.
  • useSyncExternalStore is a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. It removes the need for useEffect when implementing subscriptions to external data sources, and is recommended for any library that integrates with state external to React.
  • useInsertionEffect is a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you’ve already built a CSS-in-JS library we don’t expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout.
React DOM Client

These new APIs are now exported from react-dom/client:

  • createRoot: New method to create a root to render or unmount. Use it instead of ReactDOM.render. New features in React 18 don't work without it.
  • hydrateRoot: New method to hydrate a server rendered application. Use it instead of ReactDOM.hydrate in conjunction with the new React DOM Server APIs. New features in React 18 don't work without it.

Both createRoot and hydrateRoot accept a new option called onRecoverableError in case you want to be notified when React recovers from errors during rendering or hydration for logging. By default, React will use reportError, or console.error in the older browsers.

React DOM Server

These new APIs are now exported from react-dom/server and have full support for streaming Suspense on the server:

  • renderToPipeableStream: for streaming in Node environments.
  • renderToReadableStream: for modern edge runtime environments, such as Deno and Cloudflare workers.

The existing renderToString method keeps working but is discouraged.

facebook/react (react-is)

v19.0.0

Compare Source

Below is a list of all new features, APIs, deprecations, and breaking changes. Read React 19 release post and React 19 upgrade guide for more information.

Note: To help make the upgrade to React 19 easier, we’ve published a [email protected] release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.

New Features
React
  • Actions: startTransition can now accept async functions. Functions passed to startTransition are called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects like fetch() in the pending state, and provides support for error handling, and optimistic updates.
  • useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form action prop to support progressive enhancement in forms.
  • useOptimistic: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.
  • use: is a new API that allows reading resources in render. In React 19, use accepts a promise or Context. If provided a promise, use will suspend until a value is resolved. use can only be used in render but can be called conditionally.
  • ref as a prop: Refs can now be used as props, removing the need for forwardRef.
  • Suspense sibling pre-warming: When a component suspends, React will immediately commit the fallback of the nearest Suspense boundary, without waiting for the entire sibling tree to render. After the fallback commits, React will schedule another render for the suspended siblings to “pre-warm” lazy requests.
React DOM Client
  • <form> action prop: Form Actions allow you to manage forms automatically and integrate with useFormStatus. When a <form> action succeeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new requestFormReset API.
  • <button> and <input> formAction prop: Actions can be passed to the formAction prop to configure form submission behavior. This allows using different Actions depending on the input.
  • useFormStatus: is a new hook that provides the status of the parent <form> action, as if the form was a Context provider. The hook returns the values: pending, data, method, and action.
  • Support for Document Metadata: We’ve added support for rendering document metadata tags in components natively. React will automatically hoist them into the <head> section of the document.
  • Support for Stylesheets: React 19 will ensure stylesheets are inserted into the <head> on the client before revealing the content of a Suspense boundary that depends on that stylesheet.
  • Support for async scripts: Async scripts can be rendered anywhere in the component tree and React will handle ordering and deduplication.
  • Support for preloading resources: React 19 ships with preinit, preload, prefetchDNS, and preconnect APIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.
React DOM Server
  • Added prerender and prerenderToNodeStream APIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. Unlike renderToString, they wait for data to load for HTML generation.
React Server Components
  • RSC features such as directives, server components, and server functions are now stable. This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture. The underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. See docs for how to support React Server Components.
Deprecations
  • Deprecated: element.ref access: React 19 supports ref as a prop, so we’re deprecating element.ref in favor of element.props.ref. Accessing will result in a warning.
  • react-test-renderer: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @​testing-library/react or @​testing-library/react-native
Breaking Changes

React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to 18.3.1, where we've added additional deprecation warnings. Check out the upgrade guide for more details and guidance on codemodding.

React
  • New JSX Transform is now required: We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
  • Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced onUncaughtError and onCaughtError methods to createRoot and hydrateRoot to customize this error handling.
  • Removed: propTypes: Using propTypes will now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
  • Removed: defaultProps for functions: ES6 default parameters can be used in place. Class components continue to support defaultProps since there is no ES6 alternative.
  • Removed: contextTypes and getChildContext: Legacy Context for class components has been removed in favor of the contextType API.
  • Removed: string refs: Any usage of string refs need to be migrated to ref callbacks.
  • Removed: Module pattern factories: A rarely used pattern that can be migrated to regular functions.
  • Removed: React.createFactory: Now that JSX is broadly supported, all createFactory usage can be migrated to JSX components.
  • Removed: react-test-renderer/shallow: This has been a re-export of react-shallow-renderer since React 18. If needed, you can continue to use the third-party package directly. We recommend using @​testing-library/react or @​testing-library/react-native instead.
React DOM
  • Removed: react-dom/test-utils: We’ve moved act from react-dom/test-utils to react. All other utilities have been removed.
  • Removed: ReactDOM.render, ReactDOM.hydrate: These have been removed in favor of the concurrent equivalents: ReactDOM.createRoot and ReactDOM.hydrateRoot.
  • Removed: unmountComponentAtNode: Removed in favor of root.unmount().
  • Removed: ReactDOM.findDOMNode: You can replace ReactDOM.findDOMNode with DOM Refs.
Notable Changes
React
  • <Context> as a provider: You can now render <Context> as a provider instead of <Context.Provider>.
  • Cleanup functions for refs: When the component unmounts, React will call the cleanup function returned from the ref callback.
  • useDeferredValue initial value argument: When provided, useDeferredValue will return the initial value for the initial render of a component, then schedule a re-render in the background with the deferredValue returned.
  • Support for Custom Elements: React 19 now passes all tests on Custom Elements Everywhere.
  • StrictMode changes: useMemo and useCallback will now reuse the memoized results from the first render, during the second render. Additionally, StrictMode will now double-invoke ref callback functions on initial mount.
  • UMD builds removed: To load React 19 with a script tag, we recommend using an ESM-based CDN such as esm.sh.
React DOM
  • Diffs for hydration errors: In the case of a mismatch, React 19 logs a single error with a diff of the mismatched content.
  • Compatibility with third-party scripts and extensions: React will now force a client re-render to fix up any mismatched content caused by elements inserted by third-party JS.
TypeScript Changes

The most common changes can be codemodded with npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files.

  • Removed deprecated TypeScript types:
    • ReactChild (replacement: React.ReactElement | number | string)
    • ReactFragment (replacement: Iterable<React.ReactNode>)
    • ReactNodeArray (replacement: ReadonlyArray<React.ReactNode>)
    • ReactText (replacement: number | string)
    • VoidFunctionComponent (replacement: FunctionComponent)
    • VFC (replacement: FC)
    • Moved to prop-types: Requireable, ValidationMap, Validator, WeakValidationMap
    • Moved to create-react-class: ClassicComponentClass, ClassicComponent, ClassicElement, ComponentSpec, Mixin, ReactChildren, ReactHTML, ReactSVG, SFCFactory
  • Disallow implicit return in refs: refs can now accept cleanup functions. When you return something else, we can’t tell if you intentionally returned something not meant to clean up or returned the wrong value. Implicit returns of anything but functions will now error.
  • Require initial argument to useRef: The initial argument is now required to match useState, createContext etc
  • Refs are mutable by default: Ref objects returned from useRef() are now always mutable instead of sometimes being immutable. This feature was too confusing for users and conflicted with legit cases where refs were managed by React and manually written to.
  • Strict ReactElement typing: The props of React elements now default to unknown instead of any if the element is typed as ReactElement
  • JSX namespace in TypeScript: The global JSX namespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package: import { JSX } from 'react'
  • Better useReducer typings: Most useReducer usage should not require explicit type arguments.
    For example,
    -useReducer<React.Reducer<State, Action>>(reducer)
    +useReducer(reducer)
    or
    -useReducer<React.Reducer<State, Action>>(reducer)
    +useReducer<State, Action>(reducer)
All Changes
React

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update react monorepo to v18 (major) fix(deps): update react monorepo to v18 (major) Sep 27, 2022
@renovate renovate bot changed the title fix(deps): update react monorepo to v18 (major) Update react monorepo to v18 (major) Dec 17, 2022
@renovate renovate bot changed the title Update react monorepo to v18 (major) fix(deps): update react monorepo to v18 (major) Dec 17, 2022
@renovate renovate bot changed the title fix(deps): update react monorepo to v18 (major) Update react monorepo to v18 (major) Dec 18, 2022
@renovate renovate bot changed the title Update react monorepo to v18 (major) fix(deps): update react monorepo to v18 (major) Jan 16, 2023
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from f3e7d10 to 49c8383 Compare February 24, 2023 09:12
@renovate renovate bot changed the title fix(deps): update react monorepo to v18 (major) chore(deps): update react monorepo to v18 (major) Feb 24, 2023
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 3 times, most recently from d4d60ba to d06ec05 Compare March 29, 2023 03:25
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 2 times, most recently from 26e843b to c0ad828 Compare April 4, 2023 05:52
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 2 times, most recently from 64463be to 2d50ad2 Compare April 12, 2023 12:25
@renovate renovate bot changed the title chore(deps): update react monorepo to v18 (major) Update react monorepo to v18 (major) Apr 17, 2023
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 2 times, most recently from 20b5d62 to d0f1d50 Compare April 22, 2023 02:52
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 2 times, most recently from aca1b58 to 0bdcd6b Compare April 26, 2023 00:16
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 7 times, most recently from 44d3b0d to 302a7e6 Compare May 6, 2023 12:52
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 302a7e6 to 12df0ef Compare May 24, 2023 17:44
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 2 times, most recently from 273c02a to 63aa0de Compare June 7, 2023 22:25
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 63aa0de to 90e7fef Compare June 10, 2023 09:06
@renovate renovate bot changed the title Update react monorepo to v18 (major) chore(deps): update react monorepo to v18 (major) Jun 7, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 080d0c1 to feaf490 Compare July 12, 2024 14:48
@renovate renovate bot changed the title chore(deps): update react monorepo to v18 (major) Update react monorepo to v18 (major) Jul 12, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from feaf490 to de04845 Compare August 20, 2024 23:27
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 3 times, most recently from 20d1fd3 to 71f4c07 Compare September 4, 2024 09:44
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 3 times, most recently from 0363d21 to da3cf75 Compare September 19, 2024 19:13
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 3 times, most recently from 4e78e90 to 369b2e1 Compare September 27, 2024 20:04
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 369b2e1 to 3c9199d Compare October 2, 2024 19:13
@renovate renovate bot changed the title Update react monorepo to v18 (major) chore(deps): update react monorepo to v18 (major) Oct 7, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 3c9199d to dd9c895 Compare October 11, 2024 15:54
@renovate renovate bot changed the title chore(deps): update react monorepo to v18 (major) chore(deps): update react monorepo (major) Oct 11, 2024
@renovate renovate bot changed the title chore(deps): update react monorepo (major) Update react monorepo (major) Oct 22, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from dd9c895 to 5b6fe3b Compare October 23, 2024 06:11
@renovate renovate bot changed the title Update react monorepo (major) chore(deps): update react monorepo (major) Oct 29, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 5b6fe3b to 93a159e Compare November 6, 2024 14:03
@renovate renovate bot changed the title chore(deps): update react monorepo (major) Update react monorepo (major) Nov 13, 2024
@renovate renovate bot changed the title Update react monorepo (major) chore(deps): update react monorepo (major) Nov 19, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 93a159e to 7533d9e Compare December 4, 2024 19:54
@renovate renovate bot changed the title chore(deps): update react monorepo (major) Update react monorepo (major) Dec 5, 2024
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch 3 times, most recently from f422486 to 26ade37 Compare December 9, 2024 22:44
@renovate renovate bot force-pushed the renovate/major-react-monorepo branch from 26ade37 to 43eb6e2 Compare December 18, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants