Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #417

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Version Packages #417

merged 1 commit into from
Jan 31, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 26, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

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

[email protected]

Minor Changes

  • Migrate to widget lifecycle hooks (#425)

@anywidget/[email protected]

Patch Changes

@anywidget/[email protected]

Patch Changes

@anywidget/[email protected]

Patch Changes

  • Add Initialize method types (#395)

Copy link

netlify bot commented Jan 26, 2024

Deploy Preview for anywidget canceled.

Name Link
🔨 Latest commit 095be75
🔍 Latest deploy log https://app.netlify.com/sites/anywidget/deploys/65bad0697e5dd40008c86149

@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 81e97b0 to c4da7df Compare January 26, 2024 15:53
@github-actions github-actions bot force-pushed the changeset-release/main branch 5 times, most recently from 611f8e7 to 78f80e3 Compare January 31, 2024 18:30
@github-actions github-actions bot force-pushed the changeset-release/main branch 3 times, most recently from 0ae9a29 to 7b3fdf3 Compare January 31, 2024 22:46
@github-actions github-actions bot force-pushed the changeset-release/main branch from 7b3fdf3 to 095be75 Compare January 31, 2024 22:57
@manzt manzt merged commit 4a128ea into main Jan 31, 2024
4 checks passed
@manzt manzt deleted the changeset-release/main branch January 31, 2024 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant