Skip to content
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

Allow custom transforms to participate in the main-thread pre-compilation #722

Closed
jamestalmage opened this issue Apr 5, 2016 · 5 comments
Labels
enhancement new functionality future we'll get back to this eventually low priority

Comments

@jamestalmage
Copy link
Contributor

We currently support pre-compilation of ES2015 using Babel in the main thread. This means the child processes don't pay the penalty of loading up Babel for every thread.

TypeScript and CoffeScript users can use require hooks (i.e. --require coffe-script/register), but then they pay that cost for every forked process (increased require times and memory usage).

We could allow other transforms to participate via some sort of plugin API. This would allow TypeScript and CoffeeScript users to realize the same speed increase and reduced memory footprint.

Custom plugins for other transforms would need to be developed. transform-chain is something I built with this in mind and could be helpful.

The decision we need to make is:

  1. Should we do this?
  2. Should we do it now or after 1.0.0?
  3. What should the API / config look like.
@jamestalmage
Copy link
Contributor Author

Also, this would allow transforms to participate in transform caching. (transform plugins would need to expose a cache-salt in order to participate).

@sindresorhus
Copy link
Member

I think we should defer this to after 1.0.0. We already have a lot on our plates and this is non-essential to our core features and use-cases.

@sindresorhus sindresorhus added enhancement new functionality low priority future we'll get back to this eventually labels Apr 5, 2016
@billyjanitsch
Copy link
Contributor

@jamestalmage In its current form, does --require transform test code, or only imports thereof? (i.e. does --require coffee-script/register allow me to write my tests in Coffeescript?)

@jamestalmage
Copy link
Contributor Author

For tests you need #631 (comment) to land first

@novemberborn
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new functionality future we'll get back to this eventually low priority
Projects
None yet
Development

No branches or pull requests

4 participants