From c6e972220faf74101001f56c6480ab608ed5aa9f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 13 Sep 2022 18:36:15 +0000 Subject: [PATCH 1/4] chore: Update version for release --- .changeset/afraid-games-laugh.md | 5 - .changeset/afraid-parents-laugh.md | 5 - .changeset/beige-buckets-lick.md | 6 - .changeset/big-bags-report.md | 27 -- .changeset/brave-shirts-sneeze.md | 5 - .changeset/calm-lies-destroy.md | 86 ------ .changeset/chilled-beers-sell.md | 7 - .changeset/cuddly-dingos-tickle.md | 5 - .changeset/dirty-ladybugs-grow.md | 5 - .changeset/eighty-forks-search.md | 6 - .changeset/eighty-horses-leave.md | 5 - .changeset/eleven-ducks-rhyme.md | 5 - .changeset/fifty-ghosts-scream.md | 7 - .changeset/forty-phones-repair.md | 5 - .changeset/four-lobsters-crash.md | 4 - .changeset/gold-knives-drum.md | 9 - .changeset/gold-trains-rhyme.md | 6 - .changeset/hungry-vans-ring.md | 8 - .changeset/light-months-argue.md | 67 ----- .changeset/lovely-tomatoes-smoke.md | 5 - .changeset/lucky-olives-wonder.md | 5 - .changeset/metal-hounds-remain.md | 5 - .changeset/new-kiwis-burn.md | 14 - .changeset/nine-stingrays-arrive.md | 5 - .changeset/ninety-spoons-suffer.md | 59 ---- .changeset/odd-yaks-kneel.md | 5 - .changeset/pre.json | 57 ---- .changeset/red-sheep-push.md | 7 - .changeset/shy-guests-tickle.md | 6 - .changeset/silver-planes-relate.md | 5 - .changeset/sixty-otters-teach.md | 7 - .changeset/slimy-pugs-sip.md | 5 - .changeset/strange-terms-pretend.md | 7 - .changeset/strong-bees-pay.md | 5 - .changeset/stupid-dryers-shout.md | 5 - .changeset/sweet-books-switch.md | 16 - .changeset/sweet-eggs-hug.md | 5 - .changeset/thick-lions-taste.md | 6 - .changeset/thirty-monkeys-cheer.md | 5 - .changeset/tough-zoos-cry.md | 5 - .changeset/tricky-falcons-peel.md | 18 -- .changeset/unlucky-cows-rhyme.md | 5 - .changeset/weak-seas-kiss.md | 5 - .changeset/wet-readers-mate.md | 5 - .changeset/wise-scissors-hug.md | 5 - .changeset/yellow-cherries-tell.md | 5 - .changeset/young-pumas-destroy.md | 5 - .../react-router-dom-v5-compat/CHANGELOG.md | 38 +++ .../react-router-dom-v5-compat/package.json | 4 +- packages/react-router-dom/CHANGELOG.md | 212 ++++++++++++++ packages/react-router-dom/package.json | 4 +- packages/react-router-native/CHANGELOG.md | 52 ++++ packages/react-router-native/package.json | 4 +- packages/react-router/CHANGELOG.md | 260 ++++++++++++++++- packages/react-router/package.json | 4 +- packages/router/CHANGELOG.md | 275 +++++++++++++++++- packages/router/package.json | 2 +- 57 files changed, 843 insertions(+), 572 deletions(-) delete mode 100644 .changeset/afraid-games-laugh.md delete mode 100644 .changeset/afraid-parents-laugh.md delete mode 100644 .changeset/beige-buckets-lick.md delete mode 100644 .changeset/big-bags-report.md delete mode 100644 .changeset/brave-shirts-sneeze.md delete mode 100644 .changeset/calm-lies-destroy.md delete mode 100644 .changeset/chilled-beers-sell.md delete mode 100644 .changeset/cuddly-dingos-tickle.md delete mode 100644 .changeset/dirty-ladybugs-grow.md delete mode 100644 .changeset/eighty-forks-search.md delete mode 100644 .changeset/eighty-horses-leave.md delete mode 100644 .changeset/eleven-ducks-rhyme.md delete mode 100644 .changeset/fifty-ghosts-scream.md delete mode 100644 .changeset/forty-phones-repair.md delete mode 100644 .changeset/four-lobsters-crash.md delete mode 100644 .changeset/gold-knives-drum.md delete mode 100644 .changeset/gold-trains-rhyme.md delete mode 100644 .changeset/hungry-vans-ring.md delete mode 100644 .changeset/light-months-argue.md delete mode 100644 .changeset/lovely-tomatoes-smoke.md delete mode 100644 .changeset/lucky-olives-wonder.md delete mode 100644 .changeset/metal-hounds-remain.md delete mode 100644 .changeset/new-kiwis-burn.md delete mode 100644 .changeset/nine-stingrays-arrive.md delete mode 100644 .changeset/ninety-spoons-suffer.md delete mode 100644 .changeset/odd-yaks-kneel.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/red-sheep-push.md delete mode 100644 .changeset/shy-guests-tickle.md delete mode 100644 .changeset/silver-planes-relate.md delete mode 100644 .changeset/sixty-otters-teach.md delete mode 100644 .changeset/slimy-pugs-sip.md delete mode 100644 .changeset/strange-terms-pretend.md delete mode 100644 .changeset/strong-bees-pay.md delete mode 100644 .changeset/stupid-dryers-shout.md delete mode 100644 .changeset/sweet-books-switch.md delete mode 100644 .changeset/sweet-eggs-hug.md delete mode 100644 .changeset/thick-lions-taste.md delete mode 100644 .changeset/thirty-monkeys-cheer.md delete mode 100644 .changeset/tough-zoos-cry.md delete mode 100644 .changeset/tricky-falcons-peel.md delete mode 100644 .changeset/unlucky-cows-rhyme.md delete mode 100644 .changeset/weak-seas-kiss.md delete mode 100644 .changeset/wet-readers-mate.md delete mode 100644 .changeset/wise-scissors-hug.md delete mode 100644 .changeset/yellow-cherries-tell.md delete mode 100644 .changeset/young-pumas-destroy.md diff --git a/.changeset/afraid-games-laugh.md b/.changeset/afraid-games-laugh.md deleted file mode 100644 index 412b83a660..0000000000 --- a/.changeset/afraid-games-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: avoid uneccesary re-renders on defer resolution (#9155) diff --git a/.changeset/afraid-parents-laugh.md b/.changeset/afraid-parents-laugh.md deleted file mode 100644 index e5bd273fa6..0000000000 --- a/.changeset/afraid-parents-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: Capture fetcher errors at contextual route error boundaries (#8945) diff --git a/.changeset/beige-buckets-lick.md b/.changeset/beige-buckets-lick.md deleted file mode 100644 index f33d9262b3..0000000000 --- a/.changeset/beige-buckets-lick.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router-dom": patch -"@remix-run/router": patch ---- - -fix: pass useMatches objects to ScrollRestoration getKey (#9157) diff --git a/.changeset/big-bags-report.md b/.changeset/big-bags-report.md deleted file mode 100644 index 46545bb82e..0000000000 --- a/.changeset/big-bags-report.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"react-router-native": patch ---- - -feat: add `relative=path` option for url-relative routing (#9160) - -Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: - -```jsx -// Contact and EditContact do not share UI layout -} /> -} /> - -function EditContact() { - return Cancel -} -``` - -Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - -This applies to all path-related hooks and components: - -- `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` -- `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` -- `react-router-native`: `useLinkPressHandler`, `Link` diff --git a/.changeset/brave-shirts-sneeze.md b/.changeset/brave-shirts-sneeze.md deleted file mode 100644 index 2469488b9e..0000000000 --- a/.changeset/brave-shirts-sneeze.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: properly handle `
` submissions (#8984) diff --git a/.changeset/calm-lies-destroy.md b/.changeset/calm-lies-destroy.md deleted file mode 100644 index 2204e3ddd7..0000000000 --- a/.changeset/calm-lies-destroy.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -fix: remove internal router singleton (#9227) - -This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: - -- Unit tests are a pain because you need to find a way to reset the singleton in-between tests - - Use use a `_resetModuleScope` singleton for our tests - - ...but this isn't exposed to users who may want to do their own tests around our router -- The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations - - Conditional runtime ``'s won't get picked up - - Adding new ``'s during local dev won't get picked up during HMR - - Using external state in your elements doesn't work as one might expect (see #9225) - -Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` - -```jsx -// Before -function App() { - - }> - }> - - -} - -// After -let router = createBrowserRouter([{ - path: "/", - element: , - children: [{ - index: true, - element: , - }] -}]); - -function App() { - return -} -``` - -If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): - -```jsx -let routes = createRoutesFromElements( - }> - }> - -); -let router = createBrowserRouter(routes); - -function App() { - return -} -``` - -And now they can also hook into HMR correctly for router disposal: - -``` -if (import.meta.hot) { - import.meta.hot.dispose(() => router.dispose()); -} -``` - -And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. - -**Removed APIs** - -- `` -- `` -- `` -- `` -- `` - -**Modified APIs** - -- `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. - -**Added APIs** - -- `` -- `createRoutesFromElements` (alias of `createRoutesFromChildren`) diff --git a/.changeset/chilled-beers-sell.md b/.changeset/chilled-beers-sell.md deleted file mode 100644 index 384d4ec581..0000000000 --- a/.changeset/chilled-beers-sell.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -fix: Make path resolution trailing slash agnostic (#8861) diff --git a/.changeset/cuddly-dingos-tickle.md b/.changeset/cuddly-dingos-tickle.md deleted file mode 100644 index a33cfa9cd1..0000000000 --- a/.changeset/cuddly-dingos-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -fix: avoid navigation loops in re-renders in data routers (#9124) diff --git a/.changeset/dirty-ladybugs-grow.md b/.changeset/dirty-ladybugs-grow.md deleted file mode 100644 index 3e2dd23cf5..0000000000 --- a/.changeset/dirty-ladybugs-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: Handle fetcher 404s as normal boundary errors diff --git a/.changeset/eighty-forks-search.md b/.changeset/eighty-forks-search.md deleted file mode 100644 index 8ee80cde30..0000000000 --- a/.changeset/eighty-forks-search.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch ---- - -Fix broken require for CJS builds diff --git a/.changeset/eighty-horses-leave.md b/.changeset/eighty-horses-leave.md deleted file mode 100644 index 2598bbc1ad..0000000000 --- a/.changeset/eighty-horses-leave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom": patch ---- - -fix: do not overwrite input value from button with same name (#9139) diff --git a/.changeset/eleven-ducks-rhyme.md b/.changeset/eleven-ducks-rhyme.md deleted file mode 100644 index aacfeb4ec4..0000000000 --- a/.changeset/eleven-ducks-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": major ---- - -feat: bump @remix-run/router to 1.0.0 diff --git a/.changeset/fifty-ghosts-scream.md b/.changeset/fifty-ghosts-scream.md deleted file mode 100644 index 5aeb1e5c46..0000000000 --- a/.changeset/fifty-ghosts-scream.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -Make `fallbackElement` optional and change type to `ReactNode` (#8896) diff --git a/.changeset/forty-phones-repair.md b/.changeset/forty-phones-repair.md deleted file mode 100644 index d798eed0d2..0000000000 --- a/.changeset/forty-phones-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": minor ---- - -change `formMethod=GET` to be a loading navigation instead of submitting diff --git a/.changeset/four-lobsters-crash.md b/.changeset/four-lobsters-crash.md deleted file mode 100644 index ddeb91d28c..0000000000 --- a/.changeset/four-lobsters-crash.md +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -ci: prevent duplicate runs for Pull Requests diff --git a/.changeset/gold-knives-drum.md b/.changeset/gold-knives-drum.md deleted file mode 100644 index 27f3e1aeca..0000000000 --- a/.changeset/gold-knives-drum.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"react-router-dom-v5-compat": patch -"react-router-native": patch -"@remix-run/router": patch ---- - -Release script tests diff --git a/.changeset/gold-trains-rhyme.md b/.changeset/gold-trains-rhyme.md deleted file mode 100644 index 2f233ee6e2..0000000000 --- a/.changeset/gold-trains-rhyme.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -Properly trigger error boundaries on 404 routes diff --git a/.changeset/hungry-vans-ring.md b/.changeset/hungry-vans-ring.md deleted file mode 100644 index cbfe75bedc..0000000000 --- a/.changeset/hungry-vans-ring.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"react-router-dom-v5-compat": patch -"react-router-native": patch ---- - -fix: update `useLocation` to return the scoped `Location` when inside a `` component diff --git a/.changeset/light-months-argue.md b/.changeset/light-months-argue.md deleted file mode 100644 index 9569a8ab22..0000000000 --- a/.changeset/light-months-argue.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -Feat: adds `defer()` support to data routers - -Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. - -```jsx -// In your route loader, return a defer() and choose per-key whether to -// await the promise or not. As soon as the awaited promises resolve, the -// page will be rendered. -function loader() { - return defer({ - critical: await getCriticalData(), - lazy: getLazyData(), - }); -}; - -// In your route element, grab the values from useLoaderData and render them -// with inside a boundary -function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - - -
- - ); -} - -// Use separate components to render the data once it resolves, and access it -// via the useAsyncValue hook -function RenderData() { - let data = useAsyncValue(); - return

