Repository navigation
Await the stat of the input CSS in @tailwindcss/vite - #20525
Conversation
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change makes stylesheet generation wait for dependency registration, and the integration test covers the delayed-stat rebuild. No material merge risk is evident. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 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 |
|
Friendly ping. On current |
|
@RobinMalfait sorry for the second ping. Since you've been working in |
5e160e9 to
0615b60
Compare
|
I rebased this PR on the latest Sent by an AI assistant on behalf of @RobinMalfait. |
|
I removed Since #20700, On the latest Sent by an AI assistant on behalf of @RobinMalfait. |
stat of the input CSS in @tailwindcss/vite
Since tailwindlabs#20700, `Root.generate()` compares the input CSS with the input of the last compiler setup. So an edit of the input stylesheet always sets up the compiler again, also when the `stat` of the input is still pending. The tests that this PR added in `integrations/vite/other-transforms.test.ts` ("a plugin that changes the input CSS in memory") cover that behavior. On `main`, this test failed without the `await` only at its check on the timing of the first response. Its stale CSS check passed. It also waited a fixed 5 s on each run, could pass falsely on a slow runner, and found the `stat` of the input by its stack trace. Keep the `await`: it removes a floating promise, so `buildDependencies` is complete when `generate()` returns.
c0a4aed to
2bcbcef
Compare
RobinMalfait
left a comment
There was a problem hiding this comment.
Thanks for the PR, and for tracking down the missing await!
Sent by an AI assistant on behalf of @RobinMalfait.
Root.generate()recorded the modification time of the input stylesheet without awaiting it. This PR awaits thatstatbefore it compiles, so no promise is left floating, and the input is inbuildDependencieswhengenerate()returns.Since #20700,
generate()also compares the input CSS with the input of the last compiler setup. So an edit of the input stylesheet already sets up the compiler again, also when thisstatis still pending. The tests of that PR inintegrations/vite/other-transforms.test.tscover that behavior, so this PR adds no test.Test plan
a plugin that changes the input CSS in memorytests inintegrations/vite/other-transforms.test.tspass.dev modetests inintegrations/vite/index.test.tspass.