-
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
Dependency Updates and ESM Migration #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 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. |
It looks like we need the ESLint 9 update to fix this (or wait for importing ESM modules with require() to no longer be experimental) so the tests pass. I hope my progress towards ESM is appreciated and understood as something that'll eventually be necessary for the future maintenance of this project. In the meantime before the ESLint 9 migration, I'll investigate solutions. This might work, I'll investigate. |
@gziolo from what I'm seeing, it seems like the main issue is Jest not picking up the tests now that they're ESM. Jest's ESM support is still experimental and from what I see here, it seems like ESM migration is something you guys want in the future. Have you guys considered migrating away from Jest and to Vitest? With all that said, I'm going to open a new PR just for the RTLCSS bug fix soon so we can get that merged ASAP. This PR will focus on ESM migration and keeping dependencies up to date. It'll be able to be merged after the ESLint 9 migration and after tests are migrated to ESM. |
See #68493 |
Regarding ESLint v9, the last state is we support Regarding the PR scope, it's hard for me to understand why we need to switch to ESM modules and why only the
|
@shvlv yeah given the added complexity I see why solving one problem at a time can simplify things. That's why I opened #68493 which focuses just on the RTLCSS fix like this one should've. I migrated to ESM on this branch because many of the packages used here became ESM only in later versions and ESM module support from CommonJS is still experimental. It might be better to just wait for that stabilize before updating dependencies rather than migrating to ESM right now which is a much larger undertaking. With that said, I'll be closing this PR in favor of #68493 If you could look at the new PR to see why the unit tests are failing that would be greatly appreciated. The changes are minimal and I'm not seeing anything related to the changes in the error logs, which makes me think these tests were failing before any of my changes. When I run So with all that said, I think #68493 should be able to be merged now to fix support for RTLCSS. |
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.