News for hackers. Stuff that matters.
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?
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)
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.
Re:Preact, a fast 3k React alternative by Ronsenshi on Thursday January 28, 2016 @01:25PM (#10990086)
Lack of synthetic events is a huge one for me.
Re:Preact, a fast 3k React alternative by developit on Thursday January 28, 2016 @06:43PM (#10992447)
This is extremely interesting to me and I would love to hear why. I skipped synthetic events because I didn't feel they were necessary, but I would appreciate additional insight.