Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/history/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export function createHistory(opts: {

function assignKeyAndIndex(index: number, state: HistoryState | undefined) {
if (!state) {
state = {} as HistoryState
state = {}
}
const key = createRandomKey()
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/src/RouterProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function RouterContextProvider<
...router.options.context,
...rest.context,
},
} as any)
})
}

const routerContext = getRouterContext()
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/src/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export function createRootRouteWithContext<TRouterContext extends {}>() {
TLoaderFn,
TSSR,
TServerMiddlewares
>(options as any)
>(options)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/router-core/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ export class BaseRouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> {
id: TId

constructor({ id }: { id: TId }) {
this.id = id as any
this.id = id
}

notFound = (opts?: NotFoundError) => {
Expand Down
5 changes: 1 addition & 4 deletions packages/router-core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2619,10 +2619,7 @@ export class RouterCore<
const matchLocation = {
...location,
to: location.to
? this.resolvePathWithBase(
(location.from || '') as string,
location.to as string,
)
? this.resolvePathWithBase(location.from || '', location.to as string)
: undefined,
params: location.params || {},
leaveParams: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/router-core/src/ssr/createRequestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function createRequestHandler<TRouter extends AnyRouter>({
request,
router,
responseHeaders,
} as any)
})
} finally {
if (!cbWillCleanup) {
// Clean up router SSR state if the callback won't handle it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function FloatingTanStackRouterDevtools({
>
{/* {router() ? ( */}
<BaseTanStackRouterDevtoolsPanel
ref={panelRef as any}
ref={panelRef}
{...otherPanelProps}
router={router}
routerState={routerState}
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router/src/RouterProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function RouterContextProvider<
...router.options.context,
...rest.context,
},
} as any)
})

const routerContext = getRouterContext()

Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router/src/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export function createRootRouteWithContext<TRouterContext extends {}>() {
TLoaderFn,
TSSR,
THandlers
>(options as any)
>(options)
}
}

Expand Down
13 changes: 4 additions & 9 deletions packages/start-client-core/src/createServerFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import type {
AnyFunctionMiddleware,
AnyRequestMiddleware,
AssignAllServerFnContext,
FunctionMiddlewareClientFnResult,
FunctionMiddlewareServerFnResult,
IntersectAllValidatorInputs,
IntersectAllValidatorOutputs,
Expand Down Expand Up @@ -65,7 +64,7 @@ export const createServerFn: CreateServerFn<Register> = (options, __opts) => {
}

const res: ServerFnBuilder<Register, Method> = {
options: resolvedOptions as any,
options: resolvedOptions,
middleware: (middleware) => {
// multiple calls to `middleware()` merge the middlewares with the previously supplied ones
// this is primarily useful for letting users create their own abstractions on top of `createServerFn`
Expand Down Expand Up @@ -279,8 +278,8 @@ export async function executeMiddleware(
// Execute the middleware
const result = await middlewareFn({
...ctx,
next: userNext as any,
} as any)
next: userNext,
})

// If result is NOT a ctx object, we need to return it as
// the { result }
Expand Down Expand Up @@ -756,11 +755,7 @@ function serverFnBaseToMiddleware(
// but not before serializing the context
const res = await options.extractedFn?.(payload)

return next(res) as unknown as FunctionMiddlewareClientFnResult<
any,
any,
any
>
return next(res)
},
server: async ({ next, ...ctx }) => {
// Execute the server function
Expand Down
2 changes: 1 addition & 1 deletion packages/start-client-core/src/createStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const createStart = <
}
return options
},
createMiddleware: createMiddleware as any,
createMiddleware: createMiddleware,
} as StartInstance<
TSerializationAdapters,
TDefaultSsr,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-router/src/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Html = Vue.defineComponent({
if (Array.isArray(vnode.children)) {
for (const c of vnode.children) {
if (typeof c === 'object' && c !== null && 'type' in c) {
headChildren.push(c as Vue.VNode)
headChildren.push(c)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-router/src/RouterProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const RouterContextProvider = Vue.defineComponent({
},
setup(props, { attrs, slots }) {
const router = props.router as AnyRouter
const restAttrs = attrs as Record<string, any>
const restAttrs = attrs

// Allow the router to update options on the router instance
router.update({
Expand Down Expand Up @@ -67,7 +67,7 @@ export const RouterProvider = Vue.defineComponent({
// Rest of router options will be passed as attrs
},
setup(props, { attrs }) {
const restAttrs = attrs as Record<string, any>
const restAttrs = attrs

return () => {
return Vue.h(
Expand Down
6 changes: 3 additions & 3 deletions packages/vue-router/src/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function useLinkProps<
}
})

return safeProps as LinkHTMLAttributes
return safeProps
}

// External links just have simple props
Expand Down Expand Up @@ -309,7 +309,7 @@ export function useLinkProps<
}
})

return externalProps as LinkHTMLAttributes
return externalProps
}

// The click handler
Expand Down Expand Up @@ -576,7 +576,7 @@ export function useLinkProps<
}
}

return result as LinkHTMLAttributes
return result
})

// Return the computed ref itself - callers should access .value
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-router/src/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function CatchNotFound(props: {
if (isNotFound(error)) {
// If a fallback is provided, use it
if (props.fallback) {
return props.fallback(error as NotFoundError)
return props.fallback(error)
}
// Otherwise return a default not found message
return Vue.h('p', null, 'Not Found')
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-router/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export function createRootRouteWithContext<TRouterContext extends {}>() {
TLoaderFn,
TSSR,
THandlers
>(options as any)
>(options)
}
}

Expand Down
3 changes: 1 addition & 2 deletions packages/vue-router/src/ssr/renderRouterToStream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { isbot } from 'isbot'
import { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'
import type { AnyRouter } from '@tanstack/router-core'
import type { Component } from 'vue'
import type { ReadableStream } from 'node:stream/web'

function prependDoctype(
readable: globalThis.ReadableStream,
Expand Down Expand Up @@ -75,7 +74,7 @@ export const renderRouterToStream = async ({
const doctypedStream = prependDoctype(readable)
const responseStream = transformReadableStreamWithRouter(
router,
doctypedStream as unknown as ReadableStream,
doctypedStream,
)

return new Response(responseStream as any, {
Expand Down
Loading