question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add compile() method to complement process() for transformers

See original GitHub issue

🚀 Feature Proposal

Add support for a compile() like method to complement process() for transformers.

Motivation / Pitch

I’m writing an esm loader and trying to make it work as the ESM support layer for Jest (without using Babel). I found I could make esm provide a process() method and be used as a "transform": "esm" which is great! However, esm anchors its runtime to the module object created and ran through the wrapper(). Normally this isn’t a problem, since esm owns the implementation it handles this in Module#compile or Module#_extensions. However, Jest constructs modules from scratch so there is no place for esm to hook into and decorate the module object. A hook like compile or init or beforeCompile would be one way of enabling this.

Related to https://github.com/facebook/jest/issues/4842#issuecomment-377134208.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:29 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
thymikeecommented, Dec 18, 2018

Ok, cool! I’m just not sure if we squeeze this in for v24. But since this is non breaking, I guess we can give it some more time.

1reaction
SimenBcommented, Sep 23, 2018

Ah, that’s pretty neat!

@cpojer @aaronabramov do you have any thoughts on the API here? I would still like for this to be possible to use together with e.g. Babel, but if this is an OK first go we should do it.

We could also go crazy and have an --esm flag so it’s provided out of the box (like --coverage is). Would be coupled to this implementation, but I think that’s fine?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fine-tune a pretrained model - Hugging Face
In this tutorial, you will fine-tune a pretrained model with a deep learning framework of your choice: Fine-tune a pretrained model with Transformers...
Read more >
Understanding High-Level Properties of Low-Level Programs ...
Transformer models on high-level programming semantics, this ... define void @caller() { ... code or the compilation process as proxies for the whole....
Read more >
Reducing Application Build Times Using CUDA C++ ...
The CUDA 11.5 C++ compiler addresses a growing customer request. Specifically, how to reduce CUDA application build times.
Read more >
Reactor 3 Reference Guide
Schedulers.boundedElastic() is a handy way to give a blocking process its own thread so that it does not tie up other resources. See...
Read more >
Gambit, a portable implementation of Scheme
The ' -i ' option forces the compiler to process the remaining command line arguments like the interpreter. The ' -prelude ' option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found