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

Isolate treescope renderings to improve performance and duplication-safety. #52

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

copybara-service[bot]
Copy link

Isolate treescope renderings to improve performance and duplication-safety.

Includes a number of changes to improve the robustness and performance of treescope
output renderings:

  • Isolates each rendering in the "Shadow DOM", ensuring CSS styles do not conflict
    between different renderings.
  • Isolates JS definitions as properties of a custom container element, avoiding
    conflicts between different output versions.
  • Adds duplication safety: making two copies of a treescope rendering will correctly
    render it twice instead of having interference between copies.
  • Improves performance by adding CSS container content visibility annotations.

This change should significantly improve performance and responsiveness of Penzai's
visualizations when used in a notebook environment like JupyterLab, which does not
apply strong sandboxing between different output cells.

…afety.

Includes a number of changes to improve the robustness and performance of treescope
output renderings:

- Isolates each rendering in the "Shadow DOM", ensuring CSS styles do not conflict
  between different renderings.
- Isolates JS definitions as properties of a custom container element, avoiding
  conflicts between different output versions.
- Adds duplication safety: making two copies of a treescope rendering will correctly
  render it twice instead of having interference between copies.
- Improves performance by adding CSS container content visibility annotations.

This change should significantly improve performance and responsiveness of Penzai's
visualizations when used in a notebook environment like JupyterLab, which does not
apply strong sandboxing between different output cells.

PiperOrigin-RevId: 649053637
@copybara-service copybara-service bot merged commit 2c7bee8 into main Jul 3, 2024
@copybara-service copybara-service bot deleted the test_648720934 branch July 3, 2024 13:35
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