Comments (11)
支持 loose mode 的 transformer 也没几个……如果仔细看过文档的话,避开这些坑也不难。
不过根据 Six Speed,loose mode 下有显著性能差异的 ES6 特性只有 for-of-array、super 和 tagged template string 这几个。
所以我觉得更好的做法是,等 babel 6 稳定下来后,单独针对某个 transformer 配置 loose mode。
from spec.
“仔细看过文档”是一个不太靠谱的假设啊~
from spec.
这条是在babel还是5的时代下出来的,在babel6的情况下我们针对对应的transformer在性能出现问题时配就好了
from spec.
我的意思是你的应用没有benchmark证明某一点是性能瓶颈,则没有必要做这样的事情。
from spec.
@otakustay 我记得貌似内部讨论时说的是代码体积的问题而不是性能?
from spec.
是的,和代码体积有关,主要是defineProperty
代替prototype.xxx
以及for .. of
的转换
from spec.
代码体积在gzip压缩之后应该并没有什么大差异吧
from spec.
@leeight 在项目里试试?
from spec.
我拿了2个项目试一下,基本gzip后差异在2.5%左右
不过确实我们没有大量使用for .. of
这些东西,能map
、forEach
之类的就用上了
这种差异我认为是可以忽略的
from spec.
ok,并且loose在babel6里面已经不是个东西了。虽然6现在还坑不少,但是可预见很快会逐步填上。我觉得这条可以去掉, @otakustay 你觉得呢?
from spec.
这条就去掉吧
from spec.
Related Issues (20)
- React规范中强制defaultProps的规则跟redux的冲突 HOT 5
- react-style-guide描述格式 HOT 1
- 关于 “[建议]使用@autobind进行事件处理方法与this的绑定” HOT 2
- 关于 “[强制]没有子节点的非DOM组件使用自闭合语法” HOT 1
- 关于“[强制]对于值为true的属性,省去值部分” HOT 3
- 关于"[强制]为非继承自PureComponent的纯组件实现shouldComponentUpdate方法" HOT 3
- import/extensions规则需要调整 HOT 1
- 模块规范中 define() 的 factory 可以是 string 吗?
- [强制] 当文件无法使用 .js 扩展名时,使用 .es 扩展名。 HOT 10
- 3.5 字符串 [建议] 使用 数组 或 + 拼接字符串 示例中有小错误
- 3.5 字符串 [建议] 使用 数组 或 + 拼接字符串 示例中有小错误
- sudo全局安装fecs出错
- 有return的三目运算符换行怎么做? HOT 2
- 运算符处换行时,运算符必须在新行的行首,和eslint规则有冲突了
- 对象常量的属性名要全部大写吗? HOT 3
- vue单文件组件中方法和计算属性怎样注释?
- vue组件里methods方法和computed计算属性怎样注释??
- css编码规范中在Family Name 大小写必须统一一项下有小错误
- 请问文件名应该如何约定? HOT 1
- TS 『禁止不必要的类型约束』规则,可能影响 tsx 文件下正常使用 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.