Lazy: {data}

; -} - -function RenderError() { - let data = useAsyncError(); - return

Error! {data.message} {data.stack}

; -} -``` - -If you want to skip the separate components, you can use the Render Props -pattern and handle the rendering of the deferred data inline: - -```jsx -function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - {(data) =>

{data}

} -
-
- - ); -} -``` diff --git a/.changeset/lovely-tomatoes-smoke.md b/.changeset/lovely-tomatoes-smoke.md deleted file mode 100644 index f6c392bb82..0000000000 --- a/.changeset/lovely-tomatoes-smoke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom": patch ---- - -fix: respect the `` prop if it is defined (#8779) diff --git a/.changeset/lucky-olives-wonder.md b/.changeset/lucky-olives-wonder.md deleted file mode 100644 index 34db72e6bf..0000000000 --- a/.changeset/lucky-olives-wonder.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: fix default redirect push/replace behavior (#9117) diff --git a/.changeset/metal-hounds-remain.md b/.changeset/metal-hounds-remain.md deleted file mode 100644 index 49b621b33a..0000000000 --- a/.changeset/metal-hounds-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom": patch ---- - -fix: unspecified `` action should preserve search params (#9060) diff --git a/.changeset/new-kiwis-burn.md b/.changeset/new-kiwis-burn.md deleted file mode 100644 index 5ae292a870..0000000000 --- a/.changeset/new-kiwis-burn.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -Deferred API Updates - -- Removes `` from inside ``, requires users to render their own suspense boundaries -- Updates `Deferred` to use a true error boundary to catch render errors as well as data errors -- Support array and single promise usages - - `return defer([ await critical(), lazy() ])` - - `return defer(lazy())` -- Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` -- Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 diff --git a/.changeset/nine-stingrays-arrive.md b/.changeset/nine-stingrays-arrive.md deleted file mode 100644 index df8d6b23f7..0000000000 --- a/.changeset/nine-stingrays-arrive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -`resolveTo` should not mutate the provided pathname (#8839) diff --git a/.changeset/ninety-spoons-suffer.md b/.changeset/ninety-spoons-suffer.md deleted file mode 100644 index 7ede68467e..0000000000 --- a/.changeset/ninety-spoons-suffer.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -"react-router-dom": patch -"@remix-run/router": patch ---- - -feat: Add `createStaticRouter` for `@remix-run/router` SSR usage - -**Notable changes:** - -- `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) -- Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` - -**Example usage (Document Requests):** - -```jsx -// Create a static handler -let { query } = unstable_createStaticHandler(routes); - -// Perform a full-document query for the incoming Fetch Request. This will -// execute the appropriate action/loaders and return either the state or a -// Fetch Response in the case of redirects. -let state = await query(fetchRequest); - -// If we received a Fetch Response back, let our server runtime handle directly -if (state instanceof Response) { - throw state; -} - -// Otherwise, render our application providing the data routes and state -let html = ReactDOMServer.renderToString( - - - -); -``` - -**Example usage (Data Requests):** - -```jsx -// Create a static route handler -let { queryRoute } = unstable_createStaticHandler(routes); - -// Perform a single-route query for the incoming Fetch Request. This will -// execute the appropriate singular action/loader and return either the raw -// data or a Fetch Response -let data = await queryRoute(fetchRequest); - -// If we received a Fetch Response back, return it directly -if (data instanceof Response) { - return data; -} - -// Otherwise, construct a Response from the raw data (assuming json here) -return new Response(JSON.stringify(data), { - headers: { - "Content-Type": "application/json; charset=utf-8", - }, -}); -``` diff --git a/.changeset/odd-yaks-kneel.md b/.changeset/odd-yaks-kneel.md deleted file mode 100644 index b03598497d..0000000000 --- a/.changeset/odd-yaks-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: don't default to a `REPLACE` navigation on form submissions if the action redirected. The redirect takes care of avoiding the back-button-resubmit scenario, so by using a `PUSH` we allow the back button to go back to the pre-submission form page (#8979) diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 783f665c7b..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "mode": "exit", - "tag": "pre", - "initialVersions": { - "react-router": "6.4.0-pre.3", - "react-router-dom": "6.4.0-pre.3", - "react-router-dom-v5-compat": "6.4.0-pre.3", - "react-router-native": "6.4.0-pre.3", - "@remix-run/router": "0.2.0-pre.0" - }, - "changesets": [ - "afraid-games-laugh", - "afraid-parents-laugh", - "beige-buckets-lick", - "big-bags-report", - "brave-shirts-sneeze", - "calm-lies-destroy", - "chilled-beers-sell", - "cuddly-dingos-tickle", - "dirty-ladybugs-grow", - "eighty-forks-search", - "eighty-horses-leave", - "fifty-ghosts-scream", - "forty-phones-repair", - "four-lobsters-crash", - "gold-knives-drum", - "gold-trains-rhyme", - "light-months-argue", - "lovely-tomatoes-smoke", - "lucky-olives-wonder", - "metal-hounds-remain", - "new-kiwis-burn", - "nine-stingrays-arrive", - "ninety-spoons-suffer", - "odd-yaks-kneel", - "red-sheep-push", - "shy-guests-tickle", - "silver-planes-relate", - "sixty-otters-teach", - "slimy-pugs-sip", - "strange-terms-pretend", - "strong-bees-pay", - "stupid-dryers-shout", - "sweet-books-switch", - "sweet-eggs-hug", - "thick-lions-taste", - "thirty-monkeys-cheer", - "tough-zoos-cry", - "tricky-falcons-peel", - "unlucky-cows-rhyme", - "weak-seas-kiss", - "wet-readers-mate", - "wise-scissors-hug", - "yellow-cherries-tell", - "young-pumas-destroy" - ] -} diff --git a/.changeset/red-sheep-push.md b/.changeset/red-sheep-push.md deleted file mode 100644 index 11cab920fc..0000000000 --- a/.changeset/red-sheep-push.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -fix: rename resetScroll -> preventScrollReset (#9199) diff --git a/.changeset/shy-guests-tickle.md b/.changeset/shy-guests-tickle.md deleted file mode 100644 index 5c125706db..0000000000 --- a/.changeset/shy-guests-tickle.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -fix: Avoid suspense loops on promise aborted values (#9226) diff --git a/.changeset/silver-planes-relate.md b/.changeset/silver-planes-relate.md deleted file mode 100644 index f3ffe56ef5..0000000000 --- a/.changeset/silver-planes-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -fix: Additional logic fixed for relative navigation from index/pathless layout routes (#8985) diff --git a/.changeset/sixty-otters-teach.md b/.changeset/sixty-otters-teach.md deleted file mode 100644 index 092956a55b..0000000000 --- a/.changeset/sixty-otters-teach.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -feat: add basename support for data routers diff --git a/.changeset/slimy-pugs-sip.md b/.changeset/slimy-pugs-sip.md deleted file mode 100644 index 88e1afa7ac..0000000000 --- a/.changeset/slimy-pugs-sip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom-v5-compat": patch ---- - -Fix `react-router-dom` peer dependency version diff --git a/.changeset/strange-terms-pretend.md b/.changeset/strange-terms-pretend.md deleted file mode 100644 index 6d2228aabf..0000000000 --- a/.changeset/strange-terms-pretend.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) diff --git a/.changeset/strong-bees-pay.md b/.changeset/strong-bees-pay.md deleted file mode 100644 index 27a0c00586..0000000000 --- a/.changeset/strong-bees-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -ci: simplify dist/ directory for CJS/ESM only diff --git a/.changeset/stupid-dryers-shout.md b/.changeset/stupid-dryers-shout.md deleted file mode 100644 index 18167b5277..0000000000 --- a/.changeset/stupid-dryers-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": minor ---- - -feat: `useSearchParams` supports functional updates like `useState` (#8955) diff --git a/.changeset/sweet-books-switch.md b/.changeset/sweet-books-switch.md deleted file mode 100644 index 855dabc9f6..0000000000 --- a/.changeset/sweet-books-switch.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -fix: Rename `` to `` (#9095) - -- We are no longer replacing the `Promise` on `loaderData` with the value/error - when it settles so it's now always a `Promise`. -- To that end, we changed from `` to - `` for clarity, and it also now supports using - `` with raw promises from anywhere, not only those on `loaderData` - from a defer() call. - - Note that raw promises will not be automatically cancelled on interruptions - so they are not recommended -- The hooks are now `useAsyncValue`/`useAsyncError` diff --git a/.changeset/sweet-eggs-hug.md b/.changeset/sweet-eggs-hug.md deleted file mode 100644 index 152d02595e..0000000000 --- a/.changeset/sweet-eggs-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: fetcher submission revalidating fetchers using wrong key (#9166) diff --git a/.changeset/thick-lions-taste.md b/.changeset/thick-lions-taste.md deleted file mode 100644 index c3a2ea038f..0000000000 --- a/.changeset/thick-lions-taste.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"react-router": patch -"@remix-run/router": patch ---- - -fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) diff --git a/.changeset/thirty-monkeys-cheer.md b/.changeset/thirty-monkeys-cheer.md deleted file mode 100644 index 47f4032dbf..0000000000 --- a/.changeset/thirty-monkeys-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -fix: Properly handle relative navigation from index/pathless routes (#8954) diff --git a/.changeset/tough-zoos-cry.md b/.changeset/tough-zoos-cry.md deleted file mode 100644 index b40d71a1b8..0000000000 --- a/.changeset/tough-zoos-cry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -fix: webpack + React 17 won't build because of named imports of React 18 APIs (#8938) diff --git a/.changeset/tricky-falcons-peel.md b/.changeset/tricky-falcons-peel.md deleted file mode 100644 index f4c09a646c..0000000000 --- a/.changeset/tricky-falcons-peel.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"react-router": patch -"react-router-dom": patch -"@remix-run/router": patch ---- - -SSR Updates for React Router - -_Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - -- Remove `useRenderDataRouter()` in favor of ``/`` -- Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` -- `` now tracks it's own SSR error boundaries on `StaticHandlerContext` -- `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` -- `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` diff --git a/.changeset/unlucky-cows-rhyme.md b/.changeset/unlucky-cows-rhyme.md deleted file mode 100644 index 4b09fcca76..0000000000 --- a/.changeset/unlucky-cows-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: preserve loader data for loaders that opted out of revalidation (#8973) diff --git a/.changeset/weak-seas-kiss.md b/.changeset/weak-seas-kiss.md deleted file mode 100644 index 496634106f..0000000000 --- a/.changeset/weak-seas-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -Pass fetcher `actionResult` through to `shouldRevalidate` on fetcher submissions diff --git a/.changeset/wet-readers-mate.md b/.changeset/wet-readers-mate.md deleted file mode 100644 index 0c53deff3f..0000000000 --- a/.changeset/wet-readers-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: Await should fallback on route params navigations (#9181) diff --git a/.changeset/wise-scissors-hug.md b/.changeset/wise-scissors-hug.md deleted file mode 100644 index 31507bbf91..0000000000 --- a/.changeset/wise-scissors-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: use a push navigation on submission errors (#9162) diff --git a/.changeset/yellow-cherries-tell.md b/.changeset/yellow-cherries-tell.md deleted file mode 100644 index e31c8a0cfb..0000000000 --- a/.changeset/yellow-cherries-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router-dom": patch ---- - -fix: useFormAction should not include pathless splat portion (#9144) diff --git a/.changeset/young-pumas-destroy.md b/.changeset/young-pumas-destroy.md deleted file mode 100644 index aaabfa2d24..0000000000 --- a/.changeset/young-pumas-destroy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@remix-run/router": patch ---- - -fix: proxy defer resolve/reject values through tracked promises (#9200) diff --git a/packages/react-router-dom-v5-compat/CHANGELOG.md b/packages/react-router-dom-v5-compat/CHANGELOG.md index 8d67b5f1b8..8172c4c81b 100644 --- a/packages/react-router-dom-v5-compat/CHANGELOG.md +++ b/packages/react-router-dom-v5-compat/CHANGELOG.md @@ -1,5 +1,43 @@ # react-router-dom-v5-compat +## 6.4.0 + +### Patch Changes + +- f264d828: Release script tests +- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component +- f264d828: Fix `react-router-dom` peer dependency version +- Updated dependencies [5c8fdeca] +- Updated dependencies [815e1d17] +- Updated dependencies [c17512d8] +- Updated dependencies [9fa39a6d] +- Updated dependencies [c21e38ef] +- Updated dependencies [f264d828] +- Updated dependencies [f0579d8a] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [e766ab5a] +- Updated dependencies [d5b25602] +- Updated dependencies [f264d828] +- Updated dependencies [b25d53f9] +- Updated dependencies [92aa5bb0] +- Updated dependencies [9e2f92ac] +- Updated dependencies [a04ab758] +- Updated dependencies [112c02c7] +- Updated dependencies [e6b68116] +- Updated dependencies [d68d03ed] +- Updated dependencies [9fa39a6d] +- Updated dependencies [f264d828] +- Updated dependencies [c3406eb9] +- Updated dependencies [3e7e502c] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f3182f4a] +- Updated dependencies [6fef589d] + - react-router-dom@6.4.0 + - react-router@6.4.0 + ## 6.4.0-pre.15 ### Patch Changes diff --git a/packages/react-router-dom-v5-compat/package.json b/packages/react-router-dom-v5-compat/package.json index 0d406117d3..4754323e1d 100644 --- a/packages/react-router-dom-v5-compat/package.json +++ b/packages/react-router-dom-v5-compat/package.json @@ -1,6 +1,6 @@ { "name": "react-router-dom-v5-compat", - "version": "6.4.0-pre.15", + "version": "6.4.0", "description": "Migration path to React Router v6 from v4/5", "keywords": [ "react", @@ -24,7 +24,7 @@ "types": "./dist/index.d.ts", "dependencies": { "history": "^5.3.0", - "react-router": "6.4.0-pre.15" + "react-router": "6.4.0" }, "peerDependencies": { "react": ">=16.8", diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index f7573411ec..daf3c58f56 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -1,5 +1,217 @@ # react-router-dom +## 6.4.0 + +### Patch Changes + +- 5c8fdeca: fix: pass useMatches objects to ScrollRestoration getKey (#9157) +- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) + + Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: + + ```jsx + // Contact and EditContact do not share UI layout + } /> + } /> + + function EditContact() { + return Cancel + } + ``` + + Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. + + This applies to all path-related hooks and components: + + - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` + - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` + - `react-router-native`: `useLinkPressHandler`, `Link` + +- c17512d8: fix: remove internal router singleton (#9227) + + This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: + + - Unit tests are a pain because you need to find a way to reset the singleton in-between tests + - Use use a `_resetModuleScope` singleton for our tests + - ...but this isn't exposed to users who may want to do their own tests around our router + - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations + - Conditional runtime ``'s won't get picked up + - Adding new ``'s during local dev won't get picked up during HMR + - Using external state in your elements doesn't work as one might expect (see #9225) + + Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` + + ```jsx + // Before + function App() { + + }> + }> + + + } + + // After + let router = createBrowserRouter([{ + path: "/", + element: , + children: [{ + index: true, + element: , + }] + }]); + + function App() { + return + } + ``` + + If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): + + ```jsx + let routes = createRoutesFromElements( + }> + }> + + ); + let router = createBrowserRouter(routes); + + function App() { + return + } + ``` + + And now they can also hook into HMR correctly for router disposal: + + ``` + if (import.meta.hot) { + import.meta.hot.dispose(() => router.dispose()); + } + ``` + + And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. + + **Removed APIs** + + - `` + - `` + - `` + - `` + - `` + + **Modified APIs** + + - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. + + **Added APIs** + + - `` + - `createRoutesFromElements` (alias of `createRoutesFromChildren`) + +- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) +- f264d828: Fix broken require for CJS builds +- f0579d8a: fix: do not overwrite input value from button with same name (#9139) +- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) +- f264d828: Release script tests +- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component +- f264d828: fix: respect the `` prop if it is defined (#8779) +- b25d53f9: fix: unspecified `` action should preserve search params (#9060) +- 9e2f92ac: feat: Add `createStaticRouter` for `@remix-run/router` SSR usage + + **Notable changes:** + + - `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) + - Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` + + **Example usage (Document Requests):** + + ```jsx + // Create a static handler + let { query } = unstable_createStaticHandler(routes); + + // Perform a full-document query for the incoming Fetch Request. This will + // execute the appropriate action/loaders and return either the state or a + // Fetch Response in the case of redirects. + let state = await query(fetchRequest); + + // If we received a Fetch Response back, let our server runtime handle directly + if (state instanceof Response) { + throw state; + } + + // Otherwise, render our application providing the data routes and state + let html = ReactDOMServer.renderToString( + + + + ); + ``` + + **Example usage (Data Requests):** + + ```jsx + // Create a static route handler + let { queryRoute } = unstable_createStaticHandler(routes); + + // Perform a single-route query for the incoming Fetch Request. This will + // execute the appropriate singular action/loader and return either the raw + // data or a Fetch Response + let data = await queryRoute(fetchRequest); + + // If we received a Fetch Response back, return it directly + if (data instanceof Response) { + return data; + } + + // Otherwise, construct a Response from the raw data (assuming json here) + return new Response(JSON.stringify(data), { + headers: { + "Content-Type": "application/json; charset=utf-8" + } + }); + ``` + +- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) +- d68d03ed: feat: add basename support for data routers +- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) +- f3182f4a: SSR Updates for React Router + + _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ + + - Remove `useRenderDataRouter()` in favor of ``/`` + - Support automatic hydration in ``/``/`` + - Uses `window.__staticRouterHydrationData` + - Can be disabled on the server via `` + - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` + - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` + - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` + - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` + +- 6fef589d: fix: useFormAction should not include pathless splat portion (#9144) +- Updated dependencies [815e1d17] +- Updated dependencies [c17512d8] +- Updated dependencies [9fa39a6d] +- Updated dependencies [c21e38ef] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [e766ab5a] +- Updated dependencies [d5b25602] +- Updated dependencies [92aa5bb0] +- Updated dependencies [a04ab758] +- Updated dependencies [112c02c7] +- Updated dependencies [e6b68116] +- Updated dependencies [d68d03ed] +- Updated dependencies [9fa39a6d] +- Updated dependencies [f264d828] +- Updated dependencies [c3406eb9] +- Updated dependencies [3e7e502c] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f3182f4a] + - react-router@6.4.0 + ## 6.4.0-pre.15 ### Patch Changes diff --git a/packages/react-router-dom/package.json b/packages/react-router-dom/package.json index 7200a97a84..9e5daceb8c 100644 --- a/packages/react-router-dom/package.json +++ b/packages/react-router-dom/package.json @@ -1,6 +1,6 @@ { "name": "react-router-dom", - "version": "6.4.0-pre.15", + "version": "6.4.0", "description": "Declarative routing for React web applications", "keywords": [ "react", @@ -23,7 +23,7 @@ "module": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "react-router": "6.4.0-pre.15" + "react-router": "6.4.0" }, "devDependencies": { "react": "^18.2.0", diff --git a/packages/react-router-native/CHANGELOG.md b/packages/react-router-native/CHANGELOG.md index 4e6fa82e2b..dcb8623090 100644 --- a/packages/react-router-native/CHANGELOG.md +++ b/packages/react-router-native/CHANGELOG.md @@ -1,5 +1,57 @@ # react-router-native +## 6.4.0 + +### Patch Changes + +- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) + + Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: + + ```jsx + // Contact and EditContact do not share UI layout + } /> + } /> + + function EditContact() { + return Cancel + } + ``` + + Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. + + This applies to all path-related hooks and components: + + - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` + - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` + - `react-router-native`: `useLinkPressHandler`, `Link` + +- f264d828: Release script tests +- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component +- Updated dependencies [815e1d17] +- Updated dependencies [c17512d8] +- Updated dependencies [9fa39a6d] +- Updated dependencies [c21e38ef] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [e766ab5a] +- Updated dependencies [d5b25602] +- Updated dependencies [92aa5bb0] +- Updated dependencies [a04ab758] +- Updated dependencies [112c02c7] +- Updated dependencies [e6b68116] +- Updated dependencies [d68d03ed] +- Updated dependencies [9fa39a6d] +- Updated dependencies [f264d828] +- Updated dependencies [c3406eb9] +- Updated dependencies [3e7e502c] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f3182f4a] + - react-router@6.4.0 + ## 6.4.0-pre.15 ### Patch Changes diff --git a/packages/react-router-native/package.json b/packages/react-router-native/package.json index 39c067840d..b770ede006 100644 --- a/packages/react-router-native/package.json +++ b/packages/react-router-native/package.json @@ -1,6 +1,6 @@ { "name": "react-router-native", - "version": "6.4.0-pre.15", + "version": "6.4.0", "description": "Declarative routing for React Native applications", "keywords": [ "react", @@ -22,7 +22,7 @@ "types": "./dist/index.d.ts", "dependencies": { "@ungap/url-search-params": "^0.1.4", - "react-router": "6.4.0-pre.15" + "react-router": "6.4.0" }, "devDependencies": { "react": "^18.2.0", diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 543dd2245d..7450b72687 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -1,5 +1,263 @@ # react-router +## 6.4.0 + +### Minor Changes + +- f264d828: feat: `useSearchParams` supports functional updates like `useState` (#8955) + +### Patch Changes + +- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) + + Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: + + ```jsx + // Contact and EditContact do not share UI layout + } /> + } /> + + function EditContact() { + return Cancel + } + ``` + + Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. + + This applies to all path-related hooks and components: + + - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` + - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` + - `react-router-native`: `useLinkPressHandler`, `Link` + +- c17512d8: fix: remove internal router singleton (#9227) + + This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: + + - Unit tests are a pain because you need to find a way to reset the singleton in-between tests + - Use use a `_resetModuleScope` singleton for our tests + - ...but this isn't exposed to users who may want to do their own tests around our router + - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations + - Conditional runtime ``'s won't get picked up + - Adding new ``'s during local dev won't get picked up during HMR + - Using external state in your elements doesn't work as one might expect (see #9225) + + Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` + + ```jsx + // Before + function App() { + + }> + }> + + + } + + // After + let router = createBrowserRouter([{ + path: "/", + element: , + children: [{ + index: true, + element: , + }] + }]); + + function App() { + return + } + ``` + + If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): + + ```jsx + let routes = createRoutesFromElements( + }> + }> + + ); + let router = createBrowserRouter(routes); + + function App() { + return + } + ``` + + And now they can also hook into HMR correctly for router disposal: + + ``` + if (import.meta.hot) { + import.meta.hot.dispose(() => router.dispose()); + } + ``` + + And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. + + **Removed APIs** + + - `` + - `` + - `` + - `` + - `` + + **Modified APIs** + + - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. + + **Added APIs** + + - `` + - `createRoutesFromElements` (alias of `createRoutesFromChildren`) + +- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) +- c21e38ef: fix: avoid navigation loops in re-renders in data routers (#9124) +- f264d828: Fix broken require for CJS builds +- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) +- f264d828: Release script tests +- f264d828: Properly trigger error boundaries on 404 routes +- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component +- d5b25602: Feat: adds `defer()` support to data routers + + Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. + + ```jsx + // In your route loader, return a defer() and choose per-key whether to + // await the promise or not. As soon as the awaited promises resolve, the + // page will be rendered. + function loader() { + return defer({ + critical: await getCriticalData(), + lazy: getLazyData(), + }); + }; + + // In your route element, grab the values from useLoaderData and render them + // with inside a boundary + function Page() { + let data = useLoaderData(); + return ( + <> +

Critical Data: {data.critical}

+ Loading...

}> + }> + + +
+ + ); + } + + // Use separate components to render the data once it resolves, and access it + // via the useAsyncValue hook + function RenderData() { + let data = useAsyncValue(); + return

