React v0.12 发布

#1

Changelog

React Core

Breaking Changes

  • 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.

New Features

  • Spread operator ({…}) introduced to deprecate this.transferPropsTo
  • Added support for more HTML attributes: acceptCharset, classID, manifest

Deprecations

  • 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 Fixes

  • 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

####New Features

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

Breaking Changes

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

####Bug Fixes
Fixed some issues with CSS Transitions

JSX

####Breaking Changes

  • 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

####New Features

  • @jsx React.DOM no longer required
  • spread ({…}) operator introduced to allow easier use of props

Bug Fixes

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

升升升!

#3

react-router 还没准备好,你确定就要升了?

#4

旧的代码先锁定版本号不管了…
0.12 有一点挺烦的, 每次要写个 React.createFactory… 我都要考虑下改变编码风格了

#5

其實我還沒用到 react-router, 不過現在 react-router v0.10.0 已經支持 react 0.12 了

#6

哈哈。动作真快!

昨天看的时候还没升, 刚刚几分钟前更新的好像。 跟不上节奏了!