Re:Preact, a fast 3k React alternative
by losvedir on Thursday January 28, 2016 @11:34AM
(#10989161)
Where do the savings come from? I can't imagine that React.createClass() is all that much code. I'm guessing a lot of space saving comes from not doing PropTypes (which I find immensely useful) and not having a synthetic event system (meaning you can't test with TestUtils.Simulate.click()). What else is missing I wonder?
[ Parent
| on HN ]
Re:Preact, a fast 3k React alternative
by developit on Thursday January 28, 2016 @06:45PM
(#10992459)
PropTypes are supported out of the box in preact-compat. You could also use them via a preact vnode hook and the "proptypes" module (npm.im/proptypes), which is just pulled from React's codebase. Synthetic events I'm very much open to feedback on - I tend to fire actual DOM events in my Karma tests, but it seems that less common.
Re:Preact, a fast 3k React alternative
by peterhunt on Thursday January 28, 2016 @01:28PM
(#10990103)
Also property/attribute normalization.
Preact: https://github.com/developit/preact/blob/master/src/preact.j...
React: https://github.com/facebook/react/blob/3b96650e39ddda5ba4924...
Re:Preact, a fast 3k React alternative
by TheMakeA on Thursday January 28, 2016 @11:43AM
(#10989228)
PropType checking is compiled out of the production version of React.