Add @tailwindcss/turbopack loader - #20367
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the current integration test exercises the documented Turbopack loader and content-change rebuild path, and all loader-level debug spans now use the Turbopack namespace. Reviews (6): Last reviewed commit: "update changelog" | Re-trigger Greptile |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds the 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5d970c0e-53be-484b-866c-fd1ee361313d
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
CHANGELOG.mdintegrations/utils.tspackages/@tailwindcss-turbopack/README.mdpackages/@tailwindcss-turbopack/package.jsonpackages/@tailwindcss-turbopack/src/index.ctspackages/@tailwindcss-turbopack/src/index.tspackages/@tailwindcss-turbopack/tsconfig.jsonpackages/@tailwindcss-turbopack/tsup.config.ts
257dedc to
fd65315
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 54473c87-c473-46a0-96a5-5352ae281455
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
CHANGELOG.mdintegrations/turbopack/loader.test.tsintegrations/utils.tspackages/@tailwindcss-turbopack/README.mdpackages/@tailwindcss-turbopack/package.jsonpackages/@tailwindcss-turbopack/src/index.ctspackages/@tailwindcss-turbopack/src/index.tspackages/@tailwindcss-turbopack/tsconfig.jsonpackages/@tailwindcss-turbopack/tsup.config.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- integrations/utils.ts
- packages/@tailwindcss-turbopack/src/index.cts
- packages/@tailwindcss-turbopack/tsup.config.ts
- CHANGELOG.md
- packages/@tailwindcss-turbopack/tsconfig.json
- packages/@tailwindcss-turbopack/README.md
- packages/@tailwindcss-turbopack/package.json
| } catch (error) { | ||
| // Clear the cache entry on error to force a full rebuild next time | ||
| let key = getCacheKey(resourceId, options) | ||
| cache.delete(key) | ||
|
|
||
| DEBUG && I.end(`[@tailwindcss/turbopack] ${path.relative(base, inputFile)}`) | ||
| callback(error as Error) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Instrumentation.end throw behavior and report() auto-end
fd -a 'instrumentation.ts$' packages | xargs rg -n -C4 'Mismatched timer label|Auto end any pending timers'
# Compare the catch blocks of both loaders
fd -a 'index.ts$' packages/@tailwindcss-webpack packages/@tailwindcss-turbopack \
| xargs rg -n -C6 'catch \(error\)'Repository: tailwindlabs/tailwindcss
Length of output: 4636
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Files =="
fd -a 'index.ts$|instrumentation.ts$' packages | sed 's#^\./##'
echo "== Turbopack index outline/section =="
wc -l packages/@tailwindcss-turbopack/src/index.ts
sed -n '1,320p' packages/@tailwindcss-turbopack/src/index.ts
echo "== Webpack index catch section =="
sed -n '80,305p' packages/@tailwindcss-webpack/src/index.ts
echo "== Instrumentation implementation =="
sed -n '1,140p' packages/@tailwindcss-node/src/instrumentation.ts
echo "== Call sites for Instrumentation / DEBUG / report =="
rg -n -C2 'Instrumentation|DEBUG|using I|\\breport\\(' packages/@tailwindcss-turbopack/packages/@tailwindcss-webpack 2>/dev/null || rg -n -C2 'Instrumentation|DEBUG|using I|\\breport\\(' packages/@tailwindcss-turbopack/src packages/@tailwindcss-webpack/src packages/@tailwindcss-node/srcRepository: tailwindlabs/tailwindcss
Length of output: 21120
Remove the explicit I.end() from the error path.
When DEBUG is enabled, this loader can throw from an inner I.start(...) path, then call I.end() with the outer loader label. Instrumentation.end() validates timer stack order and throws before callback(error) runs, so the loader promise rejects without reporting the CSS error. The using I declaration restores this behavior by calling report(), which auto-ends pending timers.
fd65315 to
f7f880a
Compare
Summary
Test plan