8:11 Svelte is great with web components, but still has some minor kinks here and there, particularly nesting in the light DOM and with supporting context. HMR too. That’s why I created svelte-retag which supports that, light DOM and even Vite HMR. I did all that since I loved Svelte but also needed a smooth way to integrate it into our legacy PHP monolith and so far it is working really great for us; especially context, which is a killer feature for us.
@syntaxfm
4 ай бұрын
Sick!
@Fallingstar-yy5iv
4 ай бұрын
Lit was terrible for writing web-components in. Svelte was far better. Mostly not having to lean on template string for all the html div description.
@grinsk3ks
4 ай бұрын
I think lit was pretty lit. It feels very vanilla. Without all the framework jumbo. I just don't like classes very much. Very few good use cases for them. Ui components definitely not one of them.
@rand0mtv660
4 ай бұрын
23:40 I haven't tried this, but maybe it's possible to just use "onLoad" event handler on script tag? Same way you can do onLoad on an img tag for example.
@ariosetiawan173
4 ай бұрын
no ForwardRef is key of imperativeHandle, now in 19 more easy to implement imperativeHandle :D
@uidoyen
4 ай бұрын
It is truly enlightening and provided valuable insights into the latest features and improvements in React 19
@patricknelson
4 ай бұрын
It’s really great to see React supporting web components so well now. I’m _not_ a React dev but I see WC’s as a wonderful pivot point between various applications, particularly if you’re writing code that has to be shared across separate teams/apps/sites or making a library or something.
@syntaxfm
4 ай бұрын
For real. I'm all for it
@SilvestreVivo
4 ай бұрын
Summarizing the podcast: React 19 tries to work like Svelte.
@syntaxfm
4 ай бұрын
Not quite yet. Hopefully someday they take more from svelte.
@grinsk3ks
4 ай бұрын
How do you write react components now? Functions, classes, web components?
@syntaxfm
4 ай бұрын
Functions is the way.
@patricknelson
4 ай бұрын
Presumably the main method of authoring would be functions (over classes). Web components is different; more of a way to ship or share the components outside of React or in plain HTML alongside other stuff.
@2penry2
4 ай бұрын
Zustand is different to context though, Zustand is global only. Context can be used in multiple places in the tree with different values.
@rand0mtv660
4 ай бұрын
Yes true, but nothing stops you from using Context to inject a Zustand store which would then be a separate Zustand store instance for each of those component trees.
@rand0mtv660
4 ай бұрын
Sorry, I commented before I got to the part where they talk about Context. Yeah, they only think about global Context at the top level of the app that only is a single instance of that Context. They aren't really considering the scenario where you might want to render Context multiple times in different trees and provide different values to each of those Contexts as you mentioned. Although admittedly, global Context is way way more common so it's understandable that comes to mind first.
@stolinski
4 ай бұрын
@@rand0mtv660 I still don't think context as a pattern is better than what's out there for instance local state. Preact signals, Recoil, Jotai are all better for that than context IMO.
@rand0mtv660
4 ай бұрын
@@stolinski Hmm I gotta admit I haven't tried Recoil or Jotai, but also never really considered Context bad or not good. Only downside for me regarding Context is the "all consumers re-render" part.
Пікірлер: 21