-
-
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
chore: transformers must return objects, not strings #10773
Conversation
74e57c6
to
5fff2c0
Compare
oops !!!! I just made a transformer for |
Yeah, I'm not 100% convinced we should do this. There's not that much code saved - we can normalize where we call |
I'd keep the normalization for one more version and output a deprecation warning. Should give maintainers some time to migrate. |
Normalization is |
Yeah TBH 'overloading' the return with string and object doesn't seem bad to me as a permanent solution if we treat it like config by normalizing straight away when we received the result. Unless we want to encourage people in general to have their transformers add some of the optional properties because it improves user experience? In that case an object where people will wonder what other properties they could add would be a good nudge. |
One obvious one is module format (#9860 (comment)) and it is very much preferable if people return source maps if they have them as json already instead of us extracting them (via a regexp) from the returned string. Printing some warnings if either |
Yeah in that case a string would always generate a warning anyway so we might as well use that as the deprecation message 'transformers need to specify a |
just an idea related to this type of breaking change: perhaps Jest can start pushing out pre-release major versions as well as update That will give users more possibilities to test changes, adopt anything possible etc.. which is especially useful when coming to major versions with breaking changes. For minor/patch versions, that is not needed. |
27 will be quite breaking across the board (API wise and changing default, plus underlying implementations), so we'll definitely be pushing out pre-releases for this one 👍 Will start this week or next (a bit delayed due to various nugs that needed patches, but I think we're good to go now) |
5fff2c0
to
0d6c9e5
Compare
0d6c9e5
to
6a5c41f
Compare
Do we expect to land this for 27 ? |
I don't think we need to do this one, did #10823 as solution for "this file is ESM" |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Follow-up to #10753 with more scheduled breaking changes in the transformer.
Test plan
Green CI