loading...

React vs Preact?

realabbas profile image Ali Abbas ・Updated on ・1 min read

For a small project that needa blazing fast speed, which to prefer.

  • REACT
  • PREACT
  • INFERNO
  • MITHRIL
  • MOON

Discussion

pic
Editor guide
Collapse
vonheikemen profile image
Heiker

Blazing fast in what sense? Creating nodes, Updating the ui, bundle size?

Both Preact and React are fast enough.

I will choose Preact, because is 3kb.

But if you want to use hooks with preact you have to install an unstable version preact@next because the stable version doesn't have them.

Collapse
solarliner profile image
πŸ‡¨πŸ‡΅οΈ Nathan Graule

Preact entered beta a few weeks ago, and so far it's been quite stable. I'm using it for 2 projects - nothing to report bar one quirky TypeScript typing.

Collapse
itsjzt profile image
Saurabh Sharma

I would say start with react and eject when you find preact is actually making your app faster.

Collapse
maheshkay profile image
Mahesh K

Preact, definitely. I'd say you can also use react with better CDN for serving media elements. If that's something you are planning on using.

Collapse
anpos231 profile image
anpos231

Inferno ;P

Collapse
andrewbrown profile image
Collapse
yaser profile image
Yaser Al-Najjar

We have tried mithril before and it was quite frustrating... Lemme tell you the story

We wanted a simple framework for SPA, esp. once we saw that Flarum was quitely amazing done using mithril.

We started using it, but problems started to appear...
Docs are good but once you run into problems they're not enough, and ooops not many people use mithril and StackOverflow has not much on it; so, we were on our own.

That was a bit okay until we realized there was an issue in mithril itself (can't remember what it was), and the issue was discussed on github, it took about two weeks till they fixed it πŸ™„

I know it's an opensource thing but we couldn't afford with pull requesting the fixes to mithril cuz we needed speed... For financial reasons.

For our team that was it, we moved into Vue.js cuz of the small learning curve and the popularity... we can't be happier since then.

Collapse
andrewbrown profile image
Andrew Brown πŸ‡¨πŸ‡¦

Its a story with of holes. I don't doubt it may have been frustrating.

It depends on what version of Mithril you were using when you say X didn't work. Before version 1 you had to be comfortable understanding the underlying architecture of web-frameworks.

I can build my own web-framework in a weekend so my perception of easy may be skewed.

What I like about mithril codebase is its an incredibly small and sane framework.

I can open it up read, repair and debug any problem that I could have and I can't say the same for Vue, Angular or React.

Sadly Mithril will be a footnote because the developer ecosystem and plugins are not there.

Vue I would say is the framework I hate the most.
Vue does not play well with Typescript
Vue is painful to turn into isomorphic javascript.
The quality and consistency of their plugins are terrible (looking at you Axios).
Vue architectural choices makes it poor for automation.

Angular I would say is the framework that is most productive, convention and well documented. I don't care for its size or how it bought into some of the concepts that React purports as what needs to be in a web-framework but you can't win them all.

I am cursed with all this web-framework knowledge and so I tend to avoid web-frameworks all together.

Collapse
sarneeh profile image
Jakub Sarnowski

Could you elaborate on this opinion? I was considering using Preact in the next project and would like to know more :)

Collapse
realabbas profile image
Ali Abbas Author

Moonjs is good as well.

Collapse
andrewbrown profile image
Andrew Brown πŸ‡¨πŸ‡¦

First time heard of Moonjs. You learn something new every day

Thread Thread
steinskeeper profile image
Dhanush

You hear about new frameworks every day. It's more like looking at different boxes of morning cereal xD