Skip to content

refactor(client): inline dev-id value in CSS selector - #22736

Merged
sapphi-red merged 1 commit into
vitejs:mainfrom
btea:refactor/optimize-removeStyle-css-selector
Jun 23, 2026
Merged

sapphi-red merged 1 commit into
vitejs:mainfrom
btea:refactor/optimize-removeStyle-css-selector

Conversation

@btea

@btea btea commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Use data-vite-dev-id="\${CSS.escape(id)}" as the CSS selector instead of selecting all link[data-vite-dev-id] elements and filtering by ID in JavaScript. This lets the browser's native selector engine do the matching, making the code simpler and slightly more efficient.
https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape_static

@btea
btea requested a review from hi-ogawa June 22, 2026 06:34
@sapphi-red sapphi-red added the p1-chore Doesn't change code behavior (priority) label Jun 23, 2026

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sapphi-red
sapphi-red merged commit 57f59bc into vitejs:main Jun 23, 2026
@btea
btea deleted the refactor/optimize-removeStyle-css-selector branch June 23, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p1-chore Doesn't change code behavior (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo