Small but important correction - in these trivial examples you *can* use setCount(count => count + 1) to get around one issue I showed (assuming your code is that simple/trivial) In the real world this is not always an option though, the article shows better examples that demonstrate more properly: www.builder.io/blog/usesignal-is-the-future-of-web-frameworks
@Microphunktv-jb3kj Жыл бұрын
extreme performance and javascript in the same sentence... on what kind of drugs are you on ?
@rand0mtv660 Жыл бұрын
Thank you for correcting yourself in the comment here :)
@ThirdWorldUSA Жыл бұрын
Great job, Steve. Greater job still for the correction. Shows sincerity.
@fifty-plus Жыл бұрын
Except you might want to not shadow the variable.
@lameshithead9 ай бұрын
hmm the entire component doesnt need to rerender if you return it in a hook using dependencies, so wheres the difference to signals? i guess with signals you can have call the (lets say) signalhook directly without using an extra dependency, but does it work faster? i dont think so. and you cant use signals without statesand more than one component, so theres the same issue with async and statemutation
@pupfriend Жыл бұрын
I like React because it exercises the browser with rerenders. It's like browser calisthenics so the browser stays fit. I don't want by browser getting fat.
@amans6504 Жыл бұрын
Rather the exercise of the memory i'd say
@nawfelbengherbia8302 Жыл бұрын
React also keeps us warm in the winter ^^
@nero1375 Жыл бұрын
@@nawfelbengherbia8302 you mean more CPU cycles? hehehe
@muhammadmejanulhaque3305 Жыл бұрын
I love how you simply start the video with subtitles and finish the video without doing some unnecessary stuff. Loved the content
@drizzletone9148 Жыл бұрын
It's funny how something that has been present in Vue for a really long time now is depicted as something revolutionary :D
@chuksjr.1440 Жыл бұрын
Popularity never always means better!
@dominat0r360011 ай бұрын
It's been present in react long before this video, but it's popularity exploded when people realized you could do things useState can do but 40% faster
@alexiscalabera8314 Жыл бұрын
I tipically never comment, but damn, you present stuff that actually matters in a really easy and enjoyable manner. 5 minutes ago I didn't know or care about this, now I do and it's interesting af!
@tuttsj Жыл бұрын
I love the content you put out Steve. So concise and well presented. Keep up the awesome work 🙌🏻
@ken6737 Жыл бұрын
Love this content format. Simple, concise, and more importantly, it provides bite-sized information for viewers.
@eddyk564 Жыл бұрын
The way Solid JS should really be the norm in my opinion. React was build to deal with a UI that was constantly being updated, which is not the case with most web apps. It's odd that the React way as seen as normal and the Solid JS way is seen as revolutionary
@bradyfractal6653 Жыл бұрын
It’s still lipstick on a pig compared to Svelte imho
@Corrup7ioN Жыл бұрын
I used (and loved) KnockoutJS before React came out. It used a vaguely similar approach to singals which led me to always believe the whole virtual DOM diffing thing was kinda dumb, yet it was quickly accepted as being normal. KnockoutJS came out years before react and was by no means perfect, but I wish its approach was improved upon over all these years rather than largely forgotten until now.
@AlfieMakes Жыл бұрын
Stencil does something very similar to signals with their state decorator
@baxalasse Жыл бұрын
@@bradyfractal6653 your comment should be pinned!
@charlesm.2604 Жыл бұрын
What bothers me the most is JSX. - It makes it real hard to do separation of concerns between UI layer and business logic. - Event handlers. I always wondered why they don't add a history parameter to the callback like they do with state setters. That's yet an other entry on the long list of React's inconsistencies. - JSX is supposed to be a HTML DSL yet you end up using more JS in your templates for some reason. - There is no built-in CSS DSL so you end up with bad implemented CSS-in-JS librairies and utilities CSS, the man who thought it was a good idea is a masochist. When a common return statement look like this how long does it takes before you start to question wether your fancy library is solving an issue or is causing a completely new problem ? return ( {TodoStore.todos.map(item => ( {item.text.replace("x", "y")} {item.isCompleted && ( TodoStore.removeOne(item.id)}> Remove )} ) That's why I would choose Vue over React any time, the directive-based templating. And I'd obviously prefer Angular at work but the lead forces us to work with React.
@mjarkk Жыл бұрын
You don't have to add count to the useEffect dependencies if you make setCount a function with count as argument setCount(count => count + 1)
@ajfalo-fi3721 Жыл бұрын
do you even read comments before posting?
@peterbalogh5622 Жыл бұрын
@@ajfalo-fi3721What are you talking about? @mjarkk is correct, and I didn’t see any other comments yet pointing this out. Nothing wrong with the truth being stated more than once, unless you want to hide it.
@ajfalo-fi3721 Жыл бұрын
@@peterbalogh5622 see the pined comment from Steve
@Francois3k Жыл бұрын
Man u are the G.O.A.T. u made this topic so easy to digest. Keep up the firee content man!!!!!
@JosephCaburnay Жыл бұрын
I hope you continue on liking what you do and provide us more good contents like this. Thank you so much. :)
@sherifsalah5563 Жыл бұрын
Svelte does it out of the box
@chandragie Жыл бұрын
Clear & simple explanation!
@adambickford8720 Жыл бұрын
Straight talk: Its RxJs with training wheels. Of course its simpler, its solving a much easier problem.
@dkazmer26 ай бұрын
So is it better to hydrate or to dry?
@naranyala_dev Жыл бұрын
Very clear explanation, thank you
@AmxCsifier Жыл бұрын
Do you have a video about svelte? I'd like to hear your insights about it
@AmxCsifier Жыл бұрын
@@alex-craft yeah svelte is less boilerplaty than solid + i prefer the templating of svelte over jsx. I was already accustomed to it through smarty and twig etc
@genechristiansomoza4931 Жыл бұрын
How does it perform when dealing with arrays that are rendered?
@150-150 Жыл бұрын
Hey Steve, nice video! What tool and method did you use to generate your subtitles? They look great!
@brayancuenca6925 Жыл бұрын
Keep up the great content!
@baxalasse Жыл бұрын
Like RH says, "As enginers, we should be offended". Checkout Svelte instead.
@lionardo Жыл бұрын
is there a sharable state management for components in qwik.js?
@theodorosvragkos6752 Жыл бұрын
It is something that we can now use with ReactJS + Vite properly?
@AlanDanielx11 ай бұрын
Can RemixJs use signals?
@MrHauntedLollipop Жыл бұрын
What do you mean by more code to download? Whole React gets shipped in case of SSR anyway
@eyotajr Жыл бұрын
im a but confuse, so this signal thing is a solidJS only method ? and can we use it in react app ? 0:51 is that a solid js app or a react app ? is it possible to use signal in a react app ?
@IAM-v5p Жыл бұрын
Ryan Carniato, creator of Solid JS, has been on an evangelical mission to introduce the concept of signals to the javascript community, which is being adopted by a lot of other frameworks.
@dinijalil6107 Жыл бұрын
Question for you since you do deep dives, and have a general interest in learning. What are your thoughts on code assessments vs take homes for assessing a candidate's talent?
@creamy_gavin Жыл бұрын
In my experience, having a candidate do a small home assessment and then mob/pair program with the candidate to is the best way of finding out what level they are
@dinijalil6107 Жыл бұрын
@@creamy_gavin Completely agree, and you get a sense of how they name, do they test, and how well they abstract and simplify the code. I wish more people like you were hiring.
@dinaiswatching Жыл бұрын
Thanks again, Steve. I've fallen in love with this framework, but one thing concerns me, though. I'm quite aware of the $qwikfy function, but ideally it would be best if we had some UI qwik libraries, done in the qwik way, don't you agree?
@kenfrostyypaws9113 Жыл бұрын
There's a group of people working on exactly that!
@RahiyanSafinOfficial Жыл бұрын
Soon Angular? What are they doing?
@grinsk3ks Жыл бұрын
2:39 yeah vue was not forgotten =)
@jeanpierredelacruz8946 Жыл бұрын
Is Vue way performant than React in 2023? Just asking
@gasparsigma Жыл бұрын
So it's like a useRef but it triggers a re-render of where it's used? Interesting
@nguyentrieu3607 Жыл бұрын
Dude, U should try Deepsignals, the upgraded version of Signals.
@jacoblockwood4034 Жыл бұрын
Thanks for explaining that the hype isn't around something new--just that the rest of the JS community rediscovered the pub-sub model that has been around since the 90s lol
@jacoblockwood4034 Жыл бұрын
To be clear, I think signals are good--it's just odd that they haven't been around for longer. I wrote something of a wrapper around the DOM api at one point that utilized a construct very close in semantics to signals, but I never really maintained it since I shortly after learned about Solid.
@charlesm.2604 Жыл бұрын
Observer pattern
@jacoblockwood4034 Жыл бұрын
@@charlesm.2604 Mixed them up, thanks
@SomoeBlog Жыл бұрын
Ah yes, we going full circle aren't we I remember "laser beam the value directly into dom" at 2001!
@malikrajat Жыл бұрын
Hello, can you help us with more Fine-Grained and deep discussion for signal. I can see quick and solid js, is more Fine-Grained Reactivity, less expensive and give fast performance. Why not angular so much
@IAM-v5p Жыл бұрын
You forgot to call count as a getter . . typeof count is Accessor. To access the value you need to call it: setCount(count() + 1)}> Count is {count()}
@TheSaceone Жыл бұрын
angular dev here, waiting for signals :)
@michaelchen163 Жыл бұрын
There’s no doubt that things are more performant but I don’t believe that the framework makes or breaks an app. With the sheer volume of react apps in production it’s clear to me that any performance gains from frameworks like solid likely won’t matter at the end of the day unless my use case is in the critical path of what solid is great for.
@2penry2 Жыл бұрын
I Agree, It's impressive to see these new frameworks. But for me react is good enough.
@icarusgk Жыл бұрын
2:38 Vue was mentioned LETSGOOO, I feel it gets left out most of the time, thank you.
@cedi2929 Жыл бұрын
The "Vue way" is ref() correct?
@charlesm.2604 Жыл бұрын
@@cedi2929 With Vue you use Watchers, the API looks like this: watch(dependency, callback) The dependency can be any type, ref, reactive, getter function, array, etc... And the callback can be asynchronous or synchronous.
@icarusgk Жыл бұрын
@@cedi2929 Yess, ref() and reactive() are Vue's fine-grained "signals"
@albiceleste101 Жыл бұрын
I'm a freelancer, switched to Svelte this year
@albiceleste1018 ай бұрын
@@aamorous Now I use both Svelte and Next, depends on the project Next probably easier due to the React ecosystem but Svelte nicer to code in
@user-ge2vc3rl1n Жыл бұрын
Okay, but what does hydrate mean? You're saying that as if its a commonly used term and I've only heard it in redux.
@charlesm.2604 Жыл бұрын
Hydration basically means that instead of shipping your whole JS code in one bundle you have multiple chunks, so the browser only has to download the code for the content that's currently on the page.
@rand0mtv660 Жыл бұрын
In UI frameworks, hydration is a process where JavaScript code attaches itself to HTML that was sent from the server. It means JS doesn't need to rebuild whole UI again, but rather for example it can just attach event handlers to appropriate DOM nodes for that existing HTML (in case of React). It still has to run some code to actually do all that, but it doesn't need to rebuild the whole UI from scratch because it already exists, so hydration is less work compared to rendering full from scratch. What Charles M. said in his comment above is not hydration, but rather code splitting. This can be used for delayed hydration so that you only hydrate certain parts of UI when they become relevant. I think Astro does this a lot and you can tell it to only hydrate (load and run JS) for a certain part of the UI when you scroll to it for example. I guess in context of Redux it might be sending Redux store with existing data from server to browser and then just reuse that state on client. I'm not sure, haven't used Redux for a very long time.
@user-ge2vc3rl1n Жыл бұрын
@@rand0mtv660 thanks for the responses
@charlesm.2604 Жыл бұрын
@@rand0mtv660 That's partially true. Hydration's goal is to offer the possibility of modifying a view client side that was server rendered. In a meta-framework, the server generates the HTML, ships it to the client and the client side takes over, hydrating the page content upon state changes. Those event handlers you talked about aren't explaining what hydration is, they're explaining one implementation of it.
@rand0mtv660 Жыл бұрын
@@charlesm.2604 Yeah that's why I mentioned for example it can attach event handlers. I was mostly referring to React implementation since I'm most familiar with that one. The point I tried to make is that hydration doesn't have anything to do with many smaller JS bundles (code splitting) and you can have hydration with a single monolithic JS bundle that isn't code split at all. They are two different things that don't have to be used together at all.
@lawrencejob Жыл бұрын
I miss RXJS
@mises1615 Жыл бұрын
Who works on React that they have not had "signals" till now?
@hyunbinseo Жыл бұрын
There is a typo - Coutn
@brucearmstrong5536 Жыл бұрын
Angular is implementing this in it's next release v16
@skl9942 Жыл бұрын
Shouldnt count be a function in solid.js? "Count is {count()}"
@ajfalo-fi3721 Жыл бұрын
Yes
@Steve8708 Жыл бұрын
Technically it can be {count} (only in the DOM, when used directly in JS like `const double = count() * 2` you need the parens. But I think it's more idiomatic to use {count()}
@skl9942 Жыл бұрын
Oh cool, I didn't know that. Your videos are absolute golden. Thank you for the effort, its most appreciated 👍👍
@valikonen Жыл бұрын
This will be also part of Angular
@mahmudsajib8648 Жыл бұрын
Can we get a PAID frontend Reactjs course from you where you only teach about performance related stuffs? It will blow up the internet for sure.
@theanswer1993 Жыл бұрын
He's working on Qwik, not React.
@davidascholer4 ай бұрын
I'm not aboard the 'signal' train. I can see the benefit if you're new to React or don't have much experience or a good understanding of the fundamentals. I feel like it's just syntactical sugar for useState with useContext or something along those lines. I'd rather just implement that myself so half my team doesn't have to study some 3rd party library. For this example, wouldn't simply returning a function to setCount solve this problem i.e. setCount( count => count + 1)? Either way, you shouldn't ever be setting a useState variable directly in it's setter. Always wrap it in a function and pass is the old state variable as a param as shown above.
@iamcasted Жыл бұрын
Who the hell updates state in react by accessing state variable directly😭😭😭😭😭😭
@alexandreg.1000 Жыл бұрын
It is so similar to what Vue does :D
@herman751 Жыл бұрын
For the interval example you can do the same in React by passing a function to setstate.
@yeargun5582 Жыл бұрын
🔥🔥🔥
@thegrumpydeveloper Жыл бұрын
Hope react will take this as a signal 😂 to support this natively. Valtio is the close but not quite to supporting this type of behaviour but it really would be nice to be built in.
@fakenameforgoogle9168 Жыл бұрын
react would have to fundamentally change as a framework for that to happen which is very very unlikely
@thepetesmith Жыл бұрын
Solid is what React should have been. I am worried that our app will start to be doggy.
@mikopiko Жыл бұрын
The more mature qwik get, the more interested I become.
@emmanuelolowu6768 Жыл бұрын
The signal is basically like refs? I guess?
@himesh_89 Жыл бұрын
If you every create a course on React, i will be the first one to jump inm
@dongums Жыл бұрын
hmmm similir with svelte
@fifty-plus Жыл бұрын
When you fix a leaky abstraction you remove the bugs and nuance that it introduced ... and React hooks are very leaky.
@TheGryphon14 Жыл бұрын
hello jQuery
@theanswer1993 Жыл бұрын
React is really outdated at this point.
@victors16811 Жыл бұрын
This is why I use mobx instead
@drastik67 Жыл бұрын
Coutn
@zerocodefx1698 Жыл бұрын
Jargon Thrashing is Lame
@LarsRyeJeppesen Жыл бұрын
useSignal? lol
@namename8986 Жыл бұрын
what is hydrate
@branquitodemunze Жыл бұрын
these frameworks are each time worse than before, it's such a mess, fixing issues that are wrong by design
@hunterwilhelm Жыл бұрын
What's the right design? Wrong implies the existence of right