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

Bump Prettier from 2.8.8 to 3.0.0 #9304

Merged
merged 10 commits into from
Jul 14, 2023
Merged

Bump Prettier from 2.8.8 to 3.0.0 #9304

merged 10 commits into from
Jul 14, 2023

Conversation

queengooborg
Copy link
Collaborator

@queengooborg queengooborg commented Jul 14, 2023

This PR bumps Prettier from 2.8.8 to 3.0.0, and then fixes issues with the content commands caused by changes to the Prettier API. In Prettier v3.0, the format() command became asynchronous, so we were returning a Promise every so often, which caused errors when running commands. This PR aims to fix this by adding an await, and making the rest of the function chain asynchronous.

Note: because the content repositories use Prettier 3.0.0, these commands are broken regardless of the Prettier version Yari is requesting.

Note: because Prettier has changed its defaults, the formatting output has also changed. TO pass linting, all files had to be formatted, which unfortunately means a greater risk of merge conflicts. Since this is a critical bug fix, it should be merged quickly anyways.

@github-actions github-actions bot added the flaw-system issues and feature requests related to the flaws system label Jul 14, 2023
@queengooborg queengooborg changed the title Account for issues caused by Prettier v3.0 API changes Bump Prettier from 2.8.8 to 3.0.0 Jul 14, 2023
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jul 14, 2023
@queengooborg queengooborg marked this pull request as draft July 14, 2023 12:37
@queengooborg
Copy link
Collaborator Author

I'm marking this as a draft because the CI test is failing and I don't have the availability to dig into it further. CC @caugner @fiji-flo @LeoMcA (note: this is somewhat urgent as it is disrupting contributor workflow)

@queengooborg
Copy link
Collaborator Author

queengooborg commented Jul 14, 2023

Oh...well, apparently, the last commit I pushed fixed it all up, so never mind my last comment. 😛

@queengooborg queengooborg marked this pull request as ready for review July 14, 2023 13:00
@github-actions github-actions bot added merge conflicts 🚧 Please rebase onto or merge the latest main. macros tracking issues related to kumascript macros plus work around features related to MDN Plus plus:offline markdown markdown related issues and pull requests and removed merge conflicts 🚧 Please rebase onto or merge the latest main. labels Jul 14, 2023
@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@queengooborg
Copy link
Collaborator Author

@LeoMcA, I see that you're around -- are you available and willing to review and merge this quickly by chance? (Highly recommend reviewing by commit since Prettier formatting also has to be run in the same go...)

@LeoMcA
Copy link
Member

LeoMcA commented Jul 14, 2023

@queengooborg taking a look, but first up: I reckon now's not the time to make the trailingComma change if we want to merge this quickly (and if we do that in a separate PR, we can add that squashed commit to a blame ignore revs file).

Could you configure { "trailingComma": "es5" } and force push with a new "run prettier" commit (or none if there's no other changes between 2.8.8 and 3)?

@github-actions github-actions bot removed macros tracking issues related to kumascript macros plus:offline markdown markdown related issues and pull requests labels Jul 14, 2023
@queengooborg
Copy link
Collaborator Author

That's a fair point, since most of the formatting changes are from adding trailing commas. There are still some other changes, so I've included that commit.

client/src/playground/index.tsx Outdated Show resolved Hide resolved
client/src/playground/index.tsx Outdated Show resolved Hide resolved
content/document.ts Show resolved Hide resolved
content/document.ts Show resolved Hide resolved
build/blog.ts Outdated Show resolved Hide resolved
Copy link
Member

@LeoMcA LeoMcA left a comment

Choose a reason for hiding this comment

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

Looks good, just the one change:

client/src/playground/index.tsx Outdated Show resolved Hide resolved
Co-authored-by: Leo McArdle <leo@mca.is>
@LeoMcA LeoMcA merged commit d513c79 into mdn:main Jul 14, 2023
11 checks passed
@queengooborg queengooborg deleted the prettier-v3 branch July 14, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file flaw-system issues and feature requests related to the flaws system plus work around features related to MDN Plus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants