Skip to content

Releases: manzt/anywidget

@anywidget/react@0.0.4

04 Mar 22:45
8edd4f2
Compare
Choose a tag to compare

Patch Changes

anywidget@0.9.2

11 Feb 17:47
ef267d5
Compare
Choose a tag to compare

Patch Changes

  • Support Python 3.12 (#441)

  • Add nicer error boundaries with stack traces (#445)

  • feat(experimental): Add @dataclass decorator (#222)

    from anywidget.experimental import dataclass
    
    @dataclass(esm="index.js")
    class Counter:
        value: int = 0
    
    Counter()

create-anywidget@0.5.1

10 Feb 22:45
Compare
Choose a tag to compare

Patch Changes

  • Add README.md to pyproject.toml (#437)

anywidget@0.9.1

10 Feb 22:44
Compare
Choose a tag to compare

Patch Changes

  • Use signals for HMR runtime (#438)

create-anywidget@0.5.0

31 Jan 23:00
4a128ea
Compare
Choose a tag to compare

Minor Changes

  • Migrate to widget lifecycle hooks (#425)

anywidget@0.9.0

31 Jan 23:00
4a128ea
Compare
Choose a tag to compare

Minor Changes

  • Require ANYWIDGET_HMR to opt-in to HMR during development (ab25564045bbde8bc51ad55ebb09429fa5ca9157)

  • Introduce front-end widget lifecycle methods (#395)

    Deprecation Notice: Exporting a render from the front-end widget will
    trigger a deprecation notice in the browser console. The preferred way to define
    a widget's front-end code is now with a default object export.

    export default {
      initialize({ model }) {
        /* ... */
      },
      render({ model, el }) {
        /* ... */
      },
    };

    These methods introduce lifecycle hooks for widget developers:

    • initialize: is executed once in the lifetime of a widget. It has access to
      the only the model to setup non-view event handlers or state to share across
      views.
    • render: is executed once per view, or for each notebook output cell. It
      has access to the model and a unique el DOM element. This method should
      be familiar and is used to setup event handlers or access state specific to
      that view.

    The default export may also be a function which returns (a Promise for) this
    interface: This can be useful to setup some front-end specific state for the
    lifecycle of the widget.

    export default () => {
      // Create a history of all the changes to the "value" trait
      let valueHistory = [];
      return {
        initialize({ model }) {
          // Push the new changes to history
          model.on("change:value", () => valueHistory.push(model.get("value")));
        },
        render({ model, el }) {
          el.innerText = `The history is ${valueHistory}`;
          // Update each view to display the current history
          model.on("change:value", () => {
            el.innerText = `The history is ${valueHistory}`;
          });
        },
      };
    };

Patch Changes

@anywidget/types@0.1.5

31 Jan 23:01
4a128ea
Compare
Choose a tag to compare

Patch Changes

  • Add Initialize method types (#395)

@anywidget/svelte@0.0.4

31 Jan 23:00
4a128ea
Compare
Choose a tag to compare

Patch Changes

@anywidget/react@0.0.3

31 Jan 23:00
4a128ea
Compare
Choose a tag to compare

Patch Changes

create-anywidget@0.4.5

16 Jan 21:48
f349fab
Compare
Choose a tag to compare

Patch Changes

  • feat: Add example.ipynb to all projects (#414)

  • feat: Rename template options with additional hints (#415)