Add a button to navigate to a route from the `router-devtools`.
Paths with dynamic path parameters will reuse the path parameters
from the current route. Only paths, where the current path
parameters are viable for a successful navigation will have this button
appear.
---
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
This change, makes it so that the `pendingComponent` is no longer
code-split by default when using the `automaticCodeSplitting` feature.
With this change, both the `loader` and `pendingComponent` will not be
code-split by _default_.
Exposes the `ClientOnly` component for preventing rendering & hydration
errors.
## Background
When you attempt to prevent content from rendering using something like
`typeof document !== 'undefined'` as that type of conditional will cause
hydration errors.
## API
```tsx
import { ClientOnly, createRoute } from '@tanstack/react-router'
import { Charts, FallbackCharts } from './charts-that-break-server-side-rendering'
const Route = createRoute({
// ... other route options
path: '/dashboard',
component: Dashboard,
})
function Dashboard() {
return (
<div>
<p>Dashboard</p>
<ClientOnly fallback={<FallbackCharts />}>
<Charts />
</ClientOnly>
</div>
)
}
```
> [!NOTE]
> This component as is (other than I removed the `children` as a
`function`) in production on [joggr.io](https://joggr.io)
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Ahmed Abdelbaset <A7med3bdulBaset@gmail.com>
Co-authored-by: Birk Skyum <birk.skyum@pm.me>
The migration to `router-core` made the `redirect` function
more restrictive since it _only_ used the `RegisteredRouter`.
This change makes it so that it accepts `AnyRouter` with it
defaulting to the `RegisteredRouter`. Also, `TTo` also
needed to be changed, since the first generic became optional.
fixes https://github.com/TanStack/router/issues/3680
It seems like `resolvedLocation` does not always point to the latest
location state in the ref callback; sometimes it points to the previous
location and `onRendered` is not triggered.
Also this fix detaches `onRendered` event from the scroll restoration
feature.
This change hashes the generated filnames for the JSON blobs that used
for static server function RPC calls.
So it goes from being
```
/__tsr/staticServerFnCache/app_routes_nav_posts_stub_tsx--loadPostServerFn_createServerFn_handler__-this-is-a-post-slug-.json
```
to
```
/__tsr/staticServerFnCache/00e9f7af882c994097f011e6492f2a30e8754bb0.json
```
This has an added benefit of ensuring that the `sha1` hash names are
always the same in character length.
Closes#3655
Switch out our `qss` implementation from its manual solution
over to using `URLSearchParams` for handling
encoding/decoding while still retaining the same interface.
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Fixes#3741
Added hash scroll handling directly in the React `Transitioner`
component's `onResolved`, similar to how it's implemented in the Solid
version
Currently, when the code-splitter encounters a known identifier used for
configuration in `createFileRoute` (such as `component`, `loader`,
`errorComponent`, etc.) it retains the export without splitting it out
into a separate file.
This functionality is currently partially working when the export is a
"default export" which references an already declared identifier.
```ts
const loader = () => {}
export default loader
```
However, it does not work when the "default export" is also making a
function declaration for the export.
```ts
export default function loader() {}
```
This PR adds the functionality to detect this use case and perform the
same transformations to align itself with the behaviour for all others
exports.
Mentions of this being experimental in
- overview page (first in the docs)
- readme of solid-start package
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>