webpack upgrade to 16

Facebook just announced the release of React v16.0.

New features

  1. fragments
  2. error boundaries
  3. portals
  4. custom DOM attributes
  5. improved server-side rendering
  6. small lib size
  7. better render perf (with react-fiber)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    https://github.com/facebook/react/issues/10686
    v15
    render functional component tree x 115,932 ops/sec ±4.10% (55 runs sampled)
    render class based component tree x 255,407 ops/sec ±4.46% (58 runs sampled)
    render class that renders functional components x 252,045 ops/sec ±5.47% (56 runs sampled)
    Fastest is render class based component tree,render class that renders functional components
    v16
    render functional component tree x 204,931 ops/sec ±2.21% (59 runs sampled)
    render class based component tree x 339,215 ops/sec ±2.98% (58 runs sampled)
    render class that renders functional components x 326,880 ops/sec ±4.51% (56 runs sampled)
    Fastest is render class based component tree,render class that renders functional components

Install

Just update your package.json
No other configurations, and no migration issues :D
(It’s true !!!!!)

1
yarn add react react-dom

Pratical performance (in chrome devtool)

v16
img

v15
img

You maybe also need to update (optional)

1
yarn add prop-types recompose redux

Reference

  1. React v16.0
0%