Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/solid/start-large/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
(gen)
node_modules
package-lock.json
yarn.lock

.DS_Store
.cache
.env
.vercel
.output
/build/
/api/
/server/build
/public/build
Comment on lines +1 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove duplicate entries.

The file contains duplicate entries for node_modules (lines 1 and 7) and .DS_Store (lines 2 and 11).

Apply this diff to remove the duplicates:

 node_modules
 .DS_Store
 dist
 dist-ssr
 *.local
 (gen)
-node_modules
 package-lock.json
 yarn.lock

-.DS_Store
 .cache
 .env
 .vercel
 .output
 /build/
 /api/
 /server/build
 /public/build
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
node_modules
.DS_Store
dist
dist-ssr
*.local
(gen)
node_modules
package-lock.json
yarn.lock
.DS_Store
.cache
.env
.vercel
.output
/build/
/api/
/server/build
/public/build
node_modules
.DS_Store
dist
dist-ssr
*.local
(gen)
package-lock.json
yarn.lock
.cache
.env
.vercel
.output
/build/
/api/
/server/build
/public/build
🤖 Prompt for AI Agents
In examples/solid/start-large/.gitignore around lines 1 to 19 there are
duplicate entries for node_modules and .DS_Store; remove the repeated lines so
each pattern appears only once (keep one node_modules and one .DS_Store entry)
and ensure the remaining ordering is sensible, leaving the rest of the ignore
patterns unchanged.

11 changes: 11 additions & 0 deletions examples/solid/start-large/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.watcherExclude": {
"**/routeTree.gen.ts": true
},
"search.exclude": {
"**/routeTree.gen.ts": true
},
"files.readonlyInclude": {
"**/routeTree.gen.ts": true
}
}
36 changes: 36 additions & 0 deletions examples/solid/start-large/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "tanstack-solid-start-example-large",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build && tsc --noEmit",
"start": "vite start",
"gen": "node ./src/createRoutes.mjs",
"test:types": "tsc --extendedDiagnostics"
},
"dependencies": {
"@tanstack/solid-query": "^5.90.0",
"@tanstack/solid-router": "^1.135.2",
"@tanstack/solid-router-devtools": "^1.135.2",
"@tanstack/solid-start": "^1.135.2",
"solid-js": "^1.9.10",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"valibot": "^1.0.0-beta.15"
Comment on lines +13 to +21
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use workspace:* protocol for internal dependencies.

Per the coding guidelines, internal TanStack packages should use the workspace:* protocol instead of pinned versions to ensure consistency across the monorepo.

As per coding guidelines.

Apply this diff:

   "dependencies": {
-    "@tanstack/solid-query": "^5.90.0",
-    "@tanstack/solid-router": "^1.135.2",
-    "@tanstack/solid-router-devtools": "^1.135.2",
-    "@tanstack/solid-start": "^1.135.2",
+    "@tanstack/solid-query": "workspace:*",
+    "@tanstack/solid-router": "workspace:*",
+    "@tanstack/solid-router-devtools": "workspace:*",
+    "@tanstack/solid-start": "workspace:*",
     "solid-js": "^1.9.10",
     "redaxios": "^0.5.1",
     "tailwind-merge": "^2.6.0",
     "valibot": "^1.0.0-beta.15"
   },
🤖 Prompt for AI Agents
In examples/solid/start-large/package.json around lines 13 to 21, change
internal TanStack package dependency versions to use the workspace:* protocol;
specifically replace the pinned versions for @tanstack/solid-query,
@tanstack/solid-router, @tanstack/solid-router-devtools, and
@tanstack/solid-start with "workspace:*" (leave external packages like solid-js,
redaxios, tailwind-merge, valibot unchanged), then save the file.

},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.15",
"@types/node": "^22.5.4",
"vite-plugin-solid": "^2.11.10",
"postcss": "^8.5.1",
"tailwindcss": "^4.1.15",
"typescript": "^5.7.2",
"vite": "^7.1.7",
"vite-tsconfig-paths": "^5.1.4"
},
"keywords": [],
"author": "",
"license": "ISC"
}
5 changes: 5 additions & 0 deletions examples/solid/start-large/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
}
49 changes: 49 additions & 0 deletions examples/solid/start-large/src/createRoutes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { readFile, writeFile, mkdir } from 'fs/promises'
import { existsSync } from 'fs'

