|
| 1 | +## May 19 ([discuss](https://github.com/reactjs/core-notes/pull/15)) |
| 2 | + |
| 3 | +### Attendees |
| 4 | + |
| 5 | +* [Ben](https://twitter.com/soprano) (React) |
| 6 | +* [Christopher](https://twitter.com/vjeux) (React Native) |
| 7 | +* [Dan](https://twitter.com/dan_abramov) (React) |
| 8 | +* [Jim](http://github.com/jimfb) (React) |
| 9 | +* [Keyan](https://twitter.com/keyanzhang) (React, intern) |
| 10 | +* [Paul](https://twitter.com/zpao) (React) |
| 11 | +* [Sebastian](https://twitter.com/sebmarkbage) (React) |
| 12 | +* [Tom](https://twitter.com/tomocchino) (React) |
| 13 | + |
| 14 | +### `createClass()` vs ES2015 Classes |
| 15 | + |
| 16 | +#### Why Use Classes? |
| 17 | + |
| 18 | +* `createClass()` API feels outdated, and can be implemented entirely in userland if needed. |
| 19 | +* ES6 classes are less of an API, possibly simpler. |
| 20 | +* ES6 classes are friendlier to static analysis. |
| 21 | +* ES6 classes offer performance improvements in large apps. |
| 22 | +* We are in the business of UI components, not type systems. |
| 23 | + |
| 24 | +#### What’s Holding Us Back? |
| 25 | + |
| 26 | +##### Autobinding |
| 27 | + |
| 28 | +* [Class properties](https://github.com/jeffmo/es-class-fields-and-static-properties) solve this. |
| 29 | +* However they’re not moving forward at TC39 yet as [Jeff](https://github.com/jeffmo) is busy preparing for React Europe. |
| 30 | +* Downside: nobody wants experimental syntax in the documentation. |
| 31 | +* We could just always bind in constructor in the documentation. |
| 32 | + |
| 33 | +##### Mixins |
| 34 | + |
| 35 | +* A lot of components on Facebook website still use mixins, but mostly the same ones. |
| 36 | +* If we decided to deprecate `createClass` in the future, we would need to fix them first. |
| 37 | +* Possible temporary workaround: apply them on top of ES6 class like [react-mixin](https://github.com/brigand/react-mixin) does. |
| 38 | + |
| 39 | +#### Next Steps |
| 40 | + |
| 41 | +* We should update the documentation to use ES6 classes and functional components wherever possible. |
| 42 | +* Eventually we should deprecate `createClass`, possibly move it into a separate package. |
| 43 | +* We need to have a good solution for folks who don’t want to use a transpiler. |
| 44 | + |
| 45 | +### Separating Out `PropTypes` |
| 46 | + |
| 47 | +* [Jordan](https://twitter.com/ljharb) and some Airbnb folks asked about separating `PropTypes` into a generic validation library. |
| 48 | +* One concern might be that as a separate project `PropTypes` could become incompatible (as a type system) with Flow or TypeScript. |
| 49 | +* Internally long term we’d like to avoid `PropTypes` usage and rely on static typing instead. |
| 50 | +* Some checks can’t easily be expressed statically (e.g. ranges or colors). |
| 51 | +* Conclusion: anyone can take `PropTypes` code and put it on npm. |
| 52 | +* If it enforces a generic enough contract, we might try to replace `PropTypes` with it in the future, but no guarantees. |
| 53 | +* Our internal plan will be to focus on ES6 classes and Flow. |
| 54 | + |
| 55 | +### New Release Proposal |
| 56 | + |
| 57 | +* React Native is releasing RC, so [we’re shipping 15.1.0](https://github.com/facebook/react/blob/619b3e850998ad24b9750c83ca20bb95e7638957/CHANGELOG.md#1510-may-20-2016). |
| 58 | +* Originally we planned to ship 15.0.3 and 15.1.0, but we don’t plan to maintain two branches anyway, so not worth doing now. |
| 59 | +* We will release React versions every two weeks, a couple of days before React Native RCs. |
| 60 | +* We might start using [Lerna](https://lernajs.io), it works great for Babel. |
| 61 | +* Do we ship from a branch or from master? No conlusion yet. |
| 62 | + |
| 63 | +------------ |
| 64 | + |
| 65 | +Please feel free to discuss these notes in the [corresponding pull request](https://github.com/reactjs/core-notes/pull/15). |
0 commit comments