<?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>Forem: Daniel Nagy</title>
    <description>The latest articles on Forem by Daniel Nagy (@danielnagy).</description>
    <link>https://forem.com/danielnagy</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%2F1255332%2Fbb56bccc-14f2-46d3-b35b-d7c9090f956b.jpeg</url>
      <title>Forem: Daniel Nagy</title>
      <link>https://forem.com/danielnagy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/danielnagy"/>
    <language>en</language>
    <item>
      <title>Are Inline Styles Faster than CSS?</title>
      <dc:creator>Daniel Nagy</dc:creator>
      <pubDate>Sat, 06 Apr 2024 13:49:20 +0000</pubDate>
      <link>https://forem.com/danielnagy/are-inline-styles-faster-than-css-5260</link>
      <guid>https://forem.com/danielnagy/are-inline-styles-faster-than-css-5260</guid>
      <description>&lt;p&gt;&lt;a href="https://danielnagy.me/posts/Post_tsr8q6sx37pl"&gt;https://danielnagy.me/posts/Post_tsr8q6sx37pl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR&lt;/p&gt;

&lt;p&gt;I recently migrated my website from CSS-in-JS to inline styles and was pleasantly surprised by the performance improvement. Encouraged by this, I wrote a blog post suggesting that inline styles could enhance website load times.&lt;/p&gt;

&lt;p&gt;However, some skeptics rightly pointed out that my migration from a specific CSS-in-JS library to inline styles wasn't sufficient evidence to claim inline styles were faster than CSS. Determined to uncover the truth, I embarked on a comprehensive experiment.&lt;/p&gt;

&lt;p&gt;The experiment involved migrating my entire website to CSS, a painstaking process. I meticulously crafted over 2,000 lines of handwritten CSS, utilizing BEM for component styling and atomic CSS for non-component elements. Then, I built three versions of my React app: one with inline styles, one with a separate CSS file, and one with CSS inlined in the document head.&lt;/p&gt;

&lt;p&gt;Deploying all versions to a single testing environment, I meticulously measured various metrics including server render time, HTML and JavaScript sizes, browser render time, and web vitals.&lt;/p&gt;

&lt;p&gt;Server render times showed no significant correlation between inline styles and CSS. HTML size comparison revealed inline styles producing larger documents, yet after compression, they were smaller than inline CSS due to compression efficiency. JavaScript bundle size increased slightly with inline styles but became negligible after compression, resulting in the fewest bytes over the wire.&lt;/p&gt;

&lt;p&gt;Browser render performance favored inline styles, particularly in putting pixels on the screen quickly, especially evident on low-powered devices. Web vitals, including first contentful paint and largest contentful paint, often favored inline styles over CSS.&lt;/p&gt;

&lt;p&gt;In conclusion, my experiment suggests that inline styles could offer better performance than CSS, especially considering factors like browser rendering and initial page load. However, I acknowledge that this may not be universally true and encourage others to conduct their own experiments to gather more data.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>css</category>
      <category>performance</category>
    </item>
    <item>
      <title>Switching to Inline Styles Could Save You 15% or More on Page Speed</title>
      <dc:creator>Daniel Nagy</dc:creator>
      <pubDate>Mon, 18 Mar 2024 15:10:06 +0000</pubDate>
      <link>https://forem.com/danielnagy/switching-to-inline-styles-could-save-you-15-or-more-on-page-speed-4k0b</link>
      <guid>https://forem.com/danielnagy/switching-to-inline-styles-could-save-you-15-or-more-on-page-speed-4k0b</guid>
      <description>&lt;p&gt;&lt;a href="https://danielnagy.me/posts/Post_capv6evei09g"&gt;https://danielnagy.me/posts/Post_capv6evei09g&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So easy, a backend developer could do it.&lt;/p&gt;

&lt;p&gt;TL;DR&lt;/p&gt;

&lt;p&gt;I switched from CSS-in-JS to inline styles and improved the load performance of my website by 18%. I also decreased the complexity of my website, and I decreased the size of my JavaScript bundle by 6.36%. All while maintaining the same developer experience for styling.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>The Two-Tree Problem with Styling on the Web</title>
      <dc:creator>Daniel Nagy</dc:creator>
      <pubDate>Mon, 11 Mar 2024 22:14:54 +0000</pubDate>
      <link>https://forem.com/danielnagy/the-two-tree-problem-with-styling-on-the-web-1do4</link>
      <guid>https://forem.com/danielnagy/the-two-tree-problem-with-styling-on-the-web-1do4</guid>
      <description>&lt;p&gt;&lt;a href="https://danielnagy.me/posts/Post_jt4adn0o5bnr"&gt;https://danielnagy.me/posts/Post_jt4adn0o5bnr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, I discuss what I call the "two-tree problem" with styling modern web apps. The problem arises from the separation of structure and style.&lt;/p&gt;

