非死book開源的用戶界面的 JavaScript 構建庫,React v0.12 發布

jopen 10年前發布 | 16K 次閱讀 React

React v0.12 發布,此版本引入了新術語;修改了 APIs,使得 React 一些概念更簡潔。 同時還對 JSX 做了一些修改,飛起了一些函數。

此版本現已提供下載:

React 團隊通過發布了 reactreact-tools  0.12.0 包到 npm 和 react 包到 bower。

更多內容請看這里

 


Changelog

React Core

重大改進

  • key and ref moved off props object, now accessible on the element directly

  • React is now BSD licensed with accompanying Patents grant

  • Default prop resolution has moved to Element creation time instead of mount time, making them effectively static

  • React.__internals is removed - it was exposed for DevTools which no longer needs access

  • Composite Component functions can no longer be called directly - they must be wrapped with React.createFactory first. This is handled for you when using JSX.

新特性

  • Spread operator ({...}) introduced to deprecate this.transferPropsTo

  • Added support for more HTML attributes: acceptCharset, classID, manifest

廢棄

  • React.renderComponent --> React.render

  • React.renderComponentToString --> React.renderToString

  • React.renderComponentToStaticMarkup --> React.renderToStaticMarkup

  • React.isValidComponent --> React.isValidElement

  • React.PropTypes.component --> React.PropTypes.element

  • React.PropTypes.renderable --> React.PropTypes.node

  • DEPRECATED React.isValidClass

  • DEPRECATED instance.transferPropsTo

  • DEPRECATED Returning false from event handlers to preventDefault

  • DEPRECATED Convenience Constructor usage as function, instead wrap with React.createFactory

  • DEPRECATED use of key={null} to assign implicit keys

Bug 修復

  • Better handling of events and updates in nested results, fixing value restoration in "layered" controlled components

  • Correctly treat event.getModifierState as case sensitive

  • Improved normalization of event.charCode

  • Better error stacks when involving autobound methods

  • Removed DevTools message when the DevTools are installed

  • Correctly detect required language features across browsers

  • Fixed support for some HTML attributes:

    • list updates correctly now

    • scrollLeft, scrollTop removed, these should not be specified as props

  • Improved error messages

React With Addons

新特性

  • React.addons.batchedUpdates added to API for hooking into update cycle

重大改進

  • React.addons.update uses assign instead of copyProperties which does hasOwnProperty checks. Properties on prototypes will no longer be updated correctly.

Bug 修復

  • Fixed some issues with CSS Transitions

JSX

重大改進

  • Enforced convention: lower case tag names are always treated as HTML tags, upper case tag names are always treated as composite components

  • JSX no longer transforms to simple function calls

新特性

  • @jsx React.DOM no longer required

  • spread ({...}) operator introduced to allow easier use of props

Bug 修復

  • JSXTransformer: Make sourcemaps an option when using APIs directly (eg, for react-rails)

React.js 是 非死book 推出的一個用來構建用戶界面的 JavaScript 庫。

非死book開源了React,這是該公司用于構建反應式圖形界面的JavaScript庫,已經應用于構建Instagram網站及 非死book部分網站。最近出現了AngularJS、MeteorJS 和Polymer中實現的Model-Driven Views等框架,React也順應了這種趨勢。React基于在數據模型之上聲明式指定用戶界面的理念,用戶界面會自動與底層數據保持同步。與前面提及 的框架不同,出于靈活性考慮,React使用JavaScript來構建用戶界面,沒有選擇HTML。

來自:http://www.oschina.net/news/56550/react-v0-12

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!