-
-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(postcss): race condition on builder instance for simultaneous plugin invocations #2919
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 8da1e6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
for (;;) { | ||
if (!builderGuard) break | ||
await builderGuard | ||
} | ||
const _builderGuard = postcssProcess(...args) | ||
if (!_builderGuard) return | ||
|
||
builderGuard = _builderGuard.finally(() => { | ||
builderGuard = undefined | ||
}) | ||
return builderGuard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is happening here ? I'm not familiar with this for (;;)
trick
also, would it be possible to add a test somewhere in there https://github.com/chakra-ui/panda/blob/main/packages/postcss/__tests__/postcss.test.ts
Hi @doubleaxe, Do you think that PR will fix other issue "I don't see any styles" or it's not related at all ? https://panda-css.com/docs/installation/nextjs#i-dont-see-any-styles Thanks |
Closes #2916
📝 Description
Fixes postcss race condition because builder instance is singelton, and postcss plugin is async.
⛳️ Current behavior (updates)
Reported in bug report.
🚀 New behavior
Added
builderGuard
which allow only one plugin invocation to be run at a time, other invocations will wait. Tested on my instance.💣 Is this a breaking change (Yes/No): No
📝 Additional Information