-
Notifications
You must be signed in to change notification settings - Fork 344
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
Draft
brenelz
wants to merge
47
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.
+107
−0
Draft
Changes from all commits
Commits
Show all changes
47 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 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,106 @@ | ||||||||||||||
| --- | ||||||||||||||
| 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({ | ||||||||||||||
|
Comment on lines
+53
to
+54
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| plugins: [ | ||||||||||||||
| solidStart({ | ||||||||||||||
| middleware: "./src/middleware.ts" | ||||||||||||||
| }), | ||||||||||||||
| ] | ||||||||||||||
| }); | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| **4. Remove the vinxi dependency and add the vite dependency** | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| pnpm remove vinxi | ||||||||||||||
| ``` | ||||||||||||||
|
Comment on lines
+65
to
+67
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| ```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 imports from `vinxi/http` with `@solidjs/start/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' | ||||||||||||||
| }) | ||||||||||||||
| ] | ||||||||||||||
| }); | ||||||||||||||
| ``` | ||||||||||||||
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.