<?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: Oliver Williams</title>
    <description>The latest articles on DEV Community by Oliver Williams (@hypeddev).</description>
    <link>https://dev.to/hypeddev</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%2F95205%2F4f95b8c1-2d70-426b-9ae2-ffb46b9a7aa2.jpeg</url>
      <title>DEV Community: Oliver Williams</title>
      <link>https://dev.to/hypeddev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hypeddev"/>
    <language>en</language>
    <item>
      <title>FullyStacked</title>
      <dc:creator>Oliver Williams</dc:creator>
      <pubDate>Sun, 02 Apr 2023 17:26:15 +0000</pubDate>
      <link>https://dev.to/hypeddev/fullystacked-4okk</link>
      <guid>https://dev.to/hypeddev/fullystacked-4okk</guid>
      <description>&lt;p&gt;I’ve started publishing over on my own blog at &lt;a href="https://fullystacked.net"&gt;https://fullystacked.net&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Please add me to your RSS feed. I’ll be writing about CSS, Bun, new web platform features, and JavaScript. &lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>The React core team finally have opinions about CSS</title>
      <dc:creator>Oliver Williams</dc:creator>
      <pubDate>Fri, 24 Jun 2022 14:52:16 +0000</pubDate>
      <link>https://dev.to/hypeddev/the-react-core-team-finally-have-opinions-about-css-16f0</link>
      <guid>https://dev.to/hypeddev/the-react-core-team-finally-have-opinions-about-css-16f0</guid>
      <description>&lt;p&gt;At a &lt;a href="https://youtu.be/jWafEXS7EE0?t=1276"&gt;recent Q&amp;amp;A&lt;/a&gt; Dan Abramov talked of the React core team becoming more opinionated about styling approaches:&lt;/p&gt;

&lt;p&gt;“We used to be very unopinionated about styling. We’re getting a few more opinions now because there are a few more constraints like streaming server rendering, server components. We start caring a bit more about performance. Overall we’re thinking &lt;strong&gt;for dynamic stuff just use inline styles. For things that don’t change use something that compiles to CSS so that it doesn’t have extra runtime costs&lt;/strong&gt;. A lot of these approaches with runtimes are really expensive.” &lt;/p&gt;

&lt;p&gt;This statement reiterated what had already been &lt;a href="https://github.com/reactwg/react-18/discussions/110#:~:text=While%20this%20technique,use%20at%20Facebook."&gt;said by Sebastian Markbage&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;CSS-in-JS solutions with a runtime include libraries like Emotion and Styled Components, which still remain popular. &lt;/p&gt;

&lt;p&gt;Their impact on performance is a topic that Alex Russell, a Product Manager on Microsoft Edge, has harped on about for years, referring to the approach as a "full-on catastrophe", &lt;a href="https://twitter.com/slightlylate/status/1517173353869561857"&gt;writing&lt;/a&gt;: &lt;/p&gt;

&lt;p&gt;"At load time we can parallelise parsing of CSS, JS, and HTML. But when you stuff your CSS into JS, it means we need to parse &amp;amp; run JS to get rules into the doc."&lt;/p&gt;

&lt;p&gt;Facebook/Meta had announced plans to open source &lt;a href="https://engineering.fb.com/2020/05/08/web/facebook-redesign/"&gt;their own zero-runtime CSS-in-JS tool&lt;/a&gt;, but that was several years ago so may never happen. There are several open source alternatives. An engineer at Airbnb recently &lt;a href="https://medium.com/airbnb-engineering/airbnbs-trip-to-linaria-dc169230bd12"&gt;blogged about&lt;/a&gt; that companies move from a runtime CSS-in-JS library to &lt;a href="https://github.com/callstack/linaria"&gt;Linaria&lt;/a&gt;, a zero runtime option. &lt;/p&gt;

&lt;p&gt;There’s also &lt;a href="https://vanilla-extract.style/"&gt;Vanilla Extract&lt;/a&gt; from Mark Dalgleish (a co-creator of CSS Modules), another zero runtime tool that involves writing styles in TypeScript and compiling them to static CSS files at build time. In my opinion the idea of writing styles in Typescript sounds appalling, but it’s not without its fans.&lt;/p&gt;

