diff --git a/e2e/react-start/basic/src/routeTree.gen.ts b/e2e/react-start/basic/src/routeTree.gen.ts index b5ecc4a50ff..6efad91f8d7 100644 --- a/e2e/react-start/basic/src/routeTree.gen.ts +++ b/e2e/react-start/basic/src/routeTree.gen.ts @@ -19,6 +19,7 @@ import { Route as LinksRouteImport } from './routes/links' import { Route as InlineScriptsRouteImport } from './routes/inline-scripts' import { Route as DeferredRouteImport } from './routes/deferred' import { Route as ClientOnlyRouteImport } from './routes/client-only' +import { Route as AsyncScriptsRouteImport } from './routes/async-scripts' import { Route as LayoutRouteImport } from './routes/_layout' import { Route as SpecialCharsRouteRouteImport } from './routes/specialChars/route' import { Route as SearchParamsRouteRouteImport } from './routes/search-params/route' @@ -118,6 +119,11 @@ const ClientOnlyRoute = ClientOnlyRouteImport.update({ path: '/client-only', getParentRoute: () => rootRouteImport, } as any) +const AsyncScriptsRoute = AsyncScriptsRouteImport.update({ + id: '/async-scripts', + path: '/async-scripts', + getParentRoute: () => rootRouteImport, +} as any) const LayoutRoute = LayoutRouteImport.update({ id: '/_layout', getParentRoute: () => rootRouteImport, @@ -374,6 +380,7 @@ export interface FileRoutesByFullPath { '/not-found': typeof NotFoundRouteRouteWithChildren '/search-params': typeof SearchParamsRouteRouteWithChildren '/specialChars': typeof SpecialCharsRouteRouteWithChildren + '/async-scripts': typeof AsyncScriptsRoute '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute '/inline-scripts': typeof InlineScriptsRoute @@ -430,6 +437,7 @@ export interface FileRoutesByFullPath { export interface FileRoutesByTo { '/': typeof IndexRoute '/specialChars': typeof SpecialCharsRouteRouteWithChildren + '/async-scripts': typeof AsyncScriptsRoute '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute '/inline-scripts': typeof InlineScriptsRoute @@ -485,6 +493,7 @@ export interface FileRoutesById { '/search-params': typeof SearchParamsRouteRouteWithChildren '/specialChars': typeof SpecialCharsRouteRouteWithChildren '/_layout': typeof LayoutRouteWithChildren + '/async-scripts': typeof AsyncScriptsRoute '/client-only': typeof ClientOnlyRoute '/deferred': typeof DeferredRoute '/inline-scripts': typeof InlineScriptsRoute @@ -546,6 +555,7 @@ export interface FileRouteTypes { | '/not-found' | '/search-params' | '/specialChars' + | '/async-scripts' | '/client-only' | '/deferred' | '/inline-scripts' @@ -602,6 +612,7 @@ export interface FileRouteTypes { to: | '/' | '/specialChars' + | '/async-scripts' | '/client-only' | '/deferred' | '/inline-scripts' @@ -656,6 +667,7 @@ export interface FileRouteTypes { | '/search-params' | '/specialChars' | '/_layout' + | '/async-scripts' | '/client-only' | '/deferred' | '/inline-scripts' @@ -717,6 +729,7 @@ export interface RootRouteChildren { SearchParamsRouteRoute: typeof SearchParamsRouteRouteWithChildren SpecialCharsRouteRoute: typeof SpecialCharsRouteRouteWithChildren LayoutRoute: typeof LayoutRouteWithChildren + AsyncScriptsRoute: typeof AsyncScriptsRoute ClientOnlyRoute: typeof ClientOnlyRoute DeferredRoute: typeof DeferredRoute InlineScriptsRoute: typeof InlineScriptsRoute @@ -808,6 +821,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ClientOnlyRouteImport parentRoute: typeof rootRouteImport } + '/async-scripts': { + id: '/async-scripts' + path: '/async-scripts' + fullPath: '/async-scripts' + preLoaderRoute: typeof AsyncScriptsRouteImport + parentRoute: typeof rootRouteImport + } '/_layout': { id: '/_layout' path: '' @@ -1343,6 +1363,7 @@ const rootRouteChildren: RootRouteChildren = { SearchParamsRouteRoute: SearchParamsRouteRouteWithChildren, SpecialCharsRouteRoute: SpecialCharsRouteRouteWithChildren, LayoutRoute: LayoutRouteWithChildren, + AsyncScriptsRoute: AsyncScriptsRoute, ClientOnlyRoute: ClientOnlyRoute, DeferredRoute: DeferredRoute, InlineScriptsRoute: InlineScriptsRoute, diff --git a/e2e/react-start/basic/src/routes/__root.tsx b/e2e/react-start/basic/src/routes/__root.tsx index e1862b499c6..581510f616a 100644 --- a/e2e/react-start/basic/src/routes/__root.tsx +++ b/e2e/react-start/basic/src/routes/__root.tsx @@ -141,6 +141,14 @@ function RootDocument({ children }: { children: React.ReactNode }) { > Scripts {' '} + + Async Scripts + {' '} ({ + scripts: [ + { + src: 'script.js', + async: true, + }, + { + src: 'script2.js', + defer: true, + }, + ], + }), + component: AsyncScriptsComponent, +}) + +function AsyncScriptsComponent() { + return ( +
This page tests scripts with async and defer attributes.
+