From 17f67eeb5304c3218e3ba5fa7fe6235087e79342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sat, 12 Jul 2025 04:40:31 +0200 Subject: [PATCH] Tests --- .../dfef8bd1830fa25b780317b9e88c0651 | 9 +++++++ packages/example/src/routeTree.gen.ts | 24 ++++++++++++++++--- packages/example/src/routes/dev/memo.tsx | 17 +++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 packages/example/.tanstack/tmp/router-generator-K3vMsf/dfef8bd1830fa25b780317b9e88c0651 create mode 100644 packages/example/src/routes/dev/memo.tsx diff --git a/packages/example/.tanstack/tmp/router-generator-K3vMsf/dfef8bd1830fa25b780317b9e88c0651 b/packages/example/.tanstack/tmp/router-generator-K3vMsf/dfef8bd1830fa25b780317b9e88c0651 new file mode 100644 index 0000000..36ccbf1 --- /dev/null +++ b/packages/example/.tanstack/tmp/router-generator-K3vMsf/dfef8bd1830fa25b780317b9e88c0651 @@ -0,0 +1,9 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/dev/memo')({ + component: RouteComponent, +}) + +function RouteComponent() { + return
Hello "/dev/memo"!
+} diff --git a/packages/example/src/routeTree.gen.ts b/packages/example/src/routeTree.gen.ts index 636e476..a908e92 100644 --- a/packages/example/src/routeTree.gen.ts +++ b/packages/example/src/routeTree.gen.ts @@ -11,6 +11,7 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as BlankRouteImport } from './routes/blank' import { Route as IndexRouteImport } from './routes/index' +import { Route as DevMemoRouteImport } from './routes/dev/memo' import { Route as DevAsyncRenderingRouteImport } from './routes/dev/async-rendering' const BlankRoute = BlankRouteImport.update({ @@ -23,6 +24,11 @@ const IndexRoute = IndexRouteImport.update({ path: '/', getParentRoute: () => rootRouteImport, } as any) +const DevMemoRoute = DevMemoRouteImport.update({ + id: '/dev/memo', + path: '/dev/memo', + getParentRoute: () => rootRouteImport, +} as any) const DevAsyncRenderingRoute = DevAsyncRenderingRouteImport.update({ id: '/dev/async-rendering', path: '/dev/async-rendering', @@ -33,30 +39,34 @@ export interface FileRoutesByFullPath { '/': typeof IndexRoute '/blank': typeof BlankRoute '/dev/async-rendering': typeof DevAsyncRenderingRoute + '/dev/memo': typeof DevMemoRoute } export interface FileRoutesByTo { '/': typeof IndexRoute '/blank': typeof BlankRoute '/dev/async-rendering': typeof DevAsyncRenderingRoute + '/dev/memo': typeof DevMemoRoute } export interface FileRoutesById { __root__: typeof rootRouteImport '/': typeof IndexRoute '/blank': typeof BlankRoute '/dev/async-rendering': typeof DevAsyncRenderingRoute + '/dev/memo': typeof DevMemoRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' | '/blank' | '/dev/async-rendering' + fullPaths: '/' | '/blank' | '/dev/async-rendering' | '/dev/memo' fileRoutesByTo: FileRoutesByTo - to: '/' | '/blank' | '/dev/async-rendering' - id: '__root__' | '/' | '/blank' | '/dev/async-rendering' + to: '/' | '/blank' | '/dev/async-rendering' | '/dev/memo' + id: '__root__' | '/' | '/blank' | '/dev/async-rendering' | '/dev/memo' fileRoutesById: FileRoutesById } export interface RootRouteChildren { IndexRoute: typeof IndexRoute BlankRoute: typeof BlankRoute DevAsyncRenderingRoute: typeof DevAsyncRenderingRoute + DevMemoRoute: typeof DevMemoRoute } declare module '@tanstack/react-router' { @@ -75,6 +85,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexRouteImport parentRoute: typeof rootRouteImport } + '/dev/memo': { + id: '/dev/memo' + path: '/dev/memo' + fullPath: '/dev/memo' + preLoaderRoute: typeof DevMemoRouteImport + parentRoute: typeof rootRouteImport + } '/dev/async-rendering': { id: '/dev/async-rendering' path: '/dev/async-rendering' @@ -89,6 +106,7 @@ const rootRouteChildren: RootRouteChildren = { IndexRoute: IndexRoute, BlankRoute: BlankRoute, DevAsyncRenderingRoute: DevAsyncRenderingRoute, + DevMemoRoute: DevMemoRoute, } export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) diff --git a/packages/example/src/routes/dev/memo.tsx b/packages/example/src/routes/dev/memo.tsx new file mode 100644 index 0000000..e2e2bdd --- /dev/null +++ b/packages/example/src/routes/dev/memo.tsx @@ -0,0 +1,17 @@ +import { runtime } from "@/runtime" +import { createFileRoute } from "@tanstack/react-router" +import { Component } from "effect-fc" + + +const RouteComponent = Component.make(function*() { + return <> +}).pipe( + Component.withRuntime(runtime.context) +) + + + + +export const Route = createFileRoute("/dev/memo")({ + component: RouteComponent, +})