Rich Harris - SvelteSnaps

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Sponsor
    Monogram - monogram.io/
    Rich Harris builds an Instagram clone, showcasing the different features of SvelteKit.

ความคิดเห็น • 61

  • @skryonline5825
    @skryonline5825 ปีที่แล้ว +22

    Rich has a very smooth approach for presenting stuff! Great progress on Sveltekit

  • @mpiorowski
    @mpiorowski ปีที่แล้ว +15

    When You first look at this app, it looks so simple...but then Rich starts explaining all the neat small quirks You can achieve with Svelte to make this app as awesome as possible. For me, amazing learning experience.

  • @fev4
    @fev4 ปีที่แล้ว +9

    This was amazing. Eagerly waiting for the shallow routing feature! Thank you for continuing to improve upon Svelte/Kit!

  • @fev4
    @fev4 ปีที่แล้ว +16

    Man I love this. Now I got permission to mutate data! Hell yes!

    • @pookiepats
      @pookiepats 5 หลายเดือนก่อน

      😂 i cheered when he said query builders suck because boy do they. you could learn effective SQL 3x over instead

  • @henrikvilhelmberglund
    @henrikvilhelmberglund ปีที่แล้ว +40

    If you wanted to show the button when the input is valid using Tailwind you could put class="peer" on the input element and class="peer-valid:block" on the button.

    • @sazaraki
      @sazaraki ปีที่แล้ว +2

      Yes.
      This actually shows a common problem with the vast majority of tailwind complaints: it's a much more robust than meets the eye. It's difficult to "get" on a side-project weekend.

    • @yusril-ihsanul-alim
      @yusril-ihsanul-alim ปีที่แล้ว +1

      🫠

  • @tagu2912
    @tagu2912 ปีที่แล้ว

    Thanks

  • @tunisoft7465
    @tunisoft7465 ปีที่แล้ว +9

    the way he imported the page as a component
    🤯

  • @ribasenric
    @ribasenric ปีที่แล้ว +7

    Thank you for all your work on Svelte.
    I also used to hate Tailwind. I was very against the ugliness, but I gave in and use it now.

    • @daleryanaldover6545
      @daleryanaldover6545 ปีที่แล้ว

      For someone who had worked with different convoluted and opinionated css frameworks over a decade, I see tailwind as the holy grail of what css frameworks should have been in the first place. No more fighting over default styles, no more sass/scss. Tailwind is just simply beautiful! People who have argued tailwind to be not good absolutely have no idea.

    • @MattHeslington
      @MattHeslington ปีที่แล้ว +4

      Try the VS Code plugin 'Inline Fold' by Mohammed Alamri - it automatically hides/folds all your Tailwind classes. Then set a keyboard shortcut to hide/show the classes

    • @justinoneill2837
      @justinoneill2837 ปีที่แล้ว

      ​@@MattHeslingtonCtrl+T / Command+T is the default I think

  • @chinmayk8004
    @chinmayk8004 ปีที่แล้ว +3

    More such walkthroughs from RH. This is my kinda ASMR

  •  ปีที่แล้ว +1

    wow amazing work Rich, those are some great features!

  • @kaviisuri9997
    @kaviisuri9997 ปีที่แล้ว +2

    For sql, hands down the best way I've seen across all languages is sqlc in golang, it's not an orm or query builder, you write raw sql in a file, and it generates typesafe functions for you.
    Honestly just amazing, would be interesting to do it for js

    • @Mankepanke
      @Mankepanke ปีที่แล้ว +1

      Sqlx for Rust is very similar. You inline SQL but at compile time it validates the SQL, placeholders, etc and generates the correct return types for you

    • @pearceodegard582
      @pearceodegard582 ปีที่แล้ว

      Would y'all say it is easy to prevent SQL injection with sqlc and sqlx?

    • @Mankepanke
      @Mankepanke ปีที่แล้ว

      @@pearceodegard582 Yes, AFAIK with sqlx the query must be known at compile time so it cannot contain any dynamic data in the query itself. Then you place placeholders in it and call the query with values for them, which is escaped by the database itself rather than doing string manipulation before sending it over.

  • @jeremey__
    @jeremey__ ปีที่แล้ว

    Nice, was waiting for this for a long time :)

  • @lian1238
    @lian1238 ปีที่แล้ว +10

    I've been struggling to find a good ORM for javascript / typescript. I've used knex, then tried prisma, then moved to drizzle. When Rich said "they all suck." I really agree. They are *good enough* but not quite there yet imo.

    • @A.D.G
      @A.D.G ปีที่แล้ว +1

      EdgeDB has been pretty nice

    • @TannerBarcelos
      @TannerBarcelos ปีที่แล้ว

      Raw SQL with string interpolation and type coercion is where it’s at. Best experience IMO. But I’m biased, I think every software engineer should know at least basic sql

    • @lian1238
      @lian1238 ปีที่แล้ว

      @@TannerBarcelos thanks, I might just do that from now on. I can’t help but think of LINQ from C# and how convenient that is

    • @amirhosseinahmadi3706
      @amirhosseinahmadi3706 ปีที่แล้ว

      True, everyday I'm more and more grateful for EF Core.

  • @ranarisonassim880
    @ranarisonassim880 ปีที่แล้ว +5

    For me this guy is the "Micheal Jordan" of javascript

  • @edhahaz
    @edhahaz ปีที่แล้ว +1

    So this whole thing works without JS? Nuts how good everything you do is. You literally consider every single issue a dev could have

  • @kaibe5241
    @kaibe5241 ปีที่แล้ว

    I had the same view of Tailwind as you before trying it out, now I can't go back. It actually solves the key sole problem prior to its creation - management of styling your application.

  • @nevawhere5
    @nevawhere5 ปีที่แล้ว

    Any news on when this feature will be released?

  • @joppekoers3992
    @joppekoers3992 ปีที่แล้ว +1

    Is there a GitHub repository for this project?

  • @mendodev8775
    @mendodev8775 ปีที่แล้ว

    Does anybody know if he made the repo public for this? I'd love to take a look.
    I'm sorry if he showed in the video and I didn't catch it

  • @Lemmy4555
    @Lemmy4555 ปีที่แล้ว

    why should someone prefer capture/restore over replaceState inside beforeNavigate ?

  • @sean_reyes
    @sean_reyes ปีที่แล้ว

    I laughed hard on the part where you give us permission to mutate on data

  • @Mustardoable
    @Mustardoable 11 หลายเดือนก่อน

    This example is vulnerable to SQL injection right? for example `VALUES (${user.id}, ${user.username}....` the username could inject SQL

  • @oskrm
    @oskrm ปีที่แล้ว +3

    Rich, you can yammer all you want.

  • @koolvoid
    @koolvoid ปีที่แล้ว

    Bravo! i hope to find a new job where using Svelte.

  • @thelinuxlich
    @thelinuxlich ปีที่แล้ว +1

    Rich Harris needs a workshop on Kysely

  • @malipetek
    @malipetek ปีที่แล้ว

    Finally we got permisson to mutate data. I wont go to jail now when I public my private repos.

  • @edhahaz
    @edhahaz ปีที่แล้ว

    Tailwind is a design system

  • @0xedb
    @0xedb ปีที่แล้ว

    Welcome to another sermon on the mountain

  • @figloalds
    @figloalds 5 หลายเดือนก่อน

    Seeing Rich speak ill of all the trendy struff is kinda reassuring to me that I'm not crazy. Also he thinks a lot in the way that I think, like mutating the data for the sake of a more responsive presentation, like why complicate stuff when you can simply get things done?

  • @thedelanyo
    @thedelanyo ปีที่แล้ว

    Very succinct. But how does one detect js being disabled?

    • @ash8128
      @ash8128 ปีที่แล้ว +4

      Easy! The browser completely stops running your JavaScript code. And the app downgrades to a typical 90s web site with full page reload.

    • @thedelanyo
      @thedelanyo ปีที่แล้ว +1

      @@ash8128 okay. So how does one handle that logic? Because in the video, he said there's a fallback for "disabled js users"

    • @ash8128
      @ash8128 ปีที่แล้ว +1

      @@thedelanyo Backend serves 90s style html to the browser. All dynamic behaviour happens through href links, forms and inputs. Full page reload on every interaction.

    • @SvelteSociety
      @SvelteSociety  ปีที่แล้ว +5

      You make sure you use form actions and the data loading feature to handle CRUD. Make sure there are no features hidden behind logic that requires JS on the client. So basically don't do thinks like "on:submit|preventDefault={handleSubmit}" etc.

  • @rajenderkatkuri7642
    @rajenderkatkuri7642 ปีที่แล้ว +1

    Rich looks like the Jesus meme guy.

  • @TodorImreorov
    @TodorImreorov ปีที่แล้ว

    modals are now a part of the browser api (dialog element) - why make a custom one?

    • @maloxi1472
      @maloxi1472 ปีที่แล้ว +1

      The creator of Skeleton (a Svelte UI library) was asked the same question not long ago. His answer:
      "
      I did some testing during the last major refactor of the modal system. It has some a11y benefits, but honestly I found it incredibly difficult to work with. Especially in framework like Svelte - it doesn't work in a "Svelte-like" manner, it seems more geared towards folks writing apps in vanilla JS. We may revisit in the future, as I'm typically keen and prefer native browser solutions, but as it stands it's likely not going to be a consideration anytime soon
      Just FYI, we recreate most of the a11y benefits now - include focus trap, etc. So don't let that scare you away from our implementation
      [...]
      It's been a few months so some of the specifics have escaped me, but I recall the open and close mechanics relied on modifying a open attribute. There wasn't a great way to programmatically trigger it as we desired. And it really didn't jive well with the singleton approach we use for our notification features (ex: toasts)
      [...]
      (when asked about the close event on an HTMLDialogElement)
      Yeah you have to have a reference to the element - which is not great in Svelte to start with, as that means you have to start awaiting lifecycle events (ex: onMount) and then it relies on events rather than being able to control the state directly.
      [...]
      It totally makes sense for apps not build with something like Svelte, React, Vue, etc - where you have simpler and reactive state management. So I get why they went that path.
      "
      I'm tired of copy-pasting so I suggest you join the discord if you wanna see the rest / ask him a more specific question yourself

    • @modernkennnern
      @modernkennnern ปีที่แล้ว

      The dialog element spec is implemented horribly. It requires you to use the `openDialog()` function - unlike every other html element ever. Simply adding the `open` attribute does nothing.
      I'm simply baffled by just how awful that spec is. It makes it practically unusable for most scenarios.

    • @IStMl
      @IStMl ปีที่แล้ว

      because the api impl is half-assed

    • @justinoneill2837
      @justinoneill2837 ปีที่แล้ว

      ​@@maloxi1472thanks for the breakdown! I've been wondering why none of the Svelte UI libs haven't implemented this yet

  • @techinsider3611
    @techinsider3611 ปีที่แล้ว +6

    Quote of the day : I would rather look lame than look the same 🤍🤍

  • @timc.9703
    @timc.9703 ปีที่แล้ว +2

    Big fan of your work Rich, but I'll be brutally honest with you, I am worried that you are working at vercel.They are (rightly so as a VC Backed company) prioritizing the commercial interest over the community that make frameworks a success. I know people will call me crazy but the quality of the nextjs has decreased and is becoming increasingly lockled in to vercel. It is for instance, quite hard to selfhost a decent serverless xp for next if your not using vercel. The svelte core team and community are refreshingly pragmatic and seems to favor simplicity. I am worried that those two realities are not just compatible. I hope you'll be able to fight against the nextification of svelte and if not that your tc is worth it. With all respect and gratitude for the hard work. Tim.

  • @buldabang
    @buldabang ปีที่แล้ว

    height-screen => h-screen 😊

  • @kollpotato
    @kollpotato ปีที่แล้ว

    Are you a potato fan too?

  • @markglimm4740
    @markglimm4740 ปีที่แล้ว +1

    Amen to ORMs sucking.

  • @kaibe5241
    @kaibe5241 ปีที่แล้ว +1

    lol, embedding SQL. That's insane. For so many reasons. lol. I assume he's done it for brevity and presentation reasons, but even so - how you cannot value a proper ORM is beyond me.
    I've found I disagree with a lot of what Rich Harris talks about - but he does do a lot of things right, as well.