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

Port #3337 and #3377 to master #3389

Merged
merged 9 commits into from
Feb 18, 2022
Merged

Conversation

jasongrout
Copy link
Member

@jasongrout jasongrout commented Feb 18, 2022

This ports relevant parts of #3337 and #3377 to master, and makes get_model signature backwards incompatible.

Fixes #3378
Fixes #3379

  • Document "Change manager.get_model() to always return a promise" as a breaking change in the 8.0 changelog (I guess it's technically not breaking since it was allowed before, but it is a change in default behavior, so should be noted).
  • Add tests for has_model

…le asynchronous issues

    - We need the models registered synchronously before they are actually created,
      so I broke the comm/model instantiation into two steps to make sure that
      new_model is the first synchronous call in its function.
    - renamed loadFromKernelSlow to loadFromKernelModels to be more descriptive
    - clean up a few obsolete comments
    - Make sure we are using the appropriate buffers for a given widget's state.
…manager base class

From jupyter-widgets#3377.

This simplifies our code that has had to work around get_model either
returning undefined or a rejected promise if a model was not registered.
This paves the way for a future get_model in 8.0 that is truly asynchronous, never returning undefined.
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch jasongrout/ipywidgets/forwardport

@jasongrout
Copy link
Member Author

jasongrout commented Feb 18, 2022

There still are a few more things I'll need to do to make has_model pervasive throughout the system that I'll work on tomorrow.

@jasongrout jasongrout marked this pull request as draft February 18, 2022 06:54
This makes get_model() a true async function, simplifying how it is used through the codebase.
@jasongrout jasongrout marked this pull request as ready for review February 18, 2022 08:18
@ibdafna ibdafna merged commit 940c10d into jupyter-widgets:master Feb 18, 2022
@jasongrout
Copy link
Member Author

** ibdafna ** approved these changes 7 minutes ago

Thanks!

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.

Forward port changes to kernel loading logic from #3337 Forward port has_model to the 8.x widget manager
2 participants