红联Linux门户
Linux帮助

React v0.12发布,构建用户界面的JavaScript库

发布时间:2014-10-29 09:38:27来源:红联作者:empast
React v0.12 发布,此版本引入了新术语;修改了 APIs,使得 React 一些概念更简洁。 同时还对 JSX 做了一些修改,飞起了一些函数。

此版本现已提供下载:

React
Dev build with warnings: http://fb.me/react-0.12.0.js
Minified build for production: http://fb.me/react-0.12.0.min.js

React with Add-Ons
Dev build with warnings: http://fb.me/react-with-addons-0.12.0.js
Minified build for production: http://fb.me/react-with-addons-0.12.0.min.js

In-Browser JSX transformer
http://fb.me/JSXTransformer-0.12.0.js

React 团队通过发布了 react 和 react-tools 0.12.0 包到 npm 和 react 包到 bower。

重大改进

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 是 Facebook 推出的一个用来构建用户界面的 JavaScript 库。

Facebook开源了React,这是该公司用于构建反应式图形界面的JavaScript库,已经应用于构建Instagram网站及 Facebook部分网站。最近出现了AngularJS、MeteorJS 和Polymer中实现的Model-Driven Views等框架,React也顺应了这种趋势。React基于在数据模型之上声明式指定用户界面的理念,用户界面会自动与底层数据保持同步。与前面提及 的框架不同,出于灵活性考虑,React使用JavaScript来构建用户界面,没有选择HTML。

来自:开源中国社区
文章评论

共有 0 条评论