Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/start/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@
{
"label": "Cloudflare Vite Plugin",
"to": "framework/solid/examples/start-basic-cloudflare"
},
{
"label": "Cloudflare Vite Plugin",
"to": "framework/solid/examples/start-basic-netlify"
Comment on lines +333 to +335
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the incorrect label for the Netlify example.

The label says "Cloudflare Vite Plugin" but points to start-basic-netlify. This creates a duplicate label (line 330 already has "Cloudflare Vite Plugin") and misrepresents the example's purpose.

Apply this diff to correct the label:

             {
-              "label": "Cloudflare Vite Plugin",
+              "label": "Netlify Vite Plugin",
               "to": "framework/solid/examples/start-basic-netlify"
             }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"label": "Cloudflare Vite Plugin",
"to": "framework/solid/examples/start-basic-netlify"
{
"label": "Netlify Vite Plugin",
"to": "framework/solid/examples/start-basic-netlify"
🤖 Prompt for AI Agents
In docs/start/config.json around lines 333 to 335, the menu item incorrectly
uses the label "Cloudflare Vite Plugin" while linking to the Netlify example;
update the label to "Netlify" (or "Netlify Example"/"Netlify Adapter" per repo
convention) so it correctly describes the target and avoids duplicating the
Cloudflare label; keep the "to" value as
"framework/solid/examples/start-basic-netlify".

}
]
}
Expand Down
3 changes: 3 additions & 0 deletions docs/start/framework/react/guide/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ Add a `netlify.toml` file to your project root:
[build]
command = "vite build"
publish = "dist/client"
[dev]
command = "vite dev"
port = 3000
```

Deploy your application using their one-click deployment process, and you're ready to go!
Expand Down
3 changes: 3 additions & 0 deletions docs/start/framework/solid/guide/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ Add a `netlify.toml` file to your project root:
[build]
command = "vite build"
publish = "dist/client"
[dev]
command = "vite dev"
port = 3000
```

Deploy your application using their one-click deployment process, and you're ready to go!
Expand Down
9 changes: 9 additions & 0 deletions examples/solid/start-basic-netlify/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.DS_Store
.cache
.env
dist
.wrangler

# Local Netlify folder
.netlify
4 changes: 4 additions & 0 deletions examples/solid/start-basic-netlify/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/public
pnpm-lock.yaml
routeTree.gen.ts
worker-configuration.d.ts
11 changes: 11 additions & 0 deletions examples/solid/start-basic-netlify/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.watcherExclude": {
"**/routeTree.gen.ts": true
},
"search.exclude": {
"**/routeTree.gen.ts": true
},
"files.readonlyInclude": {
"**/routeTree.gen.ts": true
}
}
37 changes: 37 additions & 0 deletions examples/solid/start-basic-netlify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Start Basic Netlify

## Getting Started

### Install the dependencies

```bash
pnpm i
```

### Start the development server

```bash
pnpm dev
```

### Build for Production

```bash
pnpm build
```

### Deploy to Netlify

```sh
netlify deploy
```

## Accessing bindings

You can access Cloudflare bindings in server functions by using importable `env`:

```ts
import { env } from 'cloudflare:workers'
```

See `src/routes/index.tsx` for an example.
6 changes: 6 additions & 0 deletions examples/solid/start-basic-netlify/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "vite build"
publish = "dist/client"
[dev]
command = "vite dev"
port = 3000
29 changes: 29 additions & 0 deletions examples/solid/start-basic-netlify/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "tanstack-solid-start-example-basic-netlify",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build && tsc --noEmit",
"preview": "vite preview"
},
"dependencies": {
"@tanstack/solid-router": "^1.133.20",
"@tanstack/solid-router-devtools": "^1.133.20",
"@tanstack/solid-start": "^1.133.20",
"solid-js": "^1.9.5"
},
"devDependencies": {
"@netlify/vite-plugin-tanstack-start": "^1.1.4",
"@types/node": "^22.5.4",
"vite-plugin-solid": "^2.11.10",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^7.1.7",
"vite-tsconfig-paths": "^5.1.4",
"wrangler": "^4.40.2"
}
}
6 changes: 6 additions & 0 deletions examples/solid/start-basic-netlify/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions examples/solid/start-basic-netlify/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {
ErrorComponent,
Link,
rootRouteId,
useMatch,
useRouter,
} from '@tanstack/solid-router'
import type { ErrorComponentProps } from '@tanstack/solid-router'

export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
const router = useRouter()
const isRoot = useMatch({
strict: false,
select: (state) => state.id === rootRouteId,
})

console.error('DefaultCatchBoundary Error:', error)

return (
<div class="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
<ErrorComponent error={error} />
<div class="flex gap-2 items-center flex-wrap">
<button
onClick={() => {
router.invalidate()
}}
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Try Again
</button>
{isRoot() ? (
<Link
to="/"
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Home
</Link>
) : (
<Link
to="/"
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
onClick={(e) => {
e.preventDefault()
window.history.back()
}}
>
Go Back
</Link>
)}
</div>
</div>
)
}
25 changes: 25 additions & 0 deletions examples/solid/start-basic-netlify/src/components/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from '@tanstack/solid-router'

export function NotFound({ children }: { children?: any }) {
return (
<div class="space-y-2 p-2">
<div class="text-gray-600 dark:text-gray-400">
{children || <p>The page you are looking for does not exist.</p>}
</div>
<p class="flex items-center gap-2 flex-wrap">
<button
onClick={() => window.history.back()}
class="bg-emerald-500 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Go back
</button>
<Link
to="/"
class="bg-cyan-600 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Start Over
</Link>
</p>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ErrorComponent } from '@tanstack/solid-router'
import type { ErrorComponentProps } from '@tanstack/solid-router'

export function PostErrorComponent({ error }: ErrorComponentProps) {
return <ErrorComponent error={error} />
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ErrorComponent } from '@tanstack/solid-router'
import type { ErrorComponentProps } from '@tanstack/solid-router'

export function UserErrorComponent({ error }: ErrorComponentProps) {
return <ErrorComponent error={error} />
}
Loading
Loading