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
6 changes: 0 additions & 6 deletions examples/react/start-basic/src/Foo.ts

This file was deleted.

3 changes: 1 addition & 2 deletions examples/react/start-basic/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,10 @@ export const routeTree = rootRouteImport
._addFileTypes<FileRouteTypes>()

import type { getRouter } from './router.tsx'
import type { startInstance } from './start.tsx'
import type { createStart } from '@tanstack/react-start'
declare module '@tanstack/react-start' {
interface Register {
ssr: true
router: Awaited<ReturnType<typeof getRouter>>
config: Awaited<ReturnType<typeof startInstance.getOptions>>
}
}
4 changes: 0 additions & 4 deletions examples/react/start-basic/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createRouter } from '@tanstack/react-router'
import { getGlobalStartContext } from '@tanstack/react-start'
import { routeTree } from './routeTree.gen'
import { DefaultCatchBoundary } from './components/DefaultCatchBoundary'
import { NotFound } from './components/NotFound'
Expand All @@ -11,9 +10,6 @@ export function getRouter() {
defaultErrorComponent: DefaultCatchBoundary,
defaultNotFoundComponent: () => <NotFound />,
scrollRestoration: true,
ssr: {
nonce: getGlobalStartContext()?.nonce,
},
})
return router
}
130 changes: 0 additions & 130 deletions examples/react/start-basic/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,140 +9,10 @@ import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import * as React from 'react'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
import { NotFound } from '~/components/NotFound'
import { Test, startInstance } from '~/start'
import appCss from '~/styles/app.css?url'
import { seo } from '~/utils/seo'

export const testServerMw = startInstance
.createMiddleware()
.server(({ next, context }) => {
context.fromFetch
// ^?
context.fromServerMw
// ^?

return next({
context: {
fromIndexServerMw: true,
},
})
})

export const testFnMw = startInstance
.createMiddleware({ type: 'function' })
.middleware([testServerMw])
.server(({ next, context }) => {
context.fromFetch
// ^?
context.fromServerMw
// ^?
context.fromFnMw
// ^?
context.fromIndexServerMw
// ^?

return next({
context: {
fromIndexFnMw: true,
},
})
})

export const testGetMiddleware = startInstance
.createMiddleware()
.server(({ next, context }) => {
return next({
context: {
fromGetMiddleware: true,
},
})
})

export const Route = createRootRoute({
server: {
middleware: [testServerMw],
handlers: {
GET: ({ context, next }) => {
context.fromFetch
// ^?
context.fromServerMw
// ^?
context.fromIndexServerMw
// ^?
return next({
context: {
fromGet: true,
},
})
},
POST: ({ context, next }) => {
context.fromFetch
context.fromServerMw
context.fromIndexServerMw
return next({
context: {
fromPost: true,
},
})
},
},
// handlers: ({ createHandlers }) =>
// createHandlers({
// GET: {
// middleware: [testGetMiddleware],
// handler: ({ context, next }) => {
// context.fromFetch
// // ^?
// context.fromServerMw
// // ^?
// context.fromIndexServerMw
// // ^?
// context.fromGetMiddleware
// // ^?
// return next({
// context: {
// fromGet: true,
// fromPost: false,
// },
// })
// },
// },
// POST: {
// handler: ({ next }) => {
// return next({
// context: {
// fromGet: false,
// fromPost: true,
// },
// })
// },
// },
// }),
test: (test) => {},
},
beforeLoad: ({ serverContext }) => {
serverContext?.fromFetch
// ^?
serverContext?.fromServerMw
// ^?
serverContext?.fromIndexServerMw
// ^?
serverContext?.fromGet
// ^?
return serverContext
},
// ssr: false,
loader: ({ context }) => {
context?.fromFetch
// ^?
context?.fromServerMw
// ^?
context?.fromIndexServerMw
// ^?
context?.fromPost
// ^?
return new Test('test')
},
head: () => ({
meta: [
{
Expand Down
64 changes: 0 additions & 64 deletions examples/react/start-basic/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,70 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
import { Test } from '~/start'

export const Route = createFileRoute('/')({
// server: {
// handlers: {
// GET: ({ context, next }) => {
// context.fromFetch
// // ^?
// context.fromServerMw
// // ^?
// context.fromIndexServerMw
// // ^?
// return next({
// context: {
// fromGet: true,
// },
// })
// },
// POST: ({ context, next }) => {
// context.fromFetch
// context.fromServerMw
// context.fromIndexServerMw
// return next({
// context: {
// fromPost: true,
// },
// })
// },
// },
// // handlers: ({ createHandlers }) =>
// // createHandlers({
// // GET: {
// // middleware: [testGetMiddleware],
// // handler: ({ context, next }) => {
// // context.fromFetch
// // // ^?
// // context.fromServerMw
// // // ^?
// // context.fromIndexServerMw
// // // ^?
// // context.fromGetMiddleware
// // // ^?
// // return next({
// // context: {
// // fromGet: true,
// // fromPost: false,
// // },
// // })
// // },
// // },
// // POST: {
// // handler: ({ next }) => {
// // return next({
// // context: {
// // fromGet: false,
// // fromPost: true,
// // },
// // })
// // },
// // },
// // }),
// test: (test) => {},
// },
loader: () => {
return new Test('test')
},
component: Home,
})

Expand Down
11 changes: 0 additions & 11 deletions examples/react/start-basic/src/server.ts

This file was deleted.

114 changes: 0 additions & 114 deletions examples/react/start-basic/src/start.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions examples/react/start-basic/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import tsConfigPaths from 'vite-tsconfig-paths'
import viteReact from '@vitejs/plugin-react'

export default defineConfig({
base: '/foo/',
server: {
port: 3000,
},
Expand All @@ -14,8 +13,6 @@ export default defineConfig({
}),
tanstackStart({
srcDirectory: 'src',
start: { entry: './start.tsx' },
server: { entry: './server.ts' },
}),
viteReact(),
],
Expand Down
1 change: 0 additions & 1 deletion packages/start-client-core/src/serverRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export interface RouteServerOptions<
any
>)
>
test?: (test: Expand<ExtractHandlersContext<THandlers>>) => void
}

declare const createHandlersSymbol: unique symbol
Expand Down
Loading