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

The jupyter-ui-toolkit variables are inlined too many times #15859

Closed
krassowski opened this issue Feb 23, 2024 · 6 comments
Closed

The jupyter-ui-toolkit variables are inlined too many times #15859

krassowski opened this issue Feb 23, 2024 · 6 comments

Comments

@krassowski
Copy link
Member

Description

The CSS variables from jupyter-ui-toolkit are inlined on body and every element which has toolbar. This has many downsides:

  • the page load is slower as variables are replaced when attaching each element,
  • debugging anything in the DOM harder because it is just filled with spuriously repeated information
  • themes cannot override these variables easily, they need to have specificity over each of these elements

I suspect that this would become even worse if jupyter-ui-toolkit was to become used across more elements (#15707)

CC @brichet @fcollonval

Reproduce

A JupyterLab with a single notebook open:

to-many-styles-mounted

Expected behavior

The jupyter-ui-toolkit variables are either:

  • inlined only once in body, or
  • embedded in a style

Context

  • JupyterLab version: 4.1.2
@krassowski krassowski added bug status:Needs Triage Applied to new issues that need triage labels Feb 23, 2024
@JasonWeill JasonWeill added tag:Performance and removed status:Needs Triage Applied to new issues that need triage labels Feb 27, 2024
@Mehak261124
Copy link
Contributor

@krassowski @JasonWeill @fcollonval Can I work on this issue ?

@fcollonval
Copy link
Member

Sure don't hesitate. We don't have a policy of assigning issue.

Feel free to open a PR early to get advice

@fcollonval
Copy link
Member

@krassowski I'm not able to reproduce on 4.1.2. But I'm seeing it on the current main branch. Could you confirm it was happening for 4.1.2 in your case?

@krassowski
Copy link
Member Author

Interesting! I indeed do not see it on Binder with released 4.1.2 but do see it locally on 4.1.2 tag and on main. I guess this is some node caching issue for me then? Or is it something to do with dev mode?

@fcollonval
Copy link
Member

Thanks for having a second look. I'll test your set up and with a dev wheel from CI - I'll try to do that this week.

@krassowski
Copy link
Member Author

This is looking good in 4.2.0 prereleases so I am going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants