Skip to content

The styles contributed by jupyterlab-myst slow down JupyterLab #275

@krassowski

Description

@krassowski

Description

As highlighted in jupyterlab/jupyterlab#18076, jupyterlab-myst contributes hundreds of complex and slow selectors which forces browsers to attempt matching thousands of elements each time any DOM modification happens.

Image

Proposed solution

  1. Do not attach styles globally
  2. Use Shadow DOM for rendering markdown cells
  3. Drop the .myst prefix while in shadow DOM since not needed
  4. Reuse a single stylesheet between shadow DOMs (Markdown cells)

Additional notes

The panel/bokeh ecosystem is a good example of shadow DOM usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions