The API routes only rely on h3, which is in start-server-core, so the
entire start-api-routes package can now be agnostic.
Removes
- react-start-api-routes
- solid-start-api-routes
Introduces
- start-api-routes
Using the below setting, the examples and e2e projects opt into the
future behavior of using `./src` as the app directory, rather than
'./app':
```ts
tsr: {
appDirectory: 'src',
},
```
The `./src` directory is typically used for pure-TS Router projects, as
well as CRA. Thus this reduces the churn for a TS Router SPA to opt into
server features with TS Start.
#3700 introduced an unintended side-effect with the scroll restoration
process in TanStack Start.
This revets the code changes in `@tanstack/react-router` and
`@tanstack/solid-router` and short-circuits the tests relevant test
scripts introduced in the offending PR.
The `restoreScroll` function was directly interfacing with
`window.location.hash` to get the 'hash' value, which conflicts with how
hash routing functions. As such, when the hash value was retrieved, it
came back as `#/page#foo` instead of just `#foo` like it would with
regular browser history.
Switching it to use the `history` driver attached to the `router`
instance, correctly returns the `hash` value irrespective of the type of
routing being used.
Fixes#3479
The original `@tanstack/router-devtools` package still work - it's not
touch by this PR in any way, apart from a migration note saying:
>[@tanstack/router-devtools] Warning: This package has moved to
@tanstack/react-router-devtools. Please switch to the new package, as
this package will be dropped soon.
This introduce three new packages
- @tanstack/router-devtools-core : This is a SolidJS port of the UI
And two adapters on top, that mount this solid app and forward
router/routerState into it.
- @tanstack/solid-router-devtools
- @tanstack/router-router-devtools
For use of devtools in production, a `TanStackRouterDevtoolsInProd` can
be imported instead of the standard `TanStackRouterDevtools` that'll be
tree shaken away in prod.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Based on the discussion in https://github.com/TanStack/router/discussions/3664, I'm adding an
option to disable the formatting of the generated routeTree. The file is not meant for human consumption and disabling the formatter can significantly speed up the route generation process.
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>