The Yew Tutorial

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 49

  • @asdqwe4427
    @asdqwe4427 2 роки тому +12

    Great to see someone go beyond the click counting example 🙂

  • @thedevnoteyt
    @thedevnoteyt 2 роки тому +9

    Very informative video Chris. Please bring more videos on Yew, if possible 🙏

  • @HagbardCelineOnRust
    @HagbardCelineOnRust 2 роки тому +1

    you deliver this quality content so fast, i can not even watch it. ty. and iam so lf to 2023, my rust year. superb work

  •  Рік тому

    Thank you, I'm glad to know that someone else had the same problem with the json fetch at the end.

  • @avinashthakur80
    @avinashthakur80 2 роки тому +3

    Thanks for such an informative video. It was clean & without any distraction, just on point.

  • @casecamel6719
    @casecamel6719 2 роки тому +20

    it would be super useful to make tutorial on little more complicated examples like, passing around data through components, pages, writing rest apis and receiving and sendting to other servers.

  • @jl4zz
    @jl4zz 2 роки тому +6

    Great stuff Chris. Thoughts on ergonomics vs Dioxus, Sycamore, or Leptos? Found simple things like nested lists get really ugly, really quickly in these Rust front ends.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +7

      I think Rust frontend in general is a pretty hard sell. Some tools like Sycamore advertise as "anti-JS" which is a really tough position to be in with a large community-sized lift to rebuild an ecosystem on top of. Dioxus is really early in it's lifecycle and if you have any JavaScript skills at all I'd recommend going full Tauri over Dioxus' piecemealing of Tauri's crates. I haven't worked with Leptos at all.
      The popular state of the art in frontend JS is heavily influenced by VC funding though, so the ergonomics of Rust on the frontend has to compete with companies who are well funded and trying to onboard you quickly and lock you in. This often results in fast onboarding but high-maintenance applications over time.
      So I could see Rust building an ecosystem that isn't driven by the same factors that could be very productive. It'll take a lot of work from a bunch of people though.

  • @rexma7394
    @rexma7394 2 роки тому +10

    I would love to see a Leptos tutorial. I think it's inspired by SolidJS and most of the issues you had with Yew (defining a component name for example) don't look like so bad in Leptos

  • @aimpizza6823
    @aimpizza6823 Рік тому +1

    Has anyone figured out the proxy problem? I independently followed the yew tutorial and am stuck with the same behaviour
    EDIT: Digging through the Yew Discord I found that if you cleared the cache (or visit in an incognito window as I did) it works as expected. I have no clue why or how to prepare for such an issue but that's at least a temporary fix

  • @MonLes-xt7gc
    @MonLes-xt7gc Рік тому

    How do you split the screens perfectly

  • @dario.lencina
    @dario.lencina 2 роки тому

    Awesome video Chris!! I am adding it to my Rust Frontend Playlist!!

  • @corear
    @corear 2 роки тому +1

    Great name... will *never* be confused with Vue...

    • @DBZM1k3
      @DBZM1k3 2 роки тому +1

      Yew better enjoy the Vue from over there.

  • @johnt1342
    @johnt1342 Рік тому

    Ugh, hot reload isn't working? Nothing updates when I save my rust code.

    • @chrisbiscardi
      @chrisbiscardi  Рік тому

      You should file an issue with the project then. I was using hot-reload yesterday with the new release and it was working for me.

  • @AreQ212
    @AreQ212 2 роки тому +1

    Regarding 14:23, just think about an Option as a single element List, then it makes more sense. Same as Tree in which all nodes have only one child is a List.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому

      It turns out there's a clippy lint for preventing this approach in other contexts, so especially interesting it was chosen here -- rust-lang.github.io/rust-clippy/v0.0.212/#for_loop_over_option

  • @redcrafterlppa303
    @redcrafterlppa303 2 роки тому

    9:00 I didn't know you could destructure in the function arguments. I will definitely use this here and there

  • @j-wenning
    @j-wenning 2 роки тому +2

    That fetch/unwrap chain is pretty 1:1 with a JS fetch promise chain. Fetching can fail, and deserializing a response can fail. JS has the benefit of being able to catch *any* error with a try/catch or chained .catch.
    the same code in js:
    const data = await fetch('/tutorial/data.json')
    .then(data => data.json())
    .catch((err) => handleErr(err));
    OR
    try {
    const res = await fetch('/tutorial/data.json');
    const data = await res.json();
    } catch (err) {
    handleErr(err);
    }
    handleErr would then have to handle both request error types, and deserialization error types. So it's just as much (if not more) boilerplate to write something that actually handles both error types cleanly.

    • @Sethbeastalan
      @Sethbeastalan 9 місяців тому

      That's a really good point. I wonder if that can be handled smoothly with some macros.

  • @workflowinmind
    @workflowinmind 2 роки тому

    I saw Yew mentioned many times, but never really understood the need, after this video I can safely say that in it's current form I don't have any application for it at work. Performance wise, could you potentially draw more/faster in WASM?

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +1

      wasm doesn't have access to the dom, so you're not going to get faster dom updates afaik. It can be useful for performance if you're doing a lot of calculation, which is why I think some of the primary usage of wasm right now is with wgpu -> canvas interactions or other computationally heavy use cases.

  • @intendednull
    @intendednull 2 роки тому +2

    Awesome video! Would be interested to see your thoughts on Yewdux. It doesn't try to be Redux 1:1, but should be relatively easy to pickup for people familiar with flux-like libs.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +1

      Video today took a look at yewdux. It was very easy to pick up and follow the todomvc, etc examples

  • @michaelsegel8758
    @michaelsegel8758 2 місяці тому

    Nice Demo / Turorial.
    One small nit... the video doesn't match the tutorial doc and this could cause some confusion. Current tutorial version is 0.21 ...

  • @NotBrisk
    @NotBrisk 2 роки тому

    What program are you using to have your windows work like that? And with the rainbow background?

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +1

      I use yabai on macos, and the rainbow background is my own gradient desktop image from photoshop.
      I go over it here: ua-cam.com/video/apEXmJP5xxw/v-deo.html

  • @temoncher
    @temoncher 2 роки тому

    It is cool to see more wasm presence on the web, but this syntax, boilerplate and clones everywhere.. It looks very much like rust and react are just not meant to be used together like that

  • @Codeaholic1
    @Codeaholic1 2 роки тому

    I think it would be interesting to see a bigger React tutorial implemented in Yew.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +2

      yeah I agree. I'm planning on doing some more Rust UI explorations across a couple of tools. Is there a specific React app that you'd like to see?

    • @Codeaholic1
      @Codeaholic1 2 роки тому

      @@chrisbiscardi I only know enough react to be dangerous. But something interfacing with a database, accepting and storing data and then mixing in push based real-time events would be awesome.

  • @NotBrisk
    @NotBrisk 2 роки тому

    Chris very great video yet again!

  • @LucasOe
    @LucasOe Рік тому

    What ls tool are you using?

  • @noblenetdk
    @noblenetdk Рік тому

    To use this video: learn react...?

  • @larrymarso4492
    @larrymarso4492 2 роки тому

    Thoughts v sycamore? I've had positive though limited experience with sycamore -- but it looks better than this! However interoperability with Javascript libraries seems a no-go. A Yew tutorial including such would be illuminating.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому +1

      I'll do some videos on sycamore too. I'm pretty skeptical of anything that advertises as "anti-javascript" in general and sycamore's homepage saying "Had enough of JavaScript? So have we." as a main selling point is meh IMO.
      Giving up the very fast moving JavaScript ecosystem's libraries means you have to rebuild everything against a moving target so would require a very large community-sized lift for that to pan out, or a specific use case.

    • @larrymarso4492
      @larrymarso4492 2 роки тому

      @@chrisbiscardi thank you so much for your reply. Is Sycamore anti JavaScript from a programmatic standpoint, or simply philosophically. In other words, does it stand in the way of JavaScript library compatibility for the intrepid? I don't know how much Yew bends over backward to support JavaScript library compatibility -- which I thought was an issue with wasm-bindgen in general? (Library, not calling individual commands intentionally exported). Again, appreciate the response.

    • @chrisbiscardi
      @chrisbiscardi  2 роки тому

      @@larrymarso4492 seems philosophical since it's on their homepage. They do have a documentation page on interop: sycamore-rs.netlify.app/docs/advanced/js_interop but they're still pre first release afaik (suggested installation method is the git repo) so not all docs are filled out and we'll see how it evolves

  • @displayname7t4
    @displayname7t4 2 роки тому

    Thank you for this tutorial !

  • @quantumquantified
    @quantumquantified 2 роки тому +2

    nice video chris

  • @simdimdim
    @simdimdim 2 роки тому

    for details, lets watch next video :D

  • @gumispro
    @gumispro 2 роки тому

    U BEST!!!

  • @jonathanlevi2458
    @jonathanlevi2458 2 роки тому

    You don't have to use curly brackets for text. Only if you want to use a Rust string literal...for some reason. `Hello World` also works.