-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Feature]: Migrate to Prettier v3 #13495
Comments
Thanks for opening up an issue!
That means we probably won't ever be able to migrate - I don't think we wanna make snapshot matchers async. We could possibly have some codemod or similar, but I'm not too sure about that... What we can do is probably just drop the prettier usage in the inline snapshots and solely use the babel approach which was released in Jest 27. |
https://github.com/babel/babel/blob/main/packages/babel-register/src/worker/index.js By the way, this would be another powerful illustration of the real world for calling async in sync, and I'll probably mention this somewhere.😃 |
Using a worker might work, but I think I'd rather avoid it 😅 It's not just a single back and forth, we'd need to load all of If we could preload prettier somehow and then have the APIs be sync it'd work. But I doubt that's something prettier would want |
I just noticed that prettier seems to already have something like this, which is great! |
Ah! If that becomes a thing I guess we could use that. But dropping the runtime (albeit optional) dep on prettier would be preferable I think. |
Yes, maybe |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Please keep it open. |
Can we try to run tests with [email protected] to see what's broken? |
Sure! Should be fine to just open a PR upgrading? |
Congrats on the release! Should we use https://github.com/prettier/prettier-synchronized in Jest? |
Prettier v3 has dropped, and this appears to have broken snapshot testing in projects that upgrade. Is there any update on when we can expect to see support? |
This is tracked in #14305 |
Done in #14566 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Hi, I am a maintainer at Prettier.
The Prettier team is currently working on v3 (still alpha).
v3 will include breaking changes. (Detailed changelog is here: https://github.com/prettier/prettier/releases/tag/3.0.0-alpha.1)
For example, the all of public APIs will be async (changelog). Jest inline snapshots will probably be affected by this.
If you have any questions, feel free to mention us. We can help you.
If you have already migrated to Prettier v3, sorry but please close this issue.
Motivation
Example
N/A
Pitch
Jest inline snapshots that uses Prettier as a library, is included in Jest core
The text was updated successfully, but these errors were encountered: