Skip to content

fix: parse flat selectors in linear time (backport of 62b1917 to 6.x) - #346

Open
bradyshutt wants to merge 1 commit into
postcss:6.x.xfrom
bradyshutt:backport-flat-selector-complexity
Open

bradyshutt wants to merge 1 commit into
postcss:6.x.xfrom
bradyshutt:backport-flat-selector-complexity

Conversation

@bradyshutt

@bradyshutt bradyshutt commented Oct 13, 2026 •

Copy link
Copy Markdown

Closes #344.

Backports 62b1917 (the GHSA-rj75-hqrm-r3gf fix in 7.1.6) to 6.x.x. Same change, reformatted for this branch and with the regression tests ported to ava.

For us this is a Dependabot finding from Tailwind 3's build-time use. A 6.x release would let us clear it without forcing Tailwind 3 onto parser 7.

Testing:

  • npm test passes (780 tests, 7 new). The new tests fail on the old parser.
  • astSync('.a'.repeat(60000)): ~4.3s on 6.1.4, ~90ms with this change.
  • Parsed 200k random selectors with both 6.1.4 and this branch: identical results for every one.

Could this go out as 6.1.5? Thanks!

@bradyshutt
bradyshutt force-pushed the backport-flat-selector-complexity branch from 08a4fee to 2a07850 Compare October 13, 2026 23:55
@bradyshutt
bradyshutt marked this pull request as ready for review October 14, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant