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

Update our Babel usage to only apply stage-4 transforms #1193

Closed
novemberborn opened this issue Jan 17, 2017 · 5 comments
Closed

Update our Babel usage to only apply stage-4 transforms #1193

novemberborn opened this issue Jan 17, 2017 · 5 comments
Assignees

Comments

@novemberborn
Copy link
Member

Our current Babel usage is a bit confusing, and applies too many transforms (stage-2 even!): https://github.com/avajs/ava/blob/a380fe4f5ffa1d334a2a3786215d3c1ff10a9898/lib/babel-config.js#L43:L48

Per RFC001 we will only apply stage-4 transforms. We must only apply transforms for features that are not natively supported on Node.js 4 and 6 respectively. We must not polyfill the environment.

I'm thinking we may have to roll our own preset to do this properly, given that https://www.npmjs.com/package/babel-preset-es2015-node4 is deprecated in favor of https://github.com/babel/babel-preset-env, which pulls in unnecessary dependencies. https://www.npmjs.com/package/babel-preset-node6, confusingly, talks about ES2015 yet we need ES2017.

@sindresorhus
Copy link
Member

Yeah. We need a custom preset.

@mightyiam
Copy link
Contributor

I'm looking forward to this. Debugging should be more clear without unnecessary polyfills.

Did we think about automatically detecting target?

And what's wrong with stage 2? No one has to actually use any proposed future...

@novemberborn
Copy link
Member Author

And what's wrong with stage 2? No one has to actually use any proposed future...

But they might, accidentally.

When AVA started the language features that are now in ES2017 and earlier where not even shipping in Node.js. That's completely changed now, Node.js 8 should have full ES2017 support I think. AVA can still focus on making these features available to older runtimes but it doesn't need to advocate for features in earlier stages of development. This also aligns us with ESLint, which only supports stage-4 features.

@mightyiam
Copy link
Contributor

Alright. What about target detection? We are on target runtime. So why don't we detect and set the target accordingly?

@novemberborn
Copy link
Member Author

What about target detection? We are on target runtime. So why don't we detect and set the target accordingly?

That's the plan.

@novemberborn novemberborn self-assigned this Jan 18, 2017
novemberborn added a commit that referenced this issue Jan 18, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 19, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
novemberborn added a commit that referenced this issue Jan 20, 2017
Fixes #1193, #1195.

Closes #947 and #1089, since babel-runtime is removed.
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

3 participants