-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use jest async transformers when available #25
Comments
Awesome thanks for setting this up @benmccann! |
Support now exists in Jest! However, it hasn't yet been released yet, so we'll need to wait a little in order to be able to use it |
I was just curious @sebastianrothe if this is something you're still planning to give a go of? |
I'd love to, but my project at work takes up all my time. I'll try to give it a go at the beginning of next month. |
Extending on a few things @benmccann noted here that I agree with. If we want to support async transforms and not tie ourselves to Jest versioning, we'll need to support both sync and async transformers for the time being until a reasonable time where we can deprecate sync transformers. We can't force existing codebases using I'm not sure what the best way will be to determine if async transforms are supported. Ideas include:
Keep in mind, it may executed inside a monorepo, and note any existing |
I'm not sure it'd be much of an imposition to ask people to upgrade to v27.x. I just took a look at the breaking changes in v27 and they seem quite minor: https://jestjs.io/blog/2021/05/25/jest-27#features-coming-with-breaking-changes |
I'll be honest I didn't actually look at the breaking changes. There seems to be nothing serious, I was thinking of a few other things outside of the noted breaking changes, but again nothing of importance. If it all seems okay, we can just ignore what I said and next major version of |
From my understanding, we can keep the existing code and just write a new async transformer. I think I already did some steps to extract functionality into seperate files. The only difference will be, how the transformer is called. Either as a subprocess with node or as an async function. |
I don't understand why we'd want to keep the existing code. Calling as a subprocess with node is purely worse. We should just always return an async transformer |
Well, Jest <27 doesn't understand async transformers. If we rewrite the code, we loose compatibility with Jest 26.x Guess, people who need to run Jest 26.x can always use an older version, right. |
Yeah, that's fine. We listed |
It seems this is not quite resolved. "svelte-jester": "2.0.1" jest config
|
Yes, I am seeing same error as @gorjan-mishevski. Same jest config file svelte-jester@2.0.1 |
+1. Also same config. svelte-jester@2.0.1 |
Please use the latest version: 2.1.2 |
@benmccann updating to 2.1.2 now gives me |
@ritchieanesco #74 was fixed by #75 but that fix hasn't made its way into a released version yet. I don't know why, because 2.1.2 is unusable, so I'd have thought that 2.1.3 would be more urgent. But once 2.1.3 comes out, it will work. I've verified the fix in #75 by cloning the svelte-jester repo and putting So wait for 2.1.3 to come out and it should work for you. |
I had the same problem as @gorjan-mishevski but 2.1.3 is out now for
|
@n00pper it was left out of the published version but is being addressed 👍 |
This can't be done until jestjs/jest#9504 is completed (related PR pending jestjs/jest#9889). Filing here to track though
In order support preprocessing this library needs to spin up a new node instance for each source file which seems like it should have a negative performance impact.
One the jest work is done to support async transformers then we should use those here
The text was updated successfully, but these errors were encountered: