-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 RTLCSS Support #68456
base: trunk
Are you sure you want to change the base?
Fix RTLCSS Support #68456
Conversation
This solves WordPress#68364 to allow for the proper use of control directives.
This is done to match the regex found here: https://github.com/MohammadYounes/rtlcss/blob/master/lib/directive-parser.js#L4
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @SmushyTaco. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @SmushyTaco! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Thank you for opening this patch. It looks like it will fix the issue. Do you have any thoughts on how the comment could still be removed from the production file, as it's only necessary to instruct |
@gziolo I think I found a better solution. I'll work on writing it and push a new commit once done. |
@gziolo I have made the following changes:
There's only 1 caveat that needs fixing. When building, this message is seen:
Which I will be fixing soon. |
I see that the fix boils down to using an existing webpack plugin At the moment, CI jobs report multiple issues related to updated npm packages. In practice, it's usually easier to land targeted PRs that solve one problem at a time. For example:
@shvlv is working on an ESlint upgrade to v9 in #65648. How did you test all changes applied to the |
@gziolo the tests seem to be failing from Regarding how I've tested all of this, I'll go into depth on this once I make the finishing touches. It's currently 1:30 AM for me so I'll aim to wrap this up after I wake up. |
I'll resolve the merge conflict once I'm home. |
I'll make some finishing touches to wrap this up soon. I'll work on the clean-webpack-plugin fix when I wake up. |
This fixes #68364 to allow for the proper use of control directives.
What?
This PR stops the moving of comments and only removes comments that aren't RTLCSS control directives.
Why?
RTLCSS control directives use comments and if those comments are removed or moved, this will cause this to not function properly. See #68364 for more information.
How?
The issue is addressed by removing all comments that aren't RTLCSS control directives.
Testing Instructions
Build this SCSS code:
Only the RTLCSS comments will be preserved as intended.
Testing Instructions for Keyboard
Not applicable.
Screenshots or screencast
Not applicable.