-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update Svelte integration v6 docs #10002
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
@@ -103,44 +103,28 @@ To use your first Svelte component in Astro, head to our [UI framework documenta | |||
|
|||
This integration is powered by `@sveltejs/vite-plugin-svelte`. To customize the Svelte compiler, options can be provided to the integration. See the [`@sveltejs/vite-plugin-svelte` docs](https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/docs/config.md) for more details. | |||
|
|||
### Default options |
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.
Note there are now no default options set by Astro. It falls back to the behaviour in @sveltejs/vite-plugin-svelte
by default now.
Which means the notes about vitePreprocess
are no longer relevant, the user will have to always add that themselves if they use scss/stylus etc. Since astro add svelte
has been adding those for users by default for a long time, I don't think this will break a lot of folks. I've noted this in the core PR changeset
If you're using a preprocessor like TypeScript or SCSS in your Svelte files, you can create a `svelte.config.js` file so that the Svelte IDE extension can correctly parse the Svelte files. | ||
If you're using SCSS or Stylus in your Svelte files, you can create a `svelte.config.js` file so that they are preprocessed by Svelte, and the Svelte IDE extension can correctly parse the Svelte files. |
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 removed references to TypeScript here as Svelte 5 now handles TypeScript by default even without vitePreprocess
.
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.
Thanks, looks great @bluwy ! I only had one question below, but otherwise good to merge when the feature is released! 🙌
@@ -9,7 +9,7 @@ i18nReady: true | |||
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'; | |||
import Since from '~/components/Since.astro'; | |||
|
|||
This **[Astro integration][astro-integration]** enables server-side rendering and client-side hydration for your [Svelte](https://svelte.dev/) components. It supports Svelte 3, 4, and 5 (experimental). | |||
This **[Astro integration][astro-integration]** enables server-side rendering and client-side hydration for your [Svelte](https://svelte.dev/) 5 components. For Svelte 3 and 4 support, install `@astrojs/svelte@5` instead. |
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.
For Svelte 3 and 4 support, install
@astrojs/svelte@5
instead
Just calling attention to it because it looks weird. Svelte 5 is the default. If you want 3 and install svelte@**5**
-- just checking this isn't a typo or something!
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.
It's referring to install @astrojs/svelte
, which is an integration. And @astrojs/svelte
v5 supports Svelte 3 and 4 only.
Svelte 5 support is added on @astrojs/svelte
v6, which I didn't mention v6 here since it will be the latest.
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.
Yup, figured this out in the other PR. What a pain, but understood!
Would be much nicer if our numbers aligned with theirs!
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.
Would be much nicer if our numbers aligned with theirs!
Easy, just don't ship @astrojs/svelte v6 and update v5 until Svelte v6 drops.
Oh! just calling out that we should have something in the v5 upgrade guide, too! Let's get that in this PR so it doesn't get forgotten! |
I suppose since this isn't related to Astro v5 we don't need to update the migration guide now? Currently the migration guide for |
Yup, that's when I thought this was related to Astro 5, too! This one's good to go! |
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.
Ready to merge when the feature does!
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.
LGTM!
Description (required)
Updates docs around new behaviour for
@astrojs/svelte
v6Related issues & labels (optional)
For
@astrojs/svelte
version:6.0
. See astro PR withastro/astro#12364