Let's Build a Frontend Web Framework in Rust

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 มี.ค. 2023
  • This video will walk building a simple DOM rendering library in Rust, starting with the basics of DOM manipulation and interaction with browser APIs and incrementally building up from there.
    Resources:
    Repo: github.com/gbj/simple-framework
    Leptos: github.com/leptos-rs/leptos
    wasm-bindgen Guide: rustwasm.github.io/docs/wasm-...
    Other tools:
    Bacon: github.com/Canop/bacon
    Trunk: trunkrs.dev/

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

  • @ahmadradwan7429
    @ahmadradwan7429 ปีที่แล้ว +157

    Based priest Greg descends from the mountains to teach us more rust while his birds watch over him.

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

      truly anointed

    • @AbuAl7sn1
      @AbuAl7sn1 8 หลายเดือนก่อน

      worshiping a man who came from a vagina ?

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

    I love how the birds chirping joyfully in the background.

  • @rahulshandilya304
    @rahulshandilya304 ปีที่แล้ว +17

    I am reading leptos book in progress and love the way you don't miss to explain basic concepts. It can be even recommended to someone who has just started with rust.

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

      Where can I find this book?

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

      @@baka_geddyjust look up “leptos book” and it should be one of the first few results

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

    this was an awesome video! the audio quality was fantastic. the birds sounded like I was relaxing in the jungle learning about rust and wasm

  • @HelloThere-xs8ss
    @HelloThere-xs8ss ปีที่แล้ว +4

    thats really awesome that a small change doesnt require a complete re-rendering

  • @JkyLi
    @JkyLi 11 หลายเดือนก่อน +1

    After struggling with learning leptos for some time, I finally kind of get it after watching this video.

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

    This is an excellent introduction to building a web framework full stop! Thank you for the insight; definitely checking out that signals video.

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

      Glad it was helpful!

  • @tenthlegionstudios1343
    @tenthlegionstudios1343 10 หลายเดือนก่อน +1

    I really appreciate these from scratch type videos. They really teach you so much more and share so much knowledge. It really speeds up other developers journeys into these deeper areas. I am sure the first time learning all this was not as easy as this looks. Many thanks!

    • @tenthlegionstudios1343
      @tenthlegionstudios1343 10 หลายเดือนก่อน +1

      Would love a breakdown like this for some of the server side rendering / logic. I am not sure how complex this would be, but it really helps me understand the frameworks.

  • @eliasp.2759
    @eliasp.2759 ปีที่แล้ว +2

    Very interesting! The birds really add something though

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

    Appreciate the way you explain the basics as you go. With WASM changing so quickly its nice to not require too much WASM background knowledge

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

    That was a good first step, I hope you will have time to build and show us some more advanced stuff

  • @RoshanKharel
    @RoshanKharel 9 หลายเดือนก่อน

    came for the content. enjoyed the background chirp :)

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

    Around 29:00 when the nothing but the value changes and no other DOM node. … I said wow audibly. I’m a Leptos evangelical now - I get that solid etc will do the same but having it in Rust just makes it so much better

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

    This was great Greg! Can we get some detailed "how-to" tutorials for Leptos please?

  • @soengkanel2284
    @soengkanel2284 10 หลายเดือนก่อน

    could you make a video of how we could deploy to the host like aws, heroku?

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

    if i used pyo3 to wrap websys as a DOM api for python, would i be wasting my time in trying?

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

    This is gold! Have you considered making courses?

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

      Thanks! I haven’t really (largely time constraints) but glad you enjoyed it/it was helpful for learning.

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

    ❤️

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

    What's your fonts of the nvim? It is so light and I want to try it too.

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

      Iosevka. Stolen from fasterthanlime, who makes *outstanding* Rust content (TH-cam and blog)

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

    👌👌

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

    Do you have any content about graceful degradation? I remember you mentioning it in some video you were in, but I can’t find it anymore.

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

      Yeah toward the end of the stream I did with Ryan Carniato I show how ActionForm works even with WASM turned off. Using normal links and forms (via and or ) is how we do this in Leptos. Link to stream with Ryan: th-cam.com/users/livezgY7ql1xwW4 I’m on for the first two hours or so.

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

    Indeed, very interesting. I like the builder pattern more than JSX and so I am also currently playing with Rust and Wasm-based Web UI (but with futures-signals from dominator 😉) and I'd like to know more about this Scope stuff. Do you have any resources I could read/listen/watch that also helped you building that into leptos? Thanks.

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

      There is a short section about the runtime context in one of his previous videos. It's in "Learning Leptos: Build a fine-grained reactive system in 100 lines of code" and starts around 04:31, showing more how signals and effects work together.

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

      Cool! Leptos does also have a builder pattern/you can use it with zero macros and on stable (see example here github.com/leptos-rs/leptos/blob/main/examples/counter_without_macros/src/lib.rs)
      Re scopes: it’s a little hard to explain in a YT comment and I don’t know that I have anything published about it. This post from Sycamore lays out a very similar problem space sycamore-rs.netlify.app/news/new-reactive-primitives
      Rather than using references with lifetimes tied to a Scope via bumpalo (as in Sycamore), Leptos gives Copy + ‘static signals by storing reactive values in a slotmap and passing the indices around. Scope is kind of your handle back into that reactive system. Basically a way to model a deep reactive graph without needing to .clone() signals and move them into event listeners everywhere, etc.
      futures_signals is great although it’s a somewhat different model of reactivity (not auto-tracking dependencies, etc.)

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

      @@FlorianZier Good reminder, thanks

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

      @@gbjxc Thanks. I'll have a look to all of that. I try to dive into the Signal stuff (in Rust) to learn more atm. Not easy!

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

    I'm left with one question: what's the proper way of doing the "leaking" without using the `.forget()`?

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

      To do it without leaking we could do something like us on_cleanup() in Leptos to keep it alive until the reactive scope it’s created in is disposed. Remember “leaking” in this sense = not reclaiming memory until you navigate away from the page so a click listener on the root of an app like this is always leaked anyway (because as long as the button is there it needs to exist)

  • @FranciscoGarcia-fl1wy
    @FranciscoGarcia-fl1wy ปีที่แล้ว

    Can anybody explanied the terminal program he is using to show the errors like that

    • @xyangst
      @xyangst 4 หลายเดือนก่อน

      2:00

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

    I will make it in zig and see how it turns out

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

    May he be blessed in oxide

  • @HelloThere-xs8ss
    @HelloThere-xs8ss ปีที่แล้ว

    this reminds me of Flutter

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

      Oh interesting! I haven’t really used Flutter but these declarative (rather than imperative) patterns are really good for UI in any language.

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

      @@gbjxc Yup a lot of builder pattern in Flutter as well. They are also working on adding wasm target.

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

    God always takes care of its children.❤