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

Update to protocol 2.1.0 (echo_update) #251

Merged
merged 4 commits into from
Feb 7, 2023

Conversation

AntoinePrv
Copy link
Member

  • Add comments around the update protocol
  • Unconditionally send echo_update on front_end change
  • Update protocol version

@AntoinePrv
Copy link
Member Author

@SylvainCorlay @martinRenou @maartenbreddels @jasongrout this is a PR to add the "echo_update" feature to XWidgets.
If you have a moment, would you mind checking that it looks correct?
This is still missing the mechanism to deactivate "echo_update" on specific properties but that might require some bigger changes on the way we handle properties.

@AntoinePrv AntoinePrv changed the title Update to protoco 2.1.0 (echo_update) Update to protocol 2.1.0 (echo_update) Jan 27, 2023
@AntoinePrv AntoinePrv mentioned this pull request Jan 27, 2023
11 tasks

xtl::xoptional<bool> xcommon::global_echo_update()
{
static const auto out = get_tristate_env("JUPYTER_WIDGETS_ECHO");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to check "on", "true", "yes", "1"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that was only for ipywidgets 7, where we had to opt in for backwards compatibility . I think in ipywidgets 8 there is no op in or out anymore. But not 100% sure.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong, it's still in, and the bar for accepting values was set quite high: https://github.com/jupyter-widgets/ipywidgets/blob/main/python/ipywidgets/ipywidgets/widgets/widget.py#L29 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thanks

Copy link

@maartenbreddels maartenbreddels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SylvainCorlay SylvainCorlay merged commit a49e38b into jupyter-xeus:main Feb 7, 2023
bool is_true_string(const char* str)
{
const std::string s = tolower(trim(str));
static const auto trues = {"true", "on", "yes", "1"};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, why aren't we mirroring the logic in Jupyter Widgets and Jupyter Core of testing for the absence of negative values instead of the presence of positive values?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed there is no reason. I did not have all that context at the time of writing, we can change that.

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.

4 participants