This minor is non-breaking for Router users, since it's undocumented to the public API, but **is breaking** for Start alpha users.
This changes the options signature for meta from this:
```tsx
createRoute({
meta: () => [
...
],
links: () => [
...
],
})
```
to this:
```tsx
createRoute({
head: () => ({
meta: [
...
],
links: [
...
],
})
})
```
- Deprecated class constructor APIs in favor of new `create[Class]` functions
- Added new code-splitting paradigm that produces less code, preloads potentially faster and plays nicely with SSR and file-based routing
- Updated all examples to use new code splitting patterns and new suggested APIs
Breaking Changes:
- `load` has been renamed back (I know...) to `loader`. Don't kill me. This again stays true to the nature of its functionality.
- `loader` can once again return data, but it is stored ephemerally on the route match and re-loaded on every navigation.
- If you choose to store data in `loaderData` from the `loader` function, you'll likely want to employ some level of caching to ensure you're only fetching data when necessary and resolving as early as possible if you have any meaningful cached data to display to the user. TanStack Query is a great tool to do this.
- Route meta and router meta have been renamed back to context. Bikeshed!
- The RouterContext class has been removed in favor of a new `rootRouteWithContext` factory function e.g. rootRouteWithContext<YourRouterContext>()(config)
There are many breaking changes in this release:
- The Router class no longer has many of the methods it had.
- Most of these methods have been moved to the new routerContext, which is served via the useRouter() hook
- React state is being used for all state management, which should set the stage for better transition/suspense support
- Router Context and route context has been renamed to Router Meta and Route Meta
- Loaders are gone. You can still force a route to wait for an async function via `beforeLoad`, which is serial or `load` which is parallel.
- There's a lot of other changes, but I'm too tired to think straight.
Breaking Changes:
- `search` and `hash` are no longer directly available in route loaders
- The route `key` option has been removed
New:
- Added a new optional route option `loaderContext`. It's a function that receives `search` and `hash` and expects you to return any serializable data from them that you require in your loader. This stable-serialized value is used to uniquely identify route matches coming from this route configuration and acts as a dependency tracker for when loaders should rerun, etc.