What is Preact? (the best small React alternative)
HTML-код
- Опубликовано: 11 окт 2024
- Preact has been around for a while so I'm surprised I haven't talked about it before. It's a super cool library that is great for mobile or embedded environments and the best part of all is that it has the exact same API as React. Super cool!
Also I forgot to pull up my green screen in this video so apologies for the ever-present background 😬
Links from video:
preactjs.com/
preactjs.com/a...
preactjs.com/g...
preactjs.com/g...
preactjs.com/g...
--
DISCORD: / discord
VOTE ON VIDEOS: votey-uppy.ver...
NEWSLETTER: hswolff.com/ne...
PATREON: / hswolff
TWITCH: / hswolff11
TWITTER: / hswolff
SITE: hswolff.com/ - Наука
"its been around for a long time" - yeah, I used this on several projects back in 2016 when you straight up used h() function as the render. I lost sight of this library since I haven't done a ton of frontend work recently. Interesting to see how far its come.
It’s doing a great job keeping in parity with React. Must suck always playing catch up tho
@@hswolff Viewing it in a different way, there are way fewer things to learn, far less framework fatigue, and there is definitely no anxiety about using a bloated framework. It has its own advantages
Awesome overview Harry. Thanks so much
I remember using preact once, was quite enjoyable very lightweight. I should probably revisit it sometime.
It’s great for a solid set of use cases
My only issue is there is no apparent market demand for it. But if you are confident in the front end i.e. you know multiple libraries like React, Vue then its ok.
For me. I have to do everything React (even personal projects) as that helps me with career work. React is my new jQuery!
There is definitely market demand for it and it is the fourth most downloaded framework with two thirds of angular's downloads, it just gets lumped into React competence because it is a drop-in replacement for typical usecases, so it's just viewed as a boring way to speed up react rather than a hyped new framework.
If you want to use something react-like to make a component that people using any other framework will use, then preact is the best choice. Otherwise, the Vue team using your component will have to bundle all of react AND all of vue. It's generally a great tool to make the react skillset usable even in non-react shops, or for making libraries of webcomponents that someone may still use ten years from now.
Preact is definitely the solution. Now we gotta find the problem.
Thank you. That was very neatly explained. I've always loved how you compare and provide views. I'm getting better understanding your videos as i grow technically.
I have some follow up questions:
1) I saw the mention of class examples, does Preact support functional components too?
2) There are other plugins for Animations that are built on React. Do we have a community shift of people re-writing them to support Preact as a separate npm module all together?
3) How young and matured is Preact? Is React and Preact supported by the same members as I see the philosophy of attacking the problem seems HTML attribute and native events side vs Javascript side, (class vs className)
Please pardon my questions if they aren't inline or miss a base philosophy.
Yeahhhh, I'll just wait for sveltekit to come out
Think a new video would be great now with signals, effect it is definitely getting bigger pros
My React alternative would be Svelte
Def! Preact is more like a…pretend alternative haha
a tip: watch series on Flixzone. I've been using it for watching a lot of movies recently.
@Lorenzo Andrew yup, been watching on Flixzone for since november myself =)
@@internet4543 my lit-element alternative would be this thing called HTML
@@everytwodaysichangemyname1705 I prefer to use markdown
Very interesting. Thanks Harry! 👌🏼
You are welcome!
Hey Harry ! I have a question, What techniques do you recommend to take care of Front-end performance?, like dynamic imports, compressing images, prioritize svg over pngs?
I tried to applied some of these things to my portfolio, which is not big at all, and ended up adding like 3 Mb to the page LOL.
I would like to learn more to grow at my job. Probably you know more about it, and would like to share knowladge :)
Oh man big but good topic. Throw it up on votey-uppy.vercel.app if you could??
@@hswolff sure, thanks!
Im so sorry to bring it up but you look so alike with young Nick from This is Us
Great!
alternative - Solid JS
Yes!!! I told harry about this library. He didn't respond. I'll ask him again once Solid reaches 1.0, which by then it will have a proper website and starter kit.
unfortunately, SolidJS has no compat with react API
@@ceritagagalbarengsigit True, SolidJS although uses JSX and hook-like API, is different, where components mount once, reactivity is granular and immediate.
If you want close enough compat with React, you should check out Inferno, it's even faster than preact.
Seems kind of like Svelte in that it renders down? Seems pretty neat.
26.08.2021: What is Postact? (absolut the best small React alternative)
Lool
Is there really a need for Preact? I mean NextJS is pretty slim right? 🤔
You can config Next to use Preact for smaller bundles
I was reading preact docs 2 hours ago. wew
👀 I saw you and wanted to help
12th 😀☝️
rEact
Too meandering and unfocused
awesome overview Harry. Thanks so much