技术控

    今日:129| 主题:49225
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] RE:DOM is now 1.0!

[复制链接]
黑色无欲者 发表于 2016-10-1 19:30:07
141 1

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

RE:DOM is now 1.0!-1 (channe1advis0r,bi1is0und,eng1ishp0d,the,time,is,now)
       History

   Almost two years ago, March 10 2015, I released the first version of FRZR , a tiny view library. The API has changed a lot since that and even the name changed to RE:DOM . It has been a long journey, I’ve learned a lot and it’s awesome to finally be at the version 1.0! RE:DOM is definitely more than ready for production with 100 % test coverage.
  Performance

   RE:DOM is one of the fastest view libraries around. Here’s results of a performance test reordering 10 000 HTML elements :
  
       
  • ~30 ms Vanilla JS   
  • ~30 ms RE:DOM v1.0   
  • ~30 ms FRZR v0.22.7   
  • ~80 ms React v15.3.2   
  • ~500 ms React v0.14.7   
  • ~10 000 ms Riot.js v2.6.2  
  Riot.js is releasing v3 soon, I hope it will fix the performance issues..
  Filesize

  RE:DOM is 3.5 KB before and 2 KB after gzip.
  Server-side rendering

   With the release of RE:DOM 1.0, I also released NO:DOM – a complementary library for rendering RE:DOM apps/components server-side. It’s also tiny, easy to use and super fast.
  Embracing JavaScript

  There’s not that many abstractions in RE:DOM. You create components writing vanilla JavaScript. Diffing gets done against the DOM (with amazing performance though). You can refer to real DOM elements and still you get the benefit of “pure functions”, since updating the component should always go through only one update function by design. When with vdom you always redefine everything, with RE:DOM you can define the init state for component and separately how you update it.
  Here’s a basic hello world with just an HTML element:
  [code]import { el, mount } from redomconst hello = el('h1', 'Hello world!')mount(document.body, hello)[/code]  Here‘s a component version:
  [code]import { el, text, mount } from redom[/code]  [code]class Hello {  constructor () {    this.el = el('h1',      'Hello ',      this.target = text('world'),      '!'    )  }  update (target) {    this.target.textContent = target  }}[/code]  [code]const hello = new Hello()mount(document.body, hello)[/code]  [code]setTimeout(() => hello.update('you'), 1000)[/code]  Future

   I believe future is bright for RE:DOM, since nothing is better than writing JavaScript as close to the metal as possible. Recently I wrote aboutmastering the DOM and talked about the JavaScript fatigue, which I believe is only cured with more minimalistic approach. In the long run you benefit the most by learning the language itself and not some third party abstractions.
   If you have any questions about RE:DOM , just raise an issue on Github , send me a tweet or send me email .
  Hope you have fun with RE:DOM!
友荐云推荐




上一篇:基于Caffe的Large Margin Softmax Loss的实现(上)
下一篇:基于 Nginx 的动态代理
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

ㄚùaИΖhI 发表于 2016-10-1 22:49:34
谁能明白谁的深爱,谁又能理解谁的离开...
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表