Skip to content

perf(lint): strip stylesheet comments once per canvas zoom scan - #5712

Merged
miguel-heygen merged 1 commit into
heygen-com:mainfrom
rudycelekli:rudy/fix-canvas-zoom-css-scan
Oct 16, 2026
Merged

miguel-heygen merged 1 commit into
heygen-com:mainfrom
rudycelekli:rudy/fix-canvas-zoom-css-scan

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Long stylesheets are repeatedly scanned in full while checking canvas-level zoom: the rule loop calls stripCssComments(style.content) for each matched CSS rule and once more when the loop ends. Strip once per stylesheet and reuse the same string for the unchanged regex loop.

Fixes #5681.

Validation:

  • Ran the actual stylesheet scanning function with the actual comment stripper under Node 24.19.0. For a 1,000-rule stylesheet, full comment-stripping calls fall from 1,001 to 1, with identical matched rule headers/bodies. Multi-stylesheet, comment/string, empty stylesheet and no-stylesheet controls preserve identical inputs to the downstream classifier. No elapsed-time speedup claim is made.
  • Repository-config Oxlint 1.64.0 (lockfile version), Oxfmt 0.41.0, comment citations and comment ratchet pass. Citation checking reports one non-blocking pre-existing warning about diagnoseDerivedEnd.

Validation limitations: this characterization captures inputs to the downstream classifier rather than running the complete linter. The prescribed workspace build was attempted and failed because tsup is unavailable. Full linter suite, project-level CLI reproduction and workspace typecheck have not passed locally.

AI-assisted implementation and validation.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 16, 2026
Merged via the queue into heygen-com:main with commit 0bff834 Oct 16, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants