โ—Change8

v19.1.0

Breaking Changes
๐Ÿ“ฆ reactView on GitHub โ†’
โš  4 breakingโœจ 10 features๐Ÿ› 10 fixes๐Ÿ”ง 12 symbols

Summary

This release introduces Owner Stacks for enhanced development debugging and the experimental unstable_prerender API for Server Components. It also includes significant improvements to Suspense hydration, CSS-compliant useId formatting, and various bug fixes across React DOM and Server Components.

โš ๏ธ Breaking Changes

  • React.act is no longer available in production builds; it is now strictly a development-only method.
  • Removed support for using HTML comments (e.g. <!-- -->) as a DOM container for React DOM.
  • The useId format has changed from ':r123:' to 'ยซr123ยป' to ensure valid CSS selectors, which may affect CSS selectors relying on the old format.
  • Updated the server component wire format to remove IDs for hints and console.log.

Migration Steps

  1. Ensure React.act is only used in test or development environments, as it is removed from production.
  2. Update any DOM mounting logic that relies on HTML comments as containers to use element nodes instead.
  3. Check CSS stylesheets or automated tests that might target useId generated IDs, as the string format has changed.
  4. If using use-sync-external-store with specific entrypoints, verify compatibility with the new exports field.

โœจ New Features

  • Introduced Owner Stacks in development builds to identify components responsible for rendering.
  • Added captureOwnerStack API (development-only) to retrieve Owner Stacks for debugging.
  • Added unstable_prerender experimental API for prerendering React Server Components.
  • Added support for beforetoggle and toggle events on the dialog element.
  • Added support for <script> and <template> tags to be nested within <select> tags.
  • Added support for streaming in edge environments for Server Components.
  • Added support for sending custom error names from server to client for console replaying.
  • Exposed registerServerReference in client builds.
  • Added react-server-dom-parcel package for Parcel bundler integration.
  • Added exports field to use-sync-external-store package.json for better entrypoint support.

๐Ÿ› Bug Fixes

  • Fixed frozen fallback states by rendering unfinished Suspense boundaries on the client.
  • Fixed a regression causing key warnings for flattened positional children in development.
  • Fixed erroneous 'Waiting for Paint' logs when passive effect phase was not delayed.
  • Fixed component name resolution for Portals.
  • Fixed React DOM double warning when href attribute is an empty string.
  • Fixed getHoistableRoot() failure when the container is a Document.
  • Fixed responsive images to be preloaded as HTML instead of headers.
  • Fixed Server Component stream hangs when receiving chunks after a global error.
  • Fixed issue where pending chunks were counted twice in Server Components.
  • Fixed asserts in React Native for OffscreenComponent rendering when passChildrenWhenCloningPersistedNodes is enabled.

๐Ÿ”ง Affected Symbols

captureOwnerStackuseIdReact.actuseEffectuseInsertionEffectuseLayoutEffectunstable_prerenderregisterServerReferenceSuspensePortalOffscreenComponentuse-sync-external-store