Transform Async
See original GitHub issueDo you want to request a feature or report a bug?
Feature.
What is the current behavior?
Transforms are synchronous, basically process
returns a string
of the transformed source.
What is the expected behavior?
It would be useful to also support Promises, for asynchronous transformation.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
babel/plugin-transform-async-to-generator
Since Babel cannot automatically handle this runtime error, you should manually transform it to a promise. async function foo() { - await 42;...
Read more >babel-plugin-transform-async-to-promises - npm
Transform async /await to promise chains. Latest version: 0.8.18, last published: a year ago.
Read more >rpetrich/babel-plugin-transform-async-to-promises - GitHub
Babel plugin to transform async functions containing await expressions to the equivalent chain of Promise calls with use of minimal helper functions.
Read more >babel-plugin-transform-async-to-promises - npm package | Snyk
Babel plugin to transform async functions containing await expressions to the equivalent chain of Promise calls with use of minimal helper functions. Input:....
Read more >babel-plugin-transform-async-await | Yarn - Package Manager
Babel plugin to transform async functions containing await expressions to the equivalent chain of Promise calls with use of minimal helper functions.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi I understand the rationales for the “No”, but let me add that here we would really need the
transform
to support asynchronous methods, like Webpack does with its loader. We made a custom loader (for translations files inresx
format) that works for Webpack and that we could reuse almost as-is if the jest transform option was asynchronous. Currently the workaround has been to pre-compile all our translation files before running Jest, but it’s not optimized at all.Thanks anyway for the transform option to exist at all 😃
@jpvincent I ran into the same thing with a resx transformer. This seems to work: