-
Couldn't load subscription status.
- Fork 90
chore(deps): update react monorepo (major) #274
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
base: next
Are you sure you want to change the base?
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ffadddf:
|
7435718 to
f364777
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #274 +/- ##
=======================================
Coverage 98.58% 98.58%
=======================================
Files 8 8
Lines 424 424
Branches 148 148
=======================================
Hits 418 418
Misses 6 6 ☔ View full report in Codecov by Sentry. |
f364777 to
57e8245
Compare
ffadddf to
a7e5a8d
Compare
0b58b58 to
edc4e23
Compare
edc4e23 to
da7ba37
Compare
028b18e to
668fc0c
Compare
668fc0c to
3f56904
Compare
3f56904 to
a94b097
Compare
a94b097 to
2aeeb84
Compare
2aeeb84 to
f25fe4d
Compare
f25fe4d to
a70c17c
Compare
a70c17c to
09a06a2
Compare
09a06a2 to
8bf161e
Compare
8bf161e to
fd8a749
Compare
fd8a749 to
4fc99a1
Compare
0687b40 to
06d738e
Compare
06d738e to
893a48b
Compare
893a48b to
1795323
Compare
1795323 to
5ad5d54
Compare
5ad5d54 to
435ebc4
Compare
240afef to
92adb54
Compare
92adb54 to
a93fdf1
Compare
aee7a27 to
3ac03c2
Compare
3ac03c2 to
1ec89c8
Compare
1ec89c8 to
24f3d4b
Compare
This PR contains the following updates:
2.5.1->7.0.117.0.2->19.2.017.0.2->19.2.0Release Notes
facebook/react (eslint-plugin-react-hooks)
v7.0.1Compare Source
useEffectEventvalues as JSX props to guard against accidental propagation. (#34820 by @jf-eirinha)export =so eslint-plugin-react-hooks emits correct types for consumers in Node16 ESM projects. (#34949 by @karlhorky)configs.flatso theconfigsexport is always defined. (#34950 by @poteto)v7.0.0Compare Source
This release slims down presets to just 2 configurations (
recommendedandrecommended-latest), and all compiler rules are enabled by default.recommended-latest-legacyandflat/recommendedconfigs. The plugin now providesrecommended(legacy and flat configs with all recommended rules), andrecommended-latest(legacy and flat configs with all recommended rules plus new bleeding edge experimental compiler rules). (@poteto in #34757)v6.1.1Compare Source
Note: 6.1.0 accidentally allowed use of
recommendedwithout flat config, causing errors when used with ESLint v9'sdefineConfig()helper. This has been fixed in 6.1.1.recommendedconfig for flat config compatibility. Therecommendedconfig has been converted to flat config format. Non-flat config users should userecommended-legacyinstead. (@poteto in #34700)recommended-latestandrecommended-latest-legacyconfigs that include React Compiler rules. (@poteto in #34675)NoUnusedOptOutDirectivesrule. (@poteto in #34703)hermes-parserand dependency. (@poteto in #34719)@babel/plugin-proposal-private-methodsdependency. (@ArnaudBarre and @josephsavona in #34715)v6.1.0Compare Source
Note: Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes.
recommendedpreset. Legacy config moved torecommended-legacy. (@michaelfaith in #32457)usewithin try/catch blocks. (@poteto in #34040)useEffectEventfunctions in arbitrary closures. (@jbrown215 in #33544)React.useEffectin addition touseEffectin rules-of-hooks. (@Ayc0 in #34076)react-hookssettings config option that to acceptadditionalEffectHooksthat are used across exhaustive-deps and rules-of-hooks rules. (@jbrown215) in #34497v6.0.0Compare Source
Accidentally released. See 6.1.0 for the actual changes.
v5.2.0Compare Source
do/whileloops (@tyxla in #31720)v5.1.0Compare Source
do/whileloops (@tyxla in #28714)asexpression (@mskelton in #31119)v5.0.0Compare Source
_Buttonor_componentare no longer valid. (@kassens) in #25162useActionStatestable. (@eps1lon in #29665)asexpression in callback. (@StyleShit in #28202)asexpressions in deps array. (@StyleShit in #28189)React.use()the same asuse(). (@kassens in #27769)use()lint to non-experimental. (@kassens in #27768)asexpressions. (@cpojer in #27590)useEffect(fn, undefined). (@kassens in #27525)useEventtouseEffectEvent. (@sebmarkbage in #25881)useEventfunctions in dependency lists. (@poteto in #25512)useEventreferences instead. (@poteto in #25319)RulesOfHookswithuseEventrules. (@poteto in #25285)v4.6.2Compare Source
v4.6.1Compare Source
v4.6.0v4.5.0v4.4.0v4.3.0useTransitionsignature in the rule. (@rickhanlonii in #20976)v4.2.0v4.1.2v4.1.1v4.1.0v4.0.8typeofannotation to not be considered a dependency. (@delca85 in #19316)v4.0.7v4.0.6v4.0.5v4.0.4v4.0.3Effectdue to too many false positives. (@gaearon in #19004)v4.0.2Effectin the middle from being considered effects. (@surgeboris in #18907)v4.0.1v4.0.0PascalCase.useFoo()calls as Hooks. (@cyan33 in #18722)Effect. (@airjp73 in #18580)useRefas constant. (@sophiebits in #18496)v3.0.0facebook/react (react)
v19.2.0Compare Source
Below is a list of all new features, APIs, and bug fixes.
Read the React 19.2 release post for more information.
New React Features
<Activity>: A new API to hide and restore the UI and internal state of its children.useEffectEventis a React Hook that lets you extract non-reactive logic into an Effect Event.cacheSignal(for RSCs) lets your know when thecache()lifetime is over.New React DOM Features
resume: to resume a prerender to a stream.resumeAndPrerender: to resume a prerender to HTML.resumeToPipeableStream: to resume a prerender to a stream.resumeAndPrerenderToNodeStream: to resume a prerender to HTML.prerenderAPIs to return apostponedstate that can be passed to theresumeAPIs.Notable changes
<ViewTransition>Component. React will batch as much reveals as possible before the first paint while trying to hit popular first-contentful paint metrics.prerender,renderToReadableStream) to server-side-rendering APIs for Node.js:IDs generated by useIdAll Changes
React
<Activity />was developed over many years, starting beforeClassComponent.setState(@acdlite @sebmarkbage and many others)%oplaceholder (@eps1lon #34198)useDeferredValueloop in popstate event (@acdlite #32821)useDeferredValue(@acdlite #34376)cacheSignal(@sebmarkbage #33557)React DOM
:for IDs generated byuseId(@sebmarkbage, @eps1lon: #32001, #33342#33099, #33422)nonceto be used on hoistable styles (@Andarist #32461)React.useinsideReact.lazy-ed Component (@hi-ogawa #33941)progressiveChunkSizeoption for server-side-rendering APIs (@sebmarkbage #33027)React Server Components
<img>and<link>using hints before they're rendered (@sebmarkbage #34604)filterStackFrame(@eps1lon #33707)React Reconciler
on*handlers to account for upcoming experimental APIsv19.1.1Compare Source
React
v19.1.0Compare Source
Owner Stack
An Owner Stack is a string representing the components that are directly responsible for rendering a particular component. You can log Owner Stacks when debugging or use Owner Stacks to enhance error overlays or other development tools. Owner Stacks are only available in development builds. Component Stacks in production are unchanged.
#32538, #32529, #32538
React
useIdto use valid CSS selectors, changing format from:r123:to«r123». #32001React DOM
hrefattribute is an empty string #31783getHoistableRoot()didn’t work properly when the container was a Document #32321<!-- -->) as a DOM container. #32250<script>and<template>tags to be nested within<select>tags. #31837use-sync-external-store
exportsfield topackage.jsonforuse-sync-external-storeto support various entrypoints. #25231React Server Components
unstable_prerender, a new experimental API for prerendering React Server Components on the server #31724registerServerReferencein client builds to handle server references in different environments. #32534v19.0.0Compare 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.
New Features
React
startTransitioncan now accept async functions. Functions passed tostartTransitionare 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 likefetch()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 formactionprop 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,useaccepts a promise or Context. If provided a promise,usewill suspend until a value is resolved.usecan only be used in render but can be called conditionally.refas a prop: Refs can now be used as props, removing the need forforwardRef.React DOM Client
<form> actionprop: Form Actions allow you to manage forms automatically and integrate withuseFormStatus. When a<form> actionsucceeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the newrequestFormResetAPI.<button> and <input> formActionprop: Actions can be passed to theformActionprop 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, andaction.<head>section of the document.<head>on the client before revealing the content of a Suspense boundary that depends on that stylesheet.preinit,preload,prefetchDNS, andpreconnectAPIs 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
prerenderandprerenderToNodeStreamAPIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. UnlikerenderToString, they wait for data to load for HTML generation.React Server Components
Deprecations
element.refaccess: React 19 supports ref as a prop, so we’re deprecatingelement.refin favor ofelement.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-nativeBreaking 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
onUncaughtErrorandonCaughtErrormethods tocreateRootandhydrateRootto customize this error handling.propTypes: UsingpropTypeswill now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.defaultPropsfor functions: ES6 default parameters can be used in place. Class components continue to supportdefaultPropssince there is no ES6 alternative.contextTypesandgetChildContext: Legacy Context for class components has been removed in favor of thecontextTypeAPI.React.createFactory: Now that JSX is broadly supported, allcreateFactoryusage can be migrated to JSX components.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
react-dom/test-utils: We’ve movedactfromreact-dom/test-utilsto react. All other utilities have been removed.ReactDOM.render,ReactDOM.hydrate: These have been removed in favor of the concurrent equivalents:ReactDOM.createRootandReactDOM.hydrateRoot.unmountComponentAtNode: Removed in favor ofroot.unmount().ReactDOM.findDOMNode: You can replaceReactDOM.findDOMNodewith DOM Refs.Notable Changes
React
<Context>as a provider: You can now render<Context>as a provider instead of<Context.Provider>.useDeferredValueinitial value argument: When provided,useDeferredValuewill return the initial value for the initial render of a component, then schedule a re-render in the background with thedeferredValuereturned.useMemoanduseCallbackwill 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.React DOM
TypeScript Changes
The most common changes can be codemodded with
npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files.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)prop-types:Requireable,ValidationMap,Validator,WeakValidationMapcreate-react-class:ClassicComponentClass,ClassicComponent,ClassicElement,ComponentSpec,Mixin,ReactChildren,ReactHTML,ReactSVG,SFCFactoryuseRef: The initial argument is now required to matchuseState,createContextetcuseRef()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.ReactElementtyping: The props of React elements now default tounknowninstead ofanyif the element is typed asReactElementJSXnamespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package:import { JSX } from 'react'useReducertypings: MostuseReducerusage should not require explicit type arguments.For example,
All Changes
React
useActionState()hook to update state based on the result of a Form Action (#27270, #27278, #27309, #27302, #27307, #27366, #27370, #27321, #27374, #27372, #27397, #27399, #27460, #28557, #27570, #27571, #28631, #28788, #29694, #29695, #29694, #29665, #28232, #28319 by @acdlite, @eps1lon, and @rickhanlonii)use()API to read resources in render (#25084, #25202, #25207, #25214, #25226, #25247, #25539, #25538, #25537, #25543, #25561, #25620, #25615, #25922, #25641, #25634, #26232, #26536, #26739, #28233 by @acdlite, @MofeiZ, @sebmarkbage, @sophiebits, @eps1lon, and @hansottowirtz)useOptimistic()hook to display mutated state optimistically during an async mutation (#26740, #26772, #27277, #27453, #27454, #27936 by @acdlite)initialValueargument touseDeferredValue()hook (#27500, #27509, #27512, #27888, #27550 by @acdlite)element.refaccess (#28348, #28464, #28731 by @acdlite)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.
This PR was generated by Mend Renovate. View the repository job log.