Skip to content

Conversation

schiller-manuel
Copy link
Contributor

No description provided.

Copy link

nx-cloud bot commented Jul 2, 2025

View your CI Pipeline Execution ↗ for commit 7c279e5

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-05 12:28:06 UTC

Copy link

pkg-pr-new bot commented Jul 2, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@4565

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@4565

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@4565

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@4565

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@4565

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@4565

@tanstack/react-router-with-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-with-query@4565

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@4565

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@4565

@tanstack/react-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@4565

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@4565

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@4565

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@4565

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@4565

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@4565

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@4565

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@4565

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@4565

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@4565

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@4565

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@4565

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@4565

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@4565

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@4565

@tanstack/solid-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@4565

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@4565

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@4565

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@4565

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@4565

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@4565

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@4565

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@4565

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@4565

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@4565

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@4565

commit: 7c279e5


export function isRecoverableError(error: unknown): boolean {
if (error instanceof Error) {
return error.message.includes(RECOVERABLE_ERROR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this a more specific?

startsWith(`${RECOVERABLE_ERROR}: `)


export function tanStackStartRouter(config: Config): Array<PluginOption> {
return [
tanstackRouterGenerator({
...config,
plugins: [serverRoutesPlugin(), routesManifestPlugin()],
environmentName: VITE_ENVIRONMENT_NAMES.client,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to to something like viteEnvironmentName or something like viteApplyEnvironment?

Purely since it wouldn't have any effect on the other bundlers.


const route = this.looseRoutesById[routeId]!

const pendingMs =
route.options.pendingMs ?? this.options.defaultPendingMs

if (this.isServer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use some comments here.

Copy link
Member

@birkskyum birkskyum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as I'd expect

Copy link
Member

@SeanCassiere SeanCassiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

return <div className="p-2">hello world</div>;
}
});
if (import.meta.hot) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to have both development and production snapshots related testing for the "delete-nodes" functionality?

Currently, the difference between 'development' and 'production', is the inclusion of the HMR setup using import.meta.hot.accept.

},
]

const frameworks: Array<Config['target']> = ['react', 'solid']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably now become a shared variable between code-splitter.test.ts and delete-nodes.test.ts so that any additions in the future (of other frameworks) don't cause drift.

/**
* @default true
*/
addHmr?: boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What use-case would cause the user to set this to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see start-plugin-core. on the server there is no hmr added for example

@@ -138,27 +143,51 @@ export function compileCodeSplitReferenceRoute(

if (
!(
path.node.callee.name === 'createRoute' ||
path.node.callee.name === 'createFileRoute'
path.node.callee.name === 'createFileRoute' ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path.node.callee.name === 'createFileRoute' ||
['createFileRoute', 'createRootRoute', 'createRootRouteWithContext'].includes(path.node.callee.name)

},
)
}
if (createRouteFn !== 'createFileRoute') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its worth adding a comment here for future adventurers stating that the code-splitting we're exiting early here since the rootRoute is never code-split.

Perhaps the exit condition should just check for createRootRoute or createRootRouteWithContext.

export const Route = createFileRoute('/posts/$postId')({
validateSearch: z.object({ postId: ssrSchema }),
ssr: ({ search }) => {
if (typeof window !== 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how important this is, but we can probably share the content of the ssr, beforeLoad, and component between the routes yes?

@schiller-manuel schiller-manuel merged commit d728d69 into main Jul 5, 2025
5 checks passed
@schiller-manuel schiller-manuel deleted the feat-ssr-per-route branch July 5, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants