feat(runtime): add support for async code transformation#11191
feat(runtime): add support for async code transformation#11191SimenB merged 4 commits intojestjs:masterfrom
Conversation
|
Deploy preview for jestjs ready! Built without sensitive environment variables with commit 1495e07 |
|
Deploy preview for jestjs ready! Built without sensitive environment variables with commit 23e5f42 |
|
Deploy preview for jestjs ready! Built without sensitive environment variables with commit 507c635 |
Codecov Report
@@ Coverage Diff @@
## master #11191 +/- ##
==========================================
- Coverage 64.31% 64.27% -0.05%
==========================================
Files 307 307
Lines 13444 13458 +14
Branches 3281 3285 +4
==========================================
+ Hits 8647 8650 +3
- Misses 4090 4101 +11
Partials 707 707
Continue to review full report at Codecov.
|
|
@thymikee this is ESM already as we cannot support async transformation for CJS, although via Or am I misunderstanding your question? 😅 Did you mean the transformer should be ESM? |
|
I meant the file to be |
|
Ah! I added a test for that together with the feature in #11163. This PR is that the transformation can be async, not transformers. Should rename something... |
|
Perfect, thanks! I see these are separate responsibilities, could have checked it before asking :) |
|
No problem 👍 |
| export interface SyncTransformer<OptionType = unknown> { | ||
| canInstrument?: boolean; | ||
| createTransformer?: (options?: OptionType) => SyncTransformer; | ||
| createTransformer?: (options?: OptionType) => SyncTransformer<OptionType>; |
There was a problem hiding this comment.
all of the type changes here should have been in #9889, but I didn't test writing a transformer before merging it, just calling it from runtime. So snuck it in here 😀
|
Hmm, I observed something odd. After adopting An example is |
|
Please open up a separate issue. Note that we've never really supported using classes, so I don't think we've ever officially supported any form of |
|
oh nvm, i think something funky with my |
|
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
Fixes #9504
Test plan
e2e test added