We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
react changelog
Here's the latest scoop on all the exciting updates and fixes we've rolled out! 🚀
-
New feature: First-Class Support for Thenables
We've jazzed up the React DevTools by introducing first-class support for Thenables! Now, Promise-like objects are treated with the respect they deserve during hydration, with their status (fulfilled, rejected, or pending) clearly displayed. This means you can now inspect these objects more effectively, with previews that match each status. Plus, we've got comprehensive tests in place to ensure everything runs smoothly with subclassed promises and deeply nested objects. 🎉 -
New feature: AutoDepsDecoration Event
Say hello toAutoDepsDecoration
, a new event that enhances logging capabilities by capturing and logging the locations of dependencies used in effect hooks. This gives developers better insights into dependency management within their components, making debugging a breeze! 🔍 -
New feature: Remove Dependency Arrays with Ease
We've added a snazzy new code action feature that lets you remove dependency arrays when editing code within functions eligible for automatic dependency tracking. This means quick fixes and streamlined editing for developers, all thanks to the newAutoDepsEligibleEvent
. 💡 -
New feature: Partial Hydration for Activity
Activity boundaries now act independently, just like Suspense boundaries. This lets you hydrate outer content first and then move on to content in an Offscreen lane. It's all about prioritizing hydration when props flow or interactions happen. Plus, we've made sure<Activity mode="hidden">
content is deferred for later client rendering. Neat, right? 🤓 -
Improvement: Version Name in Publish Script
We've spiced up the publish script by allowing an optionaltagVersion
parameter. This means you can now append a tag version to the version name, like19.1.0-rc.1
, for a more detailed versioning format. Version clarity, here we come! 📦 -
New feature: Build
react-server-dom-webpack
for CodeSandbox
Testing Flight changes just got easier with the ability to buildreact-server-dom-webpack
for CodeSandbox. Now you can test and demonstrate server component features in a sandbox environment. 🛠️ -
Improvement: Add Changelog
We've added a shiny newCHANGELOG.md
file documenting changes from19.0.0-beta-9ee70a1-20241017
to19.1.0-rc.1
. This comprehensive list highlights updates, improvements, and bug fixes across various components. 📜 -
Bugfix: Handle Rejected Promises Gracefully
No more hanging! We've fixed an issue in the React Server DOM where rejected promises during prerendering could cause indefinite hangs. Now, errors are caught and processed correctly, ensuring the prerendering flow continues smoothly. 🐛 -
Improvement: Docs Resource as a Tool
The docs resource in the React MCP server now functions as a tool, returning plaintext instead of Markdown. This change enhances usability and streamlines the response format for documentation queries. 📚 -
Bugfix: Suspense Boundary Visibility
We've resolved a quirky edge case with dehydrated Suspense boundaries, ensuring proper hiding and unhiding of content when the parent boundary resuspends. This fix enhances the robustness of React's handling of complex rendering scenarios. 🎭 -
Bugfix: Fix Copyright Script
Our copyright script got a little smarter! It now avoids trying to open directories, preventing errors during execution. 📝 -
Chore: Remove Compiler Weekly Release
We've discontinued the weekly release process for the compiler, streamlining our continuous integration process for better efficiency. 🗓️
And that's a wrap! Keep an eye out for more updates and happy coding! 🎈
Included Commits
The commit titled "[ci] Remove compiler weekly release (#32977)" indicates the removal of a weekly release process for the compiler, as it is no longer deemed necessary. This change likely reflects an adjustment in the development workflow or a shift in priorities regarding compiler updates.
The commit includes modifications that eliminate the associated tasks or configurations related to the weekly release cycle, streamlining the continuous integration process. By discontinuing this practice, the team may aim to enhance efficiency and focus on more relevant release strategies.
Files changed
This commit introduces a modification to the publish script within the compiler's release process, specifically allowing for an optional tagVersion
parameter to be specified. This enhancement enables developers to append a tag version to the version name and tag, resulting in a more detailed versioning format, such as 19.1.0-rc.1
. The changes include updates to the publish.js
script to accommodate this new option, as well as adjustments to the GitHub workflow files to ensure that the tag_version
input is recognized and utilized during the release process.
Additionally, the commit modifies how the new version string is constructed, incorporating the optional tag version into the final version name when provided. This change aims to improve the clarity and specificity of versioning in the publishing workflow, facilitating better tracking and management of releases. Overall, the commit enhances the functionality and flexibility of the versioning system within the compiler's release process.
Files changed
- .github/workflows/compiler_prereleases.yml
- .github/workflows/compiler_prereleases_manual.yml
- compiler/scripts/release/publish.js
This commit introduces the ability to build the react-server-dom-webpack
package for use in CodeSandbox, enhancing the testing capabilities for Flight changes within that environment. The modification includes updates to the .codesandbox/ci.json
and package.json
files, which now incorporate react-server-dom-webpack
as part of the build process and the published directory structure. This change allows developers to more effectively test and demonstrate features related to server components in React.
Specifically, the .codesandbox/ci.json
file has been updated to include the new package in the list of packages to build and publish, while the package.json
file has been modified to adjust the build command for CodeSandbox CI to include react-server-dom-webpack
. This integration is demonstrated in an example sandbox, providing a practical application of the changes made.
Files changed
- .codesandbox/ci.json
- package.json
This commit addresses a bug related to the behavior of dehydrated Suspense boundaries within React's component hierarchy. Specifically, it resolves an edge case where a dehydrated Suspense boundary is a direct child of another hydrated Suspense boundary that resuspends without triggering the hydration or deletion of the inner boundary. The previous implementation did not account for the hiding and unhiding of dehydrated fragments, which could lead to unexpected rendering issues. The changes introduce new functions to hide and unhide Suspense boundaries, ensuring that when a parent boundary resuspends, the inner dehydrated content is properly hidden.
The commit includes modifications to several files, adding a total of 61 lines of code without any deletions. Key additions include the hideOrUnhideSuspenseBoundary
function, which manages the visibility of nodes within the Suspense boundary based on their hydration state. Additionally, tests were updated to verify that the content of the Suspense boundary is appropriately hidden when the parent resuspends and shown again once the suspension is lifted. Overall, while the author expresses uncertainty about the necessity of the fix, it enhances the robustness of React's handling of Suspense boundaries in complex rendering scenarios.
Files changed
- packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
- packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
- packages/react-reconciler/src/ReactFiberCommitHostEffects.js
- packages/react-reconciler/src/ReactFiberCommitWork.js
- packages/react-reconciler/src/ReactFiberConfigWithNoHydration.js
- packages/react-reconciler/src/forks/ReactFiberConfig.custom.js
The commit titled "Implement Partial Hydration for Activity" introduces a new feature that allows Activity boundaries to operate independently, similar to how Suspense boundaries function. This implementation enables the outer content to be hydrated first, followed by the content in an Offscreen lane, with the priority of hydration increased when props are flowed or interactions occur. Notably, the implementation avoids hydrating content within <Activity mode="hidden">
, deferring it for later client rendering. The code modifications primarily involve adapting existing SuspenseComponent logic to fit the Activity model, ensuring that if something suspends during hydration, the dehydrated content remains in place, whereas suspensions during client rendering are managed by bubbling up to the parent.
Additionally, the commit includes the addition of new test files and modifications to existing ones to accommodate the Activity boundaries. The changes span multiple files in the React DOM and reconciler packages, reflecting a comprehensive update to support this new feature. The author has initiated work on porting relevant Suspense tests to Activity versions, indicating a commitment to thorough testing and validation of the new functionality.
Files changed
- packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
- packages/react-dom/src/__tests__/ReactDOMServerPartialHydrationActivity-test.internal.js
- packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydrationActivity-test.internal.js
- packages/react-reconciler/src/ReactFiber.js
- packages/react-reconciler/src/ReactFiberActivityComponent.js
- packages/react-reconciler/src/ReactFiberBeginWork.js
- packages/react-reconciler/src/ReactFiberCommitHostEffects.js
- packages/react-reconciler/src/ReactFiberCommitWork.js
- packages/react-reconciler/src/ReactFiberCompleteWork.js
- packages/react-reconciler/src/ReactFiberHydrationContext.js
- packages/react-reconciler/src/ReactFiberReconciler.js
- packages/react-reconciler/src/ReactFiberSuspenseContext.js
- packages/react-reconciler/src/ReactFiberThrow.js
- packages/react-reconciler/src/ReactFiberTreeReflection.js
- packages/react-reconciler/src/ReactFiberUnwindWork.js
- packages/react-reconciler/src/ReactFiberWorkLoop.js
- packages/react-server/src/ReactFizzServer.js
- scripts/error-codes/codes.json
This commit addresses an issue in the React Server DOM related to handling rejected promises during the prerendering process. Specifically, it modifies the prerender
function to prevent the system from hanging indefinitely when encountering a rejected promise. The changes include the removal of the start
method in the ReadableStream
, which previously did not handle promise rejections properly. Instead, the code now ensures that errors are caught and processed correctly, allowing the prerendering flow to continue without getting stuck.
Additionally, the commit introduces several test cases that validate the new error handling capabilities. These tests confirm that the system can appropriately manage rejected promises, async iterables, and readable streams, ensuring that errors are logged and that the expected error messages are returned. This enhancement improves the robustness of the React Server DOM in handling various asynchronous scenarios, ultimately leading to a more reliable rendering process for server components.
Files changed
- packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js
- packages/react-server-dom-webpack/src/server/ReactFlightDOMServerEdge.js
- packages/react-server/src/ReactFlightServer.js
This commit introduces a new event called AutoDepsDecoration
, which is emitted during the inference of effect dependencies in a React application. The change enhances the logging capabilities of the Babel plugin used in the React compiler by allowing it to capture and log the locations of dependencies utilized within effect hooks. This is particularly useful for developers as it provides better insights into how dependencies are being managed and utilized in their components.
The implementation involves modifying the existing event logging structure to include the new AutoDepsDecorations
type, which records the source location of the useEffect
call expression and an array of source locations for the identified dependencies. The commit also includes changes to the inference logic to collect and log these dependencies, thus improving the overall developer experience by facilitating easier debugging and analysis of dependency usage in React components.
Files changed
- compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts
This commit introduces a new code action feature in the "forgive" project, allowing developers to remove dependency arrays when editing sections of code within functions eligible for automatic dependency tracking. The implementation adds a new event in the compiler and a corresponding handler in the "forgive" server, enabling the identification of eligible functions and the creation of code actions that suggest removing unnecessary dependency arrays. This enhancement aims to streamline the editing process for developers by providing quick fixes based on inferred dependencies.
The changes involve modifications to several files, including the addition of new event types and logic to handle the new code action within the server's connection setup. Specifically, the commit defines the AutoDepsEligibleEvent
, which captures the locations of the function and its dependency array, and integrates this logic into the existing event handling for code actions. The commit also introduces utility functions to check if ranges overlap, ensuring that the code actions are contextually relevant to the user's current editing position. Overall, this feature enhances the developer experience by simplifying dependency management in React applications.
Files changed
- compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts
- compiler/packages/react-forgive/server/src/index.ts
- compiler/packages/react-forgive/server/src/requests/autodepsdecorations.ts
- compiler/packages/react-forgive/server/src/utils/range.ts
The commit titled "Fix copyright script" addresses an issue in the copyright script located in the compiler's directory. The primary change made is the addition of a check to prevent the script from attempting to open directories, which could lead to errors during execution. Specifically, the code now includes a condition that uses fs.lstatSync
to determine if the given file is a directory, and if so, the function will return early without processing it.
This modification enhances the script's robustness by ensuring that only valid files are processed, thereby avoiding potential issues that could arise from attempting to read directory contents as if they were files. The commit includes three lines of code added to the copyright.js
file, with no deletions, and has been co-authored by Jordan Brown.
Files changed
- compiler/scripts/copyright.js
This commit introduces first-class support for Thenables in the React DevTools, enhancing the handling of Promise-like objects during the hydration process. The changes include modifications to the hydration logic, where Thenables are now recognized and treated as special cases alongside complex iterables like Maps and Sets. The code has been updated to properly serialize the state of Thenables, allowing for their status (fulfilled, rejected, or pending) to be accurately represented in the DevTools. This ensures that developers can inspect the state of these objects more effectively, with appropriate previews for each status.
Additionally, the commit includes comprehensive tests to verify the new functionality, ensuring that various types of Thenables, including subclassed promises and deeply nested objects, are correctly handled and displayed in the DevTools. The tests confirm that the tools can accurately reflect the state of both fulfilled and rejected promises, as well as pending ones, providing a richer debugging experience for developers working with asynchronous code in React applications.
Files changed
- packages/react-devtools-shared/src/__tests__/inspectedElement-test.js
- packages/react-devtools-shared/src/hydration.js
- packages/react-devtools-shared/src/utils.js
- packages/react-devtools-shell/README.md
- packages/react-devtools-shell/src/app/Hydration/index.js
- packages/react-devtools-shell/webpack-server.js
This commit updates the documentation resource within the React MCP server, transitioning it to function as a tool instead. The primary change involves altering the output format from Markdown to plaintext, enhancing usability. The commit modifies several files, including package.json
, where dependencies related to Markdown processing, such as turndown
, have been replaced with html-to-text
. This change reflects a shift in how documentation is processed and returned, streamlining the response format for users querying the official React documentation.
In the codebase, the previous resource handling has been replaced with a tool called query-react-dev-docs
, which allows users to search and retrieve documentation based on a query string. The new implementation utilizes the html-to-text
library to convert HTML content into plaintext, ensuring that users receive clean, readable responses. Additionally, the commit includes various refactorings, such as deduplication of search results and improved error handling, contributing to a more robust and user-friendly documentation search experience.
Files changed
- compiler/packages/react-mcp-server/package.json
- compiler/packages/react-mcp-server/src/index.ts
- compiler/packages/react-mcp-server/src/utils/algolia.ts
- compiler/yarn.lock
The commit titled "[compiler] Add changelog (#32983)" introduces a new CHANGELOG.md
file that documents changes made between the beta version 19.0.0-beta-9ee70a1-20241017
and the release candidate 19.1.0-rc.1
. This changelog includes a comprehensive list of modifications, improvements, and bug fixes across various components, specifically highlighting updates to eslint-plugin-react-hooks
and babel-plugin-react-compiler
.
Notable changes in the eslint-plugin-react-hooks
include temporary disabling of ref access in render validation and fixes for type errors, while the babel-plugin-react-compiler
saw enhancements like support for the satisfies operator and optimizations for component declarations. Overall, the changelog encompasses 59 additions and changes, reflecting ongoing efforts to improve the functionality and reliability of the React ecosystem.
Files changed
- compiler/CHANGELOG.md