Refactoring The Yew Tutorial

  Рет қаралды 5,045

chris biscardi

chris biscardi

Күн бұрын

Пікірлер: 19
@MrJakob
@MrJakob 2 жыл бұрын
Thanks for this update and the refactoring. After the last video I thought: that’s okay, but there must be cleaner way to do this. I am happy you demonstrated this way 👍
@workflowinmind
@workflowinmind 2 жыл бұрын
I hope to see you back on yt some day :) I really enjoyed the raytracer serie
@MrJakob
@MrJakob 2 жыл бұрын
@@workflowinmind definitely planing further videos in the future. As soon as I have the needed free time again. This time will hopefully come sooner then later 😁
@dyslexicsteak897
@dyslexicsteak897 2 жыл бұрын
Great job Chris, this is much better, pr this maybe? I tried using yew and it just felt like a huge mess for someone who doesn't really know what components and all these things mean so any contribution would be beneficial to the yew project.
@dealloc
@dealloc 2 жыл бұрын
If you don't know what components are, I suggest starting with React. Yew tries to copy React's APIs into a Rust environment, which I personally don't think works well. Rust has so much more powerful syntax than JS that it just doesn't make sense to make an almost 1:1 copy. Another thing is that it just doesn't feel like you're writing Rust but still have to deal with all the safety guards that Rust provides which makes it very unmanageable imo. That and if you want to write web apps, use TypeScript instead. There's a lot of overhead using WASM on the web, let alone using a memory managed programming language to deal with DOM APIs (i.e. event listeners). Start with React as it has the widest range of resources and is for the most part is backwards compatible (except unstable APIs that you likely aren't going to use yet), and their React Beta docs are also fantastic to learn about components in general.
@chrisbiscardi
@chrisbiscardi 2 жыл бұрын
If they want this work contributed I might PR it. I assume they chose functional components for a reason to reach a specific audience. The "functional component" concept got really popular in the JS ecosystem a few years ago. I'm hanging out in their discord now so should be able to find out.
@dyslexicsteak897
@dyslexicsteak897 2 жыл бұрын
@@dealloc yes, it felt quite foreign and restrictive comparing to the Rust I'm used to writing, the documentation isn't the greatest as well. I'd really like to see Rust succeed in the web space
@dyslexicsteak897
@dyslexicsteak897 2 жыл бұрын
@@chrisbiscardi 👍
@dealloc
@dealloc 2 жыл бұрын
@@dyslexicsteak897 I'm sure it will, just not for web UI/DOM in my opinion. There's still a bright future for compiled languages using WASM for more computational tasks like rendering, physics, audio, emulation and the like.
@workflowinmind
@workflowinmind 2 жыл бұрын
This makes much more sense then the tutorial version! Totally unrelated, but have you ever talked about your tutorial workflow/setup? I want to get back into doing tutorials (VFX/CG related) and would like to have "strict guidelines" and setup to not have to think about it much. Like do you record long sessions that you edit down? I feel like you manage to optimise time very well in these. No mumbling and not epileptic edit either, very good balance
@dealloc
@dealloc 2 жыл бұрын
Whatever makes you most productive is what matters. Some record long videos and cut them later, some also write a script or at least an outline to follow to make the video more coherent and avoid talking too much detail which can make it hard to follow. Others don't do it at all and can just talk coherently about a subject on the spot. People have different skills and workflows. There aren't strict guidelines. It's what you find works for you. You'll only learn and adapt your workflow by doing it.
@chrisbiscardi
@chrisbiscardi 2 жыл бұрын
I haven't talked much about my workflow. For youtube since I do daily videos it's very lightweight and has to be end-to-end finished in maybe 2 hours tops or I won't be able to ship a video. Some days I invest more, but I also have other work to do each day. The breakdown is roughly: 1. get the example ready before the video 2. talk through the code/etc and record in obs (20m-1h recording) 3. remove silence programmatically 4. edit any umms, coughing, or bad takes out (davinci resolve, one playback) 5. generate captions and review For me, I find that shipping more videos helps me more than shipping one really well produced video every week/month. So I choose the kind of video I make to fit the daily schedule whereas for Rust Adventure videos, I can spend a bunch of time on any level of production because the shipping schedule is once a month or so.
@workflowinmind
@workflowinmind 2 жыл бұрын
@@dealloc Thanks but it was not the point of my question. I was specifically curious about Chris workflow given I love the output. It's like asking a Chef you like some tips, yet you know how to cook.
@workflowinmind
@workflowinmind 2 жыл бұрын
@@chrisbiscardi Thanks! That's very insightful and I completely share you later point! I will try to adapt it and see how it goes tysm
@irlshrek
@irlshrek 2 жыл бұрын
I agree with this refactoring! It's intuitive
@thedevnoteyt
@thedevnoteyt 2 жыл бұрын
🙌
@haystackdmilith
@haystackdmilith 2 жыл бұрын
I did exactly the same in my project. These use_effect-like hooks are atrocious. Feel like some js developers trying Rust for the first time…
@dealloc
@dealloc 2 жыл бұрын
Agreed. React does not translate well to Rust-that and trying to write web apps in Rust, which is another rant I could go on and on about. For fetching, you should not use useEffect directly as it is a footgun. Rather, use abstractions like React Query, swr and the like for dealing with async operations and their state, caching and optimistic updates for a better UX.
Static, Incremental, and Serverside rendering in Perseus
13:20
chris biscardi
Рет қаралды 3,6 М.
Can we have Redux in Rust? (Yewdux)
15:56
chris biscardi
Рет қаралды 6 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Can We Make Yew Even Faster?
25:22
Greg Johnston
Рет қаралды 13 М.
Generic Traits, Impls, and Slices in Rustlang
18:05
chris biscardi
Рет қаралды 11 М.
Learn Rust | Twelveth Lesson - Ownership & its usage
21:43
Code Roamer
Рет қаралды 826
CSS in Rust with Stylist and Yew
11:20
chris biscardi
Рет қаралды 9 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 572 М.
Why i think C++ is better than rust
32:48
ThePrimeTime
Рет қаралды 336 М.
The Yew Tutorial
22:41
chris biscardi
Рет қаралды 39 М.
zig will change programming forever
9:34
Low Level
Рет қаралды 359 М.
Rust Demystified 🪄 Simplifying The Toughest Parts
14:05
Code to the Moon
Рет қаралды 191 М.
Implement the Builder Pattern in Rust
15:17
chris biscardi
Рет қаралды 7 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН