move breaking change note

pull/12374/head
Simon H 2 years ago committed by GitHub
parent 18dabb7327
commit 2b60b6ac50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -93,7 +93,7 @@ import App from './App.svelte';
+ const { html, head } = render(App, { props: { message: 'hello' } });
```
`render` also no longer returns CSS; it should be served separately from a CSS file.
In Svelte 4, rendering a component to a string also returned the CSS of all components. In Svelte 5, this is no longer the case by default because most of the time you're using a tooling chain that takes care of it in other ways (like SvelteKit). If you need CSS to be returned from `render`, you can set the `css` compiler option to `'injected'` and it will add `<style>` elements to the `head`.
### Component typing changes
@ -217,10 +217,6 @@ In the event that you need to support ancient browsers that don't implement `:wh
css = css.replace(/:where\((.+?)\)/, '$1');
```
### CSS no longer returned from server render by default
In Svelte 4, rendering a component to a string also returned the CSS of all components. In Svelte 5, this is no longer the case by default because most of the time you're using a tooling chain that takes care of it in other ways (like SvelteKit). If you need CSS to be returned from `render`, you can set the `css` compiler option to `'injected'` and it will add `<style>` elements to the `head`.
### Error/warning codes have been renamed
Error and warning codes have been renamed. Previously they used dashes to separate the words, they now use underscores (e.g. foo-bar becomes foo_bar). Additionally, a handful of codes have been reworded slightly.

Loading…
Cancel
Save