-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Babel plugin doesn't add PURE comment in latests babel #2619
Comments
Thanks for the report. It's odd, the line that adds the PURE comment is getting hit, but the comment is not actually getting added. I can look at this over the weekend, though I'm not sure if I can fix it. BTW, |
I ended up fixing it with a yarn patch. Basically just did
‘reference.parentPath.addComment(..)’ but I wasn’t sure that was the
correct solution.
…On Wed, Jan 19, 2022 at 1:55 PM Sam Magura ***@***.***> wrote:
Thanks for the report. It's odd, the line
<https://github.com/emotion-js/emotion/blob/main/packages/babel-plugin/src/styled-macro.js#L108>
that adds the PURE comment is getting hit, but the comment is not actually
getting added. I can look at this over the weekend, though I'm not sure if
I can fix it.
—
Reply to this email directly, view it on GitHub
<#2619 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXLLAALHAEVQFTJGJ6FVQ3UW4CL5ANCNFSM5MKN2FTQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Awesome. @Andarist is that the correct solution? |
It might be the correct solution but that also means that something has changed on the Babel side of things. In general, comments are really wonky in AST because based on a source file it's really uncertain to which AST node a particular comment belongs. So perhaps the Babel generator (from AST to text) changes its logic somehow and what we have been adding became swallowed now? We should upgrade all Babel deps and check if any of our snapshots change. |
Current behavior:
The current babel plugin seems to work fine for everything except the /* #PURE */ comment that should be seen.
To reproduce:
npm install
andnpm run build
Expected behavior:
All styled blocks should be prefixed with PURE comment
Environment information:
The text was updated successfully, but these errors were encountered: