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
remove() not removing since 8.1.14 #1526
Comments
Tailwind contains many different tools inside. It is hard to debug it. Can you try to remove Tailwind tools to find a few plugins to reproduce the issue? |
@rigor789 @ai, I put some debugger logs, and compared the 2 versions on what the difference in behaviour is related to the unwanted empty rules. On On
Hope this helps. I am unfamiliar with PostCSS internals but can try to dive deeper if anybody shares any thoughts on this. |
Thanks for looking into it @ilyavf - interesting find! I will likely have some time to take a fresh look at this sometime next week, or the week after. What's interesting is that I've tried running the empty rule removal as a separate plugin and I recall seeing the same behavior - but will need to test that again to double check. |
Very strange. We didn’t change anything with plugin API between 8.1.13 and 8.1.14. Here is only commit related to JS sources: a187464 |
After version 8.1.14 calling
rule.remove()
ordecl.remove()
doesn't remove nodes correctly.The only change between the working/non-working version is a187464 however I stepped through with the debugger, and couldn't see anything different in the calls, in fact logging out the
fromOffset
return values and diffing the outputs of the working/non-working version, they are identical, leaving me very puzzled.Tried reducing the variables in an empty project, but seems to be working fine there.
The behavior can be seen in https://github.com/rigor789/nativescript-tailwind on the
feat/tailwind2
branch. Steps to reproduce:git clone https://github.com/rigor789/nativescript-tailwind.git
git checkout feat/tailwind2
yarn && yarn build
dist/tailwind.css
(git diff
)"postcss": "8.1.13"
to8.1.14
(any higher version produces same results)yarn && yarn build
againdist/tailwind.css
now has many empty rules (seen ingit diff
)We are calling remove on rules that are empty here: https://github.com/rigor789/nativescript-tailwind/blob/bfb0c2bb90b4a72c569b81a3096a5262bc8f2a30/src/removeUnsupported.js#L49-L51
We are also calling remove on declarations here: https://github.com/rigor789/nativescript-tailwind/blob/bfb0c2bb90b4a72c569b81a3096a5262bc8f2a30/src/removeUnsupported.js#L138-L142
I'd be happy to work on a fix, but would like to get some help figuring out what's wrong 🤗
The text was updated successfully, but these errors were encountered: