Skip to content

Restore the when decorator and HTML #1691

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

Merged
merged 5 commits into from
Sep 12, 2023
Merged

Restore the when decorator and HTML #1691

merged 5 commits into from
Sep 12, 2023

Conversation

fpliger
Copy link
Contributor

@fpliger fpliger commented Sep 12, 2023

Description

This PR just restores the previous Python code we had for the @when decorator and the HTML class.

Changes

This PR adds the code for HTML in the display module (honestly we could put it somewhere else but for now I just wanted to get it back in) and the @when decorator (in event_handling.py)

It also adds 2 simple manual tests. I think we should add better integration tests for these but I'd like to merge this and add the integration tests with the right structure right after, as soon as possible.

Checklist

  • All tests pass locally
  • I have updated docs/changelog.md
  • I have created documentation for this(if applicable)

Copy link
Contributor

@WebReflection WebReflection left a comment

Choose a reason for hiding this comment

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

The only thing that bothers me is the need for from pyodide.ffi.wrappers import add_event_listener but it has nothing to do with this PR so I'll just approve it. Thanks for adding the smoke tests in, it's easy to port these later on to integration.

@fpliger
Copy link
Contributor Author

fpliger commented Sep 12, 2023

The only thing that bothers me is the need for from pyodide.ffi.wrappers import add_event_listener but it has nothing to do with this PR so I'll just approve it. Thanks for adding the smoke tests in, it's easy to port these later on to integration.

Yes, agree. I was going to change that but too overwhelmed with other things so I decided to just bring it back as it was and "clean" it later alongside with integration tests.

@fpliger fpliger merged commit 2a2ff40 into next Sep 12, 2023
@fpliger fpliger deleted the fpliger/restore_when_html branch September 12, 2023 13:27
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.

2 participants