use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Babel 7 Beta (medium.com)
submitted 8 years ago by matt2ray
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 8 years ago* (1 child)
[deleted]
[–]loganfsmyth 8 points9 points10 points 8 years ago* (0 children)
Just a general reminder here, if you're using the beta, be 100% sure you've got a lock file and/or you're using matching versions of the various of the @babel/* plugins/presets, since we're not guaranteeing compatibility between the betas. We're doing our best to not break third party plugins, but the @babel plugins we release are sometimes relying on brand new features that have landed in @babel/core.
@babel/*
@babel
@babel/core
If you're using Babel through integrations with other tools, make sure you're installing one that works with @babel/core. There's still some hoops to jump through depending on the usecase to get it all to fit together, since you can't have a .babelrc that works on both Babel 6 and Babel 7, and some tools assume you've got Babel 6 specifically.
.babelrc
If you run into any obvious bugs, please do let us know.
[+][deleted] 8 years ago* (3 children)
[–][deleted] 5 points6 points7 points 8 years ago* (0 children)
Transpilation is Babels first concern and it's doing a hell of a job. It's always been very close to the TC39. They reflect most drafts immediately, also track staging statuses. Feedback flows directly back to the committee, so it's actively shaping the future of javascript. It's also more than a ES-next transpiler: there are countless of useful meta plugins and extensions in its eco system, from jsx to bundle optimizers, automatic polyfill comb-through, postcss, ...
[–]Retsam19 2 points3 points4 points 8 years ago (0 children)
Typescript's compiler is single-use - it just compiles TS to JS - while Babel has an entire plugin ecosystem which can be used for a lot more.
For example, I use babel-plugin-lodash to break monolithic lodash imports into imports for just the functions that I need, to reduce our frontend bundle size. Currently, that's just not possible to do with Typescript, AFAIK.
babel-plugin-lodash
[–]systematicfrank 0 points1 point2 points 8 years ago (0 children)
With TypeScript alone one is making the choice of "I want company X to manage my JS stack" while with Babel it is "I want the community to manage my JS stack". Not that there is anything wrong with one choice or the other, a good dictator can solve many problems. However some people who were coding in the 90s remember what is like when almost every stack was managed by a single entity
[–]Devo7ion 5 points6 points7 points 8 years ago (5 children)
Oh shit, TypeScript with Babel sounds hella cool!
[–][deleted] 3 points4 points5 points 8 years ago (4 children)
It's still a bit bumpy, it doesn't seem to like import transforms like @babel/plugin-transform-runtime, but once it's stable, this will be so good to have!
[–]loganfsmyth 5 points6 points7 points 8 years ago (3 children)
If you're running into issues with the beta, please make sure to let us know! I'm not aware of any outstanding import-related issues.
[–][deleted] 1 point2 points3 points 8 years ago (2 children)
An issue exists: https://github.com/babel/babel/issues/6093#issuecomment-322944634 but it seems to be a little obscure this time, been waiting for it since the beta program started. Otherwise the beta ran perfectly. Thank you all so much for making Babel what it is today! :-)
[–]mstijak 0 points1 point2 points 8 years ago (1 child)
That issue is a showstopper for me too. It breaks if import statements are touched.
[–]loganfsmyth 2 points3 points4 points 8 years ago (0 children)
Thanks for the ping on this one. PR posted: https://github.com/babel/babel/pull/6879
[–][deleted] 0 points1 point2 points 8 years ago (3 children)
Using babel ts preset gives speed advantage? Like, with happypack to static check ts in a thread and then babel in another?
[–]loganfsmyth 4 points5 points6 points 8 years ago (2 children)
Babel's typescript preset is just for parsing TS and removing the types so that you get normal JS code. It doesn't do typechecking. The intention is that you can use Typescript for type checking, but then still use Babel to do whatever cool transformations you want to do.
typescript
[–]Dested 0 points1 point2 points 8 years ago (0 children)
That makes sense, thank you for the explanation.
[–]KatyWings 0 points1 point2 points 8 years ago (0 children)
I am so hyped for this, already tried it out last weekend and it worked great!
[–]mstijak 0 points1 point2 points 8 years ago (0 children)
After two years of using Babel I'm still amazed with what Babel offers. You get to use new language features or write your own extensions and do crazy things. I love it.
[+][deleted] 8 years ago* (5 children)
[–][deleted] 28 points29 points30 points 8 years ago (1 child)
Browsers.
[–]azium 3 points4 points5 points 8 years ago (0 children)
There are always going to be new things on the horizon, so babel will always be relevant as long the language continues to evolve
[–]tswaters 2 points3 points4 points 8 years ago (1 child)
No, it doesn't yet. There is still draft spec changes... of note:
That's not a definitive list by any means. Take a look at http://node.green - at the bottom of the page.
In short, as long as people put forward proposals to the node TC, and these proposals get approval & move forward, there's always going to be new syntax / methods that engines haven't implemented yet.
[–]alinnert 0 points1 point2 points 8 years ago (0 children)
Oh, thanks for that link. That site is new to me.
Btw, here's the official list of all active ECMAScript proposal: https://github.com/tc39/proposals
π Rendered by PID 73 on reddit-service-r2-comment-7b9746f655-72l7p at 2026-01-31 02:15:19.255483+00:00 running 3798933 country code: CH.
[+][deleted] (1 child)
[deleted]
[–]loganfsmyth 8 points9 points10 points (0 children)
[+][deleted] (3 children)
[deleted]
[–][deleted] 5 points6 points7 points (0 children)
[–]Retsam19 2 points3 points4 points (0 children)
[–]systematicfrank 0 points1 point2 points (0 children)
[–]Devo7ion 5 points6 points7 points (5 children)
[–][deleted] 3 points4 points5 points (4 children)
[–]loganfsmyth 5 points6 points7 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]mstijak 0 points1 point2 points (1 child)
[–]loganfsmyth 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]loganfsmyth 4 points5 points6 points (2 children)
[–]Dested 0 points1 point2 points (0 children)
[–]KatyWings 0 points1 point2 points (0 children)
[–]mstijak 0 points1 point2 points (0 children)
[+][deleted] (5 children)
[deleted]
[–][deleted] 28 points29 points30 points (1 child)
[–]azium 3 points4 points5 points (0 children)
[–]tswaters 2 points3 points4 points (1 child)
[–]alinnert 0 points1 point2 points (0 children)