Skip to content
24 changes: 18 additions & 6 deletions e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import * as Solid from 'solid-js'
import { Outlet, createRootRoute } from '@tanstack/solid-router'
import {
HeadContent,
Outlet,
Scripts,
createRootRoute,
} from '@tanstack/solid-router'
import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
import { HydrationScript } from 'solid-js/web'

export const Route = createRootRoute({
head: () => ({
Expand All @@ -22,9 +27,16 @@ export const Route = createRootRoute({

function RootComponent() {
return (
<>
<Outlet />
<TanStackRouterDevtools position="bottom-right" />
</>
<html>
<head>
<HydrationScript />
</head>
<body>
<HeadContent />
<Outlet />
<TanStackRouterDevtools position="bottom-right" />
<Scripts />
</body>
</html>
)
}
6 changes: 4 additions & 2 deletions e2e/solid-start/basic/src/client.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// DO NOT DELETE THIS FILE!!!
// This file is a good smoke test to make sure the custom client entry is working
import { hydrate } from 'solid-js/web'
import { StartClient } from '@tanstack/solid-start/client'
import { StartClient, hydrateStart } from '@tanstack/solid-start/client'

console.log("[client-entry]: using custom client entry in 'src/client.tsx'")

hydrate(() => <StartClient />, document.body)
hydrateStart().then((router) => {
hydrate(() => <StartClient router={router} />, document)
})
178 changes: 96 additions & 82 deletions e2e/solid-start/basic/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
/// <reference types="vite/client" />
import { Link, Outlet, createRootRoute } from '@tanstack/solid-router'
import {
HeadContent,
Link,
Outlet,
Scripts,
createRootRoute,
} from '@tanstack/solid-router'

import { TanStackRouterDevtoolsInProd } from '@tanstack/solid-router-devtools'
import { HydrationScript } from 'solid-js/web'
import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
import { seo } from '~/utils/seo'
Expand Down Expand Up @@ -60,86 +67,93 @@ export const Route = createRootRoute({

function RootComponent() {
return (
<>
<div class="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
class: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>{' '}
<Link
to="/posts"
activeProps={{
class: 'font-bold',
}}
>
Posts
</Link>{' '}
<Link
to="/users"
activeProps={{
class: 'font-bold',
}}
>
Users
</Link>{' '}
<Link
to="/layout-a"
activeProps={{
class: 'font-bold',
}}
>
Layout
</Link>{' '}
<Link
to="/scripts"
activeProps={{
class: 'font-bold',
}}
>
Scripts
</Link>{' '}
<Link
to="/inline-scripts"
activeProps={{
class: 'font-bold',
}}
>
Inline Scripts
</Link>{' '}
<Link
to="/deferred"
activeProps={{
class: 'font-bold',
}}
>
Deferred
</Link>{' '}
<Link
to="/redirect"
activeProps={{
class: 'font-bold',
}}
>
redirect
</Link>{' '}
<Link
// @ts-expect-error
to="/this-route-does-not-exist"
activeProps={{
class: 'font-bold',
}}
>
This Route Does Not Exist
</Link>
</div>
<Outlet />
<div class="inline-div">This is an inline styled div</div>
<TanStackRouterDevtoolsInProd />
</>
<html>
<head>
<HydrationScript />
</head>
<body>
<HeadContent />
<div class="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
class: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>{' '}
<Link
to="/posts"
activeProps={{
class: 'font-bold',
}}
>
Posts
</Link>{' '}
<Link
to="/users"
activeProps={{
class: 'font-bold',
}}
>
Users
</Link>{' '}
<Link
to="/layout-a"
activeProps={{
class: 'font-bold',
}}
>
Layout
</Link>{' '}
<Link
to="/scripts"
activeProps={{
class: 'font-bold',
}}
>
Scripts
</Link>{' '}
<Link
to="/inline-scripts"
activeProps={{
class: 'font-bold',
}}
>
Inline Scripts
</Link>{' '}
<Link
to="/deferred"
activeProps={{
class: 'font-bold',
}}
>
Deferred
</Link>{' '}
<Link
to="/redirect"
activeProps={{
class: 'font-bold',
}}
>
redirect
</Link>{' '}
<Link
// @ts-expect-error
to="/this-route-does-not-exist"
activeProps={{
class: 'font-bold',
}}
>
This Route Does Not Exist
</Link>
</div>
<Outlet />
<div class="inline-div">This is an inline styled div</div>
<TanStackRouterDevtoolsInProd />
<Scripts />
</body>
</html>
)
}
6 changes: 3 additions & 3 deletions e2e/solid-start/basic/src/routes/stream.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Await, createFileRoute } from '@tanstack/solid-router'
import { createEffect, createSignal } from 'solid-js'
import { createEffect, createSignal, Suspense } from 'solid-js'

export const Route = createFileRoute('/stream')({
component: Home,
Expand Down Expand Up @@ -45,7 +45,7 @@ function Home() {
})

return (
<>
<Suspense>
<Await
promise={loaderData().promise}
children={(promiseData) => (
Expand All @@ -59,6 +59,6 @@ function Home() {
</div>
)}
/>
</>
</Suspense>
)
}
112 changes: 63 additions & 49 deletions e2e/solid-start/custom-basepath/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { Link, Outlet, createRootRoute } from '@tanstack/solid-router'
import {
HeadContent,
Link,
Outlet,
Scripts,
createRootRoute,
} from '@tanstack/solid-router'

import { TanStackRouterDevtoolsInProd } from '@tanstack/solid-router-devtools'
import { HydrationScript } from 'solid-js/web'
import { NotFound } from '~/components/NotFound'
import appCss from '~/styles/app.css?url'
import { seo } from '~/utils/seo'
Expand Down Expand Up @@ -48,53 +55,60 @@ export const Route = createRootRoute({

function RootComponent() {
return (
<>
<div class="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
class: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>{' '}
<Link
to="/posts"
activeProps={{
class: 'font-bold',
}}
>
Posts
</Link>{' '}
<Link
to="/users"
activeProps={{
class: 'font-bold',
}}
>
Users
</Link>{' '}
<Link
to="/deferred"
activeProps={{
class: 'font-bold',
}}
>
Deferred
</Link>{' '}
<Link
// @ts-expect-error
to="/this-route-does-not-exist"
activeProps={{
class: 'font-bold',
}}
>
This Route Does Not Exist
</Link>
</div>
<Outlet />
<TanStackRouterDevtoolsInProd />
</>
<html>
<head>
<HydrationScript />
</head>
<body>
<HeadContent />
<div class="p-2 flex gap-2 text-lg">
<Link
to="/"
activeProps={{
class: 'font-bold',
}}
activeOptions={{ exact: true }}
>
Home
</Link>{' '}
<Link
to="/posts"
activeProps={{
class: 'font-bold',
}}
>
Posts
</Link>{' '}
<Link
to="/users"
activeProps={{
class: 'font-bold',
}}
>
Users
</Link>{' '}
<Link
to="/deferred"
activeProps={{
class: 'font-bold',
}}
>
Deferred
</Link>{' '}
<Link
// @ts-expect-error
to="/this-route-does-not-exist"
activeProps={{
class: 'font-bold',
}}
>
This Route Does Not Exist
</Link>
</div>
<Outlet />
<TanStackRouterDevtoolsInProd />
<Scripts />
</body>
</html>
)
}
Loading
Loading