Skip to content

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

Merged
MoOx merged 1 commit into
postcss:6.x.xfrom
bradyshutt:backport-flat-selector-complexity
Oct 19, 2026
Merged

MoOx merged 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
@lorand-horvath

Copy link
Copy Markdown

@MoOx Please merge this and release as 6.1.5. Thanks!

@MoOx
MoOx merged commit 70b0779 into postcss:6.x.x Oct 19, 2026
@MoOx

MoOx commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks ! 6.1.5 is out. I will update the GHSA accordingly.

@lorand-horvath

Copy link
Copy Markdown

@MoOx GHSA-rj75-hqrm-r3gf should also be updated.

@MoOx

MoOx commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Already done in GHSA-rj75-hqrm-r3gf but that wasn't enough. Done via github/advisory-database#10456

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.

3 participants