- Updated dependencies [
88298fd]:- @anywidget/types@0.3.0
-
Migrate to Svelte 5 signals API (#869)
This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
@anywidget/sveltein yourpackage.jsonfile or be using a version range syntax that only accepts patch upgrades such as~0.0.1.The
@anywidget/sveltenow uses Svelte 5's new runes reactivity system (aka signals). The context-based implementation has been replaced with reactive model bindings usingcreateSubscriber.Update your Svelte dependency to version 5:
npm install svelte@^5.0.0
Ensure Svelte 5 runes are enabled in your bundler configuration:
// rolldown.config.js or rollup.config.js svelte({ compilerOptions: { runes: true, }, });
The previous API used Svelte 4 and exposed model values via the
storesproxy:<script> import { stores } from "@anywidget/svelte"; let { count } = stores; </script> <button on:click={() => $count += 1}>Count is {$count}</button>
With Svelte 5,
@anywidget/sveltenow uses direct reactive bindings and the$props()rune:<script> /** @type {{ bindings: { count: number } }} */ let { bindings } = $props(); </script> <button on:click={() => bindings.count++}>Count is {bindings.count}</button>This is a breaking change. The old stores API and getContext-based access are no longer supported. You must update your components to use the new bindings prop via
$props().See manzt/ipyfoo-svelte for a complete example.
- Updated dependencies [
9c10efe9fd44f779fc2a5821c0e6a28ab0f4edad]:- @anywidget/types@0.2.0
- Ensure all src files are included in the package release (#666)
- Updated dependencies [
a4b0ec07b2b8937111487108e9b82daf3d9be2df]:- @anywidget/types@0.1.9
- Updated dependencies [
0c629955fee6379234fece8246c297c69f51ee79]:- @anywidget/types@0.1.8
- Updated dependencies [
777fc268ee06fcf13e48a1c00cfdf90c14d786dc]:- @anywidget/types@0.1.7
- Updated dependencies [
9aa8dcc8558e00e33fbe4506b68ae30113df3728]:- @anywidget/types@0.1.6
- Updated dependencies [
6608992b8fe3a9f4eb7ebb2c8c5533febf26f4dd]:- @anywidget/types@0.1.5
- fix: broken import in WrapperComponent (#219)
- feat: use JS Symbols to scope access to Svelte Context (#215)
- feat: Use Context API to expose
modelandstoresto components. (#213)