Need advice about which tool to choose?Ask the StackShare community!
Preact vs winjs: What are the differences?
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); winjs: A UI toolkit for modern browsers, by Microsoft. WinJS is a set of JavaScript toolkits that allow developers to build applications using HTML/JS/CSS technology forged with the following principles in mind: 1. Provide developers with a distinctive set of UI controls with high polish and performance with fundamental support for touch, mouse, keyboard and accessibility 2. Provide developers with a cohesive set of components and utilities to build the scaffolding and infrastructure of their applications'.
Preact and winjs can be primarily classified as "Javascript UI Libraries" tools.
Preact and winjs are both open source tools. It seems that Preact with 23.1K GitHub stars and 1.2K forks on GitHub has more adoption than winjs with 4.07K GitHub stars and 504 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 Preact
- Lightweight15
- Drop-in replacement for React5
- Performance4
- Props/state passed to render3
- ES6 class components1
Pros of winjs
- Developed by Microsoft1
- Aa0
Sign up to add or upvote prosMake informed product decisions
Cons of Preact
Cons of winjs
- Small community1