关于使用(和发布)ES2015+ 包
对于我们这些需要支持较旧浏览器的人,我们会在应用代码上运行像 Babel 这样的编译器。但这并不是我们发送到浏览器的所有代码;我们在 node_modules 中的代码也包含在内。
🌐 For those of us that need to support older browsers, we run a compiler like Babel over application code. But that's not all of the code that we ship to browsers; there's also the code in our node_modules.
我们能不能让编译依赖不仅可行,而且变得很正常?
🌐 Can we make compiling our dependencies not just possible, but normal?
接近 7.0 版本发布
查看 7.0 计划 了解 7.0 预发布版的最新更新。如果这篇文章中有不清楚的地方,告诉我吧!
Babel三岁了
生日快乐 Babel! 🎂(9月28日)
自从塞巴斯蒂安三年前开始这个项目以来,Babel 真的是进步神速!不久前,它从6to5改名为Babel;原因很充分,因为它极大地促进了许多公司、库和开发者使用 ES2015+。
🌐 Babel has really come a long way since Sebastian started the project only 3 years ago! A while back it was renamed from 6to5 to Babel; for good reason as it has significantly contributed to the use of ES2015+ by many companies, libraries, and developers alike.
为7.0做计划
如果你还不知道的话,我们计划很快发布 7.0 版本 🙌!其实这项工作早在二月份就开始了,当时我只是想发布一个版本,以停止对 Node 0.10/0.12 的支持,并移除 babel-runtime 以及其他各种代码。从那时起,我们已经发布到 alpha.20 版本了。
🌐 If you didn't know already, we're planning on releasing a 7.0 version soon 🙌 ! Work on it actually started back in February, when I just wanted to make a release to drop Node 0.10/0.12 support and remove babel-runtime and various other code. And since then, we've done releases up to alpha.20.
使用 babel-plugin-macros 的零配置代码转换
Babel 最初是作为一个转译器出现的,让你可以写最新版本的 ECMAScript 规范,但运行在还不支持这些特性的环境中。不过它现在已经远不止于此。“编译器是新的框架” 的作者 Tom Dale 的观点我非常赞同。我们看到越来越多的库和框架在编译时进行优化。我说的不是语言的语法扩展,而是一些简单的代码转换,让一些原本很难实现的模式变得可行。
🌐 Babel started out as a transpiler to let you write the latest version of the ECMAScript specification but ship to environments that don't implement those features yet. But it has become much more than that. "Compilers are the New Frameworks" says Tom Dale and I could not agree more. We're seeing more and more compile-time optimizations for libraries and frameworks. I'm not talking about syntax extensions to the language, but simple code transformations that enable patterns that would be difficult to accomplish otherwise.
为Babel做贡献:记住的三个教训
弄清楚一个新的代码库总是充满挑战,Babel 也不例外。
🌐 Getting to work your way around a new code base always poses its challenges, and Babel was no exception.
我一直在作为谷歌2017年夏季编程项目的一部分与Babel合作,致力于更新Babel转换器和Babylon解析器以适应规范的变化,并实现新功能。
🌐 I’ve been working with Babel as part of the Google Summer of Code 2017 program, working to update Babel transforms and the Babylon parser to accommodate changes to specifications and implementing new features.
这是我到目前为止从冒险中学到的一些东西。
🌐 Here’s a few things I’ve learnt from my adventures so far.
Babel的个人经历 #1 — 一次评论异常多的 PR
我们上周在 Babylon —— Babel 的解析器 —— 上为 阶段 2 装饰器规范 落地了 解析器支持。如果你不知道装饰器是什么,简单来说,装饰器就是提供一种简洁的语法来影响你装饰的类或类方法的定义。
🌐 We landed the parser support for the stage-2 decorators spec last week at Babylon — the parser for Babel. If you don’t know what a decorator is, the gist of it is that a decorator gives some concise syntax to affect the definition of a class or a class method which you decorate.
Babel 和 2017 年夏季编程
巴贝尔首次参与了代码之夏!虽然我们之前忘了发公告贴,但这里是我们的进展更新 😊
🌐 For the first time, Babel is participating in Summer of Code! Although we forgot to make an announcement post earlier, here's our progress update 😊
为工具作者升级到 Babel 7(进行中)
我们正在把迁移指南从博客文章搬到文档页面上!
🌐 We are moving the migration guide to a docs page instead of a blog post!
看看 v7-migration-api 吧!
🌐 Check out v7-migration-api!