microsoft / microsoft/monaco-editor

[Feature Request] Reducing style recalculations

Open
#3,937 2 comments 0 reactions 1 assignee View on GitHub

@hediet is already working on this.

Since May 2, 2023.

editor-core feature-request
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

I'm profiling selectors for my app, and I'm seeing some of Monaco's selectors listed in there.

Screen Shot 2023-04-29 at 16 19 41

It's not a big deal, but it looks to me like some selectors should be made more specific. For example:

  • .monaco-button-dropdown .monaco-button-dropdown-separator > div
  • .monaco-editor .view-zones .view-lines .view-line span
  • .quick-input-list .quick-input-list-rows .monaco-highlighted-label span

span and div are very broad selectors, which will be matched against a million unrelated elements over the course of the lifetime of the app, I'd suggest exploring adding a dedicated class to the matched elements and using that class in the selector instead.

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.