<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simon Wicki on Medium]]></title>
        <description><![CDATA[Stories by Simon Wicki on Medium]]></description>
        <link>https://medium.com/@zwacky?source=rss-946efead98b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YmuwlXlJ3fBPF_gSkP_18g.jpeg</url>
            <title>Stories by Simon Wicki on Medium</title>
            <link>https://medium.com/@zwacky?source=rss-946efead98b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:26:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zwacky/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Duality of CLS With Lazy Loading Components]]></title>
            <link>https://medium.com/better-programming/the-duality-of-cls-with-lazy-loading-components-c0a0e06eabf8?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0a0e06eabf8</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Mon, 28 Mar 2022 06:56:17 GMT</pubDate>
            <atom:updated>2022-03-28T11:12:07.141Z</atom:updated>
            <content:encoded><![CDATA[<h4>Build optimized web apps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knH5ID3Ddftya47sCEhreg.png" /></figure><p>When you optimize your web app, your goal is to make the experience better for the user: Which means usually ‘faster’ by transferring and parsing fewer data. But caution: The same web app can cause Cumulative Layout Shift (CLS) on slower connections but runs without CLS on a faster connection.</p><p>If you’d like a refresher about Core Web Vitals, I explained them with GIFs in <a href="https://wicki.io/posts/2021-07-core-web-vitals/">this post</a>.</p><blockquote><strong>TL;DR:</strong> slower connections <em>can</em> result in CLS when lazy loading components that you wouldn’t see on wifi connections.</blockquote><blockquote>Either don’t lazy load the component at all or await for the js file to be loaded and mounted.</blockquote><h3>The Duality</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4XnCQjFaf-YEF1EKXpfdsw.gif" /><figcaption>Slow vs fast connection: Same web app with different CLS.</figcaption></figure><p>We assume that a web app loads the same on slower connections, just <em>slower</em>. Unfortunately, that’s not always the case with lazy loadable components.</p><p>With lazy loadable components, we deal with two asyncnesses:</p><ol><li>async API responses (JSON)</li><li>async lazy loading components (JS)</li></ol><p>What if the API responses (1) are faster than the dynamically loaded JS (2)? What if you lazy load a component that sits in the middle of your web content? The answer to these questions you see in the screen capture above Google will punish you with CLS.</p><h3>CLS measurement</h3><p>I’ve seen a lot of confusion about Core Web Vitals, especially CLS.</p><p>Unlike other Core Web Vitals, CLS is continuously measured and <em>cumulatively</em> added to the score. For a classic SPA web app this means that Google will keep the CLS score on a per-route basis.</p><p>CLS has the following characteristics:</p><ul><li>After each route change, the CLS resets to 0</li><li>After any user interaction, you get a grace period of 500ms where CLS is <strong>not</strong> taken into account</li></ul><p><strong>Measurements by real users</strong>: Chrome users send Core Web Vitals metrics to Google directly. It’s not a Googlebot that captures these metrics while crawling the site.</p><p>These real user measurements are collected as <a href="https://web.dev/lab-and-field-data-differences/#field-data">Field Data</a> and flow into Google’s <a href="https://developers.google.com/web/tools/chrome-user-experience-report">CrUX report</a>.</p><p>That means you need to take the real world into account:</p><ul><li>If you have a lot of traffic from India, but your servers are on the other end of the world, your LCP (Largest Contentful Paint) will probably suffer.</li><li>If you have a lot of traffic from China, it’s likely that some services are blocked by Chinese ISPs and won’t load. This could cause unwanted CLS within your content.</li></ul><h3>Solutions</h3><p>We need to be in full control of what to display to the user at what time. With duality in mind, we need to know the following:</p><ul><li>are API requests still loading?</li><li>are async components still loading?</li></ul><p>A skeleton loader is an ideal way to wait until both, API requests and async components, are ready.</p><h3>Solution #1: Don’t lazy load components at all</h3><p>The quickest and least error-prone solution would be to pass on lazy loading components. In most cases, the saved kilobytes through lazy loading doesn’t justify the CLS that it might cause. If your performance budget allows it, go with this solution.</p><p>Let’s assume we have a Vue web app with 10% logged-in users.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/baa9736b52973bdb9f0a5d0f6539955f/href">https://medium.com/media/baa9736b52973bdb9f0a5d0f6539955f/href</a></iframe><p>Without code-splitting, we’d send the JS of &lt;HugeComponent&gt; to 90% of the users that don’t need it. This can affect LCP and FID.</p><p>With code splitting, we’d pack the JS of &lt;HugeComponent&gt; into the additional-comps.js chunk and only send it over the wire when it’s needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a32b3fe73d6e20b3f1e1b44246aaaac/href">https://medium.com/media/4a32b3fe73d6e20b3f1e1b44246aaaac/href</a></iframe><p>There are two criteria that help you decide if you should lazy load a component or not:</p><ul><li>size of &lt;HugeComponent&gt;</li><li>how often &lt;HugeComponent&gt; would be rendered for users</li></ul><p>If you come to the conclusion that your performance budget is tight and you need to lazy load the component, see solution #2.</p><h3>Solution #2: Await loading and mounting of component</h3><p>If your component isn’t used for the majority of users and it would increase the bundle by a lot, have a look at this solution.</p><p>Wait for async components to be lazily loaded and mounted can be tricky. You need to render the component but the mounting happens later. Here’s a gist of how it could be done.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bb038565368970fb324b2fb51888fe9/href">https://medium.com/media/2bb038565368970fb324b2fb51888fe9/href</a></iframe><p>If we didn’t use display: hidden for the loading state on the &lt;HugeComponent&gt;, we’d never trigger the loading of the async component. Thus, Line 28 would never be reached and the isLoading state would stay on false forever.</p><h3>Conclusion</h3><p>When you lost green URLs in the <a href="https://search.google.com/search-console">Google Search Console</a> due to CLS and you can’t reproduce it yourself, try debugging your web app with a slower connection.</p><p>So if you’re using lazy loadable components, chances are high that might be a victim of the duality of CLS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0a0e06eabf8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/the-duality-of-cls-with-lazy-loading-components-c0a0e06eabf8">The Duality of CLS With Lazy Loading Components</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sued for Using Google Fonts]]></title>
            <link>https://medium.com/swlh/time-to-say-goodbye-to-google-fonts-data-privacy-and-gdpr-dcf952edc53e?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcf952edc53e</guid>
            <category><![CDATA[gdpr]]></category>
            <category><![CDATA[data-privacy]]></category>
            <category><![CDATA[dsgvo]]></category>
            <category><![CDATA[google-fonts]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 09:23:28 GMT</pubDate>
            <atom:updated>2022-02-25T13:10:56.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*_NiRgqb1jKFBigND.jpg" /></figure><p>The German court <a href="https://rewis.io/urteile/urteil/lhm-20-01-2022-3-o-1749320/">has ruled</a> last month that Google Fonts is not in compliance with GDPR.</p><blockquote>The integration of dynamic web content such as Google Fonts from US web services is illegal without the consent of the visitor.</blockquote><p>A website operator received a fine of 100€. The Munich court clearly wanted to set an example. They even mentioned the next fine will be 250.000€ for the website operator if they don’t comply.</p><p>Data protection authorities (DPA) in other EU countries became all ears. It’s likely to see more rulings and enforcements of this in the name of GDPR.</p><p>In this post I want to show why you should care, even if you’re not from Germany.</p><h3>How Google Fonts collects personal data</h3><p>When a user wants to load a font via Google Fonts, it uses 2 types of requests:</p><ol><li><strong>Dynamic request</strong>: fonts.googleapis.com/css2?family={font}</li><li><strong>Asset request(s)</strong>: fonts.gstatic.com/s/{font}/...</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*kCwt4GlAzjrwWZea.png" /></figure><p>Requests needed for Google Fonts</p><p>The dynamic request is the reason of the German court’s ruling: The user’s IP address is <em>shared</em> with Google Fonts. This is object to personally identifyable information (PII).</p><p>From the Google Fonts <a href="https://developers.google.com/fonts/faq#what_does_using_the_google_fonts_api_mean_for_the_privacy_of_my_users">FAQ</a> we get a fuzzy idea of what is going on:</p><blockquote>Google Fonts logs records of the CSS and the font file requests, and access to this data is kept secure.</blockquote><ul><li>Are they logging user’s IP addresses along other fingerprinting PIIs?</li><li>Are they using these records to fill the gaps of a user’s internet journey?</li></ul><p>What we know is that they collect and store end-user data to be able to — what they state as needed to “serve fonts efficiently”.</p><h3>“I’m running Google Fonts, what are my options?”</h3><p>From a GDPR point of view you have 2 options:</p><ol><li><strong>Host the fonts locally</strong>: You can already download them from the Google Fonts website directly.</li><li><strong>Ask your users for consent</strong>: Implement a Consent Banner where Google Fonts is stated as one of the Data Processing Services (DPS). On top, you need to await your user’s consent before requesting the Google Font service. Postponing font files is inherently not ideal.</li></ol><h3>Why you should care</h3><p>When tech companies get enough data points to connect the dots they get a pretty good picture of what you do on the internet. This data is usually used for personalised advertisement. I could live with this if it was the user’s only drawback of personal data collection.</p><p>Google Fonts is one of these data points that helps connecting further puzzle pieces together.</p><p>Besides the advertisement aspect, it’s problematic because of:</p><ul><li>the lack of control over your personal data</li><li>leaving a profile on tech companies’ servers that can be accessed under certain requirements by the US authorities</li><li>being on the internet where data leaks and hacks happen very often</li></ul><p><strong>Currently it’s up to us developers to protect the end-user. This is why you should care.</strong></p><h3>Closing words</h3><p>I hope I could shed some light on why Google Fonts is data privacy concern.</p><p>Also: I am not a lawyer.</p><h4><strong>Time to say Goodbye to Google Fonts (2 part series)</strong></h4><ul><li><a href="https://medium.com/swlh/time-to-say-goodbye-to-google-fonts-716b2e04728e">Cache Performance</a></li><li><a href="https://medium.com/@zwacky/time-to-say-goodbye-to-google-fonts-data-privacy-and-gdpr-dcf952edc53e">Sued for using Google Fonts</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcf952edc53e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/time-to-say-goodbye-to-google-fonts-data-privacy-and-gdpr-dcf952edc53e">Sued for Using Google Fonts</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Ode to AngularJS]]></title>
            <link>https://medium.com/@zwacky/an-ode-to-angularjs-32e186743e19?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/32e186743e19</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Wed, 19 Jan 2022 09:23:20 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:15.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*w8z2YjoahliGJ7_F1Pg6bw.png" /></figure><p>In remembrance of my first love.</p><p>Your LTS came finally to an end. You retired on 31st December 2021. You will always have a special place in my heart.</p><blockquote>You arrived with great anticipation,<br> Put the web dev world upside down;<br>Model, View and Controller were in separation,<br> Even Javascript beginners didn’t frown.</blockquote><blockquote>Be it JavaScript, CoffeeScript or SCSS,<br> You handled them all in a snap;<br>Grunt helped you to transpile and compress,<br> The only thing needed was an ng-app</blockquote><blockquote>You were patient with faulty code,<br> Throwing errors with the where and why;<br>Did selectors return a wrong DOM node?<br> Did watchers kill the CPU workload?<br> Did a variable on $scope get overshadowed?<br>Maybe the external callback needs an $apply!<br> Maybe $inject lacks used params to minify!<br> Maybe avoid $rootScope for all events passing by!</blockquote><blockquote>You were either praised or attacked,<br> Yet, you advanced and left doubters behind;<br>Daily flame wars you fought against react,<br> Until the day window.angular became undefined.</blockquote><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32e186743e19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interface vs. Type Alias in TypeScript — Quick Comparison]]></title>
            <link>https://medium.com/better-programming/interface-vs-type-alias-in-typescript-quick-comparison-9b356fae8389?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b356fae8389</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Fri, 07 Jan 2022 17:12:15 GMT</pubDate>
            <atom:updated>2022-01-12T08:18:46.012Z</atom:updated>
            <content:encoded><![CDATA[<h4>An overview of TypeScript features that you can or can’t type with Type Aliases and Interfaces</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*dBBamZa3QUEbsOtT.jpg" /><figcaption>Royalty-free icon. Edited by author</figcaption></figure><p>This can be confusing for anyone working with TypeScript — beginner or seasoned programmer. Both ways can cover similar needs.</p><p>In this post, you’ll quickly see what TypeScript feature is possible to implement as Type Alias or Interface. I stayed brief and spicy to give the post an overview character.</p><p>👉 <strong>TLDR:</strong> You don’t care about each difference? What should you use?</p><blockquote>Use interface until you need type —<a href="https://twitter.com/orta/status/1356129195835973632">orta</a></blockquote><h3>Overview: Interface (I) vs Type Alias (T)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1QKY3IbtXI-9smfCxMvVlg.jpeg" /><figcaption>Image by author</figcaption></figure><h3>Primitives</h3><p>❌: Interface<br>✅: Type Alias</p><p>string, number and boolean make up the Primitives in TypeScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4kjsDehvad6RWNtl.png" /></figure><h3>Extend or Intersect</h3><p>✅: Interface<br>✅: Type Alias</p><p>Although intersect and extend are not 100% the same for interface and type alias, I put them together in this example.</p><p>The differences arise when type keys appear in both types that you want to extend or intersect from.</p><p>So if the extended or intersected key is not the same type:</p><ul><li>Type Alias lets you do it but changes that type to never</li><li>Interface spits an error that the types are not compatible</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LtmJeRREd8GrtapM.png" /></figure><h3>Mapped object types</h3><p>❌: Interface<br>✅: Type Alias</p><p>Type the keys in your objects with this. Here are a few useful applications of this:</p><ul><li>[key: string]: only strings as key allowed</li><li>[key: number]: only numbers as key allowed</li><li>[key in keyof T as `get${Capitalize&lt;string &amp; key&gt;}`]: only allow keys that start with get..., e.g. as seen in a Getter object</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*89o8XCKmcNieXHkM.png" /></figure><h3>Unions</h3><p>❌: Interface<br>✅: Type Alias</p><p>TypeScript’s equivalent to OR: The type is either x or y or z or as many as you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9gnIdelOBX2qL9F0.png" /></figure><h3>Augment existing types</h3><p>✅: Interface<br>❌: Type Alias</p><p>You can add fields to already existing types. It’s useful when you add a new field (e.g. jQuery library for auto-completion) onto an existing type (e.g. window).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FkN3eTp6VRfQLkwv.png" /></figure><h3>Tuples</h3><p>✅: Interface<br>✅: Type Alias</p><p>If you’ve used hooks in react, then you know the usefulness of tuples.</p><p>A single function call can return an array of values and functions, that are destructured and can be used as fully typed variables: const [name, setName] = useState(&#39;&#39;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LanZYaaHMCnQ7dPy.png" /></figure><h3>Functions</h3><p>✅: Interface<br>✅: Type Alias</p><p>Functions can be annotated with Parameter Types and Return Types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tSA6igu8Z3Gqiz4i.png" /></figure><h3>Recursion</h3><p>✅: Interface<br>✅: Type Alias</p><p>Recursion is simple to use. Make sure you add the optional ? to the recursive property. Otherwise, the TS compiler spits out an error upon searching an endless recursion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oW2Ps6MRsBBEXu9L.png" /></figure><h3>More Resources</h3><ul><li><a href="https://www.typescriptlang.org/play">TypeScript Playground</a></li><li><a href="https://github.com/typescript-cheatsheets/react#types-or-interfaces">Types or Interfaces in react</a></li><li><a href="https://stackoverflow.com/a/65948871/825444">Interfaces vs Types in TypeScript</a> by Mark</li><li><a href="https://blog.logrocket.com/types-vs-interfaces-in-typescript/">Types vs. interfaces in TypeScript</a> by Leonardo Maldonado</li><li><a href="https://medium.com/@martin_hotell/interface-vs-type-alias-in-typescript-2-7-2a8f1777af4c">Interface vs Type alias in TypeScript 2.7</a> by Martin Hochel</li></ul><p>Found this post interesting? Check out my Twitter about the same:</p><h3>Simon Wicki on Twitter: &quot;Yall, let&#39;s talk about: type vs interface 🤔Ever wondered if you should use type (Type Alias) or interface in Typescript? 🤔I put together a quick overview of TS features that you can or can&#39;t type with Type Aliases and Interfaces. [1/10] pic.twitter.com/2GQwrwnQ0u / Twitter&quot;</h3><p>Yall, let&#39;s talk about: type vs interface 🤔Ever wondered if you should use type (Type Alias) or interface in Typescript? 🤔I put together a quick overview of TS features that you can or can&#39;t type with Type Aliases and Interfaces. [1/10] pic.twitter.com/2GQwrwnQ0u</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b356fae8389" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/interface-vs-type-alias-in-typescript-quick-comparison-9b356fae8389">Interface vs. Type Alias in TypeScript — Quick Comparison</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Font Format to Rule Them All: WOFF2]]></title>
            <link>https://medium.com/geekculture/one-font-format-to-rule-them-all-woff2-d053e2e5165a?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d053e2e5165a</guid>
            <category><![CDATA[fonts]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Thu, 11 Nov 2021 08:49:31 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:31.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*4G0IIrBEN3zHhCF6.png" /></figure><p>Learn why WOFF2, and WOFF as a fallback, is the only font format you need.</p><p>If you’ve been around as a web developer for some time, you’ve seen these font formats in your CSS. Here’s an example for a self-hosted Raleway font:</p><pre>@font-face {<br>  font-family: &#39;Raleway&#39;;<br>  font-style: normal;<br>  font-weight: 400;<br>  src: url(https://medium.com/&#39;../raleway.eot&#39;);<br>  src: local(&#39;&#39;),<br>       url(https://medium.com/&#39;../raleway.eot?#iefix&#39;) format(&#39;embedded-opentype&#39;),<br>       url(https://medium.com/&#39;../raleway.woff2&#39;) format(&#39;woff2&#39;),<br>       url(https://medium.com/&#39;../raleway.woff&#39;) format(&#39;woff&#39;),<br>       url(https://medium.com/&#39;../raleway.ttf&#39;) format(&#39;truetype&#39;),<br>       url(https://medium.com/&#39;../raleway.svg#Raleway&#39;) format(&#39;svg&#39;);<br>}</pre><p>Do we still need to support all 5 (!) of them? Where did they come from? How do they compare to each other?</p><p>These questions I’d like to answer in this post.</p><h3>Timeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EHvLco44jlwYkug2.png" /><figcaption>Historical releases of nowadays still used font format</figcaption></figure><p>It took time and iterations to have what we’ve ended up with.</p><p>With more efficient font formats, thanks to compression, browsers were able to support them.</p><p>Have a look at Pedro Amado’s elaborate <a href="https://typeforge.files.wordpress.com/2011/11/timeline_formatos_software_fontes_v10-01.jpg">Font Format Timeline</a>. This shows, that there are in fact many more facets to font formats than we think.</p><h3>Comparison</h3><p>I’ll go ahead and use the following criteria for my score to compare font formats:</p><ul><li>Browser support as of November 2021</li><li>File size (aka format efficiency)</li></ul><p>For the file size I used <a href="http://comicneue.com/">Comic Sans Neue</a> and the browser support I gathered from <a href="https://caniuse.com/">caniuse.com</a>. Here’s the let’s have a look at the following table ordered historically with these criteria:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3691136b97987e0745f93f3e08ba5da/href">https://medium.com/media/c3691136b97987e0745f93f3e08ba5da/href</a></iframe><p>Let me explain why WOFF2 scored higher than WOFF in this comparison: It all comes down to the 7 kb in file size. Generally if your site shows the user content more quickly, your conversion will increase — even if the gain is only in the hundred millisecond range.</p><p>Your fonts could be:</p><ul><li>blocking content from appearing (invisible text)</li><li>cause layout shifts</li><li>delay further assets from downloading on flaky mobile networks</li><li>sending bad signals to Google (LCP &amp; CLS from Core Web Vitals)</li></ul><h3>How to convert</h3><p>It’s a very good idea to self host your fonts for performance reasons. I described one case in my <a href="https://wicki.io/posts/2020-11-goodbye-google-fonts/">Time to Say Goodbye to Google Fonts</a> post.</p><p>How to best convert a font type to WOFF2 and WOFF depends where you got your font type from:</p><ul><li><strong>Google Fonts:</strong> Download the used font types on Google Fonts and use <a href="http://google-webfonts-helper.herokuapp.com/fonts">google-webfonts-helper</a> to download the other font formats.</li><li><strong>everything else:</strong> Use <a href="https://www.fontsquirrel.com/tools/webfont-generator">Font Squirrels’s Webfont Generator</a>. The ‘optimal’ setting even only spits out WOFF2 and WOFF files.</li></ul><h3>Conclusion</h3><p>WOFF2, and WOFF as fallback, is enough nowadays¹.</p><p>¹) <em>if</em> your site doesn’t need support for antiquated browseres like IE8.</p><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d053e2e5165a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/one-font-format-to-rule-them-all-woff2-d053e2e5165a">One Font Format to Rule Them All: WOFF2</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keep Your Javascript Bundle Size in Check]]></title>
            <link>https://medium.com/@zwacky/keep-your-javascript-bundle-size-in-check-142920a815d3?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/142920a815d3</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Wed, 18 Aug 2021 07:43:10 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:37.286Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a developer who is concerned about the size of newly added libraries? Or do you want to find a culprit in a rather big Javascript bundle?</p><p>If you’re like me, then you answered yes to both questions.</p><p>In this post I’ll cover a few tools that come in handy for a <strong>quick</strong> analysis of bundle sizes <strong>without changing or ejecting your build architecture</strong>.</p><h3>VS Code extension: Import Cost</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*fSjZrMzevqwsTUVx.gif" /><figcaption>Immediately see the weight of what you import in VS Code.</figcaption></figure><p>Understand the cost of an import early.</p><p>This extension will display inline in the editor the size of the imported package. It supports tree shaking, so the size should be displayed correctly for a few exported functions.</p><p>With this you may spot mistakes like these:</p><pre>import moment from &#39;moment&#39;; // 289.7KB<br>moment.now();</pre><pre>import { now } from &#39;moment&#39;; // 0.082KB<br>now();</pre><p>It’s also available for <strong>JetBrains IDE</strong>, <strong>Atom</strong> and <strong>Vim</strong>.</p><p>👉 <a href="https://github.com/wix/import-cost">https://github.com/wix/import-cost</a></p><h3>Website: Bundlephobia</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z6Y2ECq7vIBECBMu.png" /></figure><p>This website lets you search for libraries and display their sizes without the need to install. It shows the size of each version and even suggests alternatives to similar libraries that might be lighter — talking about a new framework or library every week.</p><p>You could also drop your package.json file and order it by size to see your biggest libraries. Personally I find this quite fun, but usually I use this tool to check bundle sizes of not-yet-installed libraries.</p><p>👉 <a href="https://bundlephobia.com/">https://bundlephobia.com/</a></p><h3>NPM: source-map-explorer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IYmuRQbw9CYaBLjX.png" /></figure><p>Like the name suggests you need to build source maps. With modern framework CLIs it’s enabled by default in prod builds.</p><p>Useful tool for imported package visualisation in relation to their size. By clicking on the packages, you can further imspect their sizes and children.</p><p>👉 npx source-map-explorer ./dist *.js<br>👉 <a href="https://github.com/danvk/source-map-explorer">https://github.com/danvk/source-map-explorer</a></p><h3>Website: PageSpeed Insight / Lighthouse</h3><p>If your site is already public you can use Google’s PageSpeed Insight to detect big Javascript bundles.</p><p><strong>Bonus</strong>: It also includes Javascript files, that are downloaded on runtime from your ad networks, Google Tag Manager and other tools.</p><p>👉 <a href="https://developers.google.com/speed/pagespeed/insights/">https://developers.google.com/speed/pagespeed/insights/</a></p><p>Check out this tweet to see the treemap in action:</p><h3>Lighthouse on Twitter: &quot;The Lighthouse Treemap lets you see what&#39;s in the JavaScript you ship and find where you can trim based on module size and execution coverage.With Lighthouse 8 it&#39;s now in PSI, Canary DevTools, and the CLI if it can see your source maps 🌳🗺️Try it out: https://t.co/TkkzvxHAbY pic.twitter.com/VbMErHuLW8 / Twitter&quot;</h3><p>The Lighthouse Treemap lets you see what&#39;s in the JavaScript you ship and find where you can trim based on module size and execution coverage.With Lighthouse 8 it&#39;s now in PSI, Canary DevTools, and the CLI if it can see your source maps 🌳🗺️Try it out: https://t.co/TkkzvxHAbY pic.twitter.com/VbMErHuLW8</p><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=142920a815d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accurate Daily Measurements of Core Web Vitals with Google Analytics]]></title>
            <link>https://medium.com/@zwacky/accurate-daily-measurements-of-core-web-vitals-with-google-analytics-8f3b4f48bd6b?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f3b4f48bd6b</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 08:39:35 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:42.832Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever optimised your website for the Core Web Vitals (CWV)? Did you want to check your changes the next day — but Google’s various tools don’t give you current daily CWV metrics due to the <em>rolling 28-day window</em>?</p><p>In this post I’ll review Google’s toolset for measuring CWV and explain how to see if your changes had any effect on CWV day by day with Google Analytics (GA).</p><h3>Accurate daily CWV measurements: Create your report</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aIA0SPNfjAoYAF5oL21trA.png" /><figcaption>3-step workflow to get your daily accurate CWV report.</figcaption></figure><p>There isn’t a prebuilt view for daily accurate reports in any analytics service out of the box. That’s why we need to create our own report in three steps:</p><ul><li><a href="https://github.com/GoogleChrome/web-vitals">web-vitals</a>: to measure CWV metrics in the frontend</li><li><a href="https://github.com/GoogleChrome/web-vitals#using-analyticsjs">CWV GA tracking snippet</a>: to send these captured metrics over to GA</li><li><a href="https://web-vitals-report.web.app/">Web Vitals Report</a>: to create your CWV report by connecting your GA with this external reporting tool</li></ul><p>The web-vitals library lets us grab all CWV metrics of each visitor of the site. These metrics are then sent off to Google Analytics. The external Web Vitals Report tool can then extract these tracking events from your GA account and create a daily accurate report.</p><p><strong>Don’t be fooled</strong>: GA can display your CLS, LCP and other CWV metrics when you search for these events. But they’re inaccurate in the GA events view. For instance it’s possible that multiple CLS events are sent, each with their own <em>delta</em> value that accumulates to the total CLS. You’d need to group by that day <strong>and</strong> url <strong>and</strong> user to get an accurate reporting. This grouping isn’t supported out of the box.</p><p>That’s why Google created the external tool <strong>Web Vitals Report</strong>. You can connect your GA account with it and it will extract the data. If you followed the default naming inside of the CWV GA tracking snippet, everything will work out of the box. You’ll be rewarded with shiny graphs and an accurate* report overall.</p><p>*) GA <a href="https://github.com/GoogleChromeLabs/web-vitals-report#1-million-row-limit">imposes a limit</a> in each report which can lead to sampling and an inaccurate report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SZRN4vGq5nYdWNMsWE0SQ.png" /><figcaption>Core Web Vitals reports are a great way to group metric by day and overall break downs.</figcaption></figure><p>The screenshot above is an excerpt of the <strong>Web Vitals Report</strong> with daily accurate Core Web Vital metrics.</p><h3>Inaccurate daily CWV measurements: Google’s tools</h3><p>For daily CWV measurements we can’t rely on Google’s tools because they either aggregate over a long 28-day period or only measure single pages with synthetic, non Real-User Metrics (RUM). So it takes a lot of days to see any change within that period.</p><p>Still, Google provides a great — and very easy — overview of your CWV metrics to plan where to optimise next. But you can’t check the impact on CWV of your optimisation with these tools, e.g. the next day.</p><p><strong>Field data</strong> aka real-user experiences:</p><ul><li><a href="https://search.google.com/search-console">Google Search Console</a>: measures similar pages</li><li><a href="https://developers.google.com/speed/pagespeed/insights/">PageSpeed Insights</a>: measures a single page &amp; all pages as a whole</li><li>CrUX (Chrome UX Report): measures single pages &amp; all pages as a whole</li></ul><p><strong>Lab data</strong> aka synthetic user experience:</p><ul><li><a href="https://developers.google.com/web/tools/lighthouse">Lighthouse</a>: measures a single page</li><li><a href="https://developers.google.com/web/tools/chrome-devtools">Chrome DevTools</a>: measures a single page</li><li><a href="https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma?hl=en">Web Vitals Chrome Extension</a>: measures a single page</li></ul><h3>Rolling 28-day window explained</h3><p><em>I dedicate a paragraph to this in particular because the rolling 28-day window appears many times in CWV measurement — especially in how the field data is measured.</em></p><p>Imagine you had <strong>27 days</strong> of awful Cumulative Layout Shift (CLS) of 1.0 and on <strong>day 28</strong> you magically fix it to 0.</p><p>At <strong>day 28</strong> your average CLS would be 0.96 — which would be rounded up to 1.0 again:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/553e46662709fc9e44acf4f22af16469/href">https://medium.com/media/553e46662709fc9e44acf4f22af16469/href</a></iframe><p>In this example above your 1.0 to 0 CLS optimisation would <strong>take +23 days</strong> until you reach the allowed mobile CLS of 0.1.</p><p>See in the following table how slowly the average is decreasing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ce2559234dfb50f1340f141f5bb3cdc/href">https://medium.com/media/9ce2559234dfb50f1340f141f5bb3cdc/href</a></iframe><h3>More resources</h3><ul><li><a href="https://www.smashingmagazine.com/2021/04/complete-guide-measure-core-web-vitals/">An In-Depth Guide To Measuring Core Web Vitals</a></li><li><a href="https://groups.google.com/a/chromium.org/g/chrome-ux-report/c/PRGtZJvmGkw/m/rzQV99-kCAAJ">Google Forum: Explanation different data points in different tools</a></li><li><a href="https://tamethebots.com/blog-n-bits/monitoring-search-console-core-web-vitals">Tracking Changes in Search Console’s Ore Web Vitals Report</a></li></ul><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f3b4f48bd6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How List Rendering Can Cause Huge Cumulative Layout Shift]]></title>
            <link>https://medium.com/@zwacky/how-list-rendering-can-cause-huge-cumulative-layout-shift-385e12cb53bb?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/385e12cb53bb</guid>
            <category><![CDATA[web-perf]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Wed, 28 Jul 2021 16:02:26 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:48.648Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you…</p><ul><li>care about Core Web Vitals, especially Cumulative Layout Shift (CLS)</li><li>use list rendering with a JS Framework (v-for, *ngFor, …)</li></ul><p>If you answered both with yes, then please read on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4oA-z9P-x7v0-Aj3BsoTVg.gif" /><figcaption>Slow connection device causes 0.51 CLS upon updating a list.</figcaption></figure><p>JS frameworks — such as Vue, Angular or React — can cache DOM nodes of list items*. Filtering a list will therefore be faster, because DOM nodes of list items can potentially be reused. This reuse is done by moving the DOM nodes around, instead of re-creating them.</p><p>But when a list changes and the nodes of list items merely switch their positions, <strong>the reused items are considered as a shift in the DOM (CLS) by Core Web Vitals on slow connection devices</strong>.</p><p>*) Vue uses :key, React uses key, Angular uses *ngFor with trackBy</p><h3>Why only on slow connection devices?</h3><p>CLS takes user interaction into account. When content is changing after a click, it’s not counted towards the CLS until a grace period of 500ms. If the delay of content changing takes longer than 500ms, you’ll be penalised with the full CLS score.</p><p>Fast connection devices will usually finish updating the list before the grace period ends.</p><p>Keep an eye out in your Google Search Console for URLs that are frequented by countries that are further away from your servers/CDNs and have a lower average mobile bandwith.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDlawQhnQjIcfv0m5XVJgQ.png" /><figcaption>A whopping 433k Indian URLs are affected here by list rendering on slow connection devices.</figcaption></figure><h3>Solution</h3><p>Google’s calculation of CLS <a href="https://web.dev/evolving-cls/">has been changed before</a>, so I would love to see this here too. Until then it’s on us to not get penalised.</p><p>We’d have to make sure, that the DOM elements get re-created everytime a list gets updated or filtered. I wouldn’t advise to completely drop the unique key (:key). Rather think of a key for each list item that is tied to the request itself, e.g. :key=&quot;item.id + &quot;-&quot; + requestQuery&quot;. The filtering itself will have a brief flash due to recreating the DOM node, but considering the Green URLs that Google will give you it’s worth it.</p><p>With this you can continue with infinite scroll and page navigation without perf loss.</p><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385e12cb53bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Core Web Vitals explained with GIFs]]></title>
            <link>https://medium.com/geekculture/what-are-core-web-vitals-f9aba01353cd?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9aba01353cd</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Wed, 21 Jul 2021 05:45:57 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:54.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*7gzfqdLk4RNguH0gGsVhvw.png" /></figure><p>With Google’s June 2021 update Core Web Vitals (CWV) will become a factor in SEO ranking. It measures the quality of a site by these three metrics: <strong>LCP</strong>, <strong>FID</strong> and <strong>CLS</strong>.</p><p>If you pass all of them them, Google will reward you with more visibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnxthDIq2UpBvIynIobquQ.png" /><figcaption>Passing your Core Web Vitals and google will reward you with visibility.</figcaption></figure><p>You can check how well you do on these metrics via several ways:</p><ul><li><a href="https://developers.google.com/speed/pagespeed/insights/">Pagespeed Insights</a></li><li><a href="https://search.google.com/">Search Console</a></li><li><a href="https://web.dev/measure/">WebDev Measure</a></li><li>Chrome DevTools &amp; Lighthouse</li><li><a href="https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma?hl=en">Web Vitals Chrome Extension</a></li><li><a href="https://github.com/GoogleChrome/web-vitals#send-the-results-to-google-analytics">Custom event tracking with Google Analytics</a></li></ul><h3>Largest Contentful Paint (LCP)</h3><blockquote>LCP marks the point in the page load timeline when the page’s main content has likely loaded.</blockquote><blockquote><a href="https://web.dev/lcp/">— web.dev</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*aEpN5sH9zJlZGN6t.gif" /><figcaption>LCP will keep changing until the Largest Contentful Paint is done, which here is at 1.766s</figcaption></figure><p>The faster you make the biggest content on the above-the-fold appear, the better your metric will be.</p><p>If you can preload the biggest image already, e.g. with &lt;link rel=&quot;preload&quot; href=&quot;...&quot;&gt; or make the content appear without rendering it with your Javascript Framework, you’ll win big.</p><p>Causes of LCP:</p><ul><li>Slow server response times</li><li>Render-blocking Javascript and CSS</li><li>Slow resource load times</li><li>Client-side rendering</li></ul><h3>First Input Delay (FID)</h3><blockquote>FID measures the time from when a user first interacts with a page to the time when the browser is actually able to begin processing event handlers in response to that interaction.</blockquote><blockquote><a href="https://web.dev/fid/">— web.dev</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*beBAq3moe4ul3c6S.gif" /><figcaption>0.666s pass until you see the website working with your interaction.</figcaption></figure><p>Javascript is synchronous and single-threaded. If a user interaction happens while the thread is busy, the user has to wait. If you have too many libraries that load at runtime, worse even if you don’t need them right away, this can increase the FID.</p><p>It’s similar to <a href="https://web.dev/tti/">TTI (Time to Interactive)</a> that you might have heard of already. However FID will only start to be measured from the user interaction. Whereas TTI will be measured from the very start of loading the site.</p><p>Causes of FID:</p><ul><li>too much javascript code to execute right away, especially 3rd party</li><li>ad networks can push lots of unneeded Javascript</li><li>not using code-splitting (e.g. with <a href="https://webpack.js.org/guides/code-splitting/">webpack</a>, <a href="https://rollupjs.org/guide/en/#code-splitting">Rollup</a>, <a href="https://parceljs.org/code_splitting.html">Parcel</a>)</li></ul><h3>Cumulative Layout Shift (CLS)</h3><blockquote>CLS is a measure of the largest burst of layout shift scores for every unexpected layout shift that occurs during the entire lifespan of a page.</blockquote><blockquote><a href="https://web.dev/cls/">— web.dev</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*WVZ4_zhgx5w6VwPe.gif" /><figcaption>CLS is happening here that makes the content jump around.</figcaption></figure><p>Layout shifts only happen when an element higher up is making other elements move. If the element is changing and there is nothing after it, it doesn’t count as a layout shift — as well as DOM changes that were caused by a user interaction with a grace period (500ms).</p><p>Note: Mobile viewports and 3G devices will cause much more CLS. Make sure to throttle your connection while optimising your page for these metrics.</p><p>Causes of CLS:</p><ul><li>images without size attributes</li><li>requests finish later that will inject content above existing content</li><li>lazy loaded components</li></ul><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9aba01353cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/what-are-core-web-vitals-f9aba01353cd">Core Web Vitals explained with GIFs</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pimp Your GitHub Profile with Books You Read]]></title>
            <link>https://medium.com/@zwacky/pimp-your-github-profile-with-books-you-read-e82aba4ab5fd?source=rss-946efead98b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e82aba4ab5fd</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Simon Wicki]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 10:23:22 GMT</pubDate>
            <atom:updated>2022-02-01T13:53:59.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XiBbqEfx1w0T9Vt3.png" /><figcaption>Keep the books you read in sync with your GitHub profile README</figcaption></figure><p>In this post I’d like to show you how to use GitHub Actions to automatically sync your Goodreads books you read in your GitHub profile README.</p><p>I created goodreads-profile-workflow for devs that love to read and like to share what they read. You can customise the input parameters to your liking: list the books you’re currently reading, last 5 books you read and even add your personal ratings, too.</p><blockquote><strong>GitHub Repo:</strong> <a href="https://github.com/zwacky/goodreads-profile-workflow">https://github.com/zwacky/goodreads-profile-workflow</a></blockquote><blockquote><strong>GitHub Action Name:</strong> Goodreads Profile Workflow</blockquote><p>Leave a star on the repo if you think it’s cool!</p><h3>GitHub Actions and Profile READMEs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k9c8iZDxx6YUqt4r.png" /></figure><p>When you head over to your GitHub profile page, <a href="https://github.com/zwacky">https://github.com/zwacky</a> in my case, you’ll see that you can do more than just pin repositories. If you’re missing yours, check out the <a href="https://docs.github.com/en/github/setting-up-and-managing-your-github-profile/managing-your-profile-readme">official docs on GitHub</a> to get one, too.</p><p>Keeping your profile README fresh with up-to-date data is a great way to show your visitors what you’re up to or what you’ve been working on. Either you do it manually or you automate it with the help of GitHub Actions. They can run workflows periodically and update your README for you.</p><p>There are tons of great ones out there. Have a look at the great list <a href="https://github.com/abhisheknaiidu/awesome-github-profile-readme">awesome-github-profile-readme</a> repo for inspiration. They include GitHub Actions that can:</p><ul><li>update your latest blog entries</li><li>update your GitHub activity</li><li>or even update your sleep data from your sleep tracker</li></ul><h3>How To Use</h3><p>I’ll quickly explain here how to use goodreads-profile-workflow and what the GitHub Actions do. For a full step-by-step guide read the <a href="https://github.com/zwacky/goodreads-profile-workflow#how-to-use">how to use section</a> of the project.</p><h4>#1 Add placeholders to your README</h4><p>Your README.md will be updated and eventually updated every hour by the GitHub Action. So it needs to know where the list begins, and where it ends. The content inbetween will then be replaced with the latest content. As an example it could look like this:</p><pre># Hey there 👋<br>I&#39;m Simon and live in Berlin as a Freelance Frontend developer.</pre><pre># Last 5 Books I&#39;ve Read 🤓<br>&lt;!-- GOODREADS-LIST:START --&gt;<br>&lt;!-- GOODREADS-LIST:END --&gt;</pre><p>You can customize the GOODREADS-LIST tags, so you can have multiple workflows updating different sections in your README. This is also what I’m using to get to the screenshot at the top of this post.</p><h4>#2 Create a workflow file</h4><p>Create a file in your own GitHub profile repo so it’s located at: {REPO}/.github/workflows/goodreads-books-workflow.yml.</p><p>GitHub Actions look for *.yml files in the /.github/workflows directory. These files are called workflows.</p><p>In this workflow file you can paste the following:</p><pre>name: Latest book list from goodreads<br>on:<br>  schedule: # Run workflow automatically<br>    # This will make it run every hour<br>    - cron: &quot;0 * * * *&quot;<br>    # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly<br>  workflow_dispatch:<br>jobs:<br>  update-readme-with-goodreads-books:<br>    name: Update this repo&#39;s README with what you&#39;re currently reading<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v2<br>      - uses: zwacky/goodreads-profile-workflow@main<br>        with:<br>          # Replace this with your goodreads user id (go to &quot;My Books&quot; on goodreads to see it in the URL)<br>          goodreads_user_id: &quot;92930971&quot;<br>          shelf: &quot;currently-reading&quot;</pre><p>The last lines are input parameters. Make sure you change them with your Goodreads ID.</p><p>Have a look at all the <a href="https://github.com/zwacky/goodreads-profile-workflow#inputs">input parameters and template variables</a> that goodreads-profile-workflow support.</p><h4>#3 Commit and trigger the workflow</h4><p>If you head over to the Actions tab in the repo. You should see your “Latest book list from goodreads” workflow. This is also where you can see if the job ran successfully or if there is an issue or typo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bcfhVzRJibM_xV_B.png" /></figure><p>Alternatively you could also wait until the scheduler picks up on the &quot;0 * * * *&quot; setting (every hour) in the yml workflow.</p><h4>#4 Done 🎉</h4><p>Hope you find this workflow useful! Please reach out via <a href="https://github.com/zwacky/goodreads-profile-workflow/issues">GitHub issues</a> or <a href="https://twitter.com/zwacky">Twitter</a>. Excited to hear from all the different reading lists and how your profile looks. Please consider leaving a GitHub star.</p><p>Simon Wicki is a Freelance Developer in Berlin. Worked on Web and Mobile apps at JustWatch. Fluent in Vue, Angular, React and Ionic. Passionate about Frontend, tech, web perf &amp; non-fiction books.</p><p><strong>👉 </strong><a href="https://twitter.com/zwacky"><strong>Join me on Twitter to follow my latest updates.</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e82aba4ab5fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>