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

Add Plugin Lifecycle Hooks before/after each <py-script> tag executes #944

Closed
JeffersGlass opened this issue Nov 13, 2022 · 0 comments · Fixed by #1063
Closed

Add Plugin Lifecycle Hooks before/after each <py-script> tag executes #944

JeffersGlass opened this issue Nov 13, 2022 · 0 comments · Fixed by #1063
Assignees
Labels
backlog issue has been triaged but has not been earmarked for any upcoming release tag: plugins Related to the infrastructure of how plugins work, or to specific plugins. type: feature New feature or request

Comments

@JeffersGlass
Copy link
Member

From a discussion on the Discord - for the purposes of enabling functionality around each PyScript tag, it would be nice to have a before-py-script and after-py-script lifecycle hook that execute immediately before and after each tag is evaluated. (Names suggested by @antocuni and are flexible.)

Some possible use-cases are:

  • Allowing redirection of stdout for each tag separately
  • Simple profiling by timing the execution of each tag
  • A tag-oriented "debugger" which pauses the execution of PyScript tags in between each tags, to allow the user to observe what that specific tag did.

Not that these are perfect (or fully-fleshed-out) examples, but an idea of what might be possible.

@JeffersGlass JeffersGlass added type: feature New feature or request tag: plugins Related to the infrastructure of how plugins work, or to specific plugins. labels Nov 13, 2022
@JeffersGlass JeffersGlass added the backlog issue has been triaged but has not been earmarked for any upcoming release label Nov 21, 2022
@JeffersGlass JeffersGlass changed the title Add Plugin Lifecycle Hooks before/after each \<py-script\> tag executes Add Plugin Lifecycle Hooks before/after each <py-script> tag executes Nov 26, 2022
@JeffersGlass JeffersGlass self-assigned this Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog issue has been triaged but has not been earmarked for any upcoming release tag: plugins Related to the infrastructure of how plugins work, or to specific plugins. type: feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant