Skip to content

Releases: manzt/anywidget

create-anywidget@0.5.8

21 Apr 22:25
1734fd8
Compare
Choose a tag to compare

Patch Changes

  • Bump dependencies (#547)

anywidget@0.9.9

21 Apr 22:25
1734fd8
Compare
Choose a tag to compare

Patch Changes

  • Make a blanket _repr_mimbundle_ implementation (#546)

    ipywidgets v7 and v8 switched from using _ipython_display_ to _repr_mimebundle_ for rendering widgets in Jupyter. This means that depending on which version of ipywidgets used (v7 in Google Colab), anywidget end users need to handle the behavior of both methods. This change adds a blanket implementation of _repr_mimebundle_ so that it is easier to wrap an anywidget:

    import anywidget
    import traitlets
    
    class Widget(anywidget.AnyWidget):
        _esm = "index.js"
        _css = "style.css"
        value = traitlets.Unicode("Hello, World!").tag(sync=True)
    
    class Wrapper:
        def __init__(self):
            self._widget = Widget()
    
        # Easy to forward the underlying widget's repr to the wrapper class, across all versions of ipywidgets
        def _repr_mimebundle_(self, include=None, exclude=None):
            return self._widget._repr_mimebundle_(include, exclude)

anywidget@0.9.8

19 Apr 18:45
7daa99b
Compare
Choose a tag to compare

Patch Changes

  • experimental Ensure anywidget.experimental.command is called with self (#545)

  • experimental Replace invoke timeout with more flexible AbortSignal (#540)

    This allows more flexible control over aborting the invoke request, including delegating to third-party libraries that manage cancellation.

    export default {
      async render({ model, el }) {
        const controller = new AbortController();
    
        // Randomly abort the request after 1 second
        setTimeout(() => Math.random() < 0.5 && controller.abort(), 1000);
    
        const signal = controller.signal;
        model
          .invoke("echo", "Hello, world", { signal })
          .then((result) => {
            el.innerHTML = result;
          })
          .catch((err) => {
            el.innerHTML = `Error: ${err.message}`;
          });
      },
    };
  • Updated dependencies [a4b0ec07b2b8937111487108e9b82daf3d9be2df]:

    • @anywidget/types@0.1.9

@anywidget/types@0.1.9

19 Apr 18:45
7daa99b
Compare
Choose a tag to compare

Patch Changes

  • experimental Replace invoke timeout with more flexible AbortSignal (#540)

    This allows more flexible control over aborting the invoke request, including delegating to third-party libraries that manage cancellation.

    export default {
      async render({ model, el }) {
        const controller = new AbortController();
    
        // Randomly abort the request after 1 second
        setTimeout(() => Math.random() < 0.5 && controller.abort(), 1000);
    
        const signal = controller.signal;
        model
          .invoke("echo", "Hello, world", { signal })
          .then((result) => {
            el.innerHTML = result;
          })
          .catch((err) => {
            el.innerHTML = `Error: ${err.message}`;
          });
      },
    };

@anywidget/svelte@0.0.8

19 Apr 18:45
7daa99b
Compare
Choose a tag to compare

Patch Changes

@anywidget/react@0.0.7

19 Apr 18:45
7daa99b
Compare
Choose a tag to compare

Patch Changes

anywidget@0.9.7

09 Apr 19:43
1200596
Compare
Choose a tag to compare

Patch Changes

  • Refactor AnyWidget command registration (#526)

create-anywidget@0.5.7

02 Apr 21:04
8753d21
Compare
Choose a tag to compare

Patch Changes

  • Update typings with experimental API (#518)

anywidget@0.9.6

02 Apr 23:05
3ce5888
Compare
Choose a tag to compare

Patch Changes

anywidget@0.9.5

02 Apr 21:04
8753d21
Compare
Choose a tag to compare

Patch Changes

  • feat: Suppress errors when inspecting widget for commands (#522)