Lazy: {data}

; + } + + function RenderError() { + let data = useAsyncError(); + return

Error! {data.message} {data.stack}

; + } + ``` + + If you want to skip the separate components, you can use the Render Props + pattern and handle the rendering of the deferred data inline: + + ```jsx + function Page() { + let data = useLoaderData(); + return ( + <> +

Critical Data: {data.critical}

+ Loading...

}> + }> + {data =>

{data}

} +
+
+ + ); + } + ``` + +- 92aa5bb0: Deferred API Updates + + - Removes `` from inside ``, requires users to render their own suspense boundaries + - Updates `Deferred` to use a true error boundary to catch render errors as well as data errors + - Support array and single promise usages + - `return defer([ await critical(), lazy() ])` + - `return defer(lazy())` + - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` + - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 + +- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) +- 112c02c7: fix: Avoid suspense loops on promise aborted values (#9226) +- e6b68116: fix: Additional logic fixed for relative navigation from index/pathless layout routes (#8985) +- d68d03ed: feat: add basename support for data routers +- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) +- c3406eb9: fix: Rename `` to `` (#9095) + + - We are no longer replacing the `Promise` on `loaderData` with the value/error + when it settles so it's now always a `Promise`. + - To that end, we changed from `` to + `` for clarity, and it also now supports using + `` with raw promises from anywhere, not only those on `loaderData` + from a defer() call. + - Note that raw promises will not be automatically cancelled on interruptions + so they are not recommended + - The hooks are now `useAsyncValue`/`useAsyncError` + +- 3e7e502c: fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) +- f264d828: fix: Properly handle relative navigation from index/pathless routes (#8954) +- f264d828: fix: webpack + React 17 won't build because of named imports of React 18 APIs (#8938) +- f3182f4a: SSR Updates for React Router + + _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ + + - Remove `useRenderDataRouter()` in favor of ``/`` + - Support automatic hydration in ``/``/`` + - Uses `window.__staticRouterHydrationData` + - Can be disabled on the server via `` + - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` + - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` + - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` + - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` + +- Updated dependencies [e8dda1ba] +- Updated dependencies [f264d828] +- Updated dependencies [5c8fdeca] +- Updated dependencies [0bb4410b] +- Updated dependencies [c17512d8] +- Updated dependencies [9fa39a6d] +- Updated dependencies [8ed30d37] +- Updated dependencies [5bab9ebf] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [f264d828] +- Updated dependencies [d5b25602] +- Updated dependencies [5a56b5c9] +- Updated dependencies [92aa5bb0] +- Updated dependencies [f264d828] +- Updated dependencies [9e2f92ac] +- Updated dependencies [7a057e19] +- Updated dependencies [a04ab758] +- Updated dependencies [112c02c7] +- Updated dependencies [d68d03ed] +- Updated dependencies [9fa39a6d] +- Updated dependencies [b7fadce8] +- Updated dependencies [c3406eb9] +- Updated dependencies [1dc082c0] +- Updated dependencies [3e7e502c] +- Updated dependencies [f3182f4a] +- Updated dependencies [5ba67d83] +- Updated dependencies [f264d828] +- Updated dependencies [26e8b8e7] +- Updated dependencies [d0114e26] +- Updated dependencies [3e99fb22] + - @remix-run/router@1.0.0 + ## 6.4.0-pre.15 ### Patch Changes @@ -149,7 +407,7 @@

Critical Data: {data.critical}

Loading...

}> }> - {(data) =>

{data}

} + {data =>

{data}

}
diff --git a/packages/react-router/package.json b/packages/react-router/package.json index a36d28d597..fba2303947 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "6.4.0-pre.15", + "version": "6.4.0", "description": "Declarative routing for React", "keywords": [ "react", @@ -23,7 +23,7 @@ "module": "./dist/index.js", "types": "./dist/index.d.ts", "dependencies": { - "@remix-run/router": "0.2.0-pre.10" + "@remix-run/router": "1.0.0" }, "devDependencies": { "react": "^18.2.0" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index fd1aded0d8..62bc5a410a 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -1,5 +1,276 @@ # @remix-run/router +## 1.0.0 + +### Major Changes + +- 5bab9ebf: feat: bump @remix-run/router to 1.0.0 + +### Minor Changes + +- f264d828: change `formMethod=GET` to be a loading navigation instead of submitting + +### Patch Changes + +- e8dda1ba: fix: avoid uneccesary re-renders on defer resolution (#9155) +- f264d828: fix: Capture fetcher errors at contextual route error boundaries (#8945) +- 5c8fdeca: fix: pass useMatches objects to ScrollRestoration getKey (#9157) +- 0bb4410b: fix: properly handle `` submissions (#8984) +- c17512d8: fix: remove internal router singleton (#9227) + + This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: + + - Unit tests are a pain because you need to find a way to reset the singleton in-between tests + - Use use a `_resetModuleScope` singleton for our tests + - ...but this isn't exposed to users who may want to do their own tests around our router + - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations + - Conditional runtime ``'s won't get picked up + - Adding new ``'s during local dev won't get picked up during HMR + - Using external state in your elements doesn't work as one might expect (see #9225) + + Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` + + ```jsx + // Before + function App() { + + }> + }> + + + } + + // After + let router = createBrowserRouter([{ + path: "/", + element: , + children: [{ + index: true, + element: , + }] + }]); + + function App() { + return + } + ``` + + If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): + + ```jsx + let routes = createRoutesFromElements( + }> + }> + + ); + let router = createBrowserRouter(routes); + + function App() { + return + } + ``` + + And now they can also hook into HMR correctly for router disposal: + + ``` + if (import.meta.hot) { + import.meta.hot.dispose(() => router.dispose()); + } + ``` + + And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. + + **Removed APIs** + + - `` + - `` + - `` + - `` + - `` + + **Modified APIs** + + - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. + + **Added APIs** + + - `` + - `createRoutesFromElements` (alias of `createRoutesFromChildren`) + +- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) +- 8ed30d37: fix: Handle fetcher 404s as normal boundary errors +- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) +- f264d828: Release script tests +- f264d828: Properly trigger error boundaries on 404 routes +- d5b25602: Feat: adds `defer()` support to data routers + + Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. + + ```jsx + // In your route loader, return a defer() and choose per-key whether to + // await the promise or not. As soon as the awaited promises resolve, the + // page will be rendered. + function loader() { + return defer({ + critical: await getCriticalData(), + lazy: getLazyData(), + }); + }; + + // In your route element, grab the values from useLoaderData and render them + // with inside a boundary + function Page() { + let data = useLoaderData(); + return ( + <> +

Critical Data: {data.critical}

+ Loading...

}> + }> + + +
+ + ); + } + + // Use separate components to render the data once it resolves, and access it + // via the useAsyncValue hook + function RenderData() { + let data = useAsyncValue(); + return

