Releases: facebook/react
Releases · facebook/react
v15.2.1
React
- Fix errant warning about missing React element. (@gaearon in #7193)
- Better removal of dev-only code, leading to a small reduction in the minified production bundle size. (@gaearon in #7188, #7189)
React DOM
- Add stack trace to null input value warning. (@jimfb in #7040)
- Fix webcomponents example. (@jalexanderfox in #7057)
- Fix
unstable_renderSubtreeIntoContainer
so that context properly updates when linked to state. (@gaearon in #7125) - Improve invariant wording for void elements. (@starkch in #7066)
- Ensure no errors are thrown due to event handlers in server rendering. (@rricard in #7127)
- Fix regression resulting in
value
-less submit and reset inputs removing the browser-default text. (@zpao in #7197) - Fix regression resulting in empty
name
attribute being added to inputs when not provided. (@okonet in #7199) - Fix issue with nested server rendering. (@Aweary in #7033)
React Perf Add-on
React CSSTransitionGroup Add-on
- Fix issue resulting in spurious unknown property warnings. (@batusai513 in #7165)
React Native Renderer
- Improve error handling in cross-platform touch event handling. (@yungsters in #7143)
v15.2.0
React
- Add error codes to production invariants, with links to the view the full error text. (@keyanzhang in #6948)
- Include component stack information in PropType validation warnings. (@spicyj in #6771)
- Include component stack information in key warnings. (@keyanzhang in #6799)
- Stop validating props at mount time, only validate at element creation. (@keyanzhang in #6823)
- New invariant providing actionable error in missing instance case. (@yungsters in #6990)
- Add
React.PropTypes.symbol
to support ES2015 Symbols as props. (@puradox in #6377) - Fix incorrect coercion of ref or key that are undefined in development (@gaearon in #6880)
- Fix a false positive when passing other element’s props to cloneElement (@ericmatthys in #6268)
React DOM
- Add warning for unknown properties on DOM elements. (@jimfb in #6800, @gm758 in #7152)
- Properly remove attributes from custom elements. (@grassator in #6748)
- Fix invalid unicode escape in attribute name regular expression. (@nbjahan in #6772)
- Add
onLoad
handling to<link>
element. (@roderickhsiao in #6815) - Add
onError
handling to<source>
element. (@wadahiro in #6941) - Handle
value
anddefaultValue
more accurately in the DOM. (@jimfb in #6406) - Fix events issue in environments with mutated
Object.prototype
. (@Weizenlol in #6886) - Fix issue where
is="null"
ended up in the DOM in Firefox. (@darobin in #6896) - Improved performance of text escaping by using escape-html. (@aickin in #6862)
- Fix issue with
dangerouslySetInnerHTML
and SVG in Internet Explorer. (@joshhunt in #6982) - Fix issue with
<textarea>
placeholders. (@jimfb in #7002) - Fix controlled vs uncontrolled detection of
<input type="radio"/>
. (@jimfb in #7003) - Improve performance of updating text content. (@trueadm in #7005)
- Ensure controlled
<select>
components behave the same on initial render as they do on updates. (@yiminghe in #5362)
React Perf Add-on
- Add
isRunning()
API. (@nfcampos in #6763) - Improve accuracy of lifecycle hook timing. (@gaearon in #6858)
- Fix internal errors when using ReactPerf with portal components. (@gaearon in #6860)
- Fix performance regression. (@spicyj in #6770)
- Add warning that ReactPerf is not enabled in production. (@sashashakun in #6884)
React CSSTransitionGroup Add-on
- Fix timing issue with
null
node. (@keyanzhang in #6958)
React Native Renderer
- Dependencies on React Native modules use CommonJS requires instead of providesModule. (@davidaurelio in #6715)
v15.1.0
React
- Ensure we're using the latest
object-assign
, which has protection against a non-spec-compliant nativeObject.assign
. (@zpao in #6681) - Add a new warning to communicate that
props
objects passed tocreateElement
must be plain objects. (@richardscarrott in #6134) - Fix a batching bug resulting in some lifecycle methods incorrectly being called multiple times. (@spicyj in #6650)
React DOM
- Fix regression in custom elements support. (@jscissr in #6570)
- Stop incorrectly warning about using
onScroll
event handler with server rendering. (@Aweary in #6678) - Fix grammar in the controlled input warning. (@jakeboone02 in #6657)
- Fix issue preventing
<object>
nodes from being able to read<param>
nodes in IE. (@syranide in #6691) - Fix issue resulting in crash when using experimental error boundaries with server rendering. (@jimfb in #6694)
- Add additional information to the controlled input warning. (@borisyankov in #6341)
React Perf Add-on
- Completely rewritten to collect data more accurately and to be easier to maintain. (@gaearon in #6647, #6046)
React Native Renderer
- Remove some special cases for platform specific branching. (@sebmarkbage in #6660)
- Remove use of
merge
utility. (@sebmarkbage in #6634) - Renamed some modules to better indicate usage (@javache in #6643)
v15.0.2
React
- Removed extraneous files from npm package. (@gaearon in #6388)
- Ensure
componentWillUnmount
is only called once. (@jimfb in #6613)
ReactDOM
- Fixed bug resulting in disabled buttons responding to mouse events in IE. (@nhunzaker in #6215)
- Ensure
<option>
s are correctly selected when inside<optgroup>
. (@trevorsmith in #6442) - Restore support for rendering into a shadow root. (@Wildhoney in #6462)
- Ensure nested
<body>
elements are caught when warning for invalid markup. (@keyanzhang in #6469) - Improve warning when encountering multiple elements with the same key. (@hkal in #6500)
React TestUtils Add-on
- Ensure that functional components do not have an owner. (@gaearon in #6362)
- Handle invalid arguments to
scryRenderedDOMComponentsWithClass
better. (@ipeters90 in #6529)
React Perf Add-on
React Native Renderer
- These files are now shipped inside the React npm package. They have no impact on React core or ReactDOM.
v15.0.1
v15.0.0
Major changes
- Initial render now uses
document.createElement
instead of generating HTML. Previously we would generate a large string of HTML and then setnode.innerHTML
. At the time, this was decided to be faster than usingdocument.createElement
for the majority of cases and browsers that we supported. Browsers have continued to improve and so overwhelmingly this is no longer true. By usingcreateElement
we can make other parts of React faster. (@spicyj in #5205) data-reactid
is no longer on every node. As a result of usingdocument.createElement
, we can prime the node cache as we create DOM nodes, allowing us to skip a potential lookup (which used thedata-reactid
attribute). Root nodes will have adata-reactroot
attribute and server generated markup will still containdata-reactid
. (@spicyj in #5205)- No more extra
<span>
s. ReactDOM will now render plain text nodes interspersed with comment nodes that are used for demarcation. This gives us the same ability to update individual pieces of text, without creating extra nested nodes. If you were targeting these<span>
s in your CSS, you will need to adjust accordingly. You can always render them explicitly in your components. (@mwiencek in #5753) - Rendering
null
now uses comment nodes. Previouslynull
would render to<noscript>
elements. We now use comment nodes. This may cause issues if making use of:nth-child
CSS selectors. While we consider this rendering behavior an implementation detail of React, it's worth noting the potential problem. ()@spicyj in #5451) - Functional components can now return
null
. We added support for defining stateless components as functions in React 0.14. However, React 0.14 still allowed you to define a class component without extendingReact.Component
or usingReact.createClass()
, so we couldn’t reliably tell if your component is a function or a class, and did not allow returningnull
from it. This issue is solved in React 15, and you can now returnnull
from any component, whether it is a class or a function. (@jimfb in #5884) - Improved SVG support. All SVG tags are now fully supported. (Uncommon SVG tags are not present on the
React.DOM
element helper, but JSX andReact.createElement
work on all tag names.) All SVG attributes that are implemented by the browsers should be supported too. If you find any attributes that we have missed, please let us know in this issue. (@zpao in #6243)
Breaking changes
- No more extra
<span>
s. React.cloneElement()
now resolvesdefaultProps
. We fixed a bug inReact.cloneElement()
that some components may rely on. If some of theprops
received bycloneElement()
areundefined
, it used to return an element withundefined
values for those props. We’re changing it to be consistent withcreateElement()
. Now anyundefined
props passed tocloneElement()
are resolved to the corresponding component’sdefaultProps
. (@truongduy134 in #5997)ReactPerf.getLastMeasurements()
is opaque. This change won’t affect applications but may break some third-party tools. We are revampingReactPerf
implementation and plan to release it during the 15.x cycle. The internal performance measurement format is subject to change so, for the time being, we consider the return value ofReactPerf.getLastMeasurements()
an opaque data structure that should not be relied upon. (@gaearon in #6286)
Removed deprecations
These deprecations were introduced nine months ago in v0.14 with a warning and are removed:
- Deprecated APIs are removed from the
React
top-level export:findDOMNode
,render
,renderToString
,renderToStaticMarkup
, andunmountComponentAtNode
. As a reminder, they are now available onReactDOM
andReactDOMServer
. (@jimfb in #5832) - Deprecated addons are removed:
batchedUpdates
andcloneWithProps
. (@jimfb in #5859, @zpao in #6016) - Deprecated component instance methods are removed:
setProps
,replaceProps
, andgetDOMNode
. (@jimfb in #5570) - Deprecated CommonJS
react/addons
entry point is removed. As a reminder, you should use separatereact-addons-*
packages instead. This only applies if you use the CommonJS builds. (@gaearon in #6285) - Passing
children
to void elements like<input>
was deprecated, and now throws an error. (@jonhester in #3372) - React-specific properties on DOM
refs
(e.g.this.refs.div.props
) were deprecated, and are removed now. (@jimfb in #5495)
New deprecations, introduced with a warning
Each of these changes will continue to work as before with a new warning until the release of React 16 so you can upgrade your code gradually.
LinkedStateMixin
andvalueLink
are now deprecated due to very low popularity. If you need this, you can use a wrapper component that implements the same behavior: react-linked-input. (@jimfb in #6127)- Future versions of React will treat
<input value={null}>
as a request to clear the input. However, React 0.14 has been ignoringvalue={null}
. React 15 warns you on anull
input value and offers you to clarify your intention. To fix the warning, you may explicitly pass an empty string to clear a controlled input, or passundefined
to make the input uncontrolled. (@antoaravinth in #5048) ReactPerf.printDOM()
was renamed toReactPerf.printOperations()
, andReactPerf.getMeasurementsSummaryMap()
was renamed toReactPerf.getWasted()
. (@gaearon in #6287)
New helpful warnings
- If you use a minified copy of the development build, React DOM kindly encourages you to use the faster production build instead. (@spicyj in #5083)
- React DOM: When specifying a unit-less CSS value as a string, a future version will not add
px
automatically. This version now warns in this case (ex: writingstyle={{'{{'}}width: '300'}}
. Unitless number values likewidth: 300
are unchanged. (@pluma in #5140) - Synthetic Events will now warn when setting and accessing properties (which will not get cleared appropriately), as well as warn on access after an event has been returned to the pool. (@kentcdodds in #5940 and @koba04 in #5947)
- Elements will now warn when attempting to read
ref
andkey
from the props. (@prometheansacrifice in #5744) - React will now warn if you pass a different
props
object tosuper()
in the constructor. (@prometheansacrifice in #5346) - React will now warn if you call
setState()
insidegetChildContext()
. (@raineroviir in #6121) - React DOM now attempts to warn for mistyped event handlers on DOM elements, such as
onclick
which should beonClick
. (@ali in #5361) - React DOM now warns about
NaN
values instyle
. (@jontewks in #5811) - React DOM now warns if you specify both
value
anddefaultValue
for an input. (@mgmcdermott in #5823) - React DOM now warns if an input switches between being controlled and uncontrolled. (@TheBlasfem in #5864)
- React DOM now warns if you specify
onFocusIn
oronFocusOut
handlers as they are unnecessary in React. (@jontewks in #6296) - React now prints a descriptive error message when you pass an invalid callback as the last argument to
ReactDOM.render()
,this.setState()
, orthis.forceUpdate()
. (@conorhastings in #5193 and @gaearon in [#6310](htt...