Skip to content

perf(TailwindStyle): skip redundant traversal and avoid unnecessary r…#1413

Open
HugoHSun wants to merge 4 commits intonextfrom
hugo/rm-15353-mdx-components-not-styled-on-client-side-navigation
Open

perf(TailwindStyle): skip redundant traversal and avoid unnecessary r…#1413
HugoHSun wants to merge 4 commits intonextfrom
hugo/rm-15353-mdx-components-not-styled-on-client-side-navigation

Conversation

@HugoHSun
Copy link
Copy Markdown
Contributor

@HugoHSun HugoHSun commented Mar 31, 2026

…ecompiles

🎫 Resolve RM-15353

🎯 What does this PR do?

  • when the added node is itself a TailwindRoot, traverse() already recurses
    into its descendants — no need to also querySelectorAll into it. moved that
    check into an else branch
  • also replaced unconditional shouldUpdate = true with a classesSet size check
    in both branches, so setClasses only fires when new classes were actually found
  • adds back fix(TailwindStyle): detect nested TailwindRoot elements on DOM updates #1404 and the overlap test case suggested in the review

🧪 QA tips

  • no regression of tailwind style not applying in PJAX navigation

📸 Screenshot or Loom

@HugoHSun HugoHSun force-pushed the hugo/rm-15353-mdx-components-not-styled-on-client-side-navigation branch from 83c80e7 to 0af6ddc Compare April 1, 2026 00:29
@HugoHSun
Copy link
Copy Markdown
Contributor Author

HugoHSun commented Apr 1, 2026

@rafegoldberg the changes are all good to go!

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