Lazy: {data}

; + } + + function RenderError() { + let data = useAsyncError(); + return

Error! {data.message} {data.stack}

; + } + ``` + + If you want to skip the separate components, you can use the Render Props + pattern and handle the rendering of the deferred data inline: + + ```jsx + function Page() { + let data = useLoaderData(); + return ( + <> +

Critical Data: {data.critical}

+ Loading...

}> + }> + {data =>

{data}

} +
+
+ + ); + } + ``` + +- 5a56b5c9: fix: fix default redirect push/replace behavior (#9117) +- 92aa5bb0: Deferred API Updates + + - Removes `` from inside ``, requires users to render their own suspense boundaries + - Updates `Deferred` to use a true error boundary to catch render errors as well as data errors + - Support array and single promise usages + - `return defer([ await critical(), lazy() ])` + - `return defer(lazy())` + - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` + - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 + +- f264d828: `resolveTo` should not mutate the provided pathname (#8839) +- 9e2f92ac: feat: Add `createStaticRouter` for `@remix-run/router` SSR usage + + **Notable changes:** + + - `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) + - Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` + + **Example usage (Document Requests):** + + ```jsx + // Create a static handler + let { query } = unstable_createStaticHandler(routes); + + // Perform a full-document query for the incoming Fetch Request. This will + // execute the appropriate action/loaders and return either the state or a + // Fetch Response in the case of redirects. + let state = await query(fetchRequest); + + // If we received a Fetch Response back, let our server runtime handle directly + if (state instanceof Response) { + throw state; + } + + // Otherwise, render our application providing the data routes and state + let html = ReactDOMServer.renderToString( + + + + ); + ``` + + **Example usage (Data Requests):** + + ```jsx + // Create a static route handler + let { queryRoute } = unstable_createStaticHandler(routes); + + // Perform a single-route query for the incoming Fetch Request. This will + // execute the appropriate singular action/loader and return either the raw + // data or a Fetch Response + let data = await queryRoute(fetchRequest); + + // If we received a Fetch Response back, return it directly + if (data instanceof Response) { + return data; + } + + // Otherwise, construct a Response from the raw data (assuming json here) + return new Response(JSON.stringify(data), { + headers: { + "Content-Type": "application/json; charset=utf-8" + } + }); + ``` + +- 7a057e19: fix: don't default to a `REPLACE` navigation on form submissions if the action redirected. The redirect takes care of avoiding the back-button-resubmit scenario, so by using a `PUSH` we allow the back button to go back to the pre-submission form page (#8979) +- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) +- 112c02c7: fix: Avoid suspense loops on promise aborted values (#9226) +- d68d03ed: feat: add basename support for data routers +- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) +- b7fadce8: ci: simplify dist/ directory for CJS/ESM only +- c3406eb9: fix: Rename `` to `` (#9095) + + - We are no longer replacing the `Promise` on `loaderData` with the value/error + when it settles so it's now always a `Promise`. + - To that end, we changed from `` to + `` for clarity, and it also now supports using + `` with raw promises from anywhere, not only those on `loaderData` + from a defer() call. + - Note that raw promises will not be automatically cancelled on interruptions + so they are not recommended + - The hooks are now `useAsyncValue`/`useAsyncError` + +- 1dc082c0: fix: fetcher submission revalidating fetchers using wrong key (#9166) +- 3e7e502c: fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) +- f3182f4a: SSR Updates for React Router + + _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ + + - Remove `useRenderDataRouter()` in favor of ``/`` + - Support automatic hydration in ``/``/`` + - Uses `window.__staticRouterHydrationData` + - Can be disabled on the server via `` + - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` + - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` + - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` + - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` + +- 5ba67d83: fix: preserve loader data for loaders that opted out of revalidation (#8973) +- f264d828: Pass fetcher `actionResult` through to `shouldRevalidate` on fetcher submissions +- 26e8b8e7: fix: Await should fallback on route params navigations (#9181) +- d0114e26: fix: use a push navigation on submission errors (#9162) +- 3e99fb22: fix: proxy defer resolve/reject values through tracked promises (#9200) + ## 0.2.0-pre.10 ### Patch Changes @@ -108,8 +379,8 @@ // Otherwise, construct a Response from the raw data (assuming json here) return new Response(JSON.stringify(data), { headers: { - "Content-Type": "application/json; charset=utf-8", - }, + "Content-Type": "application/json; charset=utf-8" + } }); ``` diff --git a/packages/router/package.json b/packages/router/package.json index 0db24927f8..752e09ace2 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@remix-run/router", - "version": "0.2.0-pre.10", + "version": "1.0.0", "description": "Nested/Data-driven/Framework-agnostic Routing", "keywords": [ "remix", From ab9e771e0ead1ffd7406ebdeb36117855268da96 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 13 Sep 2022 15:03:36 -0400 Subject: [PATCH 2/4] Update changeslogs --- .../react-router-dom-v5-compat/CHANGELOG.md | 138 +----- packages/react-router-dom/CHANGELOG.md | 437 +--------------- packages/react-router-native/CHANGELOG.md | 162 +----- packages/react-router/CHANGELOG.md | 469 +----------------- packages/router/CHANGELOG.md | 445 +---------------- 5 files changed, 51 insertions(+), 1600 deletions(-) diff --git a/packages/react-router-dom-v5-compat/CHANGELOG.md b/packages/react-router-dom-v5-compat/CHANGELOG.md index 8172c4c81b..080749632e 100644 --- a/packages/react-router-dom-v5-compat/CHANGELOG.md +++ b/packages/react-router-dom-v5-compat/CHANGELOG.md @@ -2,139 +2,7 @@ ## 6.4.0 -### Patch Changes +**Updated dependencies** -- f264d828: Release script tests -- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component -- f264d828: Fix `react-router-dom` peer dependency version -- Updated dependencies [5c8fdeca] -- Updated dependencies [815e1d17] -- Updated dependencies [c17512d8] -- Updated dependencies [9fa39a6d] -- Updated dependencies [c21e38ef] -- Updated dependencies [f264d828] -- Updated dependencies [f0579d8a] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [e766ab5a] -- Updated dependencies [d5b25602] -- Updated dependencies [f264d828] -- Updated dependencies [b25d53f9] -- Updated dependencies [92aa5bb0] -- Updated dependencies [9e2f92ac] -- Updated dependencies [a04ab758] -- Updated dependencies [112c02c7] -- Updated dependencies [e6b68116] -- Updated dependencies [d68d03ed] -- Updated dependencies [9fa39a6d] -- Updated dependencies [f264d828] -- Updated dependencies [c3406eb9] -- Updated dependencies [3e7e502c] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f3182f4a] -- Updated dependencies [6fef589d] - - react-router-dom@6.4.0 - - react-router@6.4.0 - -## 6.4.0-pre.15 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.15 - - react-router-dom@6.4.0-pre.15 - -## 6.4.0-pre.14 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.14 - - react-router-dom@6.4.0-pre.14 - -## 6.4.0-pre.13 - -### Patch Changes - -- Updated dependencies - - react-router-dom@6.4.0-pre.13 - - react-router@6.4.0-pre.13 - -## 6.4.0-pre.12 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.12 - - react-router-dom@6.4.0-pre.12 - -## 6.4.0-pre.11 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.11 - - react-router-dom@6.4.0-pre.11 - -## 6.4.0-pre.10 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.10 - - react-router-dom@6.4.0-pre.10 - -## 6.4.0-pre.9 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.9 - - react-router-dom@6.4.0-pre.9 - -## 6.4.0-pre.8 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.8 - - react-router-dom@6.4.0-pre.8 - -## 6.4.0-pre.7 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.7` - - `react-router-dom@6.4.0-pre.7` - -## 6.4.0-pre.6 - -### Patch Changes - -- Fix `react-router-dom` peer dependency version -- Updated dependencies - - `react-router@6.4.0-pre.6` - - `react-router-dom@6.4.0-pre.6` - -## 6.4.0-pre.5 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.5` - - `react-router-dom@6.4.0-pre.5` - -## 6.4.0-pre.4 - -### Patch Changes - -- Fix missing `dist` files - -## 6.4.0-pre.3 - -### Patch Changes - -- Updated dependencies +- react-router-dom@6.4.0 +- react-router@6.4.0 diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index daf3c58f56..b1cf134a5a 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -2,428 +2,33 @@ ## 6.4.0 -### Patch Changes +- Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. -- 5c8fdeca: fix: pass useMatches objects to ScrollRestoration getKey (#9157) -- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) +**New APIs** - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: +- Create your router with `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` +- Render your router with `` +- Load data with a Route `loader` and mutate with a Route `action` +- Handle errors with Route `errorElement` +- Submit data with the new `` component +- Perform in-page data loads and mutations with `useFetcher()` +- Defer non-critical data with `defer` and `Await` +- Manage scroll position with `` - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> +**New Features** - function EditContact() { - return Cancel - } - ``` +- Perform path-relative navigations with `` (#9160) - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. +**Bug Fixes** - This applies to all path-related hooks and components: +- Path resolution is now trailing slash agnostic (#8861) +- `useLocation` returns the scoped location inside a `` component (#9094) +- respect the `` prop if it is defined (#8779) - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` +**Updated Dependencies** -- c17512d8: fix: remove internal router singleton (#9227) +- react-router@6.4.0 - This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: - - - Unit tests are a pain because you need to find a way to reset the singleton in-between tests - - Use use a `_resetModuleScope` singleton for our tests - - ...but this isn't exposed to users who may want to do their own tests around our router - - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations - - Conditional runtime ``'s won't get picked up - - Adding new ``'s during local dev won't get picked up during HMR - - Using external state in your elements doesn't work as one might expect (see #9225) - - Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` - - ```jsx - // Before - function App() { - - }> - }> - - - } - - // After - let router = createBrowserRouter([{ - path: "/", - element: , - children: [{ - index: true, - element: , - }] - }]); - - function App() { - return - } - ``` - - If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): - - ```jsx - let routes = createRoutesFromElements( - }> - }> - - ); - let router = createBrowserRouter(routes); - - function App() { - return - } - ``` - - And now they can also hook into HMR correctly for router disposal: - - ``` - if (import.meta.hot) { - import.meta.hot.dispose(() => router.dispose()); - } - ``` - - And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. - - **Removed APIs** - - - `` - - `` - - `` - - `` - - `` - - **Modified APIs** - - - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. - - **Added APIs** - - - `` - - `createRoutesFromElements` (alias of `createRoutesFromChildren`) - -- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) -- f264d828: Fix broken require for CJS builds -- f0579d8a: fix: do not overwrite input value from button with same name (#9139) -- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) -- f264d828: Release script tests -- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component -- f264d828: fix: respect the `` prop if it is defined (#8779) -- b25d53f9: fix: unspecified `` action should preserve search params (#9060) -- 9e2f92ac: feat: Add `createStaticRouter` for `@remix-run/router` SSR usage - - **Notable changes:** - - - `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) - - Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` - - **Example usage (Document Requests):** - - ```jsx - // Create a static handler - let { query } = unstable_createStaticHandler(routes); - - // Perform a full-document query for the incoming Fetch Request. This will - // execute the appropriate action/loaders and return either the state or a - // Fetch Response in the case of redirects. - let state = await query(fetchRequest); - - // If we received a Fetch Response back, let our server runtime handle directly - if (state instanceof Response) { - throw state; - } - - // Otherwise, render our application providing the data routes and state - let html = ReactDOMServer.renderToString( - - - - ); - ``` - - **Example usage (Data Requests):** - - ```jsx - // Create a static route handler - let { queryRoute } = unstable_createStaticHandler(routes); - - // Perform a single-route query for the incoming Fetch Request. This will - // execute the appropriate singular action/loader and return either the raw - // data or a Fetch Response - let data = await queryRoute(fetchRequest); - - // If we received a Fetch Response back, return it directly - if (data instanceof Response) { - return data; - } - - // Otherwise, construct a Response from the raw data (assuming json here) - return new Response(JSON.stringify(data), { - headers: { - "Content-Type": "application/json; charset=utf-8" - } - }); - ``` - -- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) -- d68d03ed: feat: add basename support for data routers -- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- f3182f4a: SSR Updates for React Router - - _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - - - Remove `useRenderDataRouter()` in favor of ``/`` - - Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` - - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` - - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` - - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` - -- 6fef589d: fix: useFormAction should not include pathless splat portion (#9144) -- Updated dependencies [815e1d17] -- Updated dependencies [c17512d8] -- Updated dependencies [9fa39a6d] -- Updated dependencies [c21e38ef] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [e766ab5a] -- Updated dependencies [d5b25602] -- Updated dependencies [92aa5bb0] -- Updated dependencies [a04ab758] -- Updated dependencies [112c02c7] -- Updated dependencies [e6b68116] -- Updated dependencies [d68d03ed] -- Updated dependencies [9fa39a6d] -- Updated dependencies [f264d828] -- Updated dependencies [c3406eb9] -- Updated dependencies [3e7e502c] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f3182f4a] - - react-router@6.4.0 - -## 6.4.0-pre.15 - -### Patch Changes - -- fix: remove internal router singleton (#9227) - - This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: - - - Unit tests are a pain because you need to find a way to reset the singleton in-between tests - - Use use a `_resetModuleScope` singleton for our tests - - ...but this isn't exposed to users who may want to do their own tests around our router - - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations - - Conditional runtime ``'s won't get picked up - - Adding new ``'s during local dev won't get picked up during HMR - - Using external state in your elements doesn't work as one might expect (see #9225) - - Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` - - ```jsx - // Before - function App() { - - }> - }> - - - } - - // After - let router = createBrowserRouter([{ - path: "/", - element: , - children: [{ - index: true, - element: , - }] - }]); - - function App() { - return - } - ``` - - If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): - - ```jsx - let routes = createRoutesFromElements( - }> - }> - - ); - let router = createBrowserRouter(routes); - - function App() { - return - } - ``` - - And now they can also hook into HMR correctly for router disposal: - - ``` - if (import.meta.hot) { - import.meta.hot.dispose(() => router.dispose()); - } - ``` - - And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. - - **Removed APIs** - - - `` - - `` - - `` - - `` - - `` - - **Modified APIs** - - - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. - - **Added APIs** - - - `` - - `createRoutesFromElements` (alias of `createRoutesFromChildren`) - -- Updated dependencies - - react-router@6.4.0-pre.15 - -## 6.4.0-pre.14 - -### Patch Changes - -- fix: rename resetScroll -> preventScrollReset (#9199) -- Updated dependencies - - react-router@6.4.0-pre.14 - -## 6.4.0-pre.13 - -### Patch Changes - -- fix: pass `useMatches` objects to `ScrollRestoration` `getKey` (#9157) -- feat: add `relative=path` option for url-relative routing (#9160) - - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: - - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> - - function EditContact() { - return Cancel - } - ``` - - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - - This applies to all path-related hooks and components: - - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` - -- fix: `useFormAction` should not include pathless splat portion (#9144) -- Updated dependencies - - react-router@6.4.0-pre.13 - -## 6.4.0-pre.12 - -### Patch Changes - -- fix: do not overwrite input value from button with same name (#9139) -- fix: unspecified `` action should preserve search params (#9060) -- Updated dependencies - - react-router@6.4.0-pre.12 - -## 6.4.0-pre.11 - -### Patch Changes - -- Updated dependencies [c3406eb9] - - react-router@6.4.0-pre.11 - -## 6.4.0-pre.10 - -### Patch Changes - -- SSR Updates for React Router (#9058) - - _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - - - Remove `useRenderDataRouter()` in favor of ``/`` - - Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` - - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` - - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` - - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` - -- Updated dependencies - - react-router@6.4.0-pre.10 - -## 6.4.0-pre.9 - -### Patch Changes - -- feat: add basename support for data routers (#9026) -- Updated dependencies - - react-router@6.4.0-pre.9 - -## 6.4.0-pre.8 - -### Patch Changes - -- fix: Make path resolution trailing slash agnostic (#8861) -- fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- Updated dependencies - - react-router@6.4.0-pre.8 - -## 6.4.0-pre.7 - -### Patch Changes - -- Respect the `` prop if it is defined (#8779) -- Updated dependencies - - `react-router@6.4.0-pre.7` - -## 6.4.0-pre.6 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.6` - -## 6.4.0-pre.5 - -### Patch Changes - -- Fix broken require for CJS builds -- Updated dependencies - - `react-router@6.4.0-pre.5` - -## 6.4.0-pre.4 - -### Patch Changes - -- Fix missing `dist` files - -## 6.4.0-pre.3 - -### Patch Changes - -- Make `fallbackElement` optional and change type to `ReactNode` (type changes only) (#8896) -- Properly trigger error boundaries on 404 routes +[rr-docs]: https://reactrouter.com/ +[rr-feature-overview]: https://reactrouter.com/en/main/start/overview +[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial diff --git a/packages/react-router-native/CHANGELOG.md b/packages/react-router-native/CHANGELOG.md index dcb8623090..dbce3ead59 100644 --- a/packages/react-router-native/CHANGELOG.md +++ b/packages/react-router-native/CHANGELOG.md @@ -2,163 +2,11 @@ ## 6.4.0 -### Patch Changes +**Bug Fixes** -- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) +- Path resolution is now trailing slash agnostic (#8861) +- `useLocation` returns the scoped location inside a `` component (#9094) - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: +**Updated dependencies** - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> - - function EditContact() { - return Cancel - } - ``` - - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - - This applies to all path-related hooks and components: - - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` - -- f264d828: Release script tests -- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component -- Updated dependencies [815e1d17] -- Updated dependencies [c17512d8] -- Updated dependencies [9fa39a6d] -- Updated dependencies [c21e38ef] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [e766ab5a] -- Updated dependencies [d5b25602] -- Updated dependencies [92aa5bb0] -- Updated dependencies [a04ab758] -- Updated dependencies [112c02c7] -- Updated dependencies [e6b68116] -- Updated dependencies [d68d03ed] -- Updated dependencies [9fa39a6d] -- Updated dependencies [f264d828] -- Updated dependencies [c3406eb9] -- Updated dependencies [3e7e502c] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f3182f4a] - - react-router@6.4.0 - -## 6.4.0-pre.15 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.15 - -## 6.4.0-pre.14 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.14 - -## 6.4.0-pre.13 - -### Patch Changes - -- feat: add `relative=path` option for url-relative routing (#9160) - - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: - - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> - - function EditContact() { - return Cancel - } - ``` - - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - - This applies to all path-related hooks and components: - - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` - -- Updated dependencies - - react-router@6.4.0-pre.13 - -## 6.4.0-pre.12 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.12 - -## 6.4.0-pre.11 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.11 - -## 6.4.0-pre.10 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.10 - -## 6.4.0-pre.9 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.9 - -## 6.4.0-pre.8 - -### Patch Changes - -- Updated dependencies - - react-router@6.4.0-pre.8 - -## 6.4.0-pre.7 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.7` - -## 6.4.0-pre.6 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.6` - -## 6.4.0-pre.5 - -### Patch Changes - -- Updated dependencies - - `react-router@6.4.0-pre.5` - -## 6.4.0-pre.4 - -### Patch Changes - -- Fix missing `dist` files - -## 6.4.0-pre.3 - -### Patch Changes - -- Updated dependencies +- react-router@6.4.0 diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 7450b72687..6e10a33c61 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -2,464 +2,25 @@ ## 6.4.0 -### Minor Changes +- Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. -- f264d828: feat: `useSearchParams` supports functional updates like `useState` (#8955) +**New APIs** -### Patch Changes +- Create your router with `createMemoryRouter` +- Render your router with `` +- Load data with a Route `loader` and mutate with a Route `action` +- Handle errors with Route `errorElement` +- Defer non-critical data with `defer` and `Await` -- 815e1d17: feat: add `relative=path` option for url-relative routing (#9160) +**Bug Fixes** - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure for UI reasons: +- Path resolution is now trailing slash agnostic (#8861) +- `useLocation` returns the scoped location inside a `` component (#9094) - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> +**Updated Dependencies** - function EditContact() { - return Cancel - } - ``` +- @remix-run/router@1.0.0 - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - - This applies to all path-related hooks and components: - - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` - -- c17512d8: fix: remove internal router singleton (#9227) - - This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: - - - Unit tests are a pain because you need to find a way to reset the singleton in-between tests - - Use use a `_resetModuleScope` singleton for our tests - - ...but this isn't exposed to users who may want to do their own tests around our router - - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations - - Conditional runtime ``'s won't get picked up - - Adding new ``'s during local dev won't get picked up during HMR - - Using external state in your elements doesn't work as one might expect (see #9225) - - Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` - - ```jsx - // Before - function App() { - - }> - }> - - - } - - // After - let router = createBrowserRouter([{ - path: "/", - element: , - children: [{ - index: true, - element: , - }] - }]); - - function App() { - return - } - ``` - - If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): - - ```jsx - let routes = createRoutesFromElements( - }> - }> - - ); - let router = createBrowserRouter(routes); - - function App() { - return - } - ``` - - And now they can also hook into HMR correctly for router disposal: - - ``` - if (import.meta.hot) { - import.meta.hot.dispose(() => router.dispose()); - } - ``` - - And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. - - **Removed APIs** - - - `` - - `` - - `` - - `` - - `` - - **Modified APIs** - - - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. - - **Added APIs** - - - `` - - `createRoutesFromElements` (alias of `createRoutesFromChildren`) - -- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) -- c21e38ef: fix: avoid navigation loops in re-renders in data routers (#9124) -- f264d828: Fix broken require for CJS builds -- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) -- f264d828: Release script tests -- f264d828: Properly trigger error boundaries on 404 routes -- e766ab5a: fix: update `useLocation` to return the scoped `Location` when inside a `` component -- d5b25602: Feat: adds `defer()` support to data routers - - Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. - - ```jsx - // In your route loader, return a defer() and choose per-key whether to - // await the promise or not. As soon as the awaited promises resolve, the - // page will be rendered. - function loader() { - return defer({ - critical: await getCriticalData(), - lazy: getLazyData(), - }); - }; - - // In your route element, grab the values from useLoaderData and render them - // with inside a boundary - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - - -
- - ); - } - - // Use separate components to render the data once it resolves, and access it - // via the useAsyncValue hook - function RenderData() { - let data = useAsyncValue(); - return