const length = 100

const main = async () => {
const absolute = (await readFile('./src/routes/absolute.tsx')).toString()
const relative = (await readFile('./src/routes/relative.tsx')).toString()
const searchRoute = (
await readFile('./src/routes/search/route.tsx')
).toString()
const search = (
await readFile('./src/routes/search/searchPlaceholder.tsx')
).toString()
const paramsRoute = (
await readFile('./src/routes/params/route.tsx')
).toString()
const params = await (
await readFile('./src/routes/params/$paramsPlaceholder.tsx')
).toString()

if (!existsSync('./src/routes/(gen)')) {
await mkdir('./src/routes/(gen)')
}

if (!existsSync('./src/routes/(gen)/search')) {
await mkdir('./src/routes/(gen)/search')
}

if (!existsSync('./src/routes/(gen)/params')) {
await mkdir('./src/routes/(gen)/params')
}

await writeFile('./src/routes/(gen)/search/route.tsx', searchRoute)
await writeFile('./src/routes/(gen)/params/route.tsx', paramsRoute)

for (let y = 0; y < length; y = y + 1) {
const replacedAbsolute = absolute.replaceAll('/absolute', `/absolute${y}`)
const replacedRelative = relative.replaceAll('/relative', `/relative${y}`)
const replacedSearch = search.replaceAll('searchPlaceholder', `search${y}`)
const replacedParams = params.replaceAll('paramsPlaceholder', `param${y}`)
await writeFile(`./src/routes/(gen)/absolute${y}.tsx`, replacedAbsolute)
await writeFile(`./src/routes/(gen)/relative${y}.tsx`, replacedRelative)
await writeFile(`./src/routes/(gen)/search/search${y}.tsx`, replacedSearch)
await writeFile(`./src/routes/(gen)/params/$param${y}.tsx`, replacedParams)
}
}

main()
Comment on lines +37 to +49
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Handle main() rejections.

main() is async and its errors currently surface as unhandled promise rejections. Wrap the call so failures exit cleanly. (tanstack.com)

-main()
+main().catch((err) => {
+  console.error(err)
+  process.exit(1)
+})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (let y = 0; y < length; y = y + 1) {
const replacedAbsolute = absolute.replaceAll('/absolute', `/absolute${y}`)
const replacedRelative = relative.replaceAll('/relative', `/relative${y}`)
const replacedSearch = search.replaceAll('searchPlaceholder', `search${y}`)
const replacedParams = params.replaceAll('paramsPlaceholder', `param${y}`)
await writeFile(`./src/routes/(gen)/absolute${y}.tsx`, replacedAbsolute)
await writeFile(`./src/routes/(gen)/relative${y}.tsx`, replacedRelative)
await writeFile(`./src/routes/(gen)/search/search${y}.tsx`, replacedSearch)
await writeFile(`./src/routes/(gen)/params/$param${y}.tsx`, replacedParams)
}
}
main()
for (let y = 0; y < length; y = y + 1) {
const replacedAbsolute = absolute.replaceAll('/absolute', `/absolute${y}`)
const replacedRelative = relative.replaceAll('/relative', `/relative${y}`)
const replacedSearch = search.replaceAll('searchPlaceholder', `search${y}`)
const replacedParams = params.replaceAll('paramsPlaceholder', `param${y}`)
await writeFile(`./src/routes/(gen)/absolute${y}.tsx`, replacedAbsolute)
await writeFile(`./src/routes/(gen)/relative${y}.tsx`, replacedRelative)
await writeFile(`./src/routes/(gen)/search/search${y}.tsx`, replacedSearch)
await writeFile(`./src/routes/(gen)/params/$param${y}.tsx`, replacedParams)
}
}
main().catch((err) => {
console.error(err)
process.exit(1)
})
🤖 Prompt for AI Agents
In examples/solid/start-large/src/createRoutes.mjs around lines 37 to 49, the
top-level async main() call is unhandled and can produce unhandled promise
rejections; update the invocation to handle rejections by either awaiting it
inside an immediately-invoked async function with try/catch or by appending
.catch(err => { console.error(err); process.exit(1); }) to main(), ensuring any
thrown error is logged and the process exits with a non-zero code.

