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/
  • НаукаНаука

Комментарии • 40

  • @wolfymaster
    @wolfymaster 3 года назад +6

    "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.

    • @hswolff
      @hswolff  3 года назад +2

      It’s doing a great job keeping in parity with React. Must suck always playing catch up tho

    • @BosonCollider
      @BosonCollider Год назад +1

      @@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

  • @zach_authvow
    @zach_authvow 9 месяцев назад

    Awesome overview Harry. Thanks so much

  • @lukaswerner4390
    @lukaswerner4390 3 года назад +10

    I remember using preact once, was quite enjoyable very lightweight. I should probably revisit it sometime.

    • @hswolff
      @hswolff  3 года назад

      It’s great for a solid set of use cases

  • @Andy-si1pl
    @Andy-si1pl Год назад +4

    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!

    • @BosonCollider
      @BosonCollider Год назад +1

      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.

  • @alexlun4464
    @alexlun4464 Год назад +1

    Preact is definitely the solution. Now we gotta find the problem.

  • @ajithmoni1712
    @ajithmoni1712 2 года назад +1

    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.

  • @izio4408
    @izio4408 3 года назад +3

    Yeahhhh, I'll just wait for sveltekit to come out

  • @dereksniper
    @dereksniper 9 месяцев назад

    Think a new video would be great now with signals, effect it is definitely getting bigger pros

  • @go371211
    @go371211 3 года назад +18

    My React alternative would be Svelte

    • @hswolff
      @hswolff  3 года назад +4

      Def! Preact is more like a…pretend alternative haha

    • @lorenzoandrew6130
      @lorenzoandrew6130 3 года назад

      a tip: watch series on Flixzone. I've been using it for watching a lot of movies recently.

    • @leandroaydin911
      @leandroaydin911 3 года назад

      @Lorenzo Andrew yup, been watching on Flixzone for since november myself =)

    • @everytwodaysichangemyname1705
      @everytwodaysichangemyname1705 3 года назад +6

      @@internet4543 my lit-element alternative would be this thing called HTML

    • @mintesnotmelese7912
      @mintesnotmelese7912 2 года назад +1

      @@everytwodaysichangemyname1705 I prefer to use markdown

  • @tariki833
    @tariki833 3 года назад

    Very interesting. Thanks Harry! 👌🏼

    • @hswolff
      @hswolff  3 года назад +1

      You are welcome!

  • @unmy400
    @unmy400 3 года назад +3

    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 :)

    • @hswolff
      @hswolff  3 года назад +3

      Oh man big but good topic. Throw it up on votey-uppy.vercel.app if you could??

    • @unmy400
      @unmy400 3 года назад

      @@hswolff sure, thanks!

  • @aninham
    @aninham 3 года назад +1

    Im so sorry to bring it up but you look so alike with young Nick from This is Us

  • @omega.developer
    @omega.developer 3 года назад

    Great!

  • @arpitbharti6245
    @arpitbharti6245 3 года назад +2

    alternative - Solid JS

    • @aquaductape
      @aquaductape 3 года назад

      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.

    • @ceritagagalbarengsigit
      @ceritagagalbarengsigit 3 года назад

      unfortunately, SolidJS has no compat with react API

    • @aquaductape
      @aquaductape 3 года назад

      ​@@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.

    • @hswolff
      @hswolff  3 года назад

      Seems kind of like Svelte in that it renders down? Seems pretty neat.

  • @73dines
    @73dines 3 года назад

    26.08.2021: What is Postact? (absolut the best small React alternative)

  • @LieberLois
    @LieberLois 3 года назад

    Is there really a need for Preact? I mean NextJS is pretty slim right? 🤔

    • @Vreth6
      @Vreth6 3 года назад +2

      You can config Next to use Preact for smaller bundles

  • @Shubham-xh9nz
    @Shubham-xh9nz 3 года назад

    I was reading preact docs 2 hours ago. wew

    • @hswolff
      @hswolff  3 года назад

      👀 I saw you and wanted to help

  • @kettenbach
    @kettenbach 3 года назад

    12th 😀☝️

  • @yaelsprikut
    @yaelsprikut 3 года назад

    rEact

  • @Hshjshshjsj72727
    @Hshjshshjsj72727 9 месяцев назад

    Too meandering and unfocused

  • @zach_authvow
    @zach_authvow 9 месяцев назад

    awesome overview Harry. Thanks so much