hannoeru / vite-plugin-pages

File system based route generator for ⚑️Vite
MIT License
1.87k stars 128 forks source link

chore(deps): update dependency react-router to ^6.9.0 #385

Closed renovate[bot] closed 1 year ago

renovate[bot] commented 1 year ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-router ^6.4.5 -> ^6.9.0 age adoption passing confidence

Release Notes

remix-run/react-router ### [`v6.9.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​690) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.8.2...react-router@6.9.0) ##### Minor Changes - React Router now supports an alternative way to define your route `element` and `errorElement` fields as React Components instead of React Elements. You can instead pass a React Component to the new `Component` and `ErrorBoundary` fields if you choose. There is no functional difference between the two, so use whichever approach you prefer πŸ˜€. You shouldn't be defining both, but if you do `Component`/`ErrorBoundary` will "win". ([#​10045](https://togithub.com/remix-run/react-router/pull/10045)) **Example JSON Syntax** ```jsx // Both of these work the same: const elementRoutes = [{ path: '/', element: , errorElement: , }] const componentRoutes = [{ path: '/', Component: Home, ErrorBoundary: HomeError, }] function Home() { ... } function HomeError() { ... } ``` **Example JSX Syntax** ```jsx // Both of these work the same: const elementRoutes = createRoutesFromElements( } errorElement={ } /> ); const componentRoutes = createRoutesFromElements( ); function Home() { ... } function HomeError() { ... } ``` - **Introducing Lazy Route Modules!** ([#​10045](https://togithub.com/remix-run/react-router/pull/10045)) In order to keep your application bundles small and support code-splitting of your routes, we've introduced a new `lazy()` route property. This is an async function that resolves the non-route-matching portions of your route definition (`loader`, `action`, `element`/`Component`, `errorElement`/`ErrorBoundary`, `shouldRevalidate`, `handle`). Lazy routes are resolved on initial load and during the `loading` or `submitting` phase of a navigation or fetcher call. You cannot lazily define route-matching properties (`path`, `index`, `children`) since we only execute your lazy route functions after we've matched known routes. Your `lazy` functions will typically return the result of a dynamic import. ```jsx // In this example, we assume most folks land on the homepage so we include that // in our critical-path bundle, but then we lazily load modules for /a and /b so // they don't load until the user navigates to those routes let routes = createRoutesFromElements( }> } /> import("./a")} /> import("./b")} /> ); ``` Then in your lazy route modules, export the properties you want defined for the route: ```jsx export async function loader({ request }) { let data = await fetchData(request); return json(data); } // Export a `Component` directly instead of needing to create a React Element from it export function Component() { let data = useLoaderData(); return ( <>

You made it!

{data}

); } // Export an `ErrorBoundary` directly instead of needing to create a React Element from it export function ErrorBoundary() { let error = useRouteError(); return isRouteErrorResponse(error) ? (

{error.status} {error.statusText}

) : (

{error.message || error}

); } ``` An example of this in action can be found in the [`examples/lazy-loading-router-provider`](https://togithub.com/remix-run/react-router/tree/main/examples/lazy-loading-router-provider) directory of the repository. πŸ™Œ Huge thanks to [@​rossipedia](https://togithub.com/rossipedia) for the [Initial Proposal](https://togithub.com/remix-run/react-router/discussions/9826) and [POC Implementation](https://togithub.com/remix-run/react-router/pull/9830). - Updated dependencies: - `@remix-run/router@1.4.0` ##### Patch Changes - Fix `generatePath` incorrectly applying parameters in some cases ([#​10078](https://togithub.com/remix-run/react-router/pull/10078)) - Improve memoization for context providers to avoid unnecessary re-renders ([#​9983](https://togithub.com/remix-run/react-router/pull/9983)) ### [`v6.8.2`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​682) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.8.1...react-router@6.8.2) ##### Patch Changes - Updated dependencies: - `@remix-run/router@1.3.3` ### [`v6.8.1`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​681) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.8.0...react-router@6.8.1) ##### Patch Changes - Remove inaccurate console warning for POP navigations and update active blocker logic ([#​10030](https://togithub.com/remix-run/react-router/pull/10030)) - Updated dependencies: - `@remix-run/router@1.3.2` ### [`v6.8.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​680) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.7.0...react-router@6.8.0) ##### Patch Changes - Updated dependencies: - `@remix-run/router@1.3.1` ### [`v6.7.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​670) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.6.2...react-router@6.7.0) ##### Minor Changes - Add `unstable_useBlocker` hook for blocking navigations within the app's location origin ([#​9709](https://togithub.com/remix-run/react-router/pull/9709)) ##### Patch Changes - Fix `generatePath` when optional params are present ([#​9764](https://togithub.com/remix-run/react-router/pull/9764)) - Update `` to accept `ReactNode` as children function return result ([#​9896](https://togithub.com/remix-run/react-router/pull/9896)) - Updated dependencies: - `@remix-run/router@1.3.0` ### [`v6.6.2`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​662) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.6.1...react-router@6.6.2) ##### Patch Changes - Ensure `useId` consistency during SSR ([#​9805](https://togithub.com/remix-run/react-router/pull/9805)) ### [`v6.6.1`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​661) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.6.0...react-router@6.6.1) ##### Patch Changes - Updated dependencies: - `@remix-run/router@1.2.1` ### [`v6.6.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​660) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.5.0...react-router@6.6.0) ##### Patch Changes - Prevent `useLoaderData` usage in `errorElement` ([#​9735](https://togithub.com/remix-run/react-router/pull/9735)) - Updated dependencies: - `@remix-run/router@1.2.0` ### [`v6.5.0`](https://togithub.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#​650) [Compare Source](https://togithub.com/remix-run/react-router/compare/react-router@6.4.5...react-router@6.5.0) This release introduces support for [Optional Route Segments](https://togithub.com/remix-run/react-router/issues/9546). Now, adding a `?` to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters. **Optional Params Examples** - `` will match: - `/multistep` - `/multistep/:widget1` - `/multistep/:widget1/:widget2` - `/multistep/:widget1/:widget2/:widget3` **Optional Static Segment Example** - `` will match: - `/` - `/home` - `` will match: - `/about` - `/fr/about` ##### Minor Changes - Allows optional routes and optional static segments ([#​9650](https://togithub.com/remix-run/react-router/pull/9650)) ##### Patch Changes - Stop incorrectly matching on partial named parameters, i.e. ``, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the `useParams` call site: ([#​9506](https://togithub.com/remix-run/react-router/pull/9506)) ```jsx // Old behavior at URL /prefix-123 }> function Comp() { let params = useParams(); // { id: '123' } let id = params.id; // "123" ... } // New behavior at URL /prefix-123 }> function Comp() { let params = useParams(); // { id: 'prefix-123' } let id = params.id.replace(/^prefix-/, ''); // "123" ... } ``` - Updated dependencies: - `@remix-run/router@1.1.0`

Configuration

πŸ“… Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

πŸ”• Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.