Lazy: {data}

; - } - - function RenderError() { - let data = useAsyncError(); - return

Error! {data.message} {data.stack}

; - } - ``` - - If you want to skip the separate components, you can use the Render Props - pattern and handle the rendering of the deferred data inline: - - ```jsx - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - {data =>

{data}

} -
-
- - ); - } - ``` - -- 92aa5bb0: Deferred API Updates - - - Removes `` from inside ``, requires users to render their own suspense boundaries - - Updates `Deferred` to use a true error boundary to catch render errors as well as data errors - - Support array and single promise usages - - `return defer([ await critical(), lazy() ])` - - `return defer(lazy())` - - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` - - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 - -- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) -- 112c02c7: fix: Avoid suspense loops on promise aborted values (#9226) -- e6b68116: fix: Additional logic fixed for relative navigation from index/pathless layout routes (#8985) -- d68d03ed: feat: add basename support for data routers -- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- c3406eb9: fix: Rename `` to `` (#9095) - - - We are no longer replacing the `Promise` on `loaderData` with the value/error - when it settles so it's now always a `Promise`. - - To that end, we changed from `` to - `` for clarity, and it also now supports using - `` with raw promises from anywhere, not only those on `loaderData` - from a defer() call. - - Note that raw promises will not be automatically cancelled on interruptions - so they are not recommended - - The hooks are now `useAsyncValue`/`useAsyncError` - -- 3e7e502c: fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) -- f264d828: fix: Properly handle relative navigation from index/pathless routes (#8954) -- f264d828: fix: webpack + React 17 won't build because of named imports of React 18 APIs (#8938) -- f3182f4a: SSR Updates for React Router - - _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - - - Remove `useRenderDataRouter()` in favor of ``/`` - - Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` - - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` - - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` - - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` - -- Updated dependencies [e8dda1ba] -- Updated dependencies [f264d828] -- Updated dependencies [5c8fdeca] -- Updated dependencies [0bb4410b] -- Updated dependencies [c17512d8] -- Updated dependencies [9fa39a6d] -- Updated dependencies [8ed30d37] -- Updated dependencies [5bab9ebf] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [f264d828] -- Updated dependencies [d5b25602] -- Updated dependencies [5a56b5c9] -- Updated dependencies [92aa5bb0] -- Updated dependencies [f264d828] -- Updated dependencies [9e2f92ac] -- Updated dependencies [7a057e19] -- Updated dependencies [a04ab758] -- Updated dependencies [112c02c7] -- Updated dependencies [d68d03ed] -- Updated dependencies [9fa39a6d] -- Updated dependencies [b7fadce8] -- Updated dependencies [c3406eb9] -- Updated dependencies [1dc082c0] -- Updated dependencies [3e7e502c] -- Updated dependencies [f3182f4a] -- Updated dependencies [5ba67d83] -- Updated dependencies [f264d828] -- Updated dependencies [26e8b8e7] -- Updated dependencies [d0114e26] -- Updated dependencies [3e99fb22] - - @remix-run/router@1.0.0 - -## 6.4.0-pre.15 - -### Patch Changes - -- fix: remove internal router singleton (#9227) -- fix: Avoid suspense loops on promise aborted values (#9226) -- Updated dependencies - - @remix-run/router@0.2.0-pre.10 - -## 6.4.0-pre.14 - -### Patch Changes - -- fix: rename resetScroll -> preventScrollReset (#9199) -- Updated dependencies - - @remix-run/router@0.2.0-pre.9 - -## 6.4.0-pre.13 - -### Patch Changes - -- feat: add `relative=path` option for url-relative routing (#9160) - - Adds a `relative=path` option to navigation aspects to allow users to opt-into paths behaving relative to the current URL instead of the current route hierarchy. This is useful if you're sharing route patterns in a non-nested structure UI reasons: - - ```jsx - // Contact and EditContact do not share UI layout - } /> - } /> - - function EditContact() { - return Cancel - } - ``` - - Without this, the user would need to reconstruct the `contacts/:id` url using `useParams` and either hardcoding the `/contacts` prefix or parsing it from `useLocation`. - - This applies to all path-related hooks and components: - - - `react-router`: `useHref`, `useResolvedPath`, `useNavigate`, `Navigate` - - `react-router-dom`: `useLinkClickHandler`, `useFormAction`, `useSubmit`, `Link`, `Form` - - `react-router-native`: `useLinkPressHandler`, `Link` - -- Updated dependencies - - @remix-run/router@0.2.0-pre.8 - -## 6.4.0-pre.12 - -### Patch Changes - -- fix: avoid navigation loops in `` re-renders in data routers (#9124) -- Updated dependencies - - @remix-run/router@0.2.0-pre.7 - -## 6.4.0-pre.11 - -### Patch Changes - -- c3406eb9: fix: Rename `` to `` (#9095) - - - We are no longer replacing the `Promise` on `loaderData` with the value/error - when it settles so it's now always a `Promise`. - - To that end, we changed from `` to - `` for clarity, and it also now supports using - `` with raw promises from anywhere, not only those on `loaderData` - from a defer() call. - - Note that raw promises will not be automatically cancelled on interruptions - so they are not recommended - - The hooks are now `useAsyncValue`/`useAsyncError` - -- Updated dependencies - - @remix-run/router@0.2.0-pre.6 - -## 6.4.0-pre.10 - -### Patch Changes - -- feat: Deferred API Updates (#9070) - - - Removes `` from inside ``, requires users to render their own suspense boundaries - - Updates `Await` to use a true error boundary to catch render errors as well as data errors - - Support array and single promise usages - - `return defer([ await critical(), lazy() ])` - - `return defer(lazy())` - - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` - - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 - -- Updated dependencies - - @remix-run/router@0.2.0-pre.5 - -## 6.4.0-pre.9 - -### Patch Changes - -- Feat: adds `defer()` support to data routers (#9002) - - Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. - - ```jsx - // In your route loader, return a defer() and choose per-key whether to - // await the promise or not. As soon as the awaited promises resolve, the - // page will be rendered. - function loader() { - return defer({ - critical: await getCriticalData(), - lazy: getLazyData(), - }); - }; - - // In your route element, grab the values from useLoaderData and render them - // with - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - - -
- - ); - } - - // Use separate components to render the data once it resolves, and access it - // via the useAsyncValue hook - function RenderData() { - let data = useAsyncValue(); - return