&lt;p&gt;I suggest that while CSS is a well-designed language for styling, the cascade and separation of styles from HTML may have been mistakes.&lt;/p&gt;

&lt;p&gt;I then examine some popular styling libraries, including Emotion, Styled Components, Tailwind, and UI Box, assessing their effectiveness in addressing the two-tree problem.&lt;/p&gt;

&lt;p&gt;I make a case for inline styles as a potential solution, emphasizing their simplicity. I acknowledge the limits of inline styles but suggest that these limits might not be significant issues for modern web development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>The American Dream</title>
      <dc:creator>Daniel Nagy</dc:creator>
      <pubDate>Thu, 29 Feb 2024 20:40:54 +0000</pubDate>
      <link>https://forem.com/danielnagy/the-american-dream-3a8b</link>
      <guid>https://forem.com/danielnagy/the-american-dream-3a8b</guid>
      <description>&lt;p&gt;In this article, I tell the story of my journey into computer science and my struggle with mental health.&lt;/p&gt;

&lt;p&gt;While intentionally dramatic at times, I promise this is not a sob story, and I'm not looking for sympathy. I just want to share my story.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;I begin my story by informing the reader that I had a rough start in life and that I had to enter the work force at a young age. I then progress to my high school years when I started messing with computers.&lt;/p&gt;

&lt;p&gt;After high school I went to college to study computer science. My junior year I got an internship doing web development. During my internship, I created an open-source project that became popular. I got a job at a startup in Los Angeles and moved to California.&lt;/p&gt;

&lt;p&gt;I made some job transitions, and then the pandemic hit. I started working remotely from my apartment in Hollywood. I was miserable living in Hollywood, so I moved to Austin, TX. My job started to become toxic for me but I did not realize it at the time.&lt;/p&gt;

&lt;p&gt;I bought a house, and the day after I moved in, my mom passed away. I became very depressed and left my job. For awhile I could not look at code. Now I'm coding again, and I started a blog. I end by telling the reader some things I wish I would have done differently.&lt;/p&gt;

&lt;p&gt;If my story sounds interesting to you then you can read it &lt;a href="https://danielnagy.me/posts/Post_ikms829j8yu1"&gt;here&lt;/a&gt;. I hope your journey was better than mine!&lt;/p&gt;

</description>
      <category>mentalhealth</category>
      <category>workplace</category>
      <category>career</category>
      <category>burnout</category>
    </item>
    <item>
      <title>Introducing Transporter</title>
      <dc:creator>Daniel Nagy</dc:creator>
      <pubDate>Fri, 12 Jan 2024 16:55:19 +0000</pubDate>
      <link>https://forem.com/danielnagy/introducing-transporter-55m8</link>
      <guid>https://forem.com/danielnagy/introducing-transporter-55m8</guid>
      <description>&lt;p&gt;I am the author of Transporter. Transporter was made public on Jan 2, 2024. The purpose of this post it to bring attention to Transporter and receive feedback. I hope this is an appropriate place to self-promote my work.&lt;/p&gt;

&lt;p&gt;Transporter is a library for typesafe distributed computing in TypeScript. Transporter was influenced by Comlink and rxjs.&lt;/p&gt;

&lt;p&gt;Transporter makes it possible to call functions in other processes as if they were in-process. This is known as remote procedure call or RPC for short. Unlike other TypeScript RPC libraries, that focus primarily on RPC over HTTP between a web server and client, Transporter is a little more low level and general purpose.&lt;/p&gt;

&lt;p&gt;I began work on Transporter back in 2021 as part of a larger prototype that involved reusing UI fragments in React Native and in the browser. I wanted there to be a well defined API barrier between the sub-frames and the host.&lt;/p&gt;

&lt;p&gt;Some key differences between Transporter and other TypeScript RPC libraries are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Transporter is designed to be general purpose. Not only can you use Transporter over HTTP but you can use transporter over just about any transport layer, including &lt;code&gt;postMessage&lt;/code&gt; in the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transporter does not use a router. Instead you organize your API into namespaces using object composition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transporter does not use a builder API or otherwise couple your functions to Transporter. You can organize your API however you want using the syntax of TypeScript. This allows Transporter to support generic functions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transporter supports recursive RPC depending on your subprotocol. Recursive RPC allows state to be held on the call stack between processes. This also enables the use of Observables for pub-sub.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If I have peeked your interest in Transporter than please read my &lt;a href="https://danielnagy.me/posts/Post_s2fh85ot8gqd"&gt;blog post&lt;/a&gt; and checkout Transporter's &lt;a href="https://github.com/daniel-nagy/transporter"&gt;GitHub page&lt;/a&gt; where you can find examples and API docs! If you would like to discuss Transporter then feel free to start a discussion on GitHub. Thanks!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>rpc</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
