-
Notifications
You must be signed in to change notification settings - Fork 345
WIP: feat: add migrating to v2 solid-start guide #1378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brenelz
wants to merge
54
commits into
main
Choose a base branch
from
feat/migrating-to-v2-guide
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+100
−0
Open
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
971b599
feat: add migrating to v2 solid-start guide
brenelz 9ceca37
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] f37d42f
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 244886c
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] f1116e8
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] b119927
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 23a6824
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 34941cd
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 0060dd1
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 9f74d66
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 5a65818
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] e5b7874
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] ca0a85e
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 8f4a7ad
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 3f895d6
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 76657cb
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] a31f816
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] b074eef
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 2c8529f
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 93291e6
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] eb5d319
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 7150507
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 3c5ed9e
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 25cf373
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] b9817b8
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 66d925e
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] f16d29d
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 919fc56
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] f8d6c3d
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] c5d333d
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] e5ff98b
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 12d5871
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 5c09e36
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] d29b1be
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 0e3c1b5
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 088f8e5
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 5954e77
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] e728352
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 75fe4b8
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 8d02f95
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 9773ddd
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 24cfd36
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] c369c70
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 41c31ba
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] e1c15ec
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] e5af4aa
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] bc89abd
Apply suggestion from @amirhhashemi
birkskyum 0520cff
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 92829f8
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 6f19160
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] d31c94f
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 7216690
update the migration guides to SolidStart v2 (#1435)
atilafassina 001d5f2
Merge branch 'main' into feat/migrating-to-v2-guide
kodiakhq[bot] 1b7f3cf
fix typo
atilafassina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| 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 | ||
|
|
||
| ### Update dependencies | ||
|
|
||
| @solidjs/start@2.0.0-alpha.2 @solidjs/vite-plugin-nitro-2 vite@7 | ||
|
|
||
| ```package-remove | ||
| vinxi | ||
| ``` | ||
|
|
||
| ### Configuration files | ||
|
|
||
| - Remove `app.config.ts` | ||
| - Create `vite.config.ts` | ||
|
|
||
| ```tsx title="vite.config.ts" | ||
| import { solidStart } from "@solidjs/start/config"; | ||
| import { defineConfig } from "vite"; | ||
| import { nitroV2Plugin } from "@solidjs/vite-plugin-nitro-2"; | ||
|
|
||
| export default defineConfig(() => { | ||
| return { | ||
| plugins: [ | ||
| solidStart({ | ||
| middleware: "./src/middleware/index.ts", | ||
| }), | ||
| nitroV2Plugin(), | ||
| ], | ||
| }; | ||
| }); | ||
| ``` | ||
|
|
||
| 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), | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
| }); | ||
|
|
||
| ``` | ||
|
|
||
| Update the build/dev commands to use native Vite instead of vinxi. | ||
|
|
||
| ```json | ||
| "scripts": { | ||
| "dev": "vite dev", | ||
| "build": "vite build", | ||
| "start": "vite preview" | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ### Environment types | ||
|
|
||
| Only the `types` entry is new in v2. Everything else can remain unchanged. | ||
|
|
||
| ```json | ||
| "compilerOptions": { | ||
| "types": ["@solidjs/start/env"] | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ## 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) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the previous committed suggestion trimmed the code block tags due to the suggestion block also using three backticks