239 changes: 239 additions & 0 deletions examples/solid/start-large/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
/* eslint-disable */

// @ts-nocheck

// noinspection JSUnusedGlobalSymbols

// This file was automatically generated by TanStack Router.
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.

import { Route as rootRouteImport } from './routes/__root'
import { Route as RelativeRouteImport } from './routes/relative'
import { Route as LinkPropsRouteImport } from './routes/linkProps'
import { Route as AbsoluteRouteImport } from './routes/absolute'
import { Route as SearchRouteRouteImport } from './routes/search/route'
import { Route as ParamsRouteRouteImport } from './routes/params/route'
import { Route as IndexRouteImport } from './routes/index'
import { Route as SearchSearchPlaceholderRouteImport } from './routes/search/searchPlaceholder'
import { Route as ParamsParamsPlaceholderRouteImport } from './routes/params/$paramsPlaceholder'

const RelativeRoute = RelativeRouteImport.update({
id: '/relative',
path: '/relative',
getParentRoute: () => rootRouteImport,
} as any)
const LinkPropsRoute = LinkPropsRouteImport.update({
id: '/linkProps',
path: '/linkProps',
getParentRoute: () => rootRouteImport,
} as any)
const AbsoluteRoute = AbsoluteRouteImport.update({
id: '/absolute',
path: '/absolute',
getParentRoute: () => rootRouteImport,
} as any)
const SearchRouteRoute = SearchRouteRouteImport.update({
id: '/search',
path: '/search',
getParentRoute: () => rootRouteImport,
} as any)
const ParamsRouteRoute = ParamsRouteRouteImport.update({
id: '/params',
path: '/params',
getParentRoute: () => rootRouteImport,
} as any)
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRouteImport,
} as any)
const SearchSearchPlaceholderRoute = SearchSearchPlaceholderRouteImport.update({
id: '/searchPlaceholder',
path: '/searchPlaceholder',
getParentRoute: () => SearchRouteRoute,
} as any)
const ParamsParamsPlaceholderRoute = ParamsParamsPlaceholderRouteImport.update({
id: '/$paramsPlaceholder',
path: '/$paramsPlaceholder',
getParentRoute: () => ParamsRouteRoute,
} as any)

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/params': typeof ParamsRouteRouteWithChildren
'/search': typeof SearchRouteRouteWithChildren
'/absolute': typeof AbsoluteRoute
'/linkProps': typeof LinkPropsRoute
'/relative': typeof RelativeRoute
'/params/$paramsPlaceholder': typeof ParamsParamsPlaceholderRoute
'/search/searchPlaceholder': typeof SearchSearchPlaceholderRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/params': typeof ParamsRouteRouteWithChildren
'/search': typeof SearchRouteRouteWithChildren
'/absolute': typeof AbsoluteRoute
'/linkProps': typeof LinkPropsRoute
'/relative': typeof RelativeRoute
'/params/$paramsPlaceholder': typeof ParamsParamsPlaceholderRoute
'/search/searchPlaceholder': typeof SearchSearchPlaceholderRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/': typeof IndexRoute
'/params': typeof ParamsRouteRouteWithChildren
'/search': typeof SearchRouteRouteWithChildren
'/absolute': typeof AbsoluteRoute
'/linkProps': typeof LinkPropsRoute
'/relative': typeof RelativeRoute
'/params/$paramsPlaceholder': typeof ParamsParamsPlaceholderRoute
'/search/searchPlaceholder': typeof SearchSearchPlaceholderRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
| '/params'
| '/search'
| '/absolute'
| '/linkProps'
| '/relative'
| '/params/$paramsPlaceholder'
| '/search/searchPlaceholder'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
| '/params'
| '/search'
| '/absolute'
| '/linkProps'
| '/relative'
| '/params/$paramsPlaceholder'
| '/search/searchPlaceholder'
id:
| '__root__'
| '/'
| '/params'
| '/search'
| '/absolute'
| '/linkProps'
| '/relative'
| '/params/$paramsPlaceholder'
| '/search/searchPlaceholder'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
ParamsRouteRoute: typeof ParamsRouteRouteWithChildren
SearchRouteRoute: typeof SearchRouteRouteWithChildren
AbsoluteRoute: typeof AbsoluteRoute
LinkPropsRoute: typeof LinkPropsRoute
RelativeRoute: typeof RelativeRoute
}