&lt;p&gt;It’s been Tailwind, a &lt;a href="https://tailwindcss.com/blog/tailwindcss-v3#just-in-time-all-the-time"&gt;JIT (Just In Time) compiled&lt;/a&gt; atomic CSS library (with no client-side runtime), that has really taken off, with fifty eight thousand GitHub stars at the time of writing. &lt;/p&gt;

&lt;p&gt;Or you could &lt;em&gt;just write CSS&lt;/em&gt;. With CSS itself getting more powerful with features like &lt;code&gt;@layer&lt;/code&gt;, it’s fair to say that some of the original rationale for CSS-in-JS is less relevant today. Importing a SASS or CSS file at the top of a JSX file still works well for me. As someone that spends time designing in the browser I’d be happy to never see an unreadable machine-generated class like &lt;code&gt;.atm_5tsdf&lt;/code&gt; ever again.&lt;/p&gt;

</description>
      <category>react</category>
      <category>css</category>
      <category>performance</category>
    </item>
    <item>
      <title>Using ES Modules with Fastify</title>
      <dc:creator>Oliver Williams</dc:creator>
      <pubDate>Tue, 31 Aug 2021 16:04:06 +0000</pubDate>
      <link>https://dev.to/hypeddev/es-modules-in-fastify-349f</link>
      <guid>https://dev.to/hypeddev/es-modules-in-fastify-349f</guid>
      <description>&lt;p&gt;Documentation for Fastify, as well as for all official Fastify plugins, uses the older Node CommonJS module syntax. You can however, make use of ES modules.  &lt;/p&gt;

&lt;p&gt;To use ES modules in Node, you can set &lt;code&gt;"type": "module"&lt;/code&gt; in your package.json. Then, instead of &lt;code&gt;const fastify = require('fastify')({ logger: true })&lt;/code&gt; you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Fastify&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fastify&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fastify&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Fastify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same is true for the official plugins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fastifyFormbody&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fastify-formbody&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;fastify&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fastifyFormbody&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;__dirname&lt;/code&gt; and &lt;code&gt;__filename&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;One difference between CommonJS modules and ES modules is that &lt;code&gt;__filename&lt;/code&gt;  and &lt;code&gt;__dirname&lt;/code&gt; are &lt;a href="https://nodejs.org/api/esm.html#esm_no_filename_or_dirname"&gt;not available in ES modules&lt;/a&gt;. As the official Node docs suggest, they can be replicated with via &lt;a href="https://nodejs.org/api/esm.html#esm_import_meta_url"&gt;&lt;code&gt;import.meta.url&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fileURLToPath&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;__filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fileURLToPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;__dirname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fastifyStatic&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fastify-static&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;fastify&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fastifyStatic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/public/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>node</category>
      <category>fastify</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Internet Explorer finally dies</title>
      <dc:creator>Oliver Williams</dc:creator>
      <pubDate>Sun, 18 Jul 2021 12:14:20 +0000</pubDate>
      <link>https://dev.to/hypeddev/internet-explorer-finally-dies-26cn</link>
      <guid>https://dev.to/hypeddev/internet-explorer-finally-dies-26cn</guid>
      <description>&lt;p&gt;I’ve written about the death of Internet Explorer before over on &lt;a href="https://css-tricks.com/a-business-case-for-dropping-internet-explorer/"&gt;CSS Tricks&lt;/a&gt; and &lt;a href="https://alistapart.com/article/the-slow-death-of-internet-explorer-and-future-of-progressive-enhancement/"&gt;A List Apart&lt;/a&gt;, perhaps prematurely, but we’ve finally reached a tipping point.&lt;/p&gt;

