The Yew Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

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

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

    Great to see someone go beyond the click counting example 🙂

  • @casecamel6719
    @casecamel6719 ปีที่แล้ว +19

    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.

  •  ปีที่แล้ว

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

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

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

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

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

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

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

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

      I've put it on my list to look into

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

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

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

      Yew better enjoy the Vue from over there.

  • @michaelsegel8758
    @michaelsegel8758 4 วันที่ผ่านมา

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

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

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

  • @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 6 หลายเดือนก่อน

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

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

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

  • @dario.lencina
    @dario.lencina 2 ปีที่แล้ว

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

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

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

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

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

  • @MonLes-xt7gc
    @MonLes-xt7gc ปีที่แล้ว

    How do you split the screens perfectly

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

  • @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: th-cam.com/video/apEXmJP5xxw/w-d-xo.html

  • @NotBrisk
    @NotBrisk 2 ปีที่แล้ว

    Chris very great video yet again!

  • @simdimdim
    @simdimdim 2 ปีที่แล้ว

    for details, lets watch next video :D

  • @displayname7t4
    @displayname7t4 2 ปีที่แล้ว

    Thank you for this tutorial !

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

    To use this video: learn react...?

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

    nice video chris

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

    What ls tool are you using?

  • @gumispro
    @gumispro 2 ปีที่แล้ว

    U BEST!!!

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

    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.