Skip to content

Commit b12398d

Browse files
committed
chore: rename via-loaders to via-loader-with-context
1 parent 366e4af commit b12398d

9 files changed

Lines changed: 59 additions & 63 deletions

File tree

e2e/react-start/basic/src/routeTree.gen.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Route as SearchParamsLoaderThrowsRedirectRouteImport } from './routes/s
3333
import { Route as SearchParamsDefaultRouteImport } from './routes/search-params/default'
3434
import { Route as RedirectTargetRouteImport } from './routes/redirect/$target'
3535
import { Route as PostsPostIdRouteImport } from './routes/posts.$postId'
36-
import { Route as NotFoundViaLoadersRouteImport } from './routes/not-found/via-loaders'
36+
import { Route as NotFoundViaLoaderWithContextRouteImport } from './routes/not-found/via-loader-with-context'
3737
import { Route as NotFoundViaLoaderRouteImport } from './routes/not-found/via-loader'
3838
import { Route as NotFoundViaHeadRouteImport } from './routes/not-found/via-head'
3939
import { Route as NotFoundViaBeforeLoadRouteImport } from './routes/not-found/via-beforeLoad'
@@ -166,11 +166,12 @@ const PostsPostIdRoute = PostsPostIdRouteImport.update({
166166
path: '/$postId',
167167
getParentRoute: () => PostsRoute,
168168
} as any)
169-
const NotFoundViaLoadersRoute = NotFoundViaLoadersRouteImport.update({
170-
id: '/via-loaders',
171-
path: '/via-loaders',
172-
getParentRoute: () => NotFoundRouteRoute,
173-
} as any)
169+
const NotFoundViaLoaderWithContextRoute =
170+
NotFoundViaLoaderWithContextRouteImport.update({
171+
id: '/via-loader-with-context',
172+
path: '/via-loader-with-context',
173+
getParentRoute: () => NotFoundRouteRoute,
174+
} as any)
174175
const NotFoundViaLoaderRoute = NotFoundViaLoaderRouteImport.update({
175176
id: '/via-loader',
176177
path: '/via-loader',
@@ -286,7 +287,7 @@ export interface FileRoutesByFullPath {
286287
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
287288
'/not-found/via-head': typeof NotFoundViaHeadRoute
288289
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
289-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
290+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
290291
'/posts/$postId': typeof PostsPostIdRoute
291292
'/redirect/$target': typeof RedirectTargetRouteWithChildren
292293
'/search-params/default': typeof SearchParamsDefaultRoute
@@ -323,7 +324,7 @@ export interface FileRoutesByTo {
323324
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
324325
'/not-found/via-head': typeof NotFoundViaHeadRoute
325326
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
326-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
327+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
327328
'/posts/$postId': typeof PostsPostIdRoute
328329
'/search-params/default': typeof SearchParamsDefaultRoute
329330
'/search-params/loader-throws-redirect': typeof SearchParamsLoaderThrowsRedirectRoute
@@ -365,7 +366,7 @@ export interface FileRoutesById {
365366
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
366367
'/not-found/via-head': typeof NotFoundViaHeadRoute
367368
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
368-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
369+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
369370
'/posts/$postId': typeof PostsPostIdRoute
370371
'/redirect/$target': typeof RedirectTargetRouteWithChildren
371372
'/search-params/default': typeof SearchParamsDefaultRoute
@@ -409,7 +410,7 @@ export interface FileRouteTypes {
409410
| '/not-found/via-beforeLoad'
410411
| '/not-found/via-head'
411412
| '/not-found/via-loader'
412-
| '/not-found/via-loaders'
413+
| '/not-found/via-loader-with-context'
413414
| '/posts/$postId'
414415
| '/redirect/$target'
415416
| '/search-params/default'
@@ -446,7 +447,7 @@ export interface FileRouteTypes {
446447
| '/not-found/via-beforeLoad'
447448
| '/not-found/via-head'
448449
| '/not-found/via-loader'
449-
| '/not-found/via-loaders'
450+
| '/not-found/via-loader-with-context'
450451
| '/posts/$postId'
451452
| '/search-params/default'
452453
| '/search-params/loader-throws-redirect'
@@ -487,7 +488,7 @@ export interface FileRouteTypes {
487488
| '/not-found/via-beforeLoad'
488489
| '/not-found/via-head'
489490
| '/not-found/via-loader'
490-
| '/not-found/via-loaders'
491+
| '/not-found/via-loader-with-context'
491492
| '/posts/$postId'
492493
| '/redirect/$target'
493494
| '/search-params/default'
@@ -690,11 +691,11 @@ declare module '@tanstack/react-router' {
690691
preLoaderRoute: typeof PostsPostIdRouteImport
691692
parentRoute: typeof PostsRoute
692693
}
693-
'/not-found/via-loaders': {
694-
id: '/not-found/via-loaders'
695-
path: '/via-loaders'
696-
fullPath: '/not-found/via-loaders'
697-
preLoaderRoute: typeof NotFoundViaLoadersRouteImport
694+
'/not-found/via-loader-with-context': {
695+
id: '/not-found/via-loader-with-context'
696+
path: '/via-loader-with-context'
697+
fullPath: '/not-found/via-loader-with-context'
698+
preLoaderRoute: typeof NotFoundViaLoaderWithContextRouteImport
698699
parentRoute: typeof NotFoundRouteRoute
699700
}
700701
'/not-found/via-loader': {
@@ -837,15 +838,15 @@ interface NotFoundRouteRouteChildren {
837838
NotFoundViaBeforeLoadRoute: typeof NotFoundViaBeforeLoadRoute
838839
NotFoundViaHeadRoute: typeof NotFoundViaHeadRoute
839840
NotFoundViaLoaderRoute: typeof NotFoundViaLoaderRoute
840-
NotFoundViaLoadersRoute: typeof NotFoundViaLoadersRoute
841+
NotFoundViaLoaderWithContextRoute: typeof NotFoundViaLoaderWithContextRoute
841842
NotFoundIndexRoute: typeof NotFoundIndexRoute
842843
}
843844

844845
const NotFoundRouteRouteChildren: NotFoundRouteRouteChildren = {
845846
NotFoundViaBeforeLoadRoute: NotFoundViaBeforeLoadRoute,
846847
NotFoundViaHeadRoute: NotFoundViaHeadRoute,
847848
NotFoundViaLoaderRoute: NotFoundViaLoaderRoute,
848-
NotFoundViaLoadersRoute: NotFoundViaLoadersRoute,
849+
NotFoundViaLoaderWithContextRoute: NotFoundViaLoaderWithContextRoute,
849850
NotFoundIndexRoute: NotFoundIndexRoute,
850851
}
851852

e2e/react-start/basic/src/routes/not-found/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export const Route = createFileRoute('/not-found/')({
3838
<div className="mb-2">
3939
<Link
4040
from={Route.fullPath}
41-
to="./via-loaders"
41+
to="./via-loader-with-context"
4242
preload={preload}
43-
data-testid="via-loaders"
43+
data-testid="via-loader-with-context"
4444
>
45-
via-loaders
45+
via-loader-with-context
4646
</Link>
4747
</div>
4848
</div>

e2e/react-start/basic/src/routes/not-found/via-loaders.tsx renamed to e2e/react-start/basic/src/routes/not-found/via-loader-with-context.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createFileRoute, notFound, useRouteContext } from '@tanstack/react-router'
22

3-
export const Route = createFileRoute('/not-found/via-loaders')({
3+
export const Route = createFileRoute('/not-found/via-loader-with-context')({
44
beforeLoad: () => {
55
return {
66
fool: 'of a Took'
@@ -9,14 +9,11 @@ export const Route = createFileRoute('/not-found/via-loaders')({
99
loader: () => {
1010
throw notFound()
1111
},
12-
head: () => {
13-
throw notFound()
14-
},
1512
component: RouteComponent,
1613
notFoundComponent: () => {
1714
const context = useRouteContext({ strict: false })
1815
return (
19-
<div data-testid="via-loaders-notFound-component" data-server={typeof window}>
16+
<div data-testid="via-loader-with-context-notFound-component" data-server={typeof window}>
2017
{`Hello you fool ${context.fool}`}
2118
</div>
2219
)
@@ -25,8 +22,8 @@ export const Route = createFileRoute('/not-found/via-loaders')({
2522

2623
function RouteComponent() {
2724
return (
28-
<div data-testid="via-loaders-route-component" data-server={typeof window}>
29-
Hello "/not-found/via-loaders"!
25+
<div data-testid="via-loader-with-context-route-component" data-server={typeof window}>
26+
Hello "/not-found/via-loader-with-context"!
3027
</div>
3128
)
3229
}

e2e/react-start/basic/tests/not-found.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test.describe('not-found', () => {
2525

2626
test.describe('throw notFound()', () => {
2727
const navigationTestMatrix = combinate({
28-
thrower: ['beforeLoad', 'head', 'loader', 'loaders'] as const,
28+
thrower: ['beforeLoad', 'head', 'loader', 'loader-with-context'] as const,
2929
preload: [false, true] as const,
3030
})
3131

@@ -55,7 +55,7 @@ test.describe('not-found', () => {
5555
})
5656
})
5757
const directVisitTestMatrix = combinate({
58-
thrower: ['beforeLoad', 'head', 'loader', 'loaders'] as const,
58+
thrower: ['beforeLoad', 'head', 'loader', 'loader-with-context'] as const,
5959
})
6060

6161
directVisitTestMatrix.forEach(({ thrower }) => {

e2e/react-start/basic/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const prerenderConfiguration = {
2222
'/not-found/via-beforeLoad',
2323
'/not-found/via-head',
2424
'/not-found/via-loader',
25-
'/not-found/via-loaders',
25+
'/not-found/via-loader-with-context',
2626
].some((p) => page.path.includes(p)),
2727
maxRedirects: 100,
2828
}

e2e/solid-start/basic/src/routeTree.gen.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Route as SearchParamsLoaderThrowsRedirectRouteImport } from './routes/s
3131
import { Route as SearchParamsDefaultRouteImport } from './routes/search-params/default'
3232
import { Route as RedirectTargetRouteImport } from './routes/redirect/$target'
3333
import { Route as PostsPostIdRouteImport } from './routes/posts.$postId'
34-
import { Route as NotFoundViaLoadersRouteImport } from './routes/not-found/via-loaders'
34+
import { Route as NotFoundViaLoaderWithContextRouteImport } from './routes/not-found/via-loader-with-context'
3535
import { Route as NotFoundViaLoaderRouteImport } from './routes/not-found/via-loader'
3636
import { Route as NotFoundViaHeadRouteImport } from './routes/not-found/via-head'
3737
import { Route as NotFoundViaBeforeLoadRouteImport } from './routes/not-found/via-beforeLoad'
@@ -160,11 +160,12 @@ const PostsPostIdRoute = PostsPostIdRouteImport.update({
160160
path: '/$postId',
161161
getParentRoute: () => PostsRoute,
162162
} as any)
163-
const NotFoundViaLoadersRoute = NotFoundViaLoadersRouteImport.update({
164-
id: '/via-loaders',
165-
path: '/via-loaders',
166-
getParentRoute: () => NotFoundRouteRoute,
167-
} as any)
163+
const NotFoundViaLoaderWithContextRoute =
164+
NotFoundViaLoaderWithContextRouteImport.update({
165+
id: '/via-loader-with-context',
166+
path: '/via-loader-with-context',
167+
getParentRoute: () => NotFoundRouteRoute,
168+
} as any)
168169
const NotFoundViaLoaderRoute = NotFoundViaLoaderRouteImport.update({
169170
id: '/via-loader',
170171
path: '/via-loader',
@@ -266,7 +267,7 @@ export interface FileRoutesByFullPath {
266267
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
267268
'/not-found/via-head': typeof NotFoundViaHeadRoute
268269
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
269-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
270+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
270271
'/posts/$postId': typeof PostsPostIdRoute
271272
'/redirect/$target': typeof RedirectTargetRouteWithChildren
272273
'/search-params/default': typeof SearchParamsDefaultRoute
@@ -301,7 +302,7 @@ export interface FileRoutesByTo {
301302
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
302303
'/not-found/via-head': typeof NotFoundViaHeadRoute
303304
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
304-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
305+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
305306
'/posts/$postId': typeof PostsPostIdRoute
306307
'/search-params/default': typeof SearchParamsDefaultRoute
307308
'/search-params/loader-throws-redirect': typeof SearchParamsLoaderThrowsRedirectRoute
@@ -342,7 +343,7 @@ export interface FileRoutesById {
342343
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
343344
'/not-found/via-head': typeof NotFoundViaHeadRoute
344345
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
345-
'/not-found/via-loaders': typeof NotFoundViaLoadersRoute
346+
'/not-found/via-loader-with-context': typeof NotFoundViaLoaderWithContextRoute
346347
'/posts/$postId': typeof PostsPostIdRoute
347348
'/redirect/$target': typeof RedirectTargetRouteWithChildren
348349
'/search-params/default': typeof SearchParamsDefaultRoute
@@ -383,7 +384,7 @@ export interface FileRouteTypes {
383384
| '/not-found/via-beforeLoad'
384385
| '/not-found/via-head'
385386
| '/not-found/via-loader'
386-
| '/not-found/via-loaders'
387+
| '/not-found/via-loader-with-context'
387388
| '/posts/$postId'
388389
| '/redirect/$target'
389390
| '/search-params/default'
@@ -418,7 +419,7 @@ export interface FileRouteTypes {
418419
| '/not-found/via-beforeLoad'
419420
| '/not-found/via-head'
420421
| '/not-found/via-loader'
421-
| '/not-found/via-loaders'
422+
| '/not-found/via-loader-with-context'
422423
| '/posts/$postId'
423424
| '/search-params/default'
424425
| '/search-params/loader-throws-redirect'
@@ -458,7 +459,7 @@ export interface FileRouteTypes {
458459
| '/not-found/via-beforeLoad'
459460
| '/not-found/via-head'
460461
| '/not-found/via-loader'
461-
| '/not-found/via-loaders'
462+
| '/not-found/via-loader-with-context'
462463
| '/posts/$postId'
463464
| '/redirect/$target'
464465
| '/search-params/default'
@@ -657,11 +658,11 @@ declare module '@tanstack/solid-router' {
657658
preLoaderRoute: typeof PostsPostIdRouteImport
658659
parentRoute: typeof PostsRoute
659660
}
660-
'/not-found/via-loaders': {
661-
id: '/not-found/via-loaders'
662-
path: '/via-loaders'
663-
fullPath: '/not-found/via-loaders'
664-
preLoaderRoute: typeof NotFoundViaLoadersRouteImport
661+
'/not-found/via-loader-with-context': {
662+
id: '/not-found/via-loader-with-context'
663+
path: '/via-loader-with-context'
664+
fullPath: '/not-found/via-loader-with-context'
665+
preLoaderRoute: typeof NotFoundViaLoaderWithContextRouteImport
665666
parentRoute: typeof NotFoundRouteRoute
666667
}
667668
'/not-found/via-loader': {
@@ -783,15 +784,15 @@ interface NotFoundRouteRouteChildren {
783784
NotFoundViaBeforeLoadRoute: typeof NotFoundViaBeforeLoadRoute
784785
NotFoundViaHeadRoute: typeof NotFoundViaHeadRoute
785786
NotFoundViaLoaderRoute: typeof NotFoundViaLoaderRoute
786-
NotFoundViaLoadersRoute: typeof NotFoundViaLoadersRoute
787+
NotFoundViaLoaderWithContextRoute: typeof NotFoundViaLoaderWithContextRoute
787788
NotFoundIndexRoute: typeof NotFoundIndexRoute
788789
}
789790

790791
const NotFoundRouteRouteChildren: NotFoundRouteRouteChildren = {
791792
NotFoundViaBeforeLoadRoute: NotFoundViaBeforeLoadRoute,
792793
NotFoundViaHeadRoute: NotFoundViaHeadRoute,
793794
NotFoundViaLoaderRoute: NotFoundViaLoaderRoute,
794-
NotFoundViaLoadersRoute: NotFoundViaLoadersRoute,
795+
NotFoundViaLoaderWithContextRoute: NotFoundViaLoaderWithContextRoute,
795796
NotFoundIndexRoute: NotFoundIndexRoute,
796797
}
797798

e2e/solid-start/basic/src/routes/not-found/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export const Route = createFileRoute('/not-found/')({
3838
<div class="mb-2">
3939
<Link
4040
from={Route.fullPath}
41-
to="./via-loaders"
41+
to="./via-loader-with-context"
4242
preload={preload()}
43-
data-testid="via-loaders"
43+
data-testid="via-loader-with-context"
4444
>
45-
via-loaders
45+
via-loader-with-context
4646
</Link>
4747
</div>
4848
</div>

e2e/solid-start/basic/src/routes/not-found/via-loaders.tsx renamed to e2e/solid-start/basic/src/routes/not-found/via-loader-with-context.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createFileRoute, notFound, useRouteContext } from '@tanstack/solid-router'
22

3-
export const Route = createFileRoute('/not-found/via-loaders')({
3+
export const Route = createFileRoute('/not-found/via-loader-with-context')({
44
beforeLoad: () => {
55
return {
66
fool: 'of a Took'
@@ -9,14 +9,11 @@ export const Route = createFileRoute('/not-found/via-loaders')({
99
loader: () => {
1010
throw notFound()
1111
},
12-
head: () => {
13-
throw notFound()
14-
},
1512
component: RouteComponent,
1613
notFoundComponent: () => {
1714
const context = useRouteContext({ strict: false })
1815
return (
19-
<div data-testid="via-loaders-notFound-component" data-server={typeof window}>
16+
<div data-testid="via-loader-with-context-notFound-component" data-server={typeof window}>
2017
{`Hello you fool ${context().fool}`}
2118
</div>
2219
)
@@ -25,8 +22,8 @@ export const Route = createFileRoute('/not-found/via-loaders')({
2522

2623
function RouteComponent() {
2724
return (
28-
<div data-testid="via-loaders-route-component" data-server={typeof window}>
29-
Hello "/not-found/via-loaders"!
25+
<div data-testid="via-loader-with-context-route-component" data-server={typeof window}>
26+
Hello "/not-found/via-loader-with-context"!
3027
</div>
3128
)
3229
}

e2e/solid-start/basic/tests/not-found.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test.describe('not-found', () => {
2626
test.describe('throw notFound()', () => {
2727
const navigationTestMatrix = combinate({
2828
// TODO beforeLoad!
29-
thrower: [/* 'beforeLoad',*/ 'head', 'loader', 'loaders'] as const,
29+
thrower: [/* 'beforeLoad',*/ 'head', 'loader', 'loader-with-context'] as const,
3030
preload: [false, true] as const,
3131
})
3232

@@ -56,7 +56,7 @@ test.describe('not-found', () => {
5656
})
5757
const directVisitTestMatrix = combinate({
5858
// TODO beforeLoad!
59-
thrower: [/* 'beforeLoad',*/ 'head', 'loader', 'loaders'] as const,
59+
thrower: [/* 'beforeLoad',*/ 'head', 'loader', 'loader-with-context'] as const,
6060
})
6161

6262
directVisitTestMatrix.forEach(({ thrower }) => {

0 commit comments

Comments
 (0)