Babel 中文文档
  • 印记中文
  • 文档
  • 配置
  • 试用
  • 视频
  • 博客
  • 赞助
  • 团队
  • GitHub

›All Blog Posts

All Blog Posts

  • 7.19.0 Released: Stage 3 decorators and more RegExp features!
  • 7.18.0 Released: Destructuring private elements and TypeScript 4.7
  • 7.17.0 Released: RegExp 'v' mode and ... 🥁 decorators!
  • 7.16.0 发布: ESLint 8 和 TypeScript 4.5
  • 7.15.0 发布:支持 Hack-style 管道, TypeScript 枚举常量和 Rhino 目标
  • Babel is used by millions, so why are we running out of money?
  • 7.14.0 Released: New class features enabled by default, TypeScript 4.3, and better CommonJS interop
  • 7.13.0 Released: Records and Tuples, granular compiler assumptions, and top-level targets
  • 7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks
  • 7.11.0 Released: ECMAScript 2021 support in preset-env, TypeScript 4.0 support, printing config and the future of `babel-eslint`
  • The State of babel-eslint
  • 7.10.0 Released: Class Fields in preset-env, '#private in' checks and better React tree-shaking
  • 7.9.0 Released: Smaller preset-env output, Typescript 3.8 support and a new JSX transform
  • 7.8.0 Released: ECMAScript 2020, .mjs configuration files and @babel/cli improvements
  • Babel's Funding Plans
  • 7.7.0 Released: Error recovery and TypeScript 3.7
  • 7.6.0 Released: Private static accessors and V8 intrinsic syntax
  • 7.5.0 Released: dynamic import and F# pipelines
  • The Babel Podcast
  • 7.4.0 Released: core-js 3, static private methods and partial application
  • 7.3.0 Released: Named capturing groups, private instance accessors and smart pipelines
  • 7.2.0 发布:私有实例方法(Private Instance Methods)
  • 在 Babel 中支持 TC39 标准的装饰器
  • 7.1.0 Released: Decorators, Private Static Fields
  • Babel 7 发布
  • Removing Babel's Stage Presets
  • What's Happening With the Pipeline (|>) Proposal?
  • Announcing Babel's New Partnership with trivago!
  • On Consuming (and Publishing) ES2015+ Packages
  • Nearing the 7.0 Release
  • Babel Turns Three
  • Planning for 7.0
  • Zero-config code transformation with babel-plugin-macros
  • Contributing to Babel: Three Lessons to Remember
  • Personal Experiences at Babel #1 — A PR with Unusually High Number of Reviews
  • Babel and Summer of Code 2017
  • Upgrade to Babel 7 (moved)
  • Upgrade to Babel 7 for Tool Authors (WIP)
  • 6.23.0 Released
  • The State of Babel
  • 6.19.0 Released
  • 6.18.0 Released
  • 6.16.0 Released
  • Babili (babel-minify)
  • 6.14.0 Released
  • Babel Doctor
  • Setting up Babel 6
  • 6.0.0 Released
  • React on ES6+
  • Function Bind Syntax
  • 5.0.0 Released
  • Babel 喜爱 React
  • 并非出生而逐渐走向灭亡
  • 2to3
  • 6to5 + esnext

6to5 + esnext

January 12, 2015

James Kyle

过去几个月令人兴奋的是 6to5。我们已经从一个教育项目,演变为在 npm 上有 10 万次下载量,已经有 1,800 次提交和 155 次发布,我们现在支持每个主要的 JavaScript 构建系统,最近我们成为了 Sprockets 4.0 的默认构建工具。最重要的是,我们的全新网站和文档收到了成千上万的页面访问量,并且已被包括 JavaScript Weekly 在内的多家出版物推荐。

npm downloads of 6to5, traceur, and esnext

(Source: npm, includes 5-day moving point average)

然而,一切才刚开始……

6to5 的使命是,采用未来版本的 JavaScript,并将其编译为符合规范、高性能和可读的 JavaScript 文件,而这些文件我们现在就完全可以运行它们。通过内置对 JSX 和 Flow Types 的支持,比起其他转译工具,6to5 提供更多的功能。

我们的首要任务是消除 ES6+ 采纳功能的所有障碍,虽然 6to5 可能是目前功能最完善的 ES6 转译工具,但还有其他强大的项目也在试图做同样的事情。Traceur Compiler 是我们 compiler 的最常见替代品,但最不同的地方在于,它重度依赖运行时(runtime)。其他使用 6to5 类似方式的替代方案包括:es6-transpiler, es6now, jstransform 和 esnext。

esnext 是最接近 6to5 的对标工具。其通过专注于创建一个可以生成更高质量的 ES5 兼容输出(ES5-compatible output)的智能转译工具,这两个项目都很容易上手,并且都非常关心为开发人员提供最佳工具。

几个星期前,由于我们共同的使命,Stefan Penner 联系到我们,并表达了他的期望,或许我们可以通过共同努力实现想法。由于这个想法的激励,我们很快就安排了一次会议,来讨论其中的意义。

会议进展顺利:

#6to5 + #esnext I'm looking forward to our future together! Thanks guys @sebmck @stefanpenner @eventualbuddha @Rich_Harris

— James Kyle (@thejameskyle) January 3, 2015

我们已经决定,由于我们共同的目标和理念,合并这两个项目以构建更好的转译工具是有意义的。

那么,这对两个项目意味着什么?

esnext 团队将在 6to5 项目下开展工作,带来他们的技能和经验,使其更快、更符合规范。在最后,我们会帮助大家从 esnext 迁移到 6to5 - 我们已经将所有的 esnext 测试移植到 6to5 以确保没有影响到任何功能。

(目前使用的是 esnext 的)Ember CLI 用户,默认情况下可以安装 6to5 来替换 esnext。

你可以预期替换 6to5 后,代码仍然能够继续工作;我们会想方设法地发展和改进。我们希望其他人看到我们的努力而加入我们,这样我们的精力可以用来改善和竞争。

—— 6to5 团队

Recent Posts
Babel 中文文档
文档
学习 ES2015
社区
视频用户Stack OverflowSlack 频道Twitter
更多
博客GitHub 组织GitHub 仓库Website 仓库旧版网址 6.x旧版网址 5.x