3 ms·
Has anyone extensively used Preact? Would like to hear first hand experiences about any performance gains (or anything in general)
by spocklivelong 9y ago
Has anyone extensively used Preact? Would like to hear first hand experiences about any performance gains (or anything in general)
- girvo 9y agoPreact is brilliant. I use it instead of React for basically anything that I'm allowed to, for one single reason: it's Component class's "render()" method takes props and state as arguments! Testing becomes nicer, especially when porting an existing React component over, and I find it conceptually much cleaner. Getting up and running with Preact, TypeScript (or Bublé[0]) and Rollup is pretty simple, and gives an extremely small and very fast bundle, which I just adore. The big thing, is that by choosing the right tools, I can keep my `ls node_moduels | wc -l` small, and Rollup's tree-shaking takes that even further. With some forethought, one can achieve this with React, too, but I find Preact beautiful to use, and Hyperscript instead of JSX can be a boon for rapidly prototyping an idea for a component instead of setting up yet-another-js-build-system! [0] https://buble.surge.sh/guide/ https://buble.surge.sh/guide/ Edited to add: I've also used it successfully for some (unfortunately internal, I'd love to show you them) big production systems, where we had a team of 7 developers working on it at the end. Still in use now, and it was a breeze -- and runs extremely fast, UI-wise.
- lioeters 9y agoI recently made a complete transition to Preact, and although there were a few twists needed to migrate a previous React project, overall I'm very happy with it. Haven't noticed any performance gains (other than page load time, maybe slightly). Aside from the reduction in app size, what I like is that Preact's code base is small enough to read in an evening and understand it.