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

Plans to drop babel in v3 #643

Closed
bitinn opened this issue May 21, 2019 · 9 comments
Closed

Plans to drop babel in v3 #643

bitinn opened this issue May 21, 2019 · 9 comments

Comments

@bitinn
Copy link
Collaborator

bitinn commented May 21, 2019

I have been thinking about this lately, once we dropped node v4 and v6 support in 3.x release, do we still need babel?

My gut feeling is node v8+ are modern enough that all of our code are covered, so there is no value in transpiling (and I want to change back to CommonJS syntax)

https://node.green

If possible I want to drop our build step (rollup) altogether.

@bitinn bitinn added this to the Version 3.0.0 milestone May 21, 2019
@jimmywarting
Copy link
Collaborator

I'm on board with that too.

@gr2m
Copy link
Collaborator

gr2m commented May 21, 2019

I guess a build step would still be needed as modules are not the same in Node & web.

I ended up using @pika/pack, which is using rollup under the hood. I see it as a polyfill until we can have the same modules work in both, node & browser.

I wrote about my setup here: https://gist.github.com/gr2m/5dd2ec6e3a04c3dc79f0cbb46decbe46

@dmitriz
Copy link

dmitriz commented Jun 7, 2019

@Bitin

My gut feeling is node v8+ are modern enough that all of our code are covered, so there is no value in transpiling (and I want to change back to CommonJS syntax)

The PR #649 is meant as the first step in this direction. It deals with single exports.

My question is now, what should be the strategy for multiple exports?
A possible way could be to avoid them altogether,
to prevent the modules from doing "too much".
Would that be desired or is some other strategy preferred?

@TimothyGu
Copy link
Collaborator

I’m very much onboard with removing Babel. The time has come for that. I still prefer to keep our source in ES module form though. It’s much easier to transform from ESM to CommonJS style than vice versa, and with the dust settling on Node.js’ support for ESM more people would want to use it, rather than relying on CJS-ES interop.

@bitinn
Copy link
Collaborator Author

bitinn commented Jun 12, 2019

@TimothyGu I hear you, but the status quo seems to be that many bundling tools are better at transforming from CommonJS to ESM? We have had a lot of problem with people trying to package up node-fetch for AWS using Webpack.

(My guess is most of them are confused about how Webpack/ESM work, but my anecdote observation remains that Webpack seem to just work with CommonJS?)

I love the named export from ESM, for sure, just that it seems to cause some troubles for users at the moment.

@TimothyGu
Copy link
Collaborator

many bundling tools are better at transforming from CommonJS to ESM

Well I meant like actually transforming the source, rather than providing interoperability. But if that's the difficulty people are having, then I'm all for it :)

@dmitriz
Copy link

dmitriz commented Jun 12, 2019

@TimothyGu
Just trying to understand, if there is an example of specific benefit for this project from using CommonJS mixed along with ESM as it is now, rather than only CJS?

If yes, maybe I shouldn't have been wasting my time on #649 :)

@TimothyGu
Copy link
Collaborator

@dmitriz, I think I'll defer to other people in the thread as I haven't been as active.

@xxczaki xxczaki mentioned this issue Sep 7, 2019
35 tasks
@Richienb
Copy link
Member

Richienb commented Sep 8, 2019

Babel and rollup have been dropped in favour of microbundle in 3.x

@Richienb Richienb closed this as completed Sep 8, 2019
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

6 participants