https://github.com/babel/babel-preset-env with our `"node": "current"` option can help with this.
266 karma · joined March 28, 2016
https://github.com/babel/babel-preset-env with our `"node": "current"` option can help with this.
https://github.com/babel/babylon/issues/320, https://github.com/babel/babylon/issues/523
I made an issue for parser support, and after that we can create a babel plugin though https://github.com/babel/babylon/issues/328.
It's our intention as a tool to align with TC39 and transition users to using native JS when it's supported
https://v8project.blogspot.com/2017/02/high-performance-es20...
I made https://github.com/babel/babel-preset-env to make it easier to transition. Hoping that Babel makes it easier to not have to think about whether you are using native or not, so we'll work on that workflow.
Hopefully we have a better solution about making multiple bundles (separate one for IE) soon
JSCS (https://github.com/jscs-dev/node-jscs) (now merged with ESLint) started a CST project as well https://github.com/cst/cst to help deal with autoformatting by adding whitespace type nodes.
Currently the community has a lot of interest in https://github.com/jlongster/prettier which just simply reprints the file from scratch in a consistent way (posted in https://news.ycombinator.com/item?id=13365470).
We also have https://github.com/benjamn/recast to help source to source transformations and https://github.com/facebook/jscodeshift.
TL;DR - automate your Babel config options based on targets.
babel-preset-env: A Babel preset that can automatically determine the Babel plugins and polyfills you need based on your supported environments.
It takes the data from compat-table [1] to generate a mapping [2] between a Babel plugin and the first version that a browser/env supports. We calculate the least common denominator of your targeted envs to determine the final set of plugins to compile with.
(Feel free to ask questions, I help maintain Babel and the preset). Just released a 1.0 a few weeks ago and looking for more help and usage! Looking into more help with removing unnecessary polyfills, and determining plugins based on performance via benchmarks of native/compiled.
And yes there is a lot of work that goes into making this work correctly (and in the foreseeable future with ES2015+). Would appreciate any help moving forward. And maybe we should just replace/recommend this preset instead of anything else to fight the fatigue..
[1]: https://kangax.github.io/compat-table/es6/ [2]: https://github.com/babel/babel-preset-env/blob/master/data/p...
> We also presented Traceur at NodeConf 2011. The video is available on YouTube [1]
[1] https://www.youtube.com/watch?feature=player_detailpage&v=nt...
Personally, I'm most excited about babel-preset-env, and fixing how we work with the TC39 process via experimental plugins, and working with the community more.
For anyone wanting to get started in OSS or Babel I just started a year ago from knowing nothing about it!
https://babeljs.io/docs/plugins/transform-object-rest-spread...
Might be cool in combination with preset-env
https://twitter.com/jlongster/status/804888882408026113 which uses recast/babylon
(I'm working on it so let me know if you have questions)
For react, the docs for the website is in the same repo as the main code under "docs/" https://github.com/facebook/react/tree/master/docs.
A lot of projects do what we do with babel: have a separate repo with the whole username.github.io name: https://github.com/babel/babel.github.io.
And a lot of projects started adding links to edit the page you are currently on: http://babeljs.io/docs/learn-es2015/ (see the "edit this page" link on the header. For yarn it's on the bottom: https://yarnpkg.com/en/docs/. That at least makes it easy to edit a specific page for typos etc. Then you can just edit it from the website
Contributing can be a lot more than just PRs though: - answering questions on stack overflow, chat (irc, gitter, slack)
- creating a minimal code repro, checking for duplicates, checking if a bug is fixed in a later release/master branch
- writing tutorials/usage scenarios, giving talks, just using the project and providing feedback
- helping with documentation + website
- translations if possible
- reviewing other PRs
- helping with the changelog, testing prereleases
- adding to the discussion on issues
Bigger projects can have a pretty hard time with maintenance: fixing bugs, juggling PRs, making releases, answering questions, etc.
(We're looking for help on https://github.com/babel/babel and trying to figure out how we can make the project more contributor friendly!)
I'd be much easier to find a project you use or know about so you have a lot more context into the project, it's usage, documentation, etc.
In Babel we use ESLint for this https://github.com/babel/babel/blob/master/Makefile#L20-L27
It allows passing in a set of supported browsers and transpiling what is required using the lowest common denominator env (uses https://github.com/kangax/compat-table for data).
// .babelrc with preset options
{
"presets": [
["env", {
"targets": {
"chrome": 52,
"ie": 11,
"browsers": ["last 2 versions", "safari 7"]
}
}]
]
}
If you have questions, ask below (or make an issue)Yes, it doesn't need to be 33M that's just a result of the way it was used (babel-cli is that big) and I'm saying that it's something that we can fix