From 971b5998a0c98ad19232791adc5205479bf93dab Mon Sep 17 00:00:00 2001 From: Brenley Dueck Date: Wed, 17 Dec 2025 18:44:36 -0600 Subject: [PATCH 1/4] feat: add migrating to v2 solid-start guide --- src/routes/solid-router/concepts/data.json | 1 - src/routes/solid-start/data.json | 1 + src/routes/solid-start/migrating-from-v1.mdx | 108 +++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/routes/solid-start/migrating-from-v1.mdx diff --git a/src/routes/solid-router/concepts/data.json b/src/routes/solid-router/concepts/data.json index 835a9fb96..8cef16056 100644 --- a/src/routes/solid-router/concepts/data.json +++ b/src/routes/solid-router/concepts/data.json @@ -8,7 +8,6 @@ "nesting.mdx", "layouts.mdx", "alternative-routers.mdx", - "queries.mdx", "actions.mdx" ] } diff --git a/src/routes/solid-start/data.json b/src/routes/solid-start/data.json index aac47ac2c..7457ff697 100644 --- a/src/routes/solid-start/data.json +++ b/src/routes/solid-start/data.json @@ -3,6 +3,7 @@ "pages": [ "index.mdx", "getting-started.mdx", + "migrating-from-v1.mdx", "building-your-application", "advanced", "guides" diff --git a/src/routes/solid-start/migrating-from-v1.mdx b/src/routes/solid-start/migrating-from-v1.mdx new file mode 100644 index 000000000..799984204 --- /dev/null +++ b/src/routes/solid-start/migrating-from-v1.mdx @@ -0,0 +1,108 @@ +--- +title: Migrating from v1 +use_cases: >- + existing project, migration, upgrade +tags: + - setup + - installation + - starter + - template + - quickstart + - init +version: '2.0' +description: >- + Migrate your SolidStart project from v1 to v2. +--- + +This is a migration guide of how to upgrade your v1 SolidStart app to our new v2 version. + +Please note that some third-party packages may not be compatible with v2 yet. + +## Migration steps + +**1. Update your project to use the latest version of SolidStart** + +```package-install +@solidjs/start@alpha +``` + +**2. Rename `app.config.ts` to `vite.config.ts`** + +**3. Update`vite.config.ts`** + +v2 ships as a native vite plugin using the environment api instead of vinxi. + +```tsx +import { defineConfig } from "vite"; +import { solidStart } from "@solidjs/start/config"; +export default defineConfig({ + plugins: [ + solidStart(), + ] +}); +``` + +An important note is that `defineConfig` comes from `vite` directly. + +#### Defining middleware + +Middlware is defined using the `middleware` option on the `solidStart` vite plugin. + +```tsx +import { defineConfig } from "vite"; +import { solidStart } from "@solidjs/start/config"; +export default defineConfig({ + plugins: [ + solidStart({ + middleware: "./src/middleware.ts" + }), + ] +}); +``` + +**4. Remove the vinxi dependency and add the vite dependency** + +```bash +pnpm remove vinxi +``` + +```json +"dependencies": { + "vite": "^7" +} +``` + +**5. Update`package.json` build/dev commands** + +Update the build/dev commands to use native vite instead of vinxi. + +```json +"scripts": { + "dev": "vite dev", + "build": "vite build" +} +``` + +**6. Replace all leftover vinxi imports** + +- `useSession` now comes from `@solidjs/start/server` instead of `vinxi/http + +**7. Add back nitro via the vite plugin** + +```package-install +nitro@latest +``` + +```tsx +import { defineConfig } from "vite"; +import { solidStart } from "@solidjs/start/config"; + +export default defineConfig({ + plugins: [ + solidStart(), + nitro({ + preset: 'netlify' + }) + ] +}); +``` \ No newline at end of file From bc89abd27c598a7b1054bd9ff227fa116c0434f1 Mon Sep 17 00:00:00 2001 From: Birk Skyum <74932975+birkskyum@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:26:39 +0100 Subject: [PATCH 2/4] Apply suggestion from @amirhhashemi Co-authored-by: Amir Hossein Hashemi <87268103+amirhhashemi@users.noreply.github.com> --- src/routes/solid-start/migrating-from-v1.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/solid-start/migrating-from-v1.mdx b/src/routes/solid-start/migrating-from-v1.mdx index 799984204..45a19df42 100644 --- a/src/routes/solid-start/migrating-from-v1.mdx +++ b/src/routes/solid-start/migrating-from-v1.mdx @@ -83,9 +83,7 @@ Update the build/dev commands to use native vite instead of vinxi. } ``` -**6. Replace all leftover vinxi imports** - -- `useSession` now comes from `@solidjs/start/server` instead of `vinxi/http +**6. Replace all imports from `vinxi/http` with `@solidjs/start/http`** **7. Add back nitro via the vite plugin** From 7216690dac36a30f1cc5ce30f52975c2c9afb7e9 Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Wed, 4 Mar 2026 11:35:02 +0100 Subject: [PATCH 3/4] update the migration guides to SolidStart v2 (#1435) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/routes/solid-start/migrating-from-v1.mdx | 109 +++++++++---------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/src/routes/solid-start/migrating-from-v1.mdx b/src/routes/solid-start/migrating-from-v1.mdx index 45a19df42..a0d694c8b 100644 --- a/src/routes/solid-start/migrating-from-v1.mdx +++ b/src/routes/solid-start/migrating-from-v1.mdx @@ -20,87 +20,82 @@ Please note that some third-party packages may not be compatible with v2 yet. ## Migration steps -**1. Update your project to use the latest version of SolidStart** +### Update dependencies ```package-install -@solidjs/start@alpha +@solidjs/start@alpha.2 @solidjs/vite-plugin-nitro-2 vite@7 ``` -**2. Rename `app.config.ts` to `vite.config.ts`** - -**3. Update`vite.config.ts`** - -v2 ships as a native vite plugin using the environment api instead of vinxi. - -```tsx -import { defineConfig } from "vite"; -import { solidStart } from "@solidjs/start/config"; -export default defineConfig({ - plugins: [ - solidStart(), - ] -}); +```package-remove +vinxi ``` -An important note is that `defineConfig` comes from `vite` directly. +### Configuration files -#### Defining middleware +- Remove `app.config.ts` +- Create `vite.config.ts` -Middlware is defined using the `middleware` option on the `solidStart` vite plugin. - -```tsx -import { defineConfig } from "vite"; +```tsx title="vite.config.ts" import { solidStart } from "@solidjs/start/config"; -export default defineConfig({ - plugins: [ - solidStart({ - middleware: "./src/middleware.ts" - }), - ] +import { defineConfig } from "vite"; +import { nitroV2Plugin } from "@solidjs/vite-plugin-nitro-2"; + +export default defineConfig(() => { + return { + plugins: [ + solidStart({ + middleware: "./src/middleware/index.ts", + }), + nitroV2Plugin(), + ], + }; }); ``` -**4. Remove the vinxi dependency and add the vite dependency** +Compile-time environment variables are now handled by Vite's environment API. + +```tsx title="vite.config.ts" +// ... +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), ""); + + return { + // ... + environments: { + ssr: { + define: { + "process.env.DATABASE_URL": JSON.stringify(env.DATABASE_URL), + }, + }, + }, + }; +}); -```bash -pnpm remove vinxi ``` -```json -"dependencies": { - "vite": "^7" -} -``` - -**5. Update`package.json` build/dev commands** - -Update the build/dev commands to use native vite instead of vinxi. +Update the build/dev commands to use native Vite instead of vinxi. ```json "scripts": { "dev": "vite dev", - "build": "vite build" + "build": "vite build", + "start": "vite preview" } ``` -**6. Replace all imports from `vinxi/http` with `@solidjs/start/http`** -**7. Add back nitro via the vite plugin** +### Environment types -```package-install -nitro@latest +Only the `types` entry is new in v2. Everything else can remain unchanged. + +```json +"compilerOptions": { + "types": ["@solidjs/start/env"] +} ``` -```tsx -import { defineConfig } from "vite"; -import { solidStart } from "@solidjs/start/config"; -export default defineConfig({ - plugins: [ - solidStart(), - nitro({ - preset: 'netlify' - }) - ] -}); -``` \ No newline at end of file +## Server runtime helpers + +- Replace all imports from `vinxi/http` with `@solidjs/start/http` +- Optional: update the middleware syntax to the newer [H3 syntax](https://h3.dev/guide/basics/middleware) From 1b7f3cfee59f1756645bb78a2849eb0f56ddbeb1 Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Thu, 5 Mar 2026 16:20:43 +0100 Subject: [PATCH 4/4] fix typo --- src/routes/solid-start/migrating-from-v1.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/solid-start/migrating-from-v1.mdx b/src/routes/solid-start/migrating-from-v1.mdx index a0d694c8b..a226da540 100644 --- a/src/routes/solid-start/migrating-from-v1.mdx +++ b/src/routes/solid-start/migrating-from-v1.mdx @@ -22,9 +22,7 @@ Please note that some third-party packages may not be compatible with v2 yet. ### Update dependencies -```package-install -@solidjs/start@alpha.2 @solidjs/vite-plugin-nitro-2 vite@7 -``` +@solidjs/start@2.0.0-alpha.2 @solidjs/vite-plugin-nitro-2 vite@7 ```package-remove vinxi