&lt;p&gt;The majority of popular JavaScript frameworks have already dropped support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/vuejs/rfcs/discussions/296"&gt;Vue 3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_developit/status/1387804823492440069"&gt;Preact 11&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.angular.io/angular-v13-is-now-available-cce66f7bc296"&gt;Angular 13&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://emberjs.com/browser-support/"&gt;Ember 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ionicframework.com/docs/reference/browser-support#desktop-browsers"&gt;Ionic&lt;/a&gt;, a library of UI components&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/RyanCarniato/status/1422307568987242496"&gt;Marko&lt;/a&gt;, the Javascript framework from Ebay&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blog.amp.dev/2021/07/20/deprecation-of-internet-explorer-support/"&gt;AMP&lt;/a&gt; from Google&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/RyanCarniato/status/1422307568987242496"&gt;SolidJS&lt;/a&gt; (a more recent JS framework)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/javascript-environment-requirements.html"&gt;React 18&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;del&gt;The React framework itself does offer support for IE11 but some projects popular in the React ecosystem have dropped the browser. For example &lt;a href="https://github.com/mobxjs/mobx/issues/1612"&gt;version 5 of MobX&lt;/a&gt;, released a few years ago, and the animation library &lt;a href="https://github.com/framer/motion/issues/364#issuecomment-542254887"&gt;Framer Motion&lt;/a&gt;.&lt;/del&gt; React dropped support for Internet Explorer with the release of version 18.&lt;/p&gt;

&lt;p&gt;Bootstrap, still the most popular CSS framework, &lt;a href="https://getbootstrap.com/docs/5.0/getting-started/browsers-devices/#internet-explorer"&gt;officially dropped support for IE&lt;/a&gt; with the release of Bootstrap 5. Tailwind, another popular CSS library, also &lt;a href="https://tailwindcss.com/docs/browser-support"&gt;dropped support for IE11&lt;/a&gt; with the release of version 2. &lt;/p&gt;

&lt;p&gt;WordPress dropped support with the release of &lt;a href="https://wordpress.org/news/2021/05/dropping-support-for-internet-explorer-11/"&gt;version 5.8&lt;/a&gt;. Drupal will drop support with the forthcoming release of &lt;a href="https://www.drupal.org/node/3199540"&gt;Drupal 10&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The list of companies that have dropped support is growing by the day, and includes: &lt;a href="https://twitter.com/devongovett/status/1317225855249125377"&gt;Adobe&lt;/a&gt;, &lt;a href="https://developer.dailymotion.com/changelog/dailymotion-no-longer-supports-internet-explorer/"&gt;Dailymotion&lt;/a&gt;, &lt;a href="https://www.skillshare.com/unsupported-browser"&gt;Skillshare&lt;/a&gt;, LinkedIn, Twitter, &lt;a href="https://blogs.sap.com/2021/02/02/internet-explorer-11-will-no-longer-be-supported-by-various-sap-ui-technologies-in-newer-releases/"&gt;SAP&lt;/a&gt;, among many others. &lt;/p&gt;

&lt;p&gt;Many of &lt;a href="https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666"&gt;Microsoft's own products&lt;/a&gt; have already dropped support: Microsoft Teams web app ended support in November 2020. Microsoft 365 apps and services dropped support on August, 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.theverge.com/2021/6/25/22550714/microsoft-windows-11-internet-explorer-disabled"&gt;Windows 11&lt;/a&gt; does not include Internet Explorer. On Windows 10 &lt;a href="https://blogs.windows.com/windowsexperience/2021/05/19/the-future-of-internet-explorer-on-windows-10-is-in-microsoft-edge/"&gt;Internet Explorer 11&lt;/a&gt; will be retired and go out of support on June 15, 2022.&lt;/p&gt;

&lt;p&gt;Senior Director of Engineering at GoDaddy &lt;a href="https://twitter.com/indexzero/status/1261033701548404749"&gt;tweeted&lt;/a&gt; back in 2020: “We dropped support &lt;a href="https://twitter.com/GoDaddy"&gt;@GoDaddy&lt;/a&gt; for IE11 in April. We've seen 25% bundle size reductions since targeting modern JavaScript for transpilation”&lt;/p&gt;

&lt;p&gt;It is now Safari that is the major outlier. Few users are stuck on old versions of Chrome or Firefox, but plenty of users get stuck on old versions of iOS. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
