Repository navigation
Upgrade wp-prettier to 3.9.6 - #82731
Conversation
|
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. |
🤖 PR meta 🤖📦 Bundle sizeSize Change: -31 B (0%) Total Size: 8.21 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
|
A merge conflict surface area would be smaller here than with some PRs (JSX filename change) we've shipped recently.
I hear that cool kids are using Oxfmt; it might be worth checking the compatibility with our custom rules. +1 to merge as soon as possible. |
ciampo
left a comment
There was a problem hiding this comment.
Once beta testing is done, should we publish wp-prettier@3.9.6 and update the manifests and lockfile off 3.9.6-beta.2? The stable npm tag is still 3.0.3, apparently
| extensions: [ | ||
| 'cjs', | ||
| 'js', | ||
| 'json', | ||
| 'jsx', | ||
| 'mjs', | ||
| 'ts', | ||
| 'tsx', | ||
| 'yml', | ||
| 'yaml', | ||
| ], |
There was a problem hiding this comment.
Should we include .cts and .mts here too? (optionally cover the four module extensions in a focused test)
There was a problem hiding this comment.
I tried to do this, but eventually gave up because not even our linter configs don't match these extensions. And we don't really have any .cts and .mts files. This might change with Node 24 and the built-in type stripping.
Let's do this as a standalone PR that adds support to all our tooling at once.
There was a problem hiding this comment.
A follow-up works 👌
Up to you if you still want to add a test for .cjs and .mjs in @wordpress/scripts? The current tests do not cover wp-scripts format, so directory formatting for these files could break without CI noticing.
With Storybook and Vitest using Vite, we could start considering the move from Webpack to Vite for our main bundles too, and a general migration to the voidZero stack |
I want the fork version number to match exactly the upstream Prettier version from which it is derived. Which is 3.9.6 now. But that also means that we have no room for error. If That's why I'm releasing only beta versions now. I'll try the same upgrade on Calypso, and if it works, then we can release |
ciampo
left a comment
There was a problem hiding this comment.
Apart from minor feeback, LGTM 🚀
I guess next steps will be to rebase, solve/conflicts for the latest unformatted files, and merge ASAP before more conflicts appear.
If we struggle, we could resort to triggering a manual dispatch of the workflow that will force all PRs to rebase.
|
Can we please wait a bit before we merge this PR? I think this needs the |
I'm certainly not in a hurry: I'd like to release the final 3.9.6 before merging and then wait 24 hours for To make sure we don't have any bugs, I'm also upgrading Calypso in Automattic/wp-calypso#114274. |
Thanks |
|
#82767 is the improvement I was referring to. |
|
@manzoorwanijk I'd like to merge the Prettier upgrade today. Do I just add the |
Yes, that is correct. The label is already added and we are good. |
FYI, here is the CI run (with summary) post-merge, to show how many PRs needed a force update. |
|
It looks like there are some failures in trunk. This should fix it - Fix prettier lint issues after prettier upgrade edit: now merged |
Those checks actually failed in this PR as well, but I guess it was merged before the run finished. |
Oh, I apologize for that. I didn't want to wait 30 minutes for irrelevant performance and e2e tests. Also the next 30 minutes would likely bring further Thanks for sorting it out quickly ❤️
I thought I upgraded the package to the final version but apparently I didn't. Fixing in #83026. That PR also adds the landed |
|
We don't really have anything that enforces that all Markdown files are formatted with Prettier, but historically I've been able to rely on my editor's "format on save" option with Markdown files with little disruption. Since these updates I've had to be a lot more careful as formatting existing files usually brings a lot of changes. I wonder if we should make another big formatting pass on all of the Or we could do nothing and continue to let Markdown be a free-for-all 😄 |
|
I would love that. I always have to choose |
|
I'd also be supportive of reformatting everything and simplifying the setup. If it's an opportunity to remove |
I updated the
wp-prettierfork from 3.0.3 (3 years old version) to the latest 3.9.6 version. It took Cursor 2 hours to rebase the patch across 2600 upstream commits 🙂 And I published it to NPM as beta (2) so that we can test it before publishing the final version.This PR upgrades the Gutenberg repo. If we later switch to Biome or something else, at least we'll be upgrading from the latest version of a mainstream formatter.
Main formatting changes I noticed:
const a = ...) break lines immediately after the=typeof import( 'foo' )used as a type inserts missing spaces&&chains no longer have extra indentiation levela | b | c | d) are broken into multiple linesA extends Btype expressions are broken into multiple lines