Skip to content

Latest commit

 

History

History
134 lines (81 loc) · 4.06 KB

File metadata and controls

134 lines (81 loc) · 4.06 KB

@anywidget/svelte

0.1.2

Patch Changes

0.1.1

Patch Changes

  • Updated dependencies [88298fd]:
    • @anywidget/types@0.3.0

0.1.0

Minor Changes

  • 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/svelte in your package.json file or be using a version range syntax that only accepts patch upgrades such as ~0.0.1.

    The @anywidget/svelte now uses Svelte 5's new runes reactivity system (aka signals). The context-based implementation has been replaced with reactive model bindings using createSubscriber.

    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 stores proxy:

    <script>
      import { stores } from "@anywidget/svelte";
      let { count } = stores;
    </script>
    
    <button on:click={() => $count += 1}>Count is {$count}</button>

    With Svelte 5, @anywidget/svelte now 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.

0.0.10

Patch Changes

0.0.9

Patch Changes

  • Ensure all src files are included in the package release (#666)

0.0.8

Patch Changes

0.0.7

Patch Changes

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

  • fix: broken import in WrapperComponent (#219)

0.0.2

Patch Changes

  • feat: use JS Symbols to scope access to Svelte Context (#215)

0.0.1

Patch Changes

  • feat: Use Context API to expose model and stores to components. (#213)