Skip to content

Commit

Permalink
docs: note html structure breaking change (#12991)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Sep 19, 2024
1 parent db6545d commit e4926d7
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,32 @@ This is a footgun. In runes mode, if you want to concatenate stuff you must wrap

Note that Svelte 5 will also warn if you have a single expression wrapped in quotes, like `answer="{42}"` — in Svelte 6, that will cause the value to be converted to a string, rather than passed as a number.

### HTML structure is stricter

In Svelte 4, you were allowed to write HTML code that would be repaired by the browser when server side rendering it. For example you could write this...

```svelte
<table>
<tr>
<td>hi</td>
</tr>
</table>
```

... and the browser would auto-insert a `<tbody>` element:

```svelte
<table>
<tbody>
<tr>
<td>hi</td>
</tr>
</tbody>
</table>
```

Svelte 5 is more strict about the HTML structure and will throw a compiler error in cases where the browser would repair the DOM.

## Other breaking changes

### Stricter `@const` assignment validation
Expand Down

0 comments on commit e4926d7

Please sign in to comment.