Need advice about which tool to choose?Ask the StackShare community!
cf-ui vs Preact: What are the differences?
cf-ui: A set of over 50 packages used to build UIs at CloudFlare using projects such as React, Redux, npm, Lerna, and more. While moving to React, we’ve taken our existing Backbone UI framework and rebuilt it from scratch on top of React. This includes over 50 packages that include dozens of components, utilities, test helpers, and more; Preact: A fast 3k React alternative. Preact is an attempt to recreate the core value proposition of React (or similar libraries like Mithril) using as little code as possible, with first-class support for ES2015. Currently the library is around 3kb (minified & gzipped).
cf-ui and Preact belong to "Javascript UI Libraries" category of the tech stack.
cf-ui and Preact are both open source tools. It seems that Preact with 23.1K GitHub stars and 1.2K forks on GitHub has more adoption than cf-ui with 1.29K GitHub stars and 89 GitHub forks.
Preact offers an API which is extremely similar to React's for less than 10% of its size (and createElement
is renamed to h
, which makes the overall bundle a lot smaller). Although it is less compatible with other libraries than the latter (and its ecosystem is nowhere as developed), this is generally not a problem as Preact exposes the preact/compat
API, which can be used as an alias both for React and ReactDOM and allows for the use of libraries which would otherwise just be compatible with React.
Pros of cf-ui
Pros of Preact
- Lightweight14
- Drop-in replacement for React5
- Props/state passed to render3
- Performance3
- ES6 class components1