Skip to content
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

Replace classnames with clsx #61138

Merged
merged 21 commits into from May 3, 2024
Merged

Replace classnames with clsx #61138

merged 21 commits into from May 3, 2024

Conversation

DaniGuardiola
Copy link
Contributor

@DaniGuardiola DaniGuardiola commented Apr 26, 2024

PR originally started as a test, see: #61091 (comment)

Then it replaced #61091, see: #61091 (comment)

There are no significant changes in this PR that weren't already part of the previous PR, I only synced with trunk and ensured that all usage of classnames was still consistently replaced with cslx.

@DaniGuardiola DaniGuardiola requested a review from tyxla May 1, 2024 08:22
@DaniGuardiola
Copy link
Contributor Author

@dcalhoun FYI the bundle size comment finally got posted 🎉 #61138 (comment)

README.md Outdated Show resolved Hide resolved
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Left a few minor suggestions/questions, but nothing critical that can't be addressed in a follow-up PR.

packages/commands/CHANGELOG.md Outdated Show resolved Hide resolved
const classes = classnames(
'components-focal-point-picker__icon_container'
);
const classes = clsx( 'components-focal-point-picker__icon_container' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some of those, I wonder why we even need a classnames/clsx utility. Guess it can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, this one's honestly kind of funny lol. Guessing there was a point in using it before and then it was updated and they just didn't remove the classnames call.

@@ -94,8 +94,7 @@ export const SVG = forwardRef(
const appliedProps = {
...props,
className:
classnames( className, { 'is-pressed': isPressed } ) ||
undefined,
clsx( className, { 'is-pressed': isPressed } ) || undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it was here before, but do we really need the || undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes no sense. Honestly I didn't really look into these, I just search-replaced.

@DaniGuardiola DaniGuardiola added the [Type] Code Quality Issues or PRs that relate to code quality label May 1, 2024
@DaniGuardiola DaniGuardiola enabled auto-merge (squash) May 1, 2024 10:48
packages/block-editor/CHANGELOG.md Show resolved Hide resolved
.github/setup-node/action.yml Outdated Show resolved Hide resolved
@desrosj
Copy link
Contributor

desrosj commented May 1, 2024

It looks like this PR is the first one making a change to the package.json file since #61211, which means it's the first one running the npm ci step.

I tried rolling that back the update to actions/setup-node, and and it worked for me (#61289). I also moved the debugging steps we added above to that PR to keep this one specific to the task at hand.

@DaniGuardiola
Copy link
Contributor Author

DaniGuardiola commented May 3, 2024

Thanks @desrosj, I'm gonna remove the unrelated CI debug changes in order to merge the PR.

@DaniGuardiola DaniGuardiola changed the title Try: Replace classnames with clsx Replace classnames with clsx May 3, 2024
@DaniGuardiola DaniGuardiola added Needs Dev Note Requires a developer note for a major WordPress release cycle and removed Needs Dev Note Requires a developer note for a major WordPress release cycle labels May 3, 2024
@DaniGuardiola DaniGuardiola merged commit c566725 into trunk May 3, 2024
63 of 65 checks passed
@DaniGuardiola DaniGuardiola deleted the ignore/clsx-size-test branch May 3, 2024 20:04
@github-actions github-actions bot added this to the Gutenberg 18.4 milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants