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

ES2015 / babel-core through options only #40

Closed
tunnckoCore opened this issue Sep 6, 2015 · 3 comments
Closed

ES2015 / babel-core through options only #40

tunnckoCore opened this issue Sep 6, 2015 · 3 comments

Comments

@tunnckoCore
Copy link

It's too big to be in the core of AVA and think it should be available only through option like --esnext or something like that. Then user just will install it only if they write in ES2015.

if (cli.flags.esnext) {
    try {
        require(resolveFrom('.', 'babel-core/register') || resolveFrom('.', 'babel/register'));
    } catch (err) {
        require('babel-core/register');
    }
}
@sindresorhus
Copy link
Member

The thinking is that you should only write your tests in ES2015. It's time. We finally have a good transpiler (Babel). You can of course write your tests in ES5, but I want to optimize for the future, not the past. Providing this out of the box without requiring the user to do anything is one of the things that is going to set AVA apart.

I agree Babel is a large dependency, but that's less of an issue for devDependencies. I'm also going to work on getting down the size of the Babel package. Help welcome there ;)

I see that the Babel package currently includes a lot of junk you don't need in Node. The package is 13.6 MB. I think with some tweaks we could get it down many MBs. Removing browser specific stuff brings it down to 9.8 MB (Maybe Babel should have a Node specific package without those?). There's also some potential for better deduping. I'll open a Babel issue about that when I have some more time to look into it.

@tunnckoCore
Copy link
Author

Actually yes, maybe you have right and it looks that installing it one time globally is the way. But I think it's not cool, when someone want to do PR and must install it (if he dont use ava).
Another side is that: iojs have fast release cycle, more and more of the cool features comes in and we all dont need transpilier for most of the things. And if someone want to use ES6 he can use it without transpilier and that required dependency can be more than what he want/use from ES>=6

Maybe Babel should have a Node specific package without those?

👍

@sindresorhus
Copy link
Member

Babel 6 is out and it's smaller, and it will be even smaller with https://github.com/babel/babel/pull/2659/files and babel/babel#2635. Closing this, but I'm going to continue working on bringing down the dependency size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants