The React You Want Is 10X Slower

  Рет қаралды 34,472

Jack Herrington

Jack Herrington

Күн бұрын

To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/JackHerrington/ . The first 200 of you will get 20% off Brilliant’s annual premium subscription.
They could have managed state in React several different ways, why did they choose the one that folks find the most confusing?
👉Code: github.com/jherr/react-state-...
👉 I'm a host on the React Round-Up podcast: devchat.tv/podcasts/react-rou...
👉 Don't forget to subscribe to this channel for more updates: bit.ly/2E7drfJ
👉 Discord server signup: / discord
👉 VS Code theme and font? Night Wolf [black] and Operator Mono
👉 Terminal Theme and font? oh-my-posh with powerlevel10k_rainbow and SpaceMono NF
0:00 Introduction
1:46 Proxy State Management
10:00 Deep Copy State Management
13:35 Proxy State Management
15:21 Reference Vs Copy Fight!
19:23 Outroduction
This video was sponsored by Brilliant

Пікірлер: 149
@BeyondLegendary
@BeyondLegendary Жыл бұрын
Impressive, very nice. Let's see Paul Allen's state management.
@leonauswien
@leonauswien Жыл бұрын
Why isn't it possible? Why not you stupid framework?
@thedishwasherakawomen8878
@thedishwasherakawomen8878 Жыл бұрын
It's something called sillian toolkit
@markcampbell2491
@markcampbell2491 Жыл бұрын
Your compliment was sufficient Luis
@joeyywill1234
@joeyywill1234 Жыл бұрын
​@@thedishwasherakawomen8878 that is actually a great name for a state management tool lol
@peterjasko7059
@peterjasko7059 10 ай бұрын
any links?
@vikingthedude
@vikingthedude Жыл бұрын
I love these intermediate-level videos. So much content is aimed towards beginners and the advanced content gets complex real fast. This strikes aa nice balance
@pedromenezes4013
@pedromenezes4013 Жыл бұрын
As always, you make those deep dives feel a lot more digestible and intuitive. Thanks!
@xryancruzx
@xryancruzx Жыл бұрын
Great video as always Jack, thank you! Interested in more of such intermediate topics which focus on inner workings of React and other libraries, and how it effects performance and developer experience etc.
@regibyte
@regibyte Жыл бұрын
I can never get enough of your videos, i already knew most of this stuff but you explained it like it was nothing Jack 🤝🏼
@emrey.7620
@emrey.7620 Жыл бұрын
I've been thinking about this recently, thank you for the informative explanation. It was an awesome video. I look forward to more videos delving into the intricacies of the subject.
@jherr
@jherr Жыл бұрын
It's been a while since I've doing one of these more "theoretical" videos. It was fun to do. But it's always a crap shoot as to whether it's going to perform well.
@myestery
@myestery Жыл бұрын
I heard vue 2 uses proxies and we had these issues with setting nested values. Now i understand clearer
@butterfly7562
@butterfly7562 11 ай бұрын
The first is somewhat similar to the vue3 proxy responsive principle, the second can use structureClone, the third point if you prefer to directly modify the mental model you can use immerjs
@johnyepthomi892
@johnyepthomi892 Жыл бұрын
This was a treat. Thanks for the content.
@mandalorian99
@mandalorian99 9 ай бұрын
fantastic comparison, good to learn about deep copy too using lodash
@javiervazquezfernandez1872
@javiervazquezfernandez1872 Жыл бұрын
I dont know how you come up with this ideas but... keep going. please. At the beginning I though that this video was more oriented to the 3 state management paradigms (proxies, atoms and flux) but was a surprise how it ended up!
@antonychiramel80
@antonychiramel80 Жыл бұрын
Damn, I learn something new everytime I watch your videos. Thanks Boss👍
@Bookwala12
@Bookwala12 Жыл бұрын
Never been disappointed watching your videos, Jack.. been over two years I think, every video I have watched, I have learnt a thing or two.. am so grateful to you..
@sagarreddy7461
@sagarreddy7461 Жыл бұрын
Awesome thanks Jack!
@eleah2665
@eleah2665 Жыл бұрын
Very interesting as usual. Thanks.
@r2_rho
@r2_rho Жыл бұрын
I use valtio extensively and love it tbh.
@tankmohit
@tankmohit Жыл бұрын
Just migrated huge app state to Valtio yesterday from zustand. Initially I liked the idea of mutating data right away when needed, instead of defining setters, but soon started having issues with deeply nested arrays and objects. Migrating back to Zustand now 😥
@WilliamShrek
@WilliamShrek Жыл бұрын
Oh my favorite channel on youtube.🌹
@padaricohora9094
@padaricohora9094 Жыл бұрын
That was a great video. So interesting ❤
@biswaranjan6342
@biswaranjan6342 Жыл бұрын
very much helpful content👏
@Q99a
@Q99a Жыл бұрын
Hi, Does react compare the mutable statetypes for rerendering, in the addAndCompareReference comparing two objects using "===" operator is a bit issue too i assume.
@jherr
@jherr Жыл бұрын
It actually uses Object.is, but === is the same behavior. It compares references and NOT contents. React itself does NOT care about the contents of your arrays or objects when it comes to state management.
@Dev-Siri
@Dev-Siri Жыл бұрын
I honestly prefer React's immutable approach. I like to treat every object as Object.freeze( ), so mutating some object directly feels weird, even more so if I have to mutate it & then set it again.
@dotjs5025
@dotjs5025 Жыл бұрын
Amazing video 🎉
@bluecup25
@bluecup25 Жыл бұрын
Brilliant video
@WilliamShrek
@WilliamShrek Жыл бұрын
It takes many many many geniuses to create Brilliant!
@WilliamShrek
@WilliamShrek Жыл бұрын
This is amazing!
@EnricoAnsaloni
@EnricoAnsaloni Жыл бұрын
I love lodash and yes it's slower but I had to use it (deepCopy) on an incoming data stream from an ECG with an incoming sample every 2ms and it kept up pretty well. Anyways, I use both lodash and object-path in most of my projects for dealing with deeply nested objects
@twothreeoneoneseventwoonefour5
@twothreeoneoneseventwoonefour5 Жыл бұрын
Rambda is a lot faster alternative. Clone (deep copy) there is 86% faster than in lodash.
@EnricoAnsaloni
@EnricoAnsaloni Жыл бұрын
@@twothreeoneoneseventwoonefour5 I'll give it a try thx for the tip
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Just dont
@bigmistqke
@bigmistqke Жыл бұрын
I have been using deepsignal (the one where u can just mutate, there are two packages called that...) for the past two weeks and really like it. Is a proxy state built on top of preact/signals.
@AK-vx4dy
@AK-vx4dy 9 ай бұрын
Good explanation. As i rember Vue2 uses proxymethod?
@andrei_fyi
@andrei_fyi 10 ай бұрын
I kinda like proxies, nested proxies are cached as well, so they only get created once, when accessed first, and it should be pretty fast; if we want to update properties that are nested 7 levels deep into a state inside a component I'd say we have bigger problems. An alternative to the [state, setState] separation that would still work with primitives would be to consume a value like we do now with `state` and set it with `set.state({ thing: { to: "patch" }}), but setState isn't at all bad the way it is.
@bigmistqke
@bigmistqke Жыл бұрын
Nice thing about proxies is no stale closures in useCallback
@RobertLigthartt
@RobertLigthartt Жыл бұрын
Question: What code theme are you using? It looks amazing!
@jherr
@jherr Жыл бұрын
Night Wolf [black]
@hypeerj
@hypeerj Жыл бұрын
I am wondering how to perfect the data structure of todoist like app. Currently, using supabase I make simple query for project that has sections array, and each section has an array of tasks I also use dnd-kit and I want to achieve the most performant task section change I can make. Currently I keep my project obj in state, when I move my task I use structuredClone and change tasks order and section in this nested messy spaghetti. Todoist uses flat projects, sections, tasks structure, each is a Map Im trying different ways right now and flat arrays and nested arrays have similar results, (0.1 to 0.4ms task drag between sections) I'll try with maps, very fun to work with it
@Zagoorland
@Zagoorland Жыл бұрын
I didnt even know that something like a "new Proxy" exists in JS... And I'm a intermediate dev. Seems like no one is talking about this, lol
@Zagoorland
@Zagoorland Жыл бұрын
maybe it's because i'm into functional programming only, but it seems like more usable in OOP
@jherr
@jherr Жыл бұрын
Hmmm, I'm actually not sure what the FP take on proxies is... Yeah. Probably a no-no. You're right. Side effects and all that.
@Septrba
@Septrba Жыл бұрын
It's a very useful tool
@Crevulus
@Crevulus Жыл бұрын
15:50 "Faker faker faker" 😂
@poyrazbirbil
@poyrazbirbil Жыл бұрын
Under which category do signals fall under? Been using them lately with Solid, and they just feel and run awesomely
@jherr
@jherr Жыл бұрын
I think they are by reference in Solid-JS. I'd have to confirm that. I doubt Ryan would make deep copies. He's too performance minded for that.
@IainSimmons
@IainSimmons 11 ай бұрын
​@@jherrSignals are by reference, Stores are proxies. And I guess the performance gain is probably more from explicit changes in the reactivity model instead of React just doing everything again because something, somewhere changed
@aquaajb
@aquaajb 9 ай бұрын
Jack: "I hereby promote you to platform architect" Me: 😨
@j0hannes5
@j0hannes5 Жыл бұрын
Am I loosing performance when using valtio or mobx compared to other options?
@jherr
@jherr Жыл бұрын
No, actually MobX is one of the fastest state managers out there.
@AmodeusR
@AmodeusR 9 ай бұрын
is the cloneDeep function to deeply copy a javascript object? If so, why not use structuredClone web API?
@crashmstr
@crashmstr Жыл бұрын
This made me curious about immer, since I’ve used it for some things, especially with deep objects (and the fact that the object destructuring gets messy in my opinion), and wow, three times slower than deep copy!
@jherr
@jherr Жыл бұрын
IMHO, the best thing to do is to learn how to manage object/array references.
@ogzhnsfgl
@ogzhnsfgl 9 ай бұрын
I was curious same think and test them, reference compare = 0.504μs deepcopy compare = 5.859μs immer compare = 9.986μs Immer looks impressive, but only for DX However, I'm concerned about its 20 times slower performance compared to reference. Is it worth sacrificing performance for this DX benefits? Btw, immer also has almost 5kb gzip package size.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Signals signals signals
8 ай бұрын
I think people doesnt give enough credit to hookstate, where do you stand on this Jack? It uses proxy and if you use it with useHookstate hook, you can observe nested objects with class getters and setters. Thanks for the great videos by the way.
@jherr
@jherr 8 ай бұрын
Tried it a while ago and it was fine. Haven't tried it since.
@zotoavinaandriamanamihaga6661
@zotoavinaandriamanamihaga6661 Жыл бұрын
what is this vscode theme, I love it so much
@jherr
@jherr Жыл бұрын
Night Wolf [black]
@zotoavinaandriamanamihaga6661
@zotoavinaandriamanamihaga6661 Жыл бұрын
@@jherr thank you ❤
@deatho0ne587
@deatho0ne587 Жыл бұрын
I know you are talking about something else, but you hint at something. DeepCopy from lodash is something like the following obj is of type obj, array, an array of objects, object of arrays, whatever clonedObj1 = JSON.parse(JSON.stringfy(obj)) clonedObj2 = structuredClone(obj)
@jherr
@jherr Жыл бұрын
StructuredClone, which is native clone, is oddly less performant than deepClone. Super weird, but that's currently the case at least with V8. I just tested a JSON.stringify/JSON.parse variant and it's about 2.5X slower than the lodash deepClone/isEqual.
@deatho0ne587
@deatho0ne587 Жыл бұрын
Think that is what I saw when doing my test also. I believe the StructructuredClone is not as defined as some other basic JS, meaning it could be very different per browser. stringfy/parse has the issue js has with strings and might be like regex under the hood. Was thinking more just when you need the initial obj to be the obj, but are not using lodash in your project. Then you do initialObj.something.deep === newObj.something.deep. Maybe you need the initial Object for different parts of the code also, so not just comparing newObj vs initialObj.
@kaushal7able
@kaushal7able Жыл бұрын
Awesome :)
@akosbalint3485
@akosbalint3485 Жыл бұрын
Immer is also based on a deep copy proxy? Is it as slow as your solution?
@jherr
@jherr Жыл бұрын
I'm not sure it is, as I recall it's kind of a hybrid proxy/deepcopy. It would be fun to try it out... :)
@tonienguix6503
@tonienguix6503 Жыл бұрын
jesus christ you are a beast jack
@SabrinaDias
@SabrinaDias 9 ай бұрын
I'm Brazilian and have difficulty keeping up when the explanation is very fast. I enjoy your videos, but it's hard to understand. It would be amazing to watch videos with a slower pace for non-native speakers. tks
@jherr
@jherr 9 ай бұрын
You can slow the playback speed down.
@sadiqshaik4064
@sadiqshaik4064 Жыл бұрын
At 16:38 you said the comparison would be true, but I think it would be false, please explain
@jherr
@jherr Жыл бұрын
Correct, just a slip of the tongue there. That would always be false.
@MichaelScharf
@MichaelScharf Жыл бұрын
What about the proxy performance?
@jherr
@jherr Жыл бұрын
I didn't run the benchmarks on proxies because I don't think they make a good option for basic state management. Primitive values need to be boxed (e.g. String("hello") vs just "hello"), which nobody is going to want to do, and nested objects and arrays get tricky because you have to mark them as proxied which means setting a special key, which messes up data integrity. It's just nasty. One good alternative would be what Solid-JS does which is to have reference based state management with createSignal, and proxy based state management with createStore. It would be great if React had a built-in useStore.
@gordonfreimann
@gordonfreimann Жыл бұрын
Can you make a comparison with signals too?
@jherr
@jherr Жыл бұрын
Not in React, no. Not without just a bunch of hackery.
@gordonfreimann
@gordonfreimann Жыл бұрын
@@jherr maybe in preact?
@jherr
@jherr Жыл бұрын
@@gordonfreimann Yeah, the preact signals are equally hacky. Any Solid-style signals on a VDOM framework is going to be subverting the framework because you are altering the DOM directly without the VDOM being updated.
@jediampm
@jediampm Жыл бұрын
Hi, nowadays no need loadash to create deep copy, all browser ( this is not part js) you can use structuredClone global fn- Of course in your test this fn will not work, you have to run in browser env. Either way, i dont think that will change the conclusion.
@bigmistqke
@bigmistqke Жыл бұрын
Is slower then deepClone
@jediampm
@jediampm Жыл бұрын
@@bigmistqke did you tested? i always prefer native feature than external libs. And depends on the browser, if you are using safari or FF ya maybe but in chromium base browser is a stretch.
@bigmistqke
@bigmistqke Жыл бұрын
@@jediampm yes i tested it myself, on firefox and chrome bc I wanted to get rid of lodash in website I m working on. It's substantially slower. google it if u don't believe me, it's actually quite established.
@essamal-mansouri2689
@essamal-mansouri2689 Жыл бұрын
Why not use immer instead?
@vigneshwarrv
@vigneshwarrv Жыл бұрын
Now I understand, why Non-primitive data are compared by their reference instead of their value in javascript 😊
@martinchya2546
@martinchya2546 Жыл бұрын
Mutable state: You have a desk with laptop, mouse, monitor and cellphone. Suddenly, your mouse drops on floor. So you take the mouse, and put it back to desk. Immutable state: You have a desk with laptop, mouse, monitor and cellphone. Suddenly, your mouse drops on floor. So, you go to the furniture store to buy exacly the same desk you have, then exaclty te same laptop, monitor, mouse. You go back to your office with all that stuff, kick your old desk with all of its content out of room, place newly purchased desk with laptop, monitor, mouse and cellphone on proper places. Then you call to the transport company to go and take your old desk & rest of old stuff. This is what "immutability" does to performance. Tons of mobile batteries drained on unoptimized websites, but at least we are modern and fancy.
@jherr
@jherr Жыл бұрын
React.createElement allocates a new object for each tag or component reference in your component. That means every time the app is re-rendered the entire VDOM tree is re-allocated. kzbin.infoY7oS9Evn_2o A new state object getting created with a shallow copy in response to a user event is trivial in comparison to all the allocation being done to render a page with a lot of tags. (And that doesn't even count all the other function references, etc. that are created during a render.)
@martinchya2546
@martinchya2546 Жыл бұрын
@@jherr indeed. I'm working on web app where performance is very important and I'm fighting a lot to make it performant. We use Vue, but it shares the problem with rerendering. During load time, after hydration, I've got a 40-50ms pause just due to GC cycle on desktop. This is the bad side of functional programming and I think at least frameworks should go towards performant code instead of "beautiful" code with no mutations. FP & Immutability is very nice tool, but do we have to use it ALWAYS and EVERYWHERE, even in framework internals, just to be modern and fancy? Like, should Vue or React really rerender huge parts of virtual DOM, which is at least O(n), instead of patching just what needs to be patched which can go down as low as O(1) in many cases (svelte does this afair)?
@umargulzar2982
@umargulzar2982 Жыл бұрын
It is going above the head 😂😂
@jherr
@jherr Жыл бұрын
Yeah, this is an intermediate to advanced video. But hey, just chill out, have a watch, should be reasonably entertaining at least. :)
@umargulzar2982
@umargulzar2982 Жыл бұрын
@@jherr no doubt you are a great teacher.. Learned a lot of things from you. Respect from Pakistan ❤️❤️❤️.
@Gabriel-iq6ug
@Gabriel-iq6ug Жыл бұрын
Cases 2 and 3 are in the wrong order 0:57
@greendsnow
@greendsnow Жыл бұрын
How does Svelte do it? it's compiled to simple js afterall. is Svelte slower? No?
@jherr
@jherr Жыл бұрын
It's been a while but I think Svelte works off of references. I've heard using destructive operators on Svelte (push, pop, shift, etc.) doesn't work, which makes me think it's running of referential identity.
@jcs184
@jcs184 Жыл бұрын
If you worried about performance related to react's system of state management, you're worried about the WRONG thing.
@jherr
@jherr Жыл бұрын
1,000%
@kr30000
@kr30000 Жыл бұрын
Not always, there are cases when react can take significant time to render when you have a lot of components, or even when people don't understand how react works. I've been able to crash a web page by simply holding down a key on my keyboard, because everything on the page was updating when entering text. From my experience, react is great until a certain point. It can be a bit harder to maintain performance as many people are making changes in a team, and 1 line of code can ruin the performance of the entire page / sub tree. I feel like a lot of frameworks have been working towards making the mental model easier. I'm interested to see what the react team does in the future.
@jherr
@jherr Жыл бұрын
@@kr30000 If a single text change event causes the entire tree to re-render that's either an issue with the structure of the application, or an issue with the lack of a debounce. I don't see how that would be helped by picking a different state management model.
@jcs184
@jcs184 Жыл бұрын
@@kr30000 true. But that kinds of mistakes can happen regardless of the library/framework. Anybody can write bad JS code. If it's easier to make mistakes in react, then I agree that it's a problem but my point is, if you code well, you don't need to worry about how performant react is as a UI library. If you want move to Solid because you think react is slow because of it's state management system, I'd say that's a very bad decision.
@gcash49
@gcash49 Жыл бұрын
@@kr30000 lol that example sounds like terrible design and architecture in your react project
@ichiroutakashima4503
@ichiroutakashima4503 Жыл бұрын
Prior to that advertisement for Brilliant, I'm surprised Jack isn't good with Math, and sciences, I guess programming logic is different to such aspects. I mean, I kind of struggled absorbing the intermediate knowledge of this video alone.
@jherr
@jherr Жыл бұрын
I'm dyslexic, so spatial stuff, how things fit together, I get that because I can make it visual. But theoretical math just doesn't really work for me. That's where the way Brilliant teaches math really helps because I can "play' with the equation and turn these equations into something I can visualize.
@mathuradas4955
@mathuradas4955 Жыл бұрын
What if we directly use useRef and mutate ref.current?
@mathuradas4955
@mathuradas4955 Жыл бұрын
It will be something like signals
@mathuradas4955
@mathuradas4955 Жыл бұрын
@jack can you help with this one? Thanks in advance :)
@jherr
@jherr Жыл бұрын
If you are doing what I think you are doing then you're just subverting React and you should use Solid-JS instead. Solid was designed to do that from scratch. TBH, for most applications React performance is fine. It's freaky to see that a component function gets re-run when state changes, but in reality, that's very fast since it's just creating some objects which are compared against other objects and when there is a delta the DOM is updated. By using useRef and then changing properties/attributes/content that React would normally do for you, you are just breaking React. And it's not clear why you would pay the price for the download of the React library just to subvert it.
@mathuradas4955
@mathuradas4955 Жыл бұрын
Got it Thanks BTW i do this via the last strategy that you explained (creating new obj and setting it via setValue) I just thought will it cause any difference if we do it by useRef
@jherr
@jherr Жыл бұрын
@@mathuradas4955 If you use a useRef then setting current on that will NOT cause a re-render. Which may be what you want. Only state changes force a re-render. And by that I mean useState/useReducer state.
@shedrachelurihu4883
@shedrachelurihu4883 Жыл бұрын
@bielgaucho_real
@bielgaucho_real Жыл бұрын
But there was no proxy comparison...
@jherr
@jherr Жыл бұрын
Fair, I left that out because for managing basic state I don't think it's acceptable. You have to box primitives (e.g. String("username") instead of just "username") and nested arrays/objects are problematic. I like what Solid did. They have createSignal for the basics, and then a createStore that returns a proxy model. I would love it if React had a built in `useStore` that would be a proxy model.
@basarat
@basarat Жыл бұрын
To the viewers : don’t build your own state manager. Valtio provides an amazing High Performance proxy state manager that is super simple to use properly: kzbin.info/www/bejne/nXi8anusispld6M
@jherr
@jherr Жыл бұрын
Agreed on not building your own.
@davidjesus8629
@davidjesus8629 7 ай бұрын
If React made the right choice, why every framework ( vue3, qwik, solid, svelte, preact, angular ) has acknowledged that modern uses of vdom and signals no only gives better DX and fine grained reactivity but also every single one of them is more performant out the box. If we go further than a todo list, you constantly need to evaluate react code to manually improve its performance. Its really tiresome how React devs keep pushing narratives to justify the dreadful dx until you internalize every pitfal in the model to solve the problems it gives.
@philheathslegalteam
@philheathslegalteam Жыл бұрын
The React you wan't is not 10x slower. It's actually faster and its called Valtio state library.
@jherr
@jherr Жыл бұрын
Lot of love for Valtio today! I love it!
@jherr
@jherr Жыл бұрын
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/JackHerrington/. The first 200 of you will get 20% off Brilliant’s annual premium subscription.
@desimis4282
@desimis4282 Жыл бұрын
I'm honestly surprised anyone would consider anything else besides going with what React leans towards. Immutability is a fantastic principle to adhere to. Comparing references is ALWAYS going to be faster. Its like you said at the end, comparing values of objects is just always going to be far slower, and depending on the size of the object and where the value change is possibly nested, it can be even slower than this.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Because React is so boring and old
@parlor3115
@parlor3115 Жыл бұрын
Not sure if this is about the comment I left the other day or not. I just wanted to clarify I was addressing the internals of the framework, particularly why React requires developers to overwrite state (recreate objects and arrays) when we already make state setter calls which itself can be used alone to signal change and rerender the component. And it is the fact that Flutter is another reactive UI framework similar to React but doesn't have this requirement that made me pose that question.
@jherr
@jherr Жыл бұрын
It's not about any comment in particular comment, more about the ongoing confusion around referential identity based state change detection and the performance impact of creating new objects and the spread operator in particular. The intention was to show that show the complexity and performance impact of other approaches. You are correct that a decent argument could be made that we could forego the performance optimization of ignoring updates that set the same state value (or reference) and just always update instead. But if it weren't there I think folks would complain in the opposite direction.
@parlor3115
@parlor3115 Жыл бұрын
@@jherr I see, but now that I think about it even more, I don't think the latter is an optimization since a) referential equality* does not imply equality by any means and b) it could be costlier from a memory management stand point (though, benchmarks that compare the cost of a component re-render to that of re-creating objects / arrays would be needed).
@jherr
@jherr Жыл бұрын
@@parlor3115 Not defending the approach (I'm not an FP-guy per se) but as to (a), in an FP model (which hooks certainly are) a change in reference certainly indicates a change since FP never mutates data in-place.
@parlor3115
@parlor3115 Жыл бұрын
@@jherr I meant referential equality and it doesn't imply value equality for non-primitive types.
@jherr
@jherr Жыл бұрын
@@parlor3115 Very true, at the most basic level it does not.
@boot-strapper
@boot-strapper Жыл бұрын
Just use apollo client to cache everything and make that the source of truth
@helloimtim
@helloimtim Жыл бұрын
The React I want is Vue 😅 Wish I could modernize my old legacy React app over to Vue
@dave-7117
@dave-7117 Жыл бұрын
The React You Want is Svelte
@bradyfractal6653
@bradyfractal6653 10 ай бұрын
No it’s not, Svelte is way faster 😂 And doesn’t have all of the bad abstractions and convoluted APIs
@usernameL1
@usernameL1 Жыл бұрын
Lodash? What is this? 2015?
@jherr
@jherr Жыл бұрын
:) structuredClone, weirdly, turns out to be a lot slower than Lodash's deepClone. And I don't know and other JS native version of a isEqual outside equating two JSON.stringify's. What would you recommend instead?
@mohitchandola3435
@mohitchandola3435 Жыл бұрын
make react series from scratch 2023 edition
@jherr
@jherr Жыл бұрын
Would you pay for it?
@mohitchandola3435
@mohitchandola3435 Жыл бұрын
nope
@jherr
@jherr Жыл бұрын
@@mohitchandola3435 Fair enough.
@mohitchandola3435
@mohitchandola3435 Жыл бұрын
@@jherr 🤦
@coder_one
@coder_one Жыл бұрын
I despise services like "Brilliant." Not because they are lousy, but because of their pathological business model in which trying out so-called trial requires credit card details.... It is shameful to recommend such crap.
@dulanjala
@dulanjala Жыл бұрын
this why javascript is so dumb. react has to create shit ton of objects just so they can diff easily... that's the biggest slow-down you can create..
@jherr
@jherr Жыл бұрын
JavaScript isn't just React, if you want an example for how to do a React style view framework without a ton of allocations check out Solid-JS.
@nitsanbh
@nitsanbh Жыл бұрын
3:47 why do the less readable Reflect.get(…arguments) when you can literally do obj[key]
@DjLeonSKennedy
@DjLeonSKennedy Жыл бұрын
When you're making "todo-like" apps and say that React is slow : D
Server Actions: NextJS 13.4's Best New Feature
21:41
Jack Herrington
Рет қаралды 59 М.
Don't Follow THIS Bad React Advice!
13:07
Jack Herrington
Рет қаралды 30 М.
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 88 МЛН
How I prepare to meet the brothers Mbappé.. 🙈 @KylianMbappe
00:17
Celine Dept
Рет қаралды 53 МЛН
OMG 😨 Era o tênis dela 🤬
00:19
Polar em português
Рет қаралды 11 МЛН
Mastering React Memo
26:56
Jack Herrington
Рет қаралды 131 М.
Signals For Solid, Qwik And React
28:17
Jack Herrington
Рет қаралды 47 М.
Smarter and Simpler React State
26:46
Jack Herrington
Рет қаралды 55 М.
Five Clever Hacks for React-Query and SWR
40:09
Jack Herrington
Рет қаралды 58 М.
Will React's New Cache Fix Its "Use" Hook?
19:41
Jack Herrington
Рет қаралды 47 М.
Finally Fix Your Issues With JS/React Memory Management 😤
20:13
Jack Herrington
Рет қаралды 79 М.
The problem with useEffect
11:37
Cosden Solutions
Рет қаралды 30 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 449 М.
3 React Mistakes, 1 App Killer
14:00
Jack Herrington
Рет қаралды 113 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
Which Phone Unlock Code Will You Choose? 🤔️
0:14
Game9bit
Рет қаралды 12 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 710 М.
Цифровые песочные часы с AliExpress
0:45
Как я сделал домашний кинотеатр
0:41
RICARDO
Рет қаралды 1,5 МЛН
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,5 МЛН
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 1,9 МЛН