Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
keep merging common parents
Instead of trying to be smart, let's keep checking for common root files
among the common parents until we don't find common parents anymore.
  • Loading branch information
RobinMalfait committed Nov 19, 2024
commit 6c14aeb43be9bee7e10c605e131b4095ac5cff2b
9 changes: 4 additions & 5 deletions packages/@tailwindcss-upgrade/src/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ export async function analyze(stylesheets: Stylesheet[]) {
// parent A and parent B will be moved to the parent of parent A and
// parent B. Parent A and parent B will be removed.
let repeat = true
while (repeat) {
repeat: while (repeat) {
repeat = false

outer: for (let [sheetA, childrenA] of commonParents) {
for (let [sheetA, childrenA] of commonParents) {
for (let [sheetB, childrenB] of commonParents) {
if (sheetA === sheetB) continue

Expand Down Expand Up @@ -316,12 +316,11 @@ export async function analyze(stylesheets: Stylesheet[]) {
commonParents.get(parent).add(child)
}

repeat = parent !== sheetA && parent !== sheetB

// Found a common parent between sheet A and sheet B. We can
// stop looking for more common parents between A and B, and
// continue with the next sheet.
break outer
repeat = true
continue repeat
}
}
}
Expand Down