declare module '@tanstack/solid-router' {
interface FileRoutesByPath {
'/relative': {
id: '/relative'
path: '/relative'
fullPath: '/relative'
preLoaderRoute: typeof RelativeRouteImport
parentRoute: typeof rootRouteImport
}
'/linkProps': {
id: '/linkProps'
path: '/linkProps'
fullPath: '/linkProps'
preLoaderRoute: typeof LinkPropsRouteImport
parentRoute: typeof rootRouteImport
}
'/absolute': {
id: '/absolute'
path: '/absolute'
fullPath: '/absolute'
preLoaderRoute: typeof AbsoluteRouteImport
parentRoute: typeof rootRouteImport
}
'/search': {
id: '/search'
path: '/search'
fullPath: '/search'
preLoaderRoute: typeof SearchRouteRouteImport
parentRoute: typeof rootRouteImport
}
'/params': {
id: '/params'
path: '/params'
fullPath: '/params'
preLoaderRoute: typeof ParamsRouteRouteImport
parentRoute: typeof rootRouteImport
}
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
'/search/searchPlaceholder': {
id: '/search/searchPlaceholder'
path: '/searchPlaceholder'
fullPath: '/search/searchPlaceholder'
preLoaderRoute: typeof SearchSearchPlaceholderRouteImport
parentRoute: typeof SearchRouteRoute
}
'/params/$paramsPlaceholder': {
id: '/params/$paramsPlaceholder'
path: '/$paramsPlaceholder'
fullPath: '/params/$paramsPlaceholder'
preLoaderRoute: typeof ParamsParamsPlaceholderRouteImport
parentRoute: typeof ParamsRouteRoute
}
}
}

interface ParamsRouteRouteChildren {
ParamsParamsPlaceholderRoute: typeof ParamsParamsPlaceholderRoute
}

const ParamsRouteRouteChildren: ParamsRouteRouteChildren = {
ParamsParamsPlaceholderRoute: ParamsParamsPlaceholderRoute,
}

const ParamsRouteRouteWithChildren = ParamsRouteRoute._addFileChildren(
ParamsRouteRouteChildren,
)

interface SearchRouteRouteChildren {
SearchSearchPlaceholderRoute: typeof SearchSearchPlaceholderRoute
}

const SearchRouteRouteChildren: SearchRouteRouteChildren = {
SearchSearchPlaceholderRoute: SearchSearchPlaceholderRoute,
}

const SearchRouteRouteWithChildren = SearchRouteRoute._addFileChildren(
SearchRouteRouteChildren,
)

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
ParamsRouteRoute: ParamsRouteRouteWithChildren,
SearchRouteRoute: SearchRouteRouteWithChildren,
AbsoluteRoute: AbsoluteRoute,
LinkPropsRoute: LinkPropsRoute,
RelativeRoute: RelativeRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

import type { getRouter } from './router.tsx'
import type { createStart } from '@tanstack/solid-start'
declare module '@tanstack/solid-start' {
interface Register {
ssr: true
router: Awaited<ReturnType<typeof getRouter>>
}
}
15 changes: 15 additions & 0 deletions examples/solid/start-large/src/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createRouter } from '@tanstack/solid-router'
import { QueryClient } from '@tanstack/solid-query'
import { routeTree } from './routeTree.gen'

export function getRouter() {
const queryClient = new QueryClient()
const router = createRouter({
routeTree,
context: {
queryClient: queryClient,
},
})

return router
}
Loading
Loading