Web Components are how your work can stay relevant for the long haul and have much broader impact than even things built for the (currently) most successful library.https://twitter.com/jthoms1/status/1118172285196746753 …
-
-
Replying to @slightlylate
I feel like I asked this question once somewhere and got kind of a non answer so wondering if you/anyone knows.. let's say I have a react-based component library and want to convert it to web components (I do). How to support or substitute for tools like render props and Context?
3 replies 0 retweets 0 likes -
Replying to @benwiley4000 @slightlylate
Things I'm not sure if I can do: 1. Pass js stuff as component params 2. Which would include functions, used to generate child content dynamically based on internally-sourced params (a.k.a. render props) 3. Inherit data implicitly passed through a dom tree (like react context)
2 replies 0 retweets 3 likes -
Replying to @benwiley4000 @slightlylate
1) An API of attributes and properties allow pushing data to a WC, you can send JS stuff via the properties
2) Functions
3) Custom Events can approximate the Context API or try @treshugart's https://github.com/skatejs/skatejs/tree/master/packages/sk-context …
4)
Checkout @openwc for more tips and techniques1 reply 1 retweet 6 likes -
Replying to @WestbrookJ @benwiley4000 and
In all refactoring, keep an open mind as your components might not want/deserve/need to be so bound up with the vertical tree (DOM or virtual) as they might be today. Look forward to hearing your progress!
1 reply 0 retweets 2 likes -
Replying to @WestbrookJ @slightlylate and
I had no idea web components could take js properties. I thought it was only attributes! This is great to know. Also thanks for the thoughts re: context. The thing for me about that is I really like the idea of scoping data by tree.
1 reply 0 retweets 2 likes -
Replying to @benwiley4000 @WestbrookJ and
This felt unintuitive and wrong at first when I hadn't grown comfortable with component architecture but now I love it. So often we assume a data store should be global/singleton and then later realize the value of multiple instances. Tree scoping can be a great way to solve this
1 reply 0 retweets 2 likes -
Replying to @benwiley4000 @WestbrookJ and
Also what's the point of using skatejs with react versus just react?
2 replies 0 retweets 0 likes
think of it this way: you're going to have some components that you want to use everywhere (including in plain HTML). To make implementing the internals of those components easier, you might use Lit, Skate, Preact, or Stencil *inside the component*
-
-
Replying to @slightlylate @benwiley4000 and
How you compose those things into an app is a separable question. Maybe you'll use the same tools for that. Maybe not. I'm certainly not advocating adding more bloat to an existing toolchain, FWIW.
1 reply 0 retweets 3 likes -
Replying to @slightlylate @benwiley4000 and
...however, you get some great mileage out of having your components be more-or-less stand-alone and not tied to your overall app's orchestration system.
1 reply 0 retweets 2 likes - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.