<?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[Clio + Calliope - Medium]]></title>
        <description><![CDATA[Our expert team builds clean, beautiful, and easy-to-use websites and mobile apps. Let’s create something together. - Medium]]></description>
        <link>https://medium.com/clio-calliope?source=rss----c9dcd285ee5a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Clio + Calliope - Medium</title>
            <link>https://medium.com/clio-calliope?source=rss----c9dcd285ee5a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:07:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/clio-calliope" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Show me the money: Justifying performance improvements using Google Analytics]]></title>
            <link>https://medium.com/clio-calliope/show-me-the-money-justifying-performance-improvements-using-google-analytics-caefe36dc30?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/caefe36dc30</guid>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Thu, 13 Jun 2019 14:29:17 GMT</pubDate>
            <atom:updated>2019-06-13T14:29:17.084Z</atom:updated>
            <content:encoded><![CDATA[<p>Trying to convince your company to make site load speed improvements? Maybe Google Analytics can help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UoTRl0SGiyDB5_8t9XJ1GA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/MNXaW_ABlZY?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">lucas Favre</a> on <a href="https://unsplash.com/collections/1815009/checkout?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Many of us who love the web and want to make it fast feel like we’re shouting out into the ether that <a href="https://developers.google.com/web/fundamentals/performance/why-performance-matters/">performance matters</a>, but I’m not sure anyone is listening. We write articles, give talks, organize whole conferences, and we even have a hashtag (#PerfMatters)! But, many companies still don’t listen. It’s not their fault necessarily.</p><blockquote>The business doesn’t care about having a fast site. It cares about making money.</blockquote><blockquote>—<a href="https://medium.com/u/b4b787f78cda">Elizabeth Sweeny</a> and <a href="https://medium.com/u/6d5456230083">Paul Irish</a> talking about speed at Google I/O 2019</blockquote><p>Businesses see pushing features as the primary activity that will increase revenue. They find it hard to picture themselves in all the <a href="https://wpostats.com/">stats about companies who have seen bottom-line impacts after improving performance</a>.</p><p><strong>We need to reframe the argument in terms of them making money. </strong>Not some other company, them. They don’t want to gamble based on some other company’s experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1AbrOc68hlAn1cqFztE1Xg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/7H7KVCihBvI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Carl Raw</a> on <a href="https://unsplash.com/collections/1815009/checkout?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This is where Google Analytics (GA) comes in handy. Most businesses already use it, and if they don’t, it’s a quick thing to add. To get the most out of this exercise, you will want to have revenue tracking in your analytics account as well (advanced e-commerce). If you do not have that set up yet, you can still track bounce rates and other metrics by page load speed.</p><p>In the rest of this post, I’ll show you how to gather and analyze the data related to load performance so that you can use it to justify work to improve performance.</p><h3>Step 0: Clean up your data</h3><p>Beware the bots. We want our data to be relevant, and unfortunately, a lot of bots out there access our websites and web applications. First, check to see if you already have bot filtering enabled. Go to <em>Admin &gt; View Settings</em>, and scroll down to find the <em>Bot Filtering</em> setting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLrHEaiFWEn81FvWsCSvUw.png" /><figcaption>Exclude all hits from known bots and spiders.</figcaption></figure><p>Before you save a filter, preview the changes to make sure you’ll get the desired effects. You can create a test view first.</p><p>We already had this setting checked, but by chance, I found that we had nearly 15% of our users coming from bots using AWS data centers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*4lgwsKP61gdc_DVy_Is4TA.png" /><figcaption>The ISP “amazon data services nova” accounted for nearly 15% of our users.</figcaption></figure><p>This isn’t good. Go to <em>Technology &gt; Network</em> and see if some variation of “amazon data services” shows up in your Service Provider list. Luckily other people have written about this, so the steps to filter out these kinds of bots are already outlined in <a href="https://www.glowmetrics.com/blog/analytics-bot-spam-amazon/">this article by GlowMetrics</a>.</p><h3>Step 1: Check your page speed sample rate</h3><p>By default, only 1% of users will be tracked for speed metrics in Google Analytics. If your business gets a lot of traffic, this sample rate might be fine. If not, you might want to bump it up at least temporarily to both establish a baseline before changes and see the results after.</p><p>First, how much data are you getting? Go to <em>Behavior &gt; Site Speed &gt; Overview</em>. You should see a statement like “XX of pageviews sent page load sample”. For us, this wasn’t a high enough number for that time period to effectively bucket page loads later. You can see your page timings buckets by going to <em>Behaviour &gt; Site Speed &gt; Page Timings</em>. By default, it puts you in the <em>Explorer</em> tab. Switch over to the <em>Distribution</em> tab, and you will see page load buckets, and how big the sample is, and the distribution for each:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Jy2qpHtuQ5TrCc7wlvcg5Q.png" /><figcaption>Page Load Time Buckets view in Google Analytics</figcaption></figure><p>These sample sizes are fine for seeing a simple distribution of page load times, but once we start segmenting those buckets into bounce rates, made a purchase, etc., the sample sizes quickly become too small.</p><p>If you determine you need to increase your sample rate, use the siteSpeedSampleRate field when creating your tag (<a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#siteSpeedSampleRate">docs</a>):</p><pre>ga(&#39;create&#39;, &#39;UA-XXXX-Y&#39;, {&#39;siteSpeedSampleRate&#39;: 10});</pre><h3>Step 2: Wait</h3><p>Gather baseline data. A month will give you a more solid baseline not subject to daily variations which might happen in a shorter report of a week or less.</p><h3>Step 3: Set up your report</h3><p>Now that you have some data to work with, let’s dive in and chop it up. Once logged in to your Google Analytics dashboard, go to the <em>Behavior &gt; Site Speed &gt; Page Timings</em> section.</p><ol><li>In the top right, change the time period to your desired time period. 10,000–20,000 total data points would be a good starting point to make sure the buckets we analyze don’t get too small.</li><li>By default, you will be in the <em>Explorer</em> tab. Switch to the <em>Distribution</em> tab to see your page timing buckets:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-cYi1yuIN7DE15KHMBa8g.png" /><figcaption>Page Timings, Distribution tab</figcaption></figure><p>Already, we can see some great data like our average page load time and then buckets of how many users experienced page load times of 0–1 sec, 1–3 sec, 3–7 sec, and so on. By expanding each of these buckets, you can see even finer grained data for each bucket. These smaller buckets vary by size from 0.2 seconds to 2 seconds to 15 seconds as you go into the higher load time brackets.</p><p>This is great, but what we’d really like to know is the bounce rate and the rate of users making a purchase for each bucket (or any key performance metric for the company). We can do this with segmenting. Above the chart and tabs, click on the <em>+Add Segment</em> button. Add <em>Bounced Sessions</em> and <em>Made a Purchase</em> (if you have advanced e-commerce enabled) to the segments. If another metric is vital to the business, select that one.</p><p>We now have a page-speed-bucketed chart for all views, bounced sessions, and views that resulted in a purchase. The only problem is that the percentages aren’t very useful — they show the percent of total views, not the percent of views in that bucket:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I2K4gvm-M-OKiClKsYWwgA.png" /><figcaption>Segmented chart showing percent of TOTAL, not of that bucket</figcaption></figure><h3>Step 4: Make your argument</h3><p>To make our argument, we’re going to need to calculate the bounce and purchase rates within each bucket. For example, in the above screenshot, to calculate the purchase rate for users with a 1–3 second load time, divide 1,987 by 9,205 to give 21.6%. Repeat this for all buckets and for bounce rate.</p><p>You can export the top-level data and do this calculation in a spreadsheet. Unfortunately, the export does not include the finer-grained buckets. You would need to manually copy that data over for analysis if desired.</p><p>Now we can generate charts to share with the decision makers that show how both purchase rate declines and bounce rate increases as page load time increases for a user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEouRufcIU47Vl0ACjpzhA.png" /><figcaption>Made a purchase vs page load time showing decreased purchase rate with increased page load times</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ue-ONRqynEthi6hZ9mU7lA.png" /><figcaption>Bounce rate vs page load time showing increased bounces with increased page load times</figcaption></figure><p>Want to go the extra mile? Calculate theoretically how much more money they might earn if you improve site speed by, say, 1 second. Determine the average revenue per purchase then move each bucket over by 1 second and calculate the difference in total revenue between the two scenarios.</p><h3>Step 5: Improve performance</h3><p>You’ve convinced the company to let you make performance improvements. Congratulations! Now you have to do the real work. Don’t know how to get started? <a href="https://web.dev/fast">web.dev/fast</a> is a good starting point.</p><h3>Step 6: Make it rain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJ6vP9H25lAt1c0bneCpsg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/mMD6mossbVk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andrew Worley</a> on <a href="https://unsplash.com/collections/1815009/checkout?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Once you’ve deployed your performance improvements, don’t forget to compare the before and after data for your key business metrics. By preparing analyses like these for our companies, we can better establish ourselves as trusted business partners… and do less work next time we need to convince them to invest in performance, whether that’s page load time, long-running JavaScript, paint, user experience, perceived performance or anything else related to performance.</p><p>Do you have a story about convincing your company to invest in performance? I’d love to hear about it in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caefe36dc30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/show-me-the-money-justifying-performance-improvements-using-google-analytics-caefe36dc30">Show me the money: Justifying performance improvements using Google Analytics</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Google Fonts Faster⚡]]></title>
            <link>https://medium.com/clio-calliope/making-google-fonts-faster-aadf3c02a36d?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/aadf3c02a36d</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[google-fonts]]></category>
            <category><![CDATA[web-performance]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Wed, 06 Feb 2019 16:54:29 GMT</pubDate>
            <atom:updated>2021-01-05T21:24:35.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Pld27Xc5xqA0eJpVQxiMw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/tFdt_ztePy4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Bob Newman</a> on <a href="https://unsplash.com/collections/3603769/font?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (cropped)</figcaption></figure><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><p>If you use Google Fonts on your website or web application, a few additional steps can lead to much faster load times. In this article, I will show you how to:</p><ol><li>Skip over some of the latency time for downloading fonts from Google Fonts</li><li>Self-host your fonts for faster speed and greater control over FOIT and FOUT</li><li>Do the same as #2 but more quickly with a cool tool</li></ol><h3>But Why?</h3><p>Google Fonts is hosted on a pretty fast and reliable content delivery network (CDN), so why might we consider hosting on our own CDN?</p><p>Let’s take a step back and look at what is happening when you request from Google Fonts using a standard &lt;link&gt; copied from their website:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fad54ef90a8366787f112f712f27c679/href">https://medium.com/media/fad54ef90a8366787f112f712f27c679/href</a></iframe><p>Did you notice that the link is for a stylesheet and not a font file? If we load the link’s <a href="https://fonts.googleapis.com/css?family=Muli:300,400,700|Oswald:500">href</a> into our browser, we see that Google Fonts loads a stylesheet of @font-face declarations for all the font styles that we requested in every character set that is available. Not all of these are used by default, thankfully.</p><p>Then, each @font-face declaration tells the browser to use a local version of the font, if available, before attempting to download the file from fonts.gstatic.com:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d7845e360173e2d89c43afa84126e2d/href">https://medium.com/media/0d7845e360173e2d89c43afa84126e2d/href</a></iframe><p>So what’s the problem?</p><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><p>First, we have a minimum of 2 separate requests to different hosts — first for the stylesheet at fonts.googleapis.com, and then to a unique URL for each font hosted at fonts.gstatic.com. This makes it impossible to take advantage of <a href="https://developers.google.com/web/fundamentals/performance/http2/#request_and_response_multiplexing">HTTP/2 multiplexing</a> or <a href="https://twitter.com/addyosmani/status/743571393174872064?lang=en">resource hints</a>.</p><p>You may be asking yourself, “Why can’t I just use the direct link to the font?” Google Fonts are updated often so you might find yourself trying to load a font from a link that no longer exists pretty quickly. 🤦🏾</p><p>The second problem we encounter with Google Fonts is that we have no control over flash-of-invisible-text (FOIT) and flash-of-unstyled-text (FOUT) while fonts are loading. Setting the <a href="https://font-display.glitch.me/">font-display</a> property in the @font-face would give us that control, but it’s defined in the Google Fonts stylesheet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HNnPte3sxH--G7e69LxiQ.png" /><figcaption>FOIT in action — note the missing navbar text in the filmstrip screenshot (throttled to slow 3G)</figcaption></figure><p>Finally, while rare, if Google Fonts is down, we won’t get our fonts. If our own CDN is down, then at least we are consistently delivering nothing to our users, right? 🤷🏻️</p><h3>If you do nothing else, at least preconnect…</h3><p>The only basic performance improvement we can do with Google Fonts hosting is warming up the DNS lookup, TCP handshake, and TLS negotiation to the fonts.gstatic.com domain with <a href="https://www.igvita.com/2015/08/17/eliminating-roundtrips-with-preconnect/">preconnect</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac0402c31a096484d9694119c429dce9/href">https://medium.com/media/ac0402c31a096484d9694119c429dce9/href</a></iframe><p>Why? If you don’t warm up the connection, the browser will wait until it sees the CSS call font files before it begins DNS/TCP/TLS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYOf7T6mi1MXnjYMvpwcwA.png" /><figcaption>Loading Google Fonts without preconnect</figcaption></figure><p>This is wasted time because we KNOW that we will definitely need to request resources from fonts.gstatic.com. By adding the preconnect, we can perform DNS/TCP/TLS before the socket is needed, thereby moving forward that branch of the waterfall:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYNZDlQHM0n0TXO5Dtu_4g.png" /><figcaption>Loading Google Fonts with preconnect to fonts.gstatic.com</figcaption></figure><h3>Even better: self-host for full control</h3><p>It would be even better if we had full control over our font files, loading, and CSS properties. Luckily, <a href="http://mranftl.com/">Mario Ranftl</a> created <a href="https://google-webfonts-helper.herokuapp.com/fonts">google-webfonts-helper</a> which helps us do exactly that! It is an amazing tool for giving us font files and font-face declarations based on the fonts, charsets, styles, and browser support you select.</p><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><h4>Step 1: Use google-webfonts-helper to download our fonts and provide basic CSS font-face declarations</h4><p>First, select the Google font you need from the left sidebar. Type in the search box for a filtered list (red arrow), then click on your font (blue arrow):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owWgq7LgSXOK-Oe0Qw4ZWQ.png" /><figcaption>Step 1: Select a font.</figcaption></figure><p>Next, select your character sets and styles. Remember that more styles mean more for the client to download:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t29nY29jwZvUUp9OkqQstg.png" /><figcaption>Select your character sets and styles (weight and style).</figcaption></figure><p>Different fonts have different levels of character support and style options. For example, Open Sans supports many more charsets than Muli:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9TaDlOu8D04s3BF6hN1aw.png" /><figcaption>Open Sans supports many more character sets including Cyrillic, Greek, Vietnamese, and extended sets.</figcaption></figure><p>Your final choice is which browsers you want to support. “Modern Browsers” will give you WOFF and WOFF2 formats while “Best Support” will also give you TTF, EOT, and SVG. For our use case, we chose to only host WOFF and WOFF2 while selecting system fonts as fallbacks for older browsers. Work with your design team to decide the best option for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEwsyAj3pSgjwCf6m7ks0A.png" /><figcaption>Select “Best Support” for all file formats or “Modern Browsers” for only WOFF and WOFF2.</figcaption></figure><p>After selecting a browser support option, copy the provided CSS into your stylesheet near the beginning of your stylesheets before you call any of those font families. We choose to put this at the top of our variables partial when using SCSS. You can customize the font file location — the default assumes ../fonts/.</p><p>Finally, download your files. Unzip them, and place them in your project in the appropriate location.</p><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><h4>Step 2: Loading Optimization</h4><p>So far, we have only moved where we are hosting files from Google’s servers to ours. This is nice, but not good enough. We want our font files to start downloading right away, not after the CSS is parsed and the CSSOM is created.</p><p>We can do this with the <a href="https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/">preload</a> resource hint:</p><blockquote>Preload is a declarative fetch, allowing you to force the browser to make a request for a resource without blocking the document’s <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onload">onload</a> event.</blockquote><blockquote>— from <a href="https://medium.com/reloading/preload-prefetch-and-priorities-in-chrome-776165961bbf">“Preload, Prefetch And Priorities in Chrome”</a> by <a href="https://medium.com/u/2508e4c7a8ec">Addy Osmani</a></blockquote><p><strong>Warning</strong>: Before we go any further, make sure you understand that preload will load a resource whether you use it or not. Only preload resources that are needed on a particular page.</p><p>How do we choose which file type to preload? Resource hints are not available in every browser, but all the browsers that support <a href="https://caniuse.com/#search=preload">preload</a> also support <a href="https://caniuse.com/#search=woff2">WOFF2</a> so we can safely choose only WOFF2.</p><p>In your HTML file, add resource hints for all WOFF2 font files you need for the current page:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72a99a3a1feaaa8cbd89fde30d40cd01/href">https://medium.com/media/72a99a3a1feaaa8cbd89fde30d40cd01/href</a></iframe><p>Let’s break down our preload &lt;link&gt; element:</p><ul><li>rel=&quot;preload&quot; tells the browser to declaratively fetch the resource but not “execute” it (our CSS will queue usage).</li><li>as=&quot;font&quot; tells the browser what it will be downloading so that it can set an appropriate priority. Without it, the browser would set a default low priority.</li><li>type=&quot;font/woff2 tells the browser the file type so that it only downloads the resource if it supports that file type.</li><li>crossorigin is required because fonts are fetched using anonymous mode CORS.</li></ul><p>So how did we do? Let’s take a look at the performance before and after. Using webpagetest.org in easy mode (Moto G4, Chrome, slow 3G), our speed index was 4.147s using only preconnect, and 3.388s using self-hosting plus preload. The waterfalls for each show how we are saving time by playing with latency:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WUW7Q3Lsw8_mSjfQYDKPw.png" /><figcaption>Loading from Google with preconnect to fonts.gstatic.com</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPlj6igUcBeqfGUul4hIUA.png" /><figcaption>Self-hosting fonts and using preload</figcaption></figure><h4>Step 3: Fix FOIT and FOUT (optional)</h4><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><p>Different people have different opinions on FOIT (flash of invisible text) and FOUT (flash of unstyled text). For the most part, we prefer to show text as fast as possible even if that means a pesky transition to our preferred font once it loads. For strongly branded content, you may want to keep a FOIT over showing off-brand fonts.</p><p>If you’re okay with FOUT, or flash of unstyled text, then we can fix FOIT by adding font-display: swap; to our @font-face declarations.</p><p>Check out all your font-display options in <a href="https://font-display.glitch.me/">this fun Glitch playground</a> by <a href="https://medium.com/u/41ab257b5c9">Monica Dinculescu</a>.</p><h3>subfont</h3><p>So what if you don’t want to go through all of these steps? The <a href="https://github.com/Munter/subfont">subfont</a> npm package will do this in addition to dynamically subsetting your fonts at build. It takes some more set-up time, but it’s definitely worth a try.</p><p>Are you a fan of <a href="https://www.gatsbyjs.org/">Gatsby</a>? There’s even a <a href="https://www.gatsbyjs.org/packages/gatsby-plugin-subfont/">subfont plugin</a> for it.</p><h3>Sarah Drasner on Twitter</h3><p>🚀 Day 3 of #devAdvent: SubFont, by @_munter_! There are best practices for font loading performance that can shave second of load time. With Subfont, Peter automated the whole process. I used to do a lot of this by hand, now it&#39;s quick as an npm i! https://t.co/yukja6AqsX</p><h3>Additional Considerations</h3><h3>*** This post is outdated! ***</h3><h3>You can read the version updated for 2021 on my site at:</h3><p><a href="https://sia.codes/posts/making-google-fonts-faster/">https://sia.codes/posts/making-google-fonts-faster/</a></p><h4>Host static assets on a CDN</h4><p>One thing Google Fonts does offer is a fast and reliable content delivery network (CDN). You should also host your static assets on a CDN for faster delivery to users in different regions. We use AWS <a href="https://www.googleadservices.com/pagead/aclk?sa=L&amp;ai=DChcSEwi1rNzkpf3eAhVDuMAKHWjAD3UYABAAGgJpbQ&amp;ohost=www.google.com&amp;cid=CAESQOD2jI5wXrtdliZn6eINII1ojoSWji97Nr_okbIjQspcJVCaoLSb8ez8l5lcExVZjcuqwfvj9HzIuHp_RtmTFGw&amp;sig=AOD64_0kKknCMjunet6xH68QLsm7qXPIHA&amp;q=&amp;ved=2ahUKEwiSzdHkpf3eAhUI0oMKHXl9DicQ0Qx6BAgFEAE&amp;adurl=">S3</a> plus <a href="https://aws.amazon.com/cloudfront/">Cloudfront</a>, the CDN service offered by Amazon, but many options exist.</p><h4>Size and Popular Fonts</h4><p>In some of my tests for our company website, I noticed smaller font file sizes for some fonts hosted by Google. My theory is this is due to Google’s variants for optimization:</p><blockquote><a href="https://fonts.google.com/">Google Fonts</a> maintains 30+ optimized variants for each font and automatically detects and delivers the optimal variant for each platform and browser.</blockquote><blockquote>— from <a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#reducing_font_size_with_compression">Web Font Optimization</a> by <a href="https://medium.com/u/2578f746f852">Ilya Grigorik</a></blockquote><p>In addition, very popular fonts like Open Sans and Roboto are likely to exist in your users’ cache. Hopefully, in a future post I can explore HTTPArchive data and give you an idea for which fonts are the most popular.</p><p>So, before you commit to a path of self-hosting, compare the tradeoffs of byte sizes and speed/control.</p><p>Want to see all the sample code and performance results? <a href="https://github.com/siakaramalegos/google-fonts-self-hosting">Here is the repo</a>.</p><h3>Resources you should checkout</h3><ul><li><a href="https://medium.com/reloading/preload-prefetch-and-priorities-in-chrome-776165961bbf">Preload, Prefetch And Priorities in Chrome</a></li><li><a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#preload_your_webfont_resources">Web Font Optimization | Web Fundamentals | Google Developers</a></li><li><a href="https://font-display.glitch.me/">Font-display playground</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aadf3c02a36d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/making-google-fonts-faster-aadf3c02a36d">Making Google Fonts Faster⚡</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My adventures in turning a Pixelbook into a developer machine]]></title>
            <link>https://medium.com/clio-calliope/my-adventures-in-turning-a-pixelbook-into-a-developer-machine-a2fe70077c12?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2fe70077c12</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[chromebook]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 22:12:58 GMT</pubDate>
            <atom:updated>2019-11-09T00:40:13.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30q0Oao9CcZsm9vLMMXpiA.png" /><figcaption>My favorite view of the ultra-thin <a href="https://store.google.com/us/config/google_pixelbook">Pixelbook</a> by Google</figcaption></figure><p>Today the FedEx man delivered my brand new Pixelbook. So much fun! I got this little tool to attempt to get off of the Mac platform without going full Linux distro. For the most part, I do web development and only need (1) a terminal, (2) an editor, preferably VS Code, and (3) a browser. Since Chrome OS deployed the new Linux beta, all these things are now possible with fewer install headaches than before. These are my adventures in trying to turn it into a dev machine.</p><h3>Step 1: Give it a chance to update before panicking</h3><p>Don’t fret that the Linux beta option doesn’t show up in your settings. First, check to see which Chrome OS you are on.</p><ol><li>Click on the clock.</li><li>Open Settings</li><li>Click on the hamburger menu</li><li>Select “About Chrome OS”</li></ol><p>You should then see your current version and whether it is checking for updates. Version 70 was the latest stable for me, though the Linux beta came out in version 69. After updating, Chrome OS will require a restart.</p><h3>Step 2: Turn on Linux</h3><p>Open your Settings again. Scroll down, and you will find a setting for the Linux beta:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_U5BrpqIPRQ0MoOfiDOdw.png" /><figcaption>Linux (Beta) setting in Chrome OS. Oh hai, <a href="https://chrome.google.com/webstore/detail/momentum/laookkfknpbbblfpciffpaejjkokdgca?hl=en">Momentum</a>!</figcaption></figure><p>After you turn on the flag, it will download and open a terminal!! 🤯🤯🤯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Vvc7_HFCevl15qL-FzCIw.png" /><figcaption>Terminal systems are go!</figcaption></figure><p><em>Note: You may have struggled like me to copy-paste things into this new terminal. Try ctrl-shift-V instead of just ctrl-V.</em></p><p>I like tools that make me faster, so I immediately attempted to installzsh and oh-my-zsh, and that’s when I came across my next problem…</p><h3>3. WTF is the password in terminal?</h3><p>It’s <a href="https://www.reddit.com/r/chromeos/comments/9hzrzm/linux_beta_user_password/">a little unclear</a>, but you can update it as follows:</p><ol><li>Switch to root with $ sudo su</li><li>Run passwd your-username-here</li><li>It will prompt you twice for a new password. To exit, type exit</li></ol><p>Boom! Now you can install and update things in your terminal.</p><h3>4. Oh My Zsh!</h3><p>I debated on adding this section, but this article really is about <em>my</em> adventures in setting up my machine, so here goes. <a href="https://github.com/robbyrussell/oh-my-zsh">Oh My Zsh</a> is totally an easy cop-out I’ve used for setting up my terminal on every machine:</p><blockquote>Oh My Zsh is an open source, community-driven framework for managing your <a href="https://www.zsh.org/">zsh</a> configuration.</blockquote><p>It gives me a custom terminal prompt that I like and Git aliases. You just need to install Zsh and then Oh My Zsh:</p><pre>$ apt install zsh<br>$ sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)&quot;</pre><p>This worked like a breeze once I knew my password. 🤦</p><h3>5. ️VS Code</h3><p>By now you should know that I like things that make my life easy. As I type these words, I have not yet attempted to install VS Code. I hope I don’t have to delete this section. Hold on while I Google some stuff…</p><p>Success! Okay, it looks like we might not have access to the file system for files downloaded using Chrome. So instead, we need to download the .deb installer using curl and then install it:</p><pre>$ curl -L https://go.microsoft.com/fwlink/\?LinkID\=760868 &gt; code.deb<br>$ sudo apt-get install ./code.deb</pre><p>For the final test, see if it runs:</p><pre>$ code .</pre><p>Success! 🙌</p><p>Thanks to <a href="https://www.reddit.com/r/Crostini/comments/8f5zu8/from_scratch_to_vs_code/">this</a> Reddit post for the VS Code installation clues. It suggests a few other libs that they had to install because of bugs, but I have not come across any bugs yet. I’ll update this post if I come across those bugs later.</p><h3>6. Installing Node and NPM via NVM</h3><p>I chose to install Node and NPM via <a href="https://github.com/creationix/nvm">Node Version Manager</a>. Install via curl:</p><pre>$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash</pre><p>Then, add these 3 lines to your .zshrc (or .bashrc):</p><pre>export NVM_DIR=&quot;$HOME/.nvm&quot;<br>[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \. &quot;$NVM_DIR/nvm.sh&quot; <br>[ -s &quot;$NVM_DIR/bash_completion&quot; ] &amp;&amp; \. &quot;$NVM_DIR/bash_completion&quot; </pre><p>Then, restart your terminal or type source .zshrc or source .bashrc to have it load the updated run commands.</p><p>Check that it’s working with nvm -v, then you can install Node with nvm install node for the latest release of Node (and NPM).</p><p>Special thanks to <a href="https://medium.com/u/278317228bd3">Yulan Lin</a> for all her help with setting up my Pixelbook!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2fe70077c12" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/my-adventures-in-turning-a-pixelbook-into-a-developer-machine-a2fe70077c12">My adventures in turning a Pixelbook into a developer machine</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In search of an extremely-fast blog]]></title>
            <link>https://medium.com/clio-calliope/in-search-of-an-extremely-fast-blog-102aaac692b4?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/102aaac692b4</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[perfmatters]]></category>
            <category><![CDATA[markdown]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Thu, 11 Oct 2018 17:28:27 GMT</pubDate>
            <atom:updated>2018-10-11T17:28:26.914Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ZcQ193cPy3sEe6Mupx52Q.jpeg" /><figcaption>This pupper is extremely fast. Photo by <a href="https://unsplash.com/photos/CpkOjOcXdUY?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Leo Rivas</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I love <a href="https://reactjs.org/">React</a>. I love <a href="https://nextjs.org/">Next.js</a> and <a href="https://www.gatsbyjs.org/">Gatsby.js</a>. However, I want to push performance to the extreme. I want to see how fast I can make a blog that’s still reasonably easy to use from a developer standpoint. I don’t need React or any other front-end framework for a static blog.</p><p>Frameworks make developing easier, but we’re putting more and more stress on users’ devices and networks. If you’re only testing on your developer machine on fast, stable networks, then you’re not testing end-user performance. Also, the cost of JavaScript byte-for-byte is higher than all other assets. The time to parse, compile, and execute is often longer than the total time to load.</p><p>Thus, my search begins for an extremely-fast blog. Yes, I know Jekyll exists, but I want to do more, and use a modern build tool for better optimizations. Here are my goals at the moment:</p><ul><li>Write blog posts in markdown because it’s more fun.</li><li>Automatically generate the blog post pages.</li><li>Automatically generate the blog post index page.</li><li>Use as little runtime JavaScript as possible (preferably none).</li><li>Make it as fast as possible (e.g., automatically generate responsive images and perhaps webp formats too)</li></ul><p>Do you already have a tool that does this well? I’d love to hear about it! Does the idea of a tool like that sound exciting to you? I’ve started a side-project to try building this myself. I’d love your feedback on architecture or even your help contributing if you have time:</p><p><a href="https://github.com/siakaramalegos/modern-markdown-blog">siakaramalegos/modern-markdown-blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=102aaac692b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/in-search-of-an-extremely-fast-blog-102aaac692b4">In search of an extremely-fast blog</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 Ways I Took Back My Sanity]]></title>
            <link>https://medium.com/clio-calliope/8-ways-i-took-back-my-sanity-43f85e095d73?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/43f85e095d73</guid>
            <category><![CDATA[digital-distraction]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[stress-management]]></category>
            <category><![CDATA[happiness]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Wed, 26 Sep 2018 15:21:11 GMT</pubDate>
            <atom:updated>2018-09-26T16:04:08.830Z</atom:updated>
            <content:encoded><![CDATA[<h4>An inexhaustive list of ways I reduced stress and increased happiness</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYy605XrzpibtBtdwHbTKQ.jpeg" /><figcaption>This is not me but my spirit woman. Photo by <a href="https://unsplash.com/photos/VBoa34qcW4w?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Seth Doyle</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><p>Our lives aren’t our lives anymore. We distract ourselves with social media. We stress about negative news and discourse. We avoid the tough problems.</p><p>Over the last eight years, I’ve made a sea change in my levels of stress and happiness. I’m sharing my discoveries in the hopes that it can help you in your own journey to contentment.</p><p>Let’s be honest, this is a work in progress. No magical cures for stress or pathways to happiness exist. It makes a catchy title, but it also takes a lot of work. Yet, the rewards are worth it.</p><h3>No phones (or TVs) in the bedroom</h3><p><a href="https://www.health.harvard.edu/staying-healthy/blue-light-has-a-dark-side">The light from device screens disrupt our sleeping patterns</a>. The distraction of social media or games pull us away from reality. Since banning my phone from the bedroom, I’ve rediscovered the joy of reading. Another benefit I did not expect was a better night’s sleep. My body and mind came back to equilibrium. Level 1 stress reduction unlocked by keeping the bedroom sacred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_h5_AtZoCvGhZa4P46uNw.jpeg" /><figcaption>This may look cool, but don’t do it! Photo by <a href="https://unsplash.com/photos/J01KEXy3XQk?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tony Lam Hoang</a> on <a href="https://unsplash.com/search/photos/phone?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>Write morning pages</h3><p>Julia Cameron wrote <a href="https://amzn.to/2DCyUMi">The Artist’s Way</a> to help people discover their creative selves. One big pillar of the process is writing morning pages. Think of these like journal writing, but in the morning when you’ve first woken up. You have to write three whole pages which are only for your own consumption (i.e., not creative writing).</p><p>Writing my morning pages gives me the opportunity to get all my worries out. Then I move on with the rest of my day without them holding me back. The pages also give me an opportunity to contemplate issues more deeply. I often come up with more creative solutions to my problems on that final page. The length is important — the first page and a half are easy. It’s the final page and a half where both the real work and the real benefit come in.</p><p>Because I’m an organizational freak, writing also helps me organize my day and prioritize tasks before I get caught up in email and social media. The back of my notebook has all sorts of to-do lists and notes (including my notes for this article).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YzTXL94lOxXrenb0rDTEg.jpeg" /><figcaption>It may or may not be against the rules to make coffee before writing. Photo by <a href="https://unsplash.com/photos/52AAiXWoVi0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Annie Spratt</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>List 3 joys daily</h3><p>Practicing gratitude for special moments has made me a more positive and happier person. When I’m finished writing my morning pages, I list out three things that gave me joy in the last 24 hours. I got this idea from Sheryl Sandberg in her book on grief, <a href="https://amzn.to/2DtI5i5">Option B</a>. For me, these are indispensable. They remind me daily to pause and enjoy the little things. I’ve learned so much about the things that make me happy, and now I actively seek them out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjpETBjuHtfn5khq7oRXsg.jpeg" /><figcaption>Put your joys to pen and paper. Photo by <a href="https://unsplash.com/photos/M4lve6jR26E?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">gabrielle cole</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>Just say no to social media</h3><p>Let’s be honest. Most social media platforms are <a href="https://www.psychologytoday.com/us/blog/get-out-your-mind/201409/the-unexpected-way-new-technology-makes-us-unhappy">cesspools of unhappiness</a>. From the unrealistic portrayals to the negative discourse, we don’t need that in our lives.</p><p>Unfortunately, I have to stay active on Twitter for work reasons. I’m a freelance developer and conference speaker. Twitter is my best source of networking and learning what’s new. <a href="https://medium.com/u/c2509fce86ff">Sarah Drasner</a> helped me make my timeline loads more positive and relevant with this suggestion:</p><h3>Sarah Drasner on Twitter</h3><p>🔥 If you want to see your timeline as chronological again, and without all the weird &quot;____ likes&quot; stuff, you can go to Settings and Privacy, scroll down, and uncheck the box that says &quot;Show the best Tweets first&quot; in the Content area. I personally love getting my timeline back!</p><p>Luckily, I can stay far away from Facebook. I haven’t deleted my account because I have so many relatives around the world on it. I reassure them that I am still alive by cross-posting to Facebook whenever I post to Instagram. And, I’ve curated my Instagram feed to show the things that bring me joy — great photography and creative inspiration.</p><blockquote>Trade in social media for real social interactions.</blockquote><p>Call that college friend you haven’t spoken to for three years. Go for high tea with your old work colleagues. Schedule a monthly wine and cheese Google hangout with your sisters.</p><p>PSA: Please don’t post your fun events only on Facebook. Many of us have cut the cord on it, but we still love you and want to come to your parties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ZrSfvyjoMCVk7z4A2SB9Q.jpeg" /><figcaption>Don’t believe the hype. These people are not happy. Photo by <a href="https://unsplash.com/photos/5AYP1yeaE3I?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">rawpixel</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>No screen Sunday</h3><p>Rediscover what life was like before we were perennially distracted by our devices and binge-worthy TV. You’ll find yourself cooking <a href="http://juliachildsrecipes.com/chicken-recipes/julia-childs-poulet-au-porto/">poulet au porto</a>, cleaning your ceiling fan, reaching out to an old friend to grab a coffee, or inviting friends over for <a href="https://amzn.to/2zu2eAL">European-style strategy games</a>.</p><p>It used to be difficult to fill our time. Without the distraction of screens, we do the things we missed doing for so long. Depending on your addiction level, you may experience a brief withdrawal process. Yes, even cleaning my ceiling fan was rewarding. My next goal: apply this to some of my work evenings as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJcngBFVIqS6gq2E6GpbBA.jpeg" /><figcaption>What fun could be in store when you turn off the screens? Photo by <a href="https://unsplash.com/photos/tOsKxvyNyDw?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Brenda Godinez</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>Declutter your possessions</h3><p>Yes, you’ve already heard of the <a href="https://amzn.to/2zsoDhO">KonMari method</a> of decluttering and organizing your life. I’m here to say it really works, and I haven’t even finished the process. Start with your clothes. Dump them all out in your living room or on your bed. Every last piece. Then pick up each item and ask yourself, “Does this bring me joy?” If it does, put it back. If not, put it in a giant black trash bag to donate.</p><p>The obvious benefit is drawers that open and close again and a closet where you can actually find your favorite clothes. What you might not notice until later is that your stress levels decrease. You no longer wear the things that you didn’t like. Also, you start buying fewer clothes because you finally realize you should only buy the things you love. So consumption and waste go down, and money goes up! WIN + WIN</p><p>After reaching clothes nirvana, applying KonMari to the rest of your possessions becomes easier. I no longer want “stuff”. I’d love a great dinner and wine with my sisters over a sweater or new kitchen gadget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhvu-05ZcyBo3eicg2ZzOw.jpeg" /><figcaption>Don’t underestimate the power of a sane closet. Photo by <a href="https://unsplash.com/photos/ljNQxfyN7AM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Shanna Camilleri</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>Call family regularly</h3><p>My parents divorced when I was a baby, and my dad was mostly absent from my life. Yet, as he got older, this amazing thing happened — he started calling me regularly. Unbelievably, we got closer.</p><p>For a brief moment, I resented my mom because she didn’t do this. But then I realized that the problem was with me. I needed to make that change if I wanted to be closer to her. That simple task of starting to call her at least weekly changed our relationship. I’m grateful.</p><p>As a corollary to this rule, make your peace with your loved ones now. A few years ago, my dad was diagnosed with lung cancer, and we lost him only four harrowing months later. To this day I am still grateful to the counselor at MD Anderson who told us not to wait to say our last words. So, we had “the talk” while he was still healthy enough and responsive. I cannot imagine how much regret I would have today if I hadn’t taken her advice. You can read more about <a href="https://medium.com/@thegreengreek/what-finally-pushed-me-to-learn-to-code-92ce51e85daf">our story here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouTWbpFNmRh9MM3JfYZpJQ.jpeg" /><figcaption>Reaching out can feel scary. Photo by <a href="https://unsplash.com/photos/jJYlr6H1ClM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Simon Rae</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>Walk twice a day</h3><p>The Japanese have a practice called <a href="http://time.com/5259602/japanese-forest-bathing/">shinrin-yoku</a> which loosely translates as “forest bathing”. Being in nature, breathing in the fresh air, and connecting to our senses brings us peace. I walk my dogs twice a day, and New Orleans explodes with nature from every piece of dirt. So our walk is almost like being in a forest. Even if I don’t get the full forest benefit, I find myself happier and more centered after each walk.</p><p>Let’s be real — the doggos also help. Yes, they make life a bit more complicated, but they are always so happy to see you. I can’t imagine my life without the multiple moments daily they make me laugh or smile. They helpfully remind me when it is time for a walk. Just don’t let Harry kiss you. He likes to eat poop. Also, read <a href="http://theoatmeal.com/comics/dog_paradox">this awesome comic</a> by the Oatmeal.</p><p>Pro tip: A dry dish glove is the best way to remove pet hair from clothes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_up_OaFMg0uMC23u4zfFFA.jpeg" /><figcaption>Hoomans need walking too. Photo by <a href="https://unsplash.com/photos/U_5ePt5_IaU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Meg Sanchez</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><h3>In Conclusion</h3><p>I will never forget the class in business school when we had the case study <a href="https://www.hbs.edu/faculty/Pages/item.aspx?num=29453">Profiles of the Class of 1976</a>. Six classmates wrote about their lives before their 10th and 20th business school reunions. In the early years, they started happy and hopeful about their careers. In the later years, they were full of regret with spouses that left them and children that didn’t speak to them. I was horrified that the same thing might happen to me.</p><p>Since then, I’ve re-evaluated my life every few years. I make sure I’m doing the things that will make me happy and have the fewest regrets. This has meant some tough choices in terms of career and income. I’ve chosen a path with less income but increased happiness. I’m definitely lucky, and not everyone has the same privileges. But some of these choices cost nothing.</p><p>When you are on your deathbed, will you regret not spending more time on Facebook? Not earning more money?</p><blockquote>What will you regret?</blockquote><p>Stop what you’re doing and do that now.</p><p>Shout-outs to <a href="https://medium.com/u/6ca0fe37eac1">Gant Laborde</a> and <a href="https://medium.com/u/f97be78924f4">Glynnis Ritchie</a> for helping make this article even better!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43f85e095d73" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/8-ways-i-took-back-my-sanity-43f85e095d73">8 Ways I Took Back My Sanity</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Disable Source Maps in Gatsby v2]]></title>
            <link>https://medium.com/clio-calliope/how-to-disable-source-maps-in-gatsby-v2-e027abcb4d3b?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/e027abcb4d3b</guid>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Wed, 22 Aug 2018 13:34:53 GMT</pubDate>
            <atom:updated>2018-08-22T13:34:52.887Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ov4vHlZxjYYJ_QigtwzXdQ.jpeg" /><figcaption>Halp! My head is full of maps… Photo by <a href="https://unsplash.com/photos/VVgVlH1D10U?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Slava Bowman</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><a href="https://www.gatsbyjs.org/">Gatsby.js</a> is a great tool for building static websites using React. In addition, it uses the principles of progressive web applications to make them “blazingly fast”. I was building my first static website using version 2 and came across the problem of source maps.</p><p>Source maps can be great. They help you debug your code in a readable way. But sometimes you just don’t want them in production. I won’t judge whether you want them or not, but I will give you the tools to disable them.</p><p>By default, Gatsby enables source maps for production builds. To disable them, we need to provide a <a href="https://next.gatsbyjs.org/docs/add-custom-webpack-config/">custom Webpack configuration</a> to Gatsby. In your gatsby-node.js file in the root directory of your project, add the following snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/496a526600b30efbe19a357dfec71fb0/href">https://medium.com/media/496a526600b30efbe19a357dfec71fb0/href</a></iframe><p>Note that you must delete your /public/ folder before running the build step if you have previously run it with source maps enabled.</p><blockquote>The build step doesn’t delete the public folder before creating new files. We do this to cut down on build times for repeat builds (e.g. images don’t need to be regenerated every time). —<a href="https://twitter.com/@jlengstorf"> </a><a href="https://medium.com/u/6a98eb806571">Jason Lengstorf</a>, Developer Advocate at Gatsby</blockquote><p>If you do not have a continuous deployment process set up (like through <a href="https://www.netlify.com/">Netlify</a>), you can modify your build script to delete the /public/ folder before running the build like so: rm -rf public &amp;&amp; gatsby build.</p><p>To further your learning:</p><ul><li><a href="https://webpack.js.org/configuration/devtool/">Webpack docs on devtool and source maps</a></li><li><a href="https://next.gatsbyjs.org/docs/add-custom-webpack-config/">Gatsby v2 docs on custom Webpack configurations</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e027abcb4d3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/how-to-disable-source-maps-in-gatsby-v2-e027abcb4d3b">How to Disable Source Maps in Gatsby v2</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Money in the Bank]]></title>
            <link>https://medium.com/clio-calliope/money-in-the-bank-36e6d2b681c5?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/36e6d2b681c5</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[stripe]]></category>
            <category><![CDATA[forms]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Thu, 01 Mar 2018 23:27:33 GMT</pubDate>
            <atom:updated>2018-03-01T23:29:04.304Z</atom:updated>
            <content:encoded><![CDATA[<h4>Card Errors with React Stripe Elements</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xkyr-y0AgzwgqzJIZ2LKDA.jpeg" /><figcaption>This little piggy wants users to complete their checkout process. Photo by <a href="https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Fabian Blank</a> on <a href="https://unsplash.com/collections/1815009/checkout?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><p>Do you <a href="https://reactjs.org/">React</a>? Do you <a href="https://stripe.com/">Stripe</a>? Do you just use the sample code in <a href="https://github.com/stripe/react-stripe-elements">react-stripe-elements</a> without adding visible errors for your users? I’ll show you how to stop punishing your users and increase your form conversions.</p><p>I recently converted one of my vanilla JavaScript apps to a React app. Luckily, Stripe built a nifty React integration with <a href="https://github.com/stripe/react-stripe-elements">react-stripe-elements</a>. It works pretty great out of the box! The one thing I was missing was showing user errors.</p><blockquote>One of the most important, and often unloved parts of form design, <em>is error handling</em>. It’s human nature to make mistakes though, and your form probably isn’t exempt to human error.</blockquote><blockquote>— Nick Babich, Editor-in-chief of UX Planet</blockquote><p>Not giving feedback is a surefire way to lose customers in your checkout flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*QVLPCG2hjbyssake2VCEGA.png" /><figcaption>“Oh no, I don’t understand what is wrong! Somebody help!”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*buKkbpeR0JFkI_e-P_eZsQ.png" /><figcaption>“Whew, I just fat-fingered the card number. Now I can fix it.”</figcaption></figure><h3>Improve your users’ experience by showing helpful, descriptive error messages</h3><p>The base JavaScript card elements already have error text included — you can checkout a live demo <a href="https://stripe.com/docs/stripe-js/elements/quickstart">here in the quick start guide</a>. However, react-stripe-elements does not. And so my search began… on Google, StackOverflow, in the readme and Github issues, and so on. Maybe I’m just bad at Googling. After stumbling on a few hints, I worked it out. Now I’m sharing with the world to hopefully make some other poor, frustrated developer’s life easier.</p><p>At a high level, we need to add an onChange function to our &lt;CardElement/&gt;, in order to hook into the core element.on(event, handler) behavior (<a href="https://stripe.com/docs/stripe-js/reference#element-on">element.on documentation</a>). The change event itself will contain an error object that you can then read and process into user feedback. Here is the output of a sample event (e):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*pkNRroIFqXLXohhyHW03hg.png" /></figure><p>Now that we understand that structure, it’s straightforward to drop in the error message as an span with error styling. I have a fully working code sample below (minus styling). To summarize the process:</p><ul><li>Create a &lt;CreditCardInput /&gt; wrapper for the react-stripe-elements &lt;CardElement /&gt;</li><li>Initialize the &lt;CreditCardInput /&gt; state with an empty errors property</li><li>Pass the errors to a styled errors&lt;span&gt;</li><li>Set an onChange handler on the &lt;CardElement /&gt; that updates the error in state</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59e81fd9c3f8ad8eb74b134b50262a7a/href">https://medium.com/media/59e81fd9c3f8ad8eb74b134b50262a7a/href</a></iframe><blockquote><strong>Voilà</strong>! Visible, instructive feedback to our users when things go wrong. Don’t leave them stuck in the checkout cart!</blockquote><p>Do you have another solution that works? Please share in the comments! Also, check out some resources below to learn more about user experience with forms and validations.</p><h3>Learn more!</h3><p>Here are some great articles on user experience with forms and validations:</p><ul><li><a href="https://uxplanet.org/designing-more-efficient-forms-assistance-and-validation-f26a5241199d">Designing More Efficient Forms: Assistance and Validation</a> by Nick Babich</li><li><a href="https://uxdesign.cc/forms-need-validation-2ecbccbacea1">Forms Need Validation</a> by Andrew Coyle</li><li><a href="https://medium.theuxblog.com/10-best-practices-for-designing-user-friendly-forms-fa0ba7c3e01f">10 Best Practices for Designing User-Friendly Forms</a> by Eleonora Ibragimova</li><li><a href="https://medium.com/@andrew.burton/form-validation-best-practices-8e3bec7d0549">Form validation best practices</a> by Andrew Burton</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2ZyYbuovoN4b6oDmHPiAg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/H0MqtsgVwMA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sasha Nadelyaeva</a> on <a href="https://unsplash.com/collections/1815009/checkout?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e6d2b681c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/money-in-the-bank-36e6d2b681c5">Money in the Bank</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The One Thing you need to know about React Router 4]]></title>
            <link>https://medium.com/clio-calliope/the-one-thing-you-need-to-know-about-react-router-4-34e27cbe7b53?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/34e27cbe7b53</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Mon, 19 Feb 2018 23:03:28 GMT</pubDate>
            <atom:updated>2017-06-07T13:40:55.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cZPQyICmd479ocLtlwIrQ.jpeg" /></figure><p>I finally started a new project using <a href="https://reacttraining.com/react-router/">React Router 4</a>. It’s no secret that the <a href="https://stackoverflow.com/questions/31079081/programmatically-navigate-using-react-router">churn</a> between versions has been pretty high, and version 4 is no different. However, I think the team at React Training has come a long way, and this version is definitely the best, and worth your time to learn.</p><p>For someone picking up React Router 4 for the first time, it’s probably very intuitive. For the rest of us, we may be getting hung up on the basics because we didn’t realize the fundamental change…</p><blockquote>“Routes” aren’t really routes, they are just components.</blockquote><p>Re-read that. Let it sink in. Repeat. Again.</p><p>Routes are now more like components that simply conditionally show or hide a target component or element based on whether the current URL matches the given path. If you focus on this key point, all the features and functionality that the new format gives you become so much more intuitive to understand.</p><p>Let’s take a look at a basic example before we dive too much further in:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f87aa3e4693f98b57e59ff6560aab40b/href">https://medium.com/media/f87aa3e4693f98b57e59ff6560aab40b/href</a></iframe><p>Apply what you already know about Router to BrowserRouter (hence the named import), and Link works the same as well.</p><p>To get a deeper understanding of Route, I highly recommend diving directly into the <a href="https://reacttraining.com/react-router/web/api/Route">API docs</a>. The quick start and basic examples sections skim over a lot of the details. You have three different ways (through props) to tell aRoute what to render: a target component, or functions in render or children that return valid nodes. Note that children always returns the given node whether there is a match or not. It’s convenient for animation and cases like when we only want to modify a className based on the route but everything else still needs to render.</p><p>We call the BrowserRouter once in an application, usually at a high level (just above where we first need to start defining routes and links).</p><p>In the “old” days, we typically defined routes all in one file. Now, you can put them closer to where they should belong, composing your application based on the URL match logic. For example, say two different geographical areas of your application need to contain content that varies based on the URL. You can define <strong>two routes</strong> (or as many as you need) to match the <strong>same URL</strong> in <strong>different</strong> parts of your application.</p><p>A Route helps you compose your React applications in a more “React” way. No more mental acrobatics to try fit a traditional routing model with a React component tree model. Remember…</p><blockquote>“Routes” aren’t really routes, they are just components.</blockquote><p>The opportunities are endless.</p><p><em>If you liked this story, give it a💚 to share the love.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34e27cbe7b53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/the-one-thing-you-need-to-know-about-react-router-4-34e27cbe7b53">The One Thing you need to know about React Router 4</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding your options with forms in React]]></title>
            <link>https://medium.com/clio-calliope/understanding-your-options-with-forms-in-react-afedc91ebf3e?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/afedc91ebf3e</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Mon, 19 Feb 2018 23:01:29 GMT</pubDate>
            <atom:updated>2017-06-07T13:40:02.938Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqH0iCDBZvVnDO-Uljhepg.jpeg" /><figcaption>Do forms make you seasick? (photo by <a href="https://unsplash.com/@timmarshall">Tim Marshall</a>)</figcaption></figure><p>Rare is the application that doesn’t rely on forms to get data from users, but <em>how well do you really understand forms in React? What are your options?</em> <em>Did you know you had options? When should you use one over another?</em></p><p>Whether you’re starting out in React or you’re more experienced but swimming in a sea of code complexity, this post will help you level up your form prowess.</p><h3>What are my options for getting form data?</h3><p>You have more than one option! We’ll talk about these three options:</p><ul><li>Controlled inputs + onChange handlers</li><li>Uncontrolled inputs + refs</li><li>Uncontrolled inputs + form serialization</li></ul><p>All three examples log the final values of the inputs to the console on submit so that you can compare the options.</p><h4>Controlled inputs + onChange handlers</h4><p>If you’ve dallied in React forms at all, chances are you are aware of <strong>controlled inputs</strong>. Facebook focuses on this method of capturing your form data in the <a href="https://facebook.github.io/react/docs/forms.html">official docs</a>.</p><p>The idea is that you give the input a starting value from state as well as an onChange method. The onChange method updates the value in state which in turn re-renders the input with the new value. When a user submits the form, all the final values are eagerly awaiting your next move in the state. Here is a basic example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87e642b8eb70db48c58fd5771a6fbd42/href">https://medium.com/media/87e642b8eb70db48c58fd5771a6fbd42/href</a></iframe><h4>Uncontrolled inputs + refs</h4><p>The <a href="https://facebook.github.io/react/docs/uncontrolled-components.html">React documentation</a> also mentions <strong>uncontrolled inputs</strong>, but as a footnote. Why? I can’t answer that. We’ll talk about the pros and cons a little later. First, let’s look at how to get form data from uncontrolled inputs using <a href="https://facebook.github.io/react/docs/refs-and-the-dom.html">refs</a>.</p><p>You can put a ref attribute on any component, and you supply it with a callback function. The callback function’s input is the underlying DOM element itself. Thus, it allows us to access the current value of the HTML &lt;input /&gt;, and then set a property on the component class with that value. On submit, we just need to grab all those class properties to send the data to the console:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e84d69cd44b9d40719ebd8c42c100a5b/href">https://medium.com/media/e84d69cd44b9d40719ebd8c42c100a5b/href</a></iframe><p><em>Facebook considers refs as “escape hatches” and discourages using them when you could use a more declarative solution. Don’t hijack the normal data flow in React unless you have to.</em></p><h4>Uncontrolled inputs + form serialization</h4><p>This is by far my favorite way to implement simple forms. Refs seem a bit intense. It’s a form, so why can’t we just grab the form data from the target form on submit? Luckily, the <a href="https://github.com/defunctzombie/form-serialize">form-serialize</a> package helps us do this. I normally don’t like adding packages, but this one is handy and tiny. It returns the form data as a URL-encoded string or as a JavaScript object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/006b6a1979634d9c99f7b6a2b966cdf2/href">https://medium.com/media/006b6a1979634d9c99f7b6a2b966cdf2/href</a></iframe><p>Note that for uncontrolled inputs, you can set an initial value for the input using the defaultValue attribute. This works for both the ref and serialization methods.</p><h3>The million dollar question — which should I use?</h3><p>The most important question you need to answer is:</p><blockquote>When do you need to access your form data?</blockquote><p>In other words, do you need access to the data before submitting or is after submit adequate? If you had a controlled form, would the onChange method do anything other than update the value of the input field in state?</p><p><strong><em>If you only need your data after submit</em></strong>, then uncontrolled inputs using either method are simpler and less tedious. They also don’t re-render on every single character change of the inputs, though this excess rendering isn’t a performance problem for most forms. You can still validate data and re-render the form with errors. You can also easily clear errors on focus.</p><p>In terms of which uncontrolled inputs method to use, I prefer serialization. For longer forms, it gives me a tidy little package with all my form data without having to access each ref individually. For me, it’s more intuitive, but play with both and see which you prefer.</p><p><strong><em>If you need your data before submit</em></strong>, then controlled inputs are your solution. They can perform live validation and conditional disabling of submit buttons. Live validations validate the inputs while the user types rather than on submit. In some cases, this is helpful — like for password strength hints.</p><p>Now go forth on the high seas of forms, confident in how to navigate through the waves of options! (too cheesy?)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYigSdSRdXuzjCIcRlMxIg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@mynameischris">Chris Davis</a></figcaption></figure><p>— — —</p><p>Want to go back to basics on forms? Check out George Mauer’s article <a href="http://www.codemag.com/Article/1701091">HTML Forms’ Time Has Come (Again)</a>.</p><p><em>Would you like an article on adding validations to forms? Or how to think through encapsulating form state? Let me know!</em></p><p><em>If you liked this story, give it a💚 to share the love.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afedc91ebf3e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/understanding-your-options-with-forms-in-react-afedc91ebf3e">Understanding your options with forms in React</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Analytics + caniuse = *MAGIC*]]></title>
            <link>https://medium.com/clio-calliope/google-analytics-caniuse-magic-22e2e6f1071c?source=rss----c9dcd285ee5a---4</link>
            <guid isPermaLink="false">https://medium.com/p/22e2e6f1071c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Sia Karamalegos]]></dc:creator>
            <pubDate>Mon, 19 Feb 2018 22:57:39 GMT</pubDate>
            <atom:updated>2017-10-27T19:49:52.567Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-lq-wTWHXThgIslSEEu1Qg.jpeg" /><figcaption>How I feel right now. Photo by <a href="https://unsplash.com/photos/GR2uZmp7mUo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rob Potter</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Today I learned that you can import your Google Analytics data into <a href="https://caniuse.com/">caniuse</a> to determine how many of your users would be able to use a particular front-end technology in their browser of choice. Maybe the rest of you have been holding out on this and just didn’t tell me. Maybe I had my head in the sand. Well, today I learned about it, and it’s amazing.</p><p>At <a href="http://www.clioandcalliope.com/">Clio + Calliope</a>, we are really excited about trying out CSS grid layouts, but we know it won’t cover all users. Now we can make informed decisions for our clients to use tools that will work in their browsers or provide fallbacks when our first pick does not work. Here is the output of caniuse using a year’s worth of Google Analytics data from one client:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99sk-CgjRmPIR8uI7XnBDA.png" /><figcaption>Can I use CSS Grid with my website’s users? Clearly not without fallbacks.</figcaption></figure><p>You can see in the top right-hand corner, that only 55.95% of our client’s users would be able to properly see a CSS grid layout (if also prefixed). So, clearly we cannot use grid without fallbacks that cover the rest of the browsers. Luckily, all I have to do to check for fallbacks like flexbox is to type “flexbox” in the <em>Can I use _______ ? </em>input box. Awesome sauce.</p><h3>How to invoke this incantation</h3><p>Go to <a href="https://caniuse.com/">caniuse</a>, and in the red <em>Can I use _______ ? </em>area, click on the Settings link to the right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0xku5AEGrwitzEbC7yXKA.png" /><figcaption>Click on the gear/settings link to the right</figcaption></figure><p>Then, the left menu sidebar will include a button to <em>Import…</em> from Google Analytics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*mWazGb4yOSQrqB4kMdx1dw.png" /></figure><p>Click on that, and follow the steps to give caniuse access permission to the Google account with your analytics information. Then, select a profile (website) that you want to import from and a date range.</p><p>After that, you should be ready to roll. Search for a particular technology, and you will see the stats for your website plus global usage in the top right.</p><h3>Give thanks where thanks is due</h3><p>I have to send a special shout out to <a href="https://medium.com/u/1780e72d7e48">Matt Shwery</a> for telling me about this today! You’re the best!</p><p><em>If you liked this story, give it a </em>👏<em> to share the love.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22e2e6f1071c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clio-calliope/google-analytics-caniuse-magic-22e2e6f1071c">Google Analytics + caniuse = *MAGIC*</a> was originally published in <a href="https://medium.com/clio-calliope">Clio + Calliope</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>