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
Post 2.0 improvements to LabIcon: work with all svg loaders, improve performance, fix issue with menus from extensions #8125
Post 2.0 improvements to LabIcon: work with all svg loaders, improve performance, fix issue with menus from extensions #8125
Conversation
- speeds up the javascript calls of LabIcon.element by 10x-20x - the browser rendering calls take the same time, so overall this is a 2x-3x speedup
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
- unlike previous approach (setting the renderer for the context menu), ContextMenuSvg ensures that all context submenus use the appropriate renderer
- will correctly override menu renderer regards of the order in which the submenus get added to/inserted in one another
This PR is now ready for review. I already went through and checked everything, but ideally whoever reviews this will build it locally and double check that there's no regressions in the menu icons. |
The summary from this meeting that for 3.0 we should fix some of these things upstream in lumino, but for now we can fix them here without breaking changes. |
References
jupyter/nbdime#512
Some improvements to LabIcon.
@vidartf With these changes you should be able to use LabIcon/
@jupyterlab/ui-components
in just about any project regardless of how svg loading is configured.Code changes
LabIcon should now work with all commonly-used svg loaders/loading schemes
raw-loader
) that directly loaded the raw data from an .svg file as a string15-20x speedup of icon creation (on the javascript side)
old code:
new code (compare
cloneNode
toresolveSvg
above):Fix icons in menus added to main menubar by extensions, and ensure that correct renderer is used for all submenus
User-facing changes
improved performance related to icons (especially when opening dirs with 1000+ files in the filebrowser)
icons should now work correctly in menus added to main menubar and in all submenus (including context submenus)
Backwards-incompatible changes
None