Lazy: {data}

; - } - - function RenderError() { - let data = useAsyncError(); - return

Error! {data.message} {data.stack}

; - } - ``` - - If you want to skip the separate components, you can use the Render Props - pattern and handle the rendering of the deferred data inline: - - ```jsx - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - {data =>

{data}

} -
-
- - ); - } - ``` - -- feat: add basename support for data routers (#9026) -- fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) -- Updated dependencies - - @remix-run/router@0.2.0-pre.4 - -## 6.4.0-pre.8 - -### Patch Changes - -- fix: Make path resolution trailing slash agnostic (#8861) -- fix: Additional logic fixed for relative navigation from index/pathless layout routes (#8985) -- fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- Updated dependencies - - @remix-run/router@0.2.0-pre.3 - -## 6.4.0-pre.7 - -### Minor Changes - -- Add support for functional updates in `useSearchParams` (similar to the `useState` callback signature) (#8955) - -### Patch Changes - -- Properly handle relative navigation from index/pathless routes (#8954) -- Fix issues building with webpack + React 17 (#8938) -- Updated dependencies - - `@remix-run/router@0.2.0-pre.2` - -## 6.4.0-pre.6 - -## 6.4.0-pre.5 - -### Patch Changes - -- Fix broken require for CJS builds - -## 6.4.0-pre.4 - -### Patch Changes - -- Fix missing `dist` files - -## 6.4.0-pre.3 - -### Patch Changes - -- Make `fallbackElement` optional and change type to `ReactNode` (type changes only) (#8896) -- Properly trigger error boundaries on 404 routes +[rr-docs]: https://reactrouter.com/ +[rr-feature-overview]: https://reactrouter.com/en/main/start/overview +[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index 62bc5a410a..f8656e426a 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -2,444 +2,13 @@ ## 1.0.0 -### Major Changes +This is the first stable release of `@remix-run/router`, which provides all the underlying routing and data loading/mutation logic for `react-router`. You should _not_ be using this package directly unless you are authoring a routing library similar to `react-router`. -- 5bab9ebf: feat: bump @remix-run/router to 1.0.0 +For an overview of the features provided by `react-router`, we recommend you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. -### Minor Changes +For an overview of the features provided by `@remix-run/router`, please check out the [README][remix-router-readme]. -- f264d828: change `formMethod=GET` to be a loading navigation instead of submitting - -### Patch Changes - -- e8dda1ba: fix: avoid uneccesary re-renders on defer resolution (#9155) -- f264d828: fix: Capture fetcher errors at contextual route error boundaries (#8945) -- 5c8fdeca: fix: pass useMatches objects to ScrollRestoration getKey (#9157) -- 0bb4410b: fix: properly handle `` submissions (#8984) -- c17512d8: fix: remove internal router singleton (#9227) - - This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases: - - - Unit tests are a pain because you need to find a way to reset the singleton in-between tests - - Use use a `_resetModuleScope` singleton for our tests - - ...but this isn't exposed to users who may want to do their own tests around our router - - The JSX children `` objects cause non-intuitive behavior based on idiomatic react expectations - - Conditional runtime ``'s won't get picked up - - Adding new ``'s during local dev won't get picked up during HMR - - Using external state in your elements doesn't work as one might expect (see #9225) - - Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider` - - ```jsx - // Before - function App() { - - }> - }> - - - } - - // After - let router = createBrowserRouter([{ - path: "/", - element: , - children: [{ - index: true, - element: , - }] - }]); - - function App() { - return - } - ``` - - If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage): - - ```jsx - let routes = createRoutesFromElements( - }> - }> - - ); - let router = createBrowserRouter(routes); - - function App() { - return - } - ``` - - And now they can also hook into HMR correctly for router disposal: - - ``` - if (import.meta.hot) { - import.meta.hot.dispose(() => router.dispose()); - } - ``` - - And finally since `` accepts a router, it makes unit testing easer since you can create a fresh router with each test. - - **Removed APIs** - - - `` - - `` - - `` - - `` - - `` - - **Modified APIs** - - - `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion. - - **Added APIs** - - - `` - - `createRoutesFromElements` (alias of `createRoutesFromChildren`) - -- 9fa39a6d: fix: Make path resolution trailing slash agnostic (#8861) -- 8ed30d37: fix: Handle fetcher 404s as normal boundary errors -- f264d828: Make `fallbackElement` optional and change type to `ReactNode` (#8896) -- f264d828: Release script tests -- f264d828: Properly trigger error boundaries on 404 routes -- d5b25602: Feat: adds `defer()` support to data routers - - Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads. - - ```jsx - // In your route loader, return a defer() and choose per-key whether to - // await the promise or not. As soon as the awaited promises resolve, the - // page will be rendered. - function loader() { - return defer({ - critical: await getCriticalData(), - lazy: getLazyData(), - }); - }; - - // In your route element, grab the values from useLoaderData and render them - // with inside a boundary - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - - -
- - ); - } - - // Use separate components to render the data once it resolves, and access it - // via the useAsyncValue hook - function RenderData() { - let data = useAsyncValue(); - return

Lazy: {data}

; - } - - function RenderError() { - let data = useAsyncError(); - return

Error! {data.message} {data.stack}

; - } - ``` - - If you want to skip the separate components, you can use the Render Props - pattern and handle the rendering of the deferred data inline: - - ```jsx - function Page() { - let data = useLoaderData(); - return ( - <> -

Critical Data: {data.critical}

- Loading...

}> - }> - {data =>

{data}

} -
-
- - ); - } - ``` - -- 5a56b5c9: fix: fix default redirect push/replace behavior (#9117) -- 92aa5bb0: Deferred API Updates - - - Removes `` from inside ``, requires users to render their own suspense boundaries - - Updates `Deferred` to use a true error boundary to catch render errors as well as data errors - - Support array and single promise usages - - `return defer([ await critical(), lazy() ])` - - `return defer(lazy())` - - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` - - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 - -- f264d828: `resolveTo` should not mutate the provided pathname (#8839) -- 9e2f92ac: feat: Add `createStaticRouter` for `@remix-run/router` SSR usage - - **Notable changes:** - - - `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) - - Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` - - **Example usage (Document Requests):** - - ```jsx - // Create a static handler - let { query } = unstable_createStaticHandler(routes); - - // Perform a full-document query for the incoming Fetch Request. This will - // execute the appropriate action/loaders and return either the state or a - // Fetch Response in the case of redirects. - let state = await query(fetchRequest); - - // If we received a Fetch Response back, let our server runtime handle directly - if (state instanceof Response) { - throw state; - } - - // Otherwise, render our application providing the data routes and state - let html = ReactDOMServer.renderToString( - - - - ); - ``` - - **Example usage (Data Requests):** - - ```jsx - // Create a static route handler - let { queryRoute } = unstable_createStaticHandler(routes); - - // Perform a single-route query for the incoming Fetch Request. This will - // execute the appropriate singular action/loader and return either the raw - // data or a Fetch Response - let data = await queryRoute(fetchRequest); - - // If we received a Fetch Response back, return it directly - if (data instanceof Response) { - return data; - } - - // Otherwise, construct a Response from the raw data (assuming json here) - return new Response(JSON.stringify(data), { - headers: { - "Content-Type": "application/json; charset=utf-8" - } - }); - ``` - -- 7a057e19: fix: don't default to a `REPLACE` navigation on form submissions if the action redirected. The redirect takes care of avoiding the back-button-resubmit scenario, so by using a `PUSH` we allow the back button to go back to the pre-submission form page (#8979) -- a04ab758: fix: rename resetScroll -> preventScrollReset (#9199) -- 112c02c7: fix: Avoid suspense loops on promise aborted values (#9226) -- d68d03ed: feat: add basename support for data routers -- 9fa39a6d: fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- b7fadce8: ci: simplify dist/ directory for CJS/ESM only -- c3406eb9: fix: Rename `` to `` (#9095) - - - We are no longer replacing the `Promise` on `loaderData` with the value/error - when it settles so it's now always a `Promise`. - - To that end, we changed from `` to - `` for clarity, and it also now supports using - `` with raw promises from anywhere, not only those on `loaderData` - from a defer() call. - - Note that raw promises will not be automatically cancelled on interruptions - so they are not recommended - - The hooks are now `useAsyncValue`/`useAsyncError` - -- 1dc082c0: fix: fetcher submission revalidating fetchers using wrong key (#9166) -- 3e7e502c: fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) -- f3182f4a: SSR Updates for React Router - - _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - - - Remove `useRenderDataRouter()` in favor of ``/`` - - Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` - - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` - - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` - - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` - -- 5ba67d83: fix: preserve loader data for loaders that opted out of revalidation (#8973) -- f264d828: Pass fetcher `actionResult` through to `shouldRevalidate` on fetcher submissions -- 26e8b8e7: fix: Await should fallback on route params navigations (#9181) -- d0114e26: fix: use a push navigation on submission errors (#9162) -- 3e99fb22: fix: proxy defer resolve/reject values through tracked promises (#9200) - -## 0.2.0-pre.10 - -### Patch Changes - -- fix: remove internal router singleton (#9227) -- fix: Avoid suspense loops on promise aborted values (#9226) - -## 0.2.0-pre.9 - -### Patch Changes - -- fix: rename resetScroll -> preventScrollReset (#9199) -- fix: Await should fallback on route params navigations (#9181) -- fix: proxy defer resolve/reject values through tracked promises (#9200) - -## 0.2.0-pre.8 - -### Patch Changes - -- fix: avoid uneccesary re-renders on `defer` resolution (#9155) -- fix: pass `useMatches` objects to `ScrollRestoration` `getKey` (#9157) -- fix: fetcher submission revalidating fetchers using wrong key (#9166) -- fix: use a push navigation on submission errors (#9162) - -## 0.2.0-pre.7 - -### Patch Changes - -- fix: fix default redirect push/replace behavior (#9117) - -## 0.2.0-pre.6 - -### Patch Changes - -- fix: Rename `` to `` (#9095) - - - We are no longer replacing the `Promise` on `loaderData` with the value/error - when it settles so it's now always a `Promise`. - - To that end, we changed from `` to - `` for clarity, and it also now supports using - `` with raw promises from anywhere, not only those on `loaderData` - from a defer() call. - - Note that raw promises will not be automatically cancelled on interruptions - so they are not recommended - - The hooks are now `useAsyncValue`/`useAsyncError` - -## 0.2.0-pre.5 - -### Patch Changes - -- feat: Deferred API Updates (#9070) - - - Support array and single promise usages - - `return defer([ await critical(), lazy() ])` - - `return defer(lazy())` - - Remove `Deferrable`/`ResolvedDeferrable` in favor of raw `Promise`'s and `Awaited` - - Remove generics from `useAsyncValue` until `useLoaderData` generic is decided in 6.5 - -- feat: Add `createStaticRouter` for `@remix-run/router` SSR usage (#9013) - - **Notable changes:** - - - `request` is now the driving force inside the router utils, so that we can better handle `Request` instances coming form the server (as opposed to `string` and `Path` instances coming from the client) - - Removed the `signal` param from `loader` and `action` functions in favor of `request.signal` - - **Example usage (Document Requests):** - - ```jsx - // Create a static handler - let { query } = unstable_createStaticHandler(routes); - - // Perform a full-document query for the incoming Fetch Request. This will - // execute the appropriate action/loaders and return either the state or a - // Fetch Response in the case of redirects. - let state = await query(fetchRequest); - - // If we received a Fetch Response back, let our server runtime handle directly - if (state instanceof Response) { - throw state; - } - - // Otherwise, render our application providing the data routes and state - let html = ReactDOMServer.renderToString( - - - - ); - ``` - - **Example usage (Data Requests):** - - ```jsx - // Create a static route handler - let { queryRoute } = unstable_createStaticHandler(routes); - - // Perform a single-route query for the incoming Fetch Request. This will - // execute the appropriate singular action/loader and return either the raw - // data or a Fetch Response - let data = await queryRoute(fetchRequest); - - // If we received a Fetch Response back, return it directly - if (data instanceof Response) { - return data; - } - - // Otherwise, construct a Response from the raw data (assuming json here) - return new Response(JSON.stringify(data), { - headers: { - "Content-Type": "application/json; charset=utf-8" - } - }); - ``` - -- feat: SSR Updates for React Router (#9058) - - _Note: The Data-Router SSR aspects of `@remix-run/router` and `react-router-dom` are being released as **unstable** in this release (`unstable_createStaticHandler` and `unstable_DataStaticRouter`), and we plan to finalize them in a subsequent minor release once the kinks can be worked out with the Remix integration. To that end, they are available for use, but are subject to breaking changes in the next minor release._ - - - Remove `useRenderDataRouter()` in favor of ``/`` - - Support automatic hydration in ``/``/`` - - Uses `window.__staticRouterHydrationData` - - Can be disabled on the server via `` - - Can be disabled (or overridden) in the browser by passing `hydrationData` to ``/`` - - `` now tracks it's own SSR error boundaries on `StaticHandlerContext` - - `StaticHandlerContext` now exposes `statusCode`/`loaderHeaders`/`actionHeaders` - - `foundMissingHydrationData` check removed since Remix routes may have loaders (for modules) that don't return data for `loaderData` - -## 0.2.0-pre.4 - -### Patch Changes - -- fix: Handle fetcher 404s as normal boundary errors (#9015) -- feat: adds `defer()` support to data routers (#9002) -- feat: add basename support for data routers (#9026) -- ci: simplify dist/ directory for CJS/ESM only (#9017) -- fix: Fix trailing slash behavior on pathless routing when using a basename (#9045) - -## 0.2.0-pre.3 - -### Patch Changes - -- fix: properly handle `` submissions (#8984) -- fix: Make path resolution trailing slash agnostic (#8861) -- fix: don't default to a `REPLACE` navigation on form submissions if the action redirected. The redirect takes care of avoiding the back-button-resubmit scenario, so by using a `PUSH` we allow the back button to go back to the pre-submission form page (#8979) -- fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975) -- fix: preserve loader data for loaders that opted out of revalidation (#8973) - -[Full Changes](https://github.com/remix-run/react-router/compare/%40remix-run/router%400.2.0-pre.2...%40remix-run/router%400.2.0-pre.3) - -## 0.2.0-pre.2 - -### Patch Changes - -- Capture fetcher errors at contextual route error boundaries (#8945) - -## 0.2.0-pre.1 - -### Patch Changes - -- Fix missing `dist` files - -## 0.2.0-pre.0 - -### Minor Changes - -- Change `formMethod=GET` to be a loading navigation instead of submitting - -### Patch Changes - -- Make `fallbackElement` optional and change type to `ReactNode` (type changes only) (#8896) -- Properly trigger error boundaries on 404 routes -- Fix `resolveTo` so that it does not mutate the provided pathname (#8839) -- Pass fetcher `actionResult` through to `shouldRevalidate` on fetcher submissions +[rr-docs]: https://reactrouter.com/ +[rr-feature-overview]: https://reactrouter.com/en/main/start/overview +[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial +[remix-router-readme]: https://github.com/remix-run/react-router/blob/main/packages/router/README.md From 9a4fd15b2e24a876637c4ddf73a0b052a9f6973f Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 13 Sep 2022 15:08:44 -0400 Subject: [PATCH 3/4] Remove bullet from changelog intro --- packages/react-router-dom/CHANGELOG.md | 2 +- packages/react-router/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index b1cf134a5a..33039d396b 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -2,7 +2,7 @@ ## 6.4.0 -- Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. +Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. **New APIs** diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 6e10a33c61..d371f07745 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -2,7 +2,7 @@ ## 6.4.0 -- Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. +Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial]. **New APIs** From 90d0ccaffee6bc1e6a621a941489c83cf997d275 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Tue, 13 Sep 2022 15:13:25 -0400 Subject: [PATCH 4/4] Change links to use version --- packages/react-router-dom/CHANGELOG.md | 4 ++-- packages/react-router/CHANGELOG.md | 4 ++-- packages/router/CHANGELOG.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index 33039d396b..e1b7793315 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -30,5 +30,5 @@ Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs ov - react-router@6.4.0 [rr-docs]: https://reactrouter.com/ -[rr-feature-overview]: https://reactrouter.com/en/main/start/overview -[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial +[rr-feature-overview]: https://reactrouter.com/en/v6.4.0/start/overview +[rr-tutorial]: https://reactrouter.com/en/v6.4.0/start/tutorial diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index d371f07745..d37ddebabd 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -22,5 +22,5 @@ Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs ov - @remix-run/router@1.0.0 [rr-docs]: https://reactrouter.com/ -[rr-feature-overview]: https://reactrouter.com/en/main/start/overview -[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial +[rr-feature-overview]: https://reactrouter.com/en/v6.4.0/start/overview +[rr-tutorial]: https://reactrouter.com/en/v6.4.0/start/tutorial diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index f8656e426a..6f3c8c42bd 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -9,6 +9,6 @@ For an overview of the features provided by `react-router`, we recommend you go For an overview of the features provided by `@remix-run/router`, please check out the [README][remix-router-readme]. [rr-docs]: https://reactrouter.com/ -[rr-feature-overview]: https://reactrouter.com/en/main/start/overview -[rr-tutorial]: https://reactrouter.com/en/main/start/tutorial +[rr-feature-overview]: https://reactrouter.com/en/v6.4.0/start/overview +[rr-tutorial]: https://reactrouter.com/en/v6.4.0/start/tutorial [remix-router-readme]: https://github.com/remix-run/react-router/blob/main/packages/router/README.md