|
| 1 | +## Migration from 1.0 to 2.0 |
| 2 | + |
| 3 | +The 2.0 release introduced a few breaking changes; see below. |
| 4 | + |
| 5 | +### Switch to `bind:` for Listbox, RadioGroup, and Switch |
| 6 | + |
| 7 | +These three components previously required you to use a `on:change` event listener to update their values. These have been changed to use two-way binding with the `bind:` directive. |
| 8 | + |
| 9 | +#### Listbox |
| 10 | + |
| 11 | +```svelte |
| 12 | +<!-- Old --> |
| 13 | +<Listbox value={foo} on:change={(e) => foo = e.detail}> |
| 14 | + ... |
| 15 | +</Listbox> |
| 16 | + |
| 17 | +<!-- New --> |
| 18 | +<Listbox bind:value={foo}> |
| 19 | + ... |
| 20 | +</Listbox> |
| 21 | +``` |
| 22 | + |
| 23 | +#### RadioGroup |
| 24 | + |
| 25 | +```svelte |
| 26 | +<!-- Old --> |
| 27 | +<RadioGroup value={foo} on:change={(e) => foo = e.detail}> |
| 28 | + ... |
| 29 | +</RadioGroup> |
| 30 | + |
| 31 | +<!-- New --> |
| 32 | +<RadioGroup bind:value={foo}> |
| 33 | + ... |
| 34 | +</RadioGroup> |
| 35 | +``` |
| 36 | + |
| 37 | +#### Switch |
| 38 | + |
| 39 | +```svelte |
| 40 | +<!-- Old --> |
| 41 | +<Switch checked={foo} on:change={(e) => foo = e.detail}> |
| 42 | + ... |
| 43 | +</Switch> |
| 44 | + |
| 45 | +<!-- New --> |
| 46 | +<Switch bind:checked={foo}> |
| 47 | + ... |
| 48 | +</Switch> |
| 49 | +``` |
| 50 | + |
| 51 | +### Renamed transition events |
| 52 | + |
| 53 | +Events emitted by the `Transition` components have been renamed for better consistency with the event names used natively in Svelte. Specifically, |
| 54 | +* `beforeEnter` is now `introstart` |
| 55 | +* `afterEnter` is now `introend` |
| 56 | +* `beforeLeave` is now `outrostart` |
| 57 | +* `afterLeave` is now `outroend` |
| 58 | + |
| 59 | +## Full version history |
| 60 | + |
1 | 61 | This is the release history of Svelte Headless UI and the correspondence with versions of Headless UI. Click on a version number to see the documentation for that version. |
2 | 62 |
|
3 | 63 | | Svelte Headless UI version | Date released | Headless UI version | Notes | |
4 | 64 | | -------------------------- | ------------- | ------------------- | ----- | |
| 65 | +| [2.0.0](../2.0) | 2023-??-?? | 1.4.2 | Switches to `bind:` for three components; renames transition events; uses `<svelte:element>` internally | |
5 | 66 | | [1.0.2](../1.0) | 2022-05-25 | 1.4.2 | Fixes TypeScript errors with some attributes | |
6 | 67 | | [1.0.1](../1.0) | 2022-05-16 | 1.4.2 | Fixes a SSR error when using the `as` prop on buttons | |
7 | 68 | | [1.0.0](../1.0) | 2022-05-06 | 1.4.2 | Much improved TypeScript support; much smaller bundle size | |
|
0 commit comments