<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John Kreitlow</title>
    <description>The latest articles on DEV Community by John Kreitlow (@johnkreitlow).</description>
    <link>https://dev.to/johnkreitlow</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F72961%2Fd2e2acfd-3af1-482e-b043-355539159867.jpg</url>
      <title>DEV Community: John Kreitlow</title>
      <link>https://dev.to/johnkreitlow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnkreitlow"/>
    <language>en</language>
    <item>
      <title>Web Components are... Web Components</title>
      <dc:creator>John Kreitlow</dc:creator>
      <pubDate>Thu, 05 Dec 2024 00:41:22 +0000</pubDate>
      <link>https://dev.to/johnkreitlow/web-components-are-web-components-3d74</link>
      <guid>https://dev.to/johnkreitlow/web-components-are-web-components-3d74</guid>
      <description>&lt;p&gt;&lt;em&gt;This post first appeared on my LinkedIn in September 2024.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As someone who builds complex custom elements for massive distributed systems, I want to weigh in on the whole "Web components are &lt;code&gt;&amp;lt;insert-opinion&amp;gt;&lt;/code&gt;" debate that's been bouncing around.&lt;/p&gt;

&lt;p&gt;Haven't wheels already been invented, like, at least a few years ago? We're all trying to find the right wheels for the carts we're trying to pull. If the &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element was perfect, we wouldn't need &lt;code&gt;&amp;lt;input type="button"&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;div role="button"&amp;gt;&lt;/code&gt; or the unsupported &lt;code&gt;&amp;lt;button is="custom-button"&amp;gt;&lt;/code&gt;, or even the forbidden impostor &lt;code&gt;&amp;lt;a class="button"&amp;gt;&lt;/code&gt;, to render this very basic, yet vastly intricate concept.&lt;/p&gt;

&lt;p&gt;The fact that we can now create a custom "button" directly in the browser, one that doesn't have the historical baggage of &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;, or the baffling rigidity of the jack-of-all-trades &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;, is something that should be celebrated. In some cases, we don't even need to include native form elements in our shadow DOM anymore, thanks to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals" rel="noopener noreferrer"&gt;ElementInternals&lt;/a&gt; API. ElementInternals handles both ARIA and form association, at a platform level. This means native forms can treat custom elements the same as any other form control, with field validation, label association, and value submission included. It's by no means a perfect solution yet, but it's better than everything we've had before it, and a lot of people are working very hard to make it better for everyone.&lt;/p&gt;

&lt;p&gt;Framework-driven components literally can't do this. If they claim they can, it means they're either building custom elements wrapped in extra JS, or they're doing a LOT of heavy lifting to reproduce what's already available in the browser.&lt;/p&gt;

&lt;p&gt;I've always had issues with front end frameworks, which is why I choose not to use them. I find that they make it dangerously easy to dig a hole too big to climb out of, especially when they bring their own abstractions that obfuscate what's actually being rendered on the page. There's too much "magic" that happens, and I don't appreciate the "just trust me, bro" vibes I get from how certain frameworks function (hooks, JSX, etc.).&lt;/p&gt;

&lt;p&gt;To wrap this up, I can count the amount of times I've had to work professionally with React, Vue, and Angular combined on one hand. I guess the one I used most was Vue, and even then it was only for a few months before I started building custom elements in 2020.&lt;/p&gt;

&lt;p&gt;I've seen no compelling reason to go back.&lt;/p&gt;

</description>
      <category>webcomponents</category>
      <category>react</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>SVG and the `all` property</title>
      <dc:creator>John Kreitlow</dc:creator>
      <pubDate>Thu, 07 Jun 2018 19:33:50 +0000</pubDate>
      <link>https://dev.to/johnkreitlow/svg-and-the-all-property-30d7</link>
      <guid>https://dev.to/johnkreitlow/svg-and-the-all-property-30d7</guid>
      <description>&lt;p&gt;Is this a bug, or a feature? I want all elements in a div to be reset with the &lt;code&gt;all&lt;/code&gt; property, but I'm getting different results in Chrome and Firefox. Chrome seems to think that the &lt;code&gt;cx&lt;/code&gt;, &lt;code&gt;cy&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;r&lt;/code&gt;, &lt;code&gt;stroke&lt;/code&gt;, and &lt;code&gt;fill&lt;/code&gt; (and probably other properties) are CSS-controllable. Firefox seems to apply the &lt;code&gt;fill&lt;/code&gt; properly, and doesn't touch the other attributes.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/radium-v/embed/gKLONY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Firefox gives me what I'd more or less expect. It's not perfect, but I'm not really sure what to expect:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feao0r114d5zm2izqw0rg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feao0r114d5zm2izqw0rg.png" alt="green circle next to a green triangle on a pink square"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Safari only shows the triangle:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcm8beqdiysh3x3isbm0h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcm8beqdiysh3x3isbm0h.png" alt="green triangle on a pink square"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chrome takes &lt;code&gt;all&lt;/code&gt; very, very seriously:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3k9mile4tz0kit7o4p6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3k9mile4tz0kit7o4p6u.png" alt="pink square"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;wat do? 🤷🏻‍♂️&lt;/p&gt;

&lt;h1&gt;
  
  
  Update
&lt;/h1&gt;

&lt;p&gt;I checked out the W3C spec and found &lt;a href="https://drafts.csswg.org/css-cascade-3/#preshint" rel="noopener noreferrer"&gt;this section&lt;/a&gt;. I think it pertains to this issue but I really have no idea how to decipher it.&lt;/p&gt;

</description>
      <category>css</category>
      <category>svg</category>
      <category>frontend</category>
      <category>help</category>
    </item>
  </channel>
</rss>
