I'm not sure which phase of web component adoption this is, but this little bit of duct tape has been working wonders for me! 😊 #JavaScript #webdev
Post
Thanks to @adactio.com, @jakelazaroff.com, and @cferdinandi.bsky.social for your many words on the topic of HTML Web Components. Please save me if this is a horrible idea! 😅
Last year, Nathan Fowler suggested user defined Web Components, like this: gomakethings.com/user-defined... If collisions are happening a lot for you, that suggests that your naming conventions aren't specific enough. I'd personally address that first.
Why? ¯\_(ツ)_/¯ I’ve started using custom elements (instead of <div> soup), even when no JS is needed. Then I’m adding a <script src> tag when I want to progressively enhance the element with JS. Then in some cases, my templating system adds multiple instances of a custom element to a page.
0 reposts1 like
Oh, this might also be useful for you: gomakethings.com/how-to-dynam...