<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Geoff Davis</title>
    <description>The latest articles on Forem by Geoff Davis (@geoff).</description>
    <link>https://forem.com/geoff</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F389%2Fb2be0d9b-e728-4bd2-8ebb-8ff3c99296af.jpg</url>
      <title>Forem: Geoff Davis</title>
      <link>https://forem.com/geoff</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/geoff"/>
    <language>en</language>
    <item>
      <title>🎉Announcing Floodgate: a "load more" component for React 🌊</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Tue, 20 Aug 2019 20:49:08 +0000</pubDate>
      <link>https://forem.com/geoff/announcing-floodgate-a-load-more-component-for-react-3llp</link>
      <guid>https://forem.com/geoff/announcing-floodgate-a-load-more-component-for-react-3llp</guid>
      <description>&lt;p&gt;I am happy to announce that after over 2 years of development, &lt;a href="https://github.com/geoffdavis92/react-floodgate"&gt;&lt;strong&gt;React Floodgate&lt;/strong&gt;&lt;/a&gt; has been released under version 1.0.0!&lt;/p&gt;

&lt;p&gt;Floodgate is a "load more" component for &lt;a href="https://reactjs.org"&gt;React.js&lt;/a&gt; that takes the complexity of managing and updating queued data and turns it into an intuitive experience. It takes a minimalist approach to configuration: with only 1 required prop and using the &lt;a href="https://reactjs.org/docs/render-props.html"&gt;render prop pattern&lt;/a&gt;, developers have precise control about how much of the available data is rendered, and the manner in which it is rendered.&lt;/p&gt;

&lt;p&gt;For a quick peek into a barebones implementation of Floodgate, check out the example below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Floodgate&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-floodgate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;LoadMore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;albums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;For Emma, Forever Ago&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Bon Iver, Bon Iver&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;22 a million&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;i,i&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Floodgate&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;albums&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;initial&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{({&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loadNext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loadComplete&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Fragment&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Bon&lt;/span&gt; &lt;span class="nx"&gt;Iver&lt;/span&gt; &lt;span class="nx"&gt;Albums&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ol&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;album&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;album&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ol&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loadNext&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;disabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loadComplete&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Add&lt;/span&gt; &lt;span class="nx"&gt;Album&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/React.Fragment&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Floodgate&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all it takes to create a working "load more" component! &lt;/p&gt;

&lt;p&gt;To get started using Floodgate today, install it into your React project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# using npm&lt;/span&gt;
npm i react-floodgate

&lt;span class="c"&gt;# using yarn&lt;/span&gt;
yarn add react-floodgate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;p&gt;While Floodgate is minimalistic, it can be incredibly powerful, depending on how its features are leveraged in concert with other components and patterns. Get a brief introduction to what Floodgate can do below; check out the &lt;a href="https://github.com/geoffdavis92/react-floodgate/blob/master/README.md"&gt;README file&lt;/a&gt; to get a deeper understanding and technical details.&lt;/p&gt;

&lt;h4&gt;
  
  
  📊 Consume any type of data
&lt;/h4&gt;

&lt;p&gt;Floodgate's &lt;code&gt;data&lt;/code&gt; prop only requires that an array is passed to it; that array can be anything, including empty! Strings, parsed JSON objects, React components, even JavaScript functions can be passed in; remember that Floodgate leaves the rendering and implementation of these items up to the developer.&lt;/p&gt;

&lt;p&gt;Values like &lt;code&gt;data={["hello", "world"]}&lt;/code&gt;, &lt;code&gt;data={[&amp;lt;li&amp;gt;Eggs&amp;lt;/li&amp;gt;, &amp;lt;li&amp;gt;cereal&amp;lt;/li&amp;gt;, &amp;lt;li&amp;gt;paper towels&amp;lt;/li&amp;gt;]}&lt;/code&gt;, &lt;code&gt;data={[]}&lt;/code&gt; are all valid to be passed to Floodgate. As a note, while Floodgate doesn't care what type(s) of item makes up the array, it is recommended to make sure the type is uniform amongst all the array elements.&lt;/p&gt;

&lt;h4&gt;
  
  
  🔢 Determine the quantity of items to render
&lt;/h4&gt;

&lt;p&gt;Tell Floodgate how many items from the &lt;code&gt;data&lt;/code&gt; array should be loaded on the initial render with the &lt;code&gt;initial&lt;/code&gt; prop. The &lt;code&gt;increment&lt;/code&gt; prop handles how many items are loaded on subsequent calls to &lt;code&gt;loadNext()&lt;/code&gt; in the render prop function.&lt;/p&gt;

&lt;h4&gt;
  
  
  🎛 Manage props from a parent component
&lt;/h4&gt;

&lt;p&gt;By utilizing React's lifecycle methods and custom callback props, Floodgate's props can be entirely managed by a parent component's state, allowing the instance's data to be asynchronously updated or end-users to have more control over how many items are loaded. I call this the &lt;a href="https://github.com/geoffdavis92/react-floodgate#controlled-floodgate"&gt;Controlled Floodgate&lt;/a&gt; pattern.&lt;/p&gt;

&lt;h4&gt;
  
  
  ☎️ Handle events with event-driven callback props
&lt;/h4&gt;

&lt;p&gt;The render prop function exposes a number of Floodgate methods to be called by its children components; namely, those are &lt;code&gt;loadNext&lt;/code&gt;, &lt;code&gt;loadAll&lt;/code&gt;, &lt;code&gt;reset&lt;/code&gt;, and &lt;code&gt;exportState&lt;/code&gt;. When these methods are called, Floodgate calls the function provided to the &lt;code&gt;on[MethodName]&lt;/code&gt; prop, if one is provided.&lt;/p&gt;

&lt;h4&gt;
  
  
  🔮 Leverage the Context API
&lt;/h4&gt;

&lt;p&gt;Floodgate utilizes the React's &lt;a href="https://reactjs.org/docs/context.html"&gt;Context API&lt;/a&gt; as of v0.6.0, preventing the need for developers to pass down methods exposed in the render prop to wherever they are needed using the &lt;code&gt;FloodgateContext&lt;/code&gt; export.&lt;/p&gt;

&lt;h4&gt;
  
  
  🛠 Built with TypeScript
&lt;/h4&gt;

&lt;p&gt;Floodgate is built with Typescript, and is distributed with a &lt;a href="https://github.com/geoffdavis92/react-floodgate/blob/master/src/types.d.ts"&gt;types definition file&lt;/a&gt; for an enhanced developer experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;For a better understanding of how Floodgate works, check out these &lt;a href="https://codesandbox.io/search?query=&amp;amp;page=1&amp;amp;configure%5BhitsPerPage%5D=12&amp;amp;refinementList%5Btags%5D%5B0%5D=react-floodgate-examples"&gt;Codesandbox.io examples&lt;/a&gt;. You can see the way the code is setup, as well as the resulting app that an end-user would interact with.&lt;/p&gt;

&lt;p&gt;One real-life example of Floodgate in use is on my personal site's &lt;a href="https://geoffdavis.info/writing/"&gt;writing page&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Roadmap
&lt;/h3&gt;

&lt;p&gt;This project is pretty green, but there are some features that I will be planning to implement in the near future, in addition to solving issues and addressing immediate needs of Floodgate users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Error Boundaries&lt;/li&gt;
&lt;li&gt;Hooks support (&lt;code&gt;useFloodgate&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Documentation website&lt;/li&gt;
&lt;li&gt;Improve README, especially "Contributors" section&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Explore on GitHub
&lt;/h3&gt;

&lt;p&gt;Floodgate is available on GitHub at &lt;a href="https://github.com/geoffdavis92/react-floodgate"&gt;geoffdavis92/react-floodgate&lt;/a&gt;. There, you can view the component's README, examine source files, file an issue, take a look at open projects, and do all the usual GitHub repo things.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you think?
&lt;/h3&gt;

&lt;p&gt;Do you like Floodgate? Is your app in desperate need of this component? Let me know by &lt;a href="https://twitter.com/intent/tweet?text=%40gdavis92%20%5Byour%20thoughts%20here%5D%20%23reactfloodgate"&gt;tweeting me&lt;/a&gt; about it, or leave a comment below! &lt;/p&gt;

&lt;p&gt;🎉 Happy developing! 🎉&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What are your go-to libraries for input masking?</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Tue, 19 Feb 2019 23:13:29 +0000</pubDate>
      <link>https://forem.com/geoff/what-are-your-go-to-libraries-for-input-masking-ij8</link>
      <guid>https://forem.com/geoff/what-are-your-go-to-libraries-for-input-masking-ij8</guid>
      <description>&lt;p&gt;My definition of input masking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Formatting of user-input in an &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; element as it is provided, into a preset shape/structure&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example, here is a set of phone inputs that have masks setup:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k7xlKknb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i2.wp.com/www.cssscript.com/wp-content/uploads/2018/11/Basic-Phone-Input-Mask-With-Pure-JavaScript-phone-mask.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k7xlKknb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i2.wp.com/www.cssscript.com/wp-content/uploads/2018/11/Basic-Phone-Input-Mask-With-Pure-JavaScript-phone-mask.png" alt="Image of HTML input elements that have preset 'masks' to auto-format user input" width="405" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://css-tricks.com/input-masking/"&gt;This CSS-Tricks&lt;/a&gt; link showcases some examples as well as some libraries, but I'm interested in what the DEV community uses nowadays (that post is ~2 years old).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus points&lt;/strong&gt; if the library is framework agnostic, i.e. does not use jQuery, Angular, React, Vue, etc.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Import Modules Out of Webpack's Scope</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Fri, 08 Feb 2019 00:38:29 +0000</pubDate>
      <link>https://forem.com/geoff/how-to-import-modules-out-of-webpacks-scope-h5</link>
      <guid>https://forem.com/geoff/how-to-import-modules-out-of-webpacks-scope-h5</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; check out the solution&lt;/p&gt;

&lt;p&gt;Consider this scenario: you work on a host of projects that all require a set of JavaScript modules, and you want to track and import the common modules from a centralized location. So, you begin to move over these common modules to their own repository; the idea is no more copy-pasting on every change, just import from this new repo!&lt;/p&gt;

&lt;p&gt;In this scenario, assume the individual projects use the common workflow of Webpack and Babel to transpile and build &lt;code&gt;.js&lt;/code&gt; bundles. Webpack has a great feature that allows aliasing of modules in a given path under a particular identifier, rather than &lt;code&gt;'../path/to/commons/module.js'&lt;/code&gt;, for example. This also works with modules outside the scope of the Webpack config file; aliasing can be configured under the &lt;code&gt;resolve.alias&lt;/code&gt; object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// webpack.config.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="na"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;commons&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../path/to/commons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To import these &lt;code&gt;commons&lt;/code&gt; modules, the import statement in one of the projects will have to be updated to use this alias:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// index.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getAvgLength&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;commons/stringUtils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this scenario, let's say the &lt;code&gt;commons&lt;/code&gt; directory has just one file now, the &lt;code&gt;stringUtils.js&lt;/code&gt; file imported above; that file looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// commons/stringUtils.js&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getAvgLength&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stringCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;combinedStringLengths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;combinedStringLengths&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;stringCount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great utility, right? So the commons directory is intialized with one module, Webpack is aliasing the &lt;code&gt;commons&lt;/code&gt; directory in a project directory, and the proper import statement is set up in that project's main JavaScript file. Now, Webpack should be restarted, and a bundle would be successfully built; restarting the browser to get this latest build would show that everything is setup, running smoothly, and no more considerations need to happen.&lt;/p&gt;

&lt;p&gt;Except, that's not necessarily the case.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;What's actually happening is the module being imported from &lt;code&gt;commons&lt;/code&gt; isn't &lt;em&gt;actually&lt;/em&gt; being loaded by Webpack and transpiled by Babel; it is being imported and placed in the bundle, able to be utilized normally, but that's it. Any modules located outside the scope of the &lt;code&gt;webpack.config.js&lt;/code&gt; are being imported and bundled without any additional transformation; this is what a section of the &lt;code&gt;bundle.js&lt;/code&gt; would look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/***/&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../path/to/commons/stringUtils.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="cm"&gt;/*!*******************************!*\
  !*** ../path/to/commons/stringUtils.js ***!
  \*******************************/&lt;/span&gt;
&lt;span class="cm"&gt;/*! exports provided: getAvgLength */&lt;/span&gt;
&lt;span class="cm"&gt;/***/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__webpack_exports__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;__webpack_require__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use strict&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;__webpack_require__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__webpack_exports__&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cm"&gt;/* harmony export (binding) */&lt;/span&gt; &lt;span class="nx"&gt;__webpack_require__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__webpack_exports__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getAvgLength&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;getAvgLength&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getAvgLength&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stringCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;combinedStringLengths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;combinedStringLengths&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;stringCount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/***/&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unless the &lt;code&gt;commons&lt;/code&gt; code is using features that are not supported by browsers yet (or for example, a type annotation system like TypeScript or Flow), no problems will be apparent until a build process is initiated or the code is tested in a browser where some of the &lt;code&gt;commons&lt;/code&gt; features are not supported. If the code being imported complies with the target environment's supported ECMAScript version (most likely ES5), then this will likely not be a problem, so this only affects ES2015+ code not in the same directory as &lt;code&gt;webpack.config.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Fix
&lt;/h3&gt;

&lt;p&gt;No amount of tweaks or updates to the project's Webpack or Babel config files will help resolve this issue; the solution is to go to the source. In the &lt;code&gt;commons&lt;/code&gt; directory, setup a script that runs all JS files through Babel, which should be run when making changes to the common modules; this can be done by adding a &lt;code&gt;package.json&lt;/code&gt;, some form of Babel configuration (seen below as a property in the package.json file), and installing &lt;code&gt;@babel/cli&lt;/code&gt;, &lt;code&gt;@babel/core&lt;/code&gt;, and &lt;code&gt;@babel/preset-env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// commons/package.json&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;babel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;babel entry.js -d dist/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;babel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;presets&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/env&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;targets&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;browsers&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;last 2 versions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devDependencies&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/cli&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^7.2.3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/core&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^7.2.2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@babel/preset-env&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;^7.3.1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When &lt;code&gt;yarn babel&lt;/code&gt;/&lt;code&gt;npm run babel&lt;/code&gt; is initiated, Babel will transpile all the files matching a glob pattern (in the above example, it only transpiles &lt;code&gt;entry.js&lt;/code&gt;) and places the result in &lt;code&gt;dist/&lt;/code&gt;. In order for the projects to import the correct, transpiled code, update the Webpack's &lt;code&gt;commons&lt;/code&gt; alias to point to that &lt;code&gt;dist&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// webpack.config.js&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;commons&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../path/to/commons/dist&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Webpack is restarted or a build is initiated, the bundle should now only output code transpiled down to whatever the Babel settings are setup to output. Problem solved!&lt;/p&gt;




&lt;p&gt;I am by no means an expert on the Webpack/Babel workflow, and so I do not know for a fact where in the pipeline the issue lies, but I suspect the breaking point is somewhere in &lt;code&gt;babel-loader&lt;/code&gt;, since Webpack is doing its job of importing the modules. Regardless, I did not write this article to point fingers, but to bring awareness and present a solution.&lt;/p&gt;

&lt;p&gt;I came across this exact issue while trying to create a common directory for my JavaScript modules at work, and upon running a build, finding that none of the ES2015+ code was being transpiled. Hopefully this helps someone out there thinking of using a similar pattern of development and organization!&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>javascript</category>
      <category>productivity</category>
      <category>babel</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 7: Tweak, refactor, and/or fix your code</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Sat, 28 Apr 2018 16:32:26 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-7-tweak-refactor-andor-fix-your-code-52ep</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-7-tweak-refactor-andor-fix-your-code-52ep</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 7 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day seven, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Tweak, refactor, and/or fix your code
&lt;/h2&gt;

&lt;p&gt;Today is all about you and your design/code perfectionism. Did you want to change your component API to be more flexible? Did you mean to tweak spacing on Day 5 but didn't have time? Perhaps you needed more time to research how to fix a few more a11y issues before you get that perfect score on Day 6. We all have to get sleep, spend time with friends and family, and have other things pop up that may affect your workflow; today is your day to finish strong and get everything up to spec as &lt;em&gt;you&lt;/em&gt; see fit.&lt;/p&gt;

&lt;p&gt;Please add your repos and/or images of your designs in the comments for inspiration! I would love to see what you all created throughout the week.&lt;/p&gt;

&lt;p&gt;Happy fixing! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators ✅&lt;/li&gt;
&lt;li&gt;Grid/list view toggles ✅&lt;/li&gt;
&lt;li&gt;Sorting ✅&lt;/li&gt;
&lt;li&gt;Pagination/load more ✅&lt;/li&gt;
&lt;li&gt;100% a11y score ✅&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes 🎯&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 6: Score 100% in an a11y audit</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Fri, 27 Apr 2018 23:28:34 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-6-score-100-in-an-a11y-audit-ci5</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-6-score-100-in-an-a11y-audit-ci5</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 6 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day six, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Score 100% in an a11y audit
&lt;/h2&gt;

&lt;p&gt;Accessibility– or a11y, pronounced "ally"– is a very important concept in modern web development. No matter whether you are building web applications or simple static landing pages, making a web page accessible should be on the forefront of every developer and designer's mind. For many, this is an afterthought, but a11y is quickly becoming a &lt;a href="https://webaim.org/blog/web-accessibility-and-seo/"&gt;metric in SEO ranking&lt;/a&gt; and vital to the &lt;a href="https://www.adatitleiii.com/2018/01/2017-website-accessibility-lawsuit-recap-a-tough-year-for-businesses/"&gt;legal integrity of your web page/app&lt;/a&gt;; it is also a good idea and strategy to make it easier for users to actually use your site/app/widget.&lt;/p&gt;

&lt;p&gt;A11y techniques span quite a few domains and disciplines, from HTML attributes and CSS states, to colors used in the design (you may notice that most colors I used in my design have WCAG contrast ratings of at least AA for their relevant domains) and text that no one will interact with unless they use a screen reader. In order to test for a web page's accessibility, there are several tools floating around the web. One such tool is &lt;strong&gt;&lt;a href="https://ffoodd.github.io/a11y.css/"&gt;a11y.css&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;a11y.css is an awesome tool that uses CSS targeting to find a11y errors, warnings, and advisable tips in your code, and show you the messages inline. You can even configure the tool to target only certain levels of warnings too. When I start working on improving accessibility, this tool is the first one I use.&lt;/p&gt;

&lt;p&gt;Another tool I use is the &lt;a href="https://developers.google.com/web/tools/lighthouse/"&gt;Google Lighthouse accessibility audit&lt;/a&gt; This tool will check all the types of things a11y.css does, and then some. It allows a little more control over debugging, as it will list offending elements, and scolling over that list will highlight those elements in the DOM, much like normal devtools do. I also find Lighthouse a &lt;em&gt;lot&lt;/em&gt; easier to figure out what to fix, since it will also link to explainer pages for each error.&lt;/p&gt;

&lt;p&gt;I've linked several tools and resources for a11y techniques and testing in the footnotes of this post, and I hope you use them and explore ways to help make the web usable for &lt;em&gt;everyone&lt;/em&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators ✅&lt;/li&gt;
&lt;li&gt;Grid/list view toggles ✅&lt;/li&gt;
&lt;li&gt;Sorting ✅&lt;/li&gt;
&lt;li&gt;Pagination/load more ✅&lt;/li&gt;
&lt;li&gt;100% a11y score 🎯&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ffoodd.github.io/a11y.css/"&gt;a11y.css&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a11yproject.com"&gt;a11y Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques"&gt;&lt;code&gt;aria&lt;/code&gt; techniques on MDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/tools/lighthouse/"&gt;Google Lighthouse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/resources/contrastchecker/"&gt;WCAG Color Contrast Checker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>a11y</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 5: Add a pagination/load more feature</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Fri, 27 Apr 2018 06:27:31 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-5-add-a-paginationload-more-feature-9je</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-5-add-a-paginationload-more-feature-9je</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 5 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day five, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a pagination/load more feature
&lt;/h2&gt;

&lt;p&gt;Have you ever submitted a search query and found yourself with over a million results from Google or Amazon? And in that situation, how many times have you had to scroll for a few hours to get to the end? None? Of course, because most robust search engines like those offer pagination or lazy loadin of search results!&lt;/p&gt;

&lt;p&gt;Pagination (the dynamic creation of pages to display content) and lazy loading content like search results or article listings are more features that really aid in providing a robust user experience on your site/app. This not only prevents users from being overwhelmed with results, but improves overall performance and accessibility by not loading dozens/hundreds/maybe thousands of results in one render and decreases the data load on a device, respectively.&lt;/p&gt;

&lt;p&gt;Following the original design I created, this is what I've got for &lt;strong&gt;Day 5&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnf6dvzp90w720cr0cl0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fnf6dvzp90w720cr0cl0g.png" alt="A results page component in list view, with one result entry highlighted to indicate it is sponsored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I chose to use a "load more" for today's feature implementation; luckily for me, I wrote a small React component to do just this called &lt;a href="https://github.com/geoffdavis92/react-floodgate" rel="noopener noreferrer"&gt;Floodgate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Floodgate is a component that utilizes &lt;a href="https://reactjs.org/docs/render-props.html" rel="noopener noreferrer"&gt;render props&lt;/a&gt; and generators to incrementally render a subset of items passed to the component. Such items can be anything array-bound, and in this case the items are an array of objects that hold the &lt;code&gt;&amp;lt;ResultEntry/&amp;gt;&lt;/code&gt; component and its dates, for sorting. Floodgate also passes in functions as arguments to load the next batch of items, load in all items, and to reset the component state. (I use the reset function after all items have rendered for easy demoing of the feature, as a normal results page may not utilize this necessarily)&lt;/p&gt;

&lt;p&gt;In order to give a good UX to the perusers of my search results, I also need to disable the load more button and perhaps display a label to inform them that all results have been displayed. Floodgate has you covered! A &lt;code&gt;loadComplete&lt;/code&gt; boolean is passed in as a render function argument as well, which yields a value of &lt;code&gt;true&lt;/code&gt; if all the items have been rendered. &lt;/p&gt;

&lt;p&gt;If you're using React to build your search results UI, give Floodgate a look and see if it can help you!&lt;/p&gt;

&lt;p&gt;Here's an animation of my load more feature in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F18jx0388xfzw7styclpi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F18jx0388xfzw7styclpi.gif" alt="A results page component switching between list and grid views, with certain sorting parameters in place, and a load more button"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check out my coded implementation &lt;a href="https://geoffdavis92.github.io/weekly-ui/" rel="noopener noreferrer"&gt;on my Github pages site for this project&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org" rel="noopener noreferrer"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org" rel="noopener noreferrer"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/" rel="noopener noreferrer"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators ✅&lt;/li&gt;
&lt;li&gt;Grid/list view toggles ✅&lt;/li&gt;
&lt;li&gt;Sorting ✅&lt;/li&gt;
&lt;li&gt;Pagination/load more 🎯&lt;/li&gt;
&lt;li&gt;100% a11y score&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/geoffdavis92/react-floodgate" rel="noopener noreferrer"&gt;&lt;code&gt;react-floodgate&lt;/code&gt;&lt;/a&gt; - a React "load more" React component for incrementally displaying data&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/2007/11/pagination-gallery-examples-and-good-practices/" rel="noopener noreferrer"&gt;Pagination – Examples And Good Practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://uxplanet.org/infinite-scrolling-best-practices-c7f24c9af1d" rel="noopener noreferrer"&gt;Infinite Scrolling Best Practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.smashingmagazine.com/2016/03/pagination-infinite-scrolling-load-more-buttons/" rel="noopener noreferrer"&gt;Infinite Scrolling, Pagination Or “Load More” Buttons? Usability Findings In eCommerce&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>react</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 4: Add sorting</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Thu, 26 Apr 2018 06:13:52 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-4-add-sorting-7e</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-4-add-sorting-7e</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 4 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day four, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Add sorting
&lt;/h2&gt;

&lt;p&gt;The sorting of search results are an important part of a useful results page. Whether it is for an ecommerce platform– sorting by price or customer review, or a search engine– sorting by date or relevance, or some other type of app/site, proper sorting methods help users get the best of your search implementation.&lt;/p&gt;

&lt;p&gt;Following the original design I created, this is what I've got for &lt;strong&gt;Day 4&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fj8cjtbklxomue6imuy5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fj8cjtbklxomue6imuy5i.png" alt="A results page component in list view, with one result entry highlighted to indicate it is sponsored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The design is a little different due to the fact that I am using the native HTML &lt;code&gt;select&lt;/code&gt; element, but the functionality is all there. The design continues to emulate the results of a mock soccer blog, so the sorting methods reflect that of a blog, i.e. sorting by date. If you were using a more robust search platform and flexible API, you could also sort by relevance (like Google and Amazon do, for example) or by price or customer rating, as previously mentioned.&lt;/p&gt;

&lt;p&gt;Here's an animation of the feature in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Faw87o75t8vbp4rnqdb71.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Faw87o75t8vbp4rnqdb71.gif" alt="A results page component switching between list and grid views, with certain sorting parameters in place"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check out my coded implementation &lt;a href="https://geoffdavis92.github.io/weekly-ui/" rel="noopener noreferrer"&gt;on my Github pages site for this project&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org" rel="noopener noreferrer"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org" rel="noopener noreferrer"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/" rel="noopener noreferrer"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators ✅&lt;/li&gt;
&lt;li&gt;Grid/list view toggles ✅&lt;/li&gt;
&lt;li&gt;Sorting 🎯&lt;/li&gt;
&lt;li&gt;Pagination/load more&lt;/li&gt;
&lt;li&gt;100% a11y score&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>react</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 3: Add grid/list view toggles</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Wed, 25 Apr 2018 05:52:42 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-3-add-gridlist-view-toggles-2jmh</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-3-add-gridlist-view-toggles-2jmh</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 3 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day three, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Add grid/list view toggles
&lt;/h2&gt;

&lt;p&gt;The ability to control the display of UI is not a very oft-included feature, but one that can enhance the experience and/or utility of an app/web site. Such a feature is included in such user interfaces as Instagram (user profile views) and Google Drive; they can certainly aid in the scannability of a design, by removing excess– yet perhaps at times useful– information.&lt;/p&gt;

&lt;p&gt;While design is an all-important decision in implementing the vision of one's app or site, handing over some control of the display can show your users that you care for their needs. &lt;/p&gt;

&lt;p&gt;Following the original design I created, this is what I've got for &lt;strong&gt;Day 3&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcmm27su78o4j8defusbt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcmm27su78o4j8defusbt.png" alt="A results page component in list view, with one result entry highlighted to indicate it is sponsored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fegr6t09jvbs2qo07ej2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fegr6t09jvbs2qo07ej2w.png" alt="A results page component in grid view, with one result entry highlighted to indicate it is sponsored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like some of the features we've created on this challenge, this view toggle may work best when preferences are saved using cookies or some other mechanism to save user state. But, I've skipped this step so far. This feature is a simple toggle that utilizes React's internal component state and dynamic styling via &lt;a href="https://styled-components.com" rel="noopener noreferrer"&gt;Styled Components&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One thing I would suggest is trying out the new(ish) &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid" rel="noopener noreferrer"&gt;&lt;code&gt;grid&lt;/code&gt; CSS API&lt;/a&gt; to style the grid view; it's not as scary as you may imagine, and it's incredibly powerful.&lt;/p&gt;

&lt;p&gt;Here's an animation of the feature in action:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff1kxwc5o0mjktd0fsb73.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff1kxwc5o0mjktd0fsb73.gif" alt="A results page component switching between list and grid views"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check out my coded implementation &lt;a href="https://geoffdavis92.github.io/weekly-ui/" rel="noopener noreferrer"&gt;on my Github pages site for this project&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org" rel="noopener noreferrer"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org" rel="noopener noreferrer"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/" rel="noopener noreferrer"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators ✅&lt;/li&gt;
&lt;li&gt;Grid/list view toggles 🎯&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Pagination/load more&lt;/li&gt;
&lt;li&gt;100% a11y score&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>react</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 2: Add result entry, sponsored/best seller indicators</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Tue, 24 Apr 2018 02:11:50 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-2-add-result-entry-sponsoredbest-seller-indicators-1pg5</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-2-add-result-entry-sponsoredbest-seller-indicators-1pg5</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 2 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day two, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Add result entry, sponsored/best seller indicators
&lt;/h2&gt;

&lt;p&gt;Back to basics again! The first thing any results page needs is an entry/entries to populate the page, because without them this would just be a bunch of whitespace. Like the rest of the UI projects we have worked on, these results should be easily traversable, have good color contrast, and have relevant content displaying, in order to be of most use to the searcher.&lt;/p&gt;

&lt;p&gt;Additionally, the original search query is display atop the page, so users are able to see what they searched; this could easily be replaced by a secondary search bar, similar to how Google's main search functions.&lt;/p&gt;

&lt;p&gt;Also like Google's search, our results should have some sort of indicator if there is paid content and/or a well-regarded result displaying. In my case, I am basing my design off of a would-be sports blog, so I have a special background color indicating the link goes to content that is sponsored by someone to appear first.&lt;/p&gt;

&lt;p&gt;Following the original design I created, this is what I've got for &lt;strong&gt;Day 2&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fha402qn8gf6tyl5z8soq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fha402qn8gf6tyl5z8soq.png" alt="A results page component, with one result entry highlighted to indicate it is sponsored"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My implementation is fairly simple, and uses a list view (for now); if you wanted to, and for &lt;em&gt;EXTRA&lt;/em&gt; points, you could use the ecommerce listing you made from Week 1, if that fits your design. &lt;/p&gt;

&lt;p&gt;I chose a faded green color to act as the sponsored content indicator, alongside a complementing, darker shade for the label. Lastly, a simple custom focus state gives a bit of character to the otherwise straightforward page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org" rel="noopener noreferrer"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org" rel="noopener noreferrer"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/" rel="noopener noreferrer"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component ✅&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators 🎯&lt;/li&gt;
&lt;li&gt;Grid/list view toggles&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Pagination/load more&lt;/li&gt;
&lt;li&gt;100% a11y score&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>react</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 3 Day 1: Design a Results Page</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Mon, 23 Apr 2018 03:12:51 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-3-day-1-design-a-results-page-1bok</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-3-day-1-design-a-results-page-1bok</guid>
      <description>&lt;p&gt;Welcome to Week 3, Day 1 of my Weekly UI challenge! Week 3 will focus on a &lt;strong&gt;results page&lt;/strong&gt; UI component; each day throughout this following week, I will pick one or two (usually related) subelements of the design to implement. For day one, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Design the component
&lt;/h2&gt;

&lt;p&gt;I personally used Sketch to design this week's component, but you can use Sketch, a similar UX/UI design program like Adobe XD, or really any other program (or just paper and pen/pencil!) to design your component.&lt;/p&gt;

&lt;p&gt;If you decide you would rather not design your own component, you are more than welcome to follow along using my designs, but I think you'd really get the most of it if you designed your own. (plus I'd love to see what you all come up with!)&lt;/p&gt;

&lt;p&gt;Here is what my results component will look like, including a number of the component's states:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3d8rfrn8i29o8lomq7kv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3d8rfrn8i29o8lomq7kv.jpg" alt="A result page component, with a list view and ancillary buttons present"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what the grid view of the component looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjkzu0miy8adkolreczzn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjkzu0miy8adkolreczzn.jpg" alt="A result page component, with a grid view and ancillary buttons present"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;Hop on those design programs (or get out that pen and paper pad) and design your own &lt;strong&gt;results page&lt;/strong&gt;! Below is a calendar of what features I will be implementing on which day, as well as a few resources that may help you.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy designing! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 3 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/22) Design component 🎯&lt;/li&gt;
&lt;li&gt;Result entry, sponsored/best seller indicators&lt;/li&gt;
&lt;li&gt;Grid/list view toggles&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Pagination/load more&lt;/li&gt;
&lt;li&gt;100% a11y score&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://uxplanet.org/best-practices-for-search-results-1bbed9d7a311" rel="noopener noreferrer"&gt;Best Practices for Search Results&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.deeson.co.uk/blog/ux-series-basic-principles-designing-search-results" rel="noopener noreferrer"&gt;The basic principles for designing search &amp;amp; results&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@erikdkennedy/7-rules-for-creating-gorgeous-ui-part-1-559d4e805cda" rel="noopener noreferrer"&gt;7 Rules for Creating Gorgeous UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://a11yproject.com/" rel="noopener noreferrer"&gt;a11y Project&lt;/a&gt; (&lt;em&gt;great&lt;/em&gt; resources for creating
accessible web sites/apps)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>design</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 2 Day 7: Tweaks, refactors, fixes</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Sat, 21 Apr 2018 22:19:06 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-2-day-7-tweaks-refactors-fixes-3j5o</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-2-day-7-tweaks-refactors-fixes-3j5o</guid>
      <description>&lt;h2&gt;
  
  
  A short announcement
&lt;/h2&gt;

&lt;p&gt;One note on future &lt;strong&gt;Weekly UI&lt;/strong&gt; posts: often times outside life gets in the way of scheduled series, especially when they have daily elements, like this one. As the summer kicks off, there will be some weeks where I will be busy and/or out of town, and unable to dedicate my full attention to Weekly UI posts as I want to; I will try to recognize those weeks ahead of time and plan on not posting a challenge for such a week.&lt;/p&gt;

&lt;p&gt;Do not fret! That doesn't mean that this series is going anywhere, but just that I want weekly challenges to be consistent with what you all have come to expect. If you want to stay as informed as possible, &lt;a href="https://dev.to/t/weeklyui"&gt;&lt;strong&gt;follow the WeeklyUI tag&lt;/strong&gt; on its tag page&lt;/a&gt; and &lt;a href="https://dev.to/geoff"&gt;give me a follow&lt;/a&gt;; this way, you will get notifications when I post challenges.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/t/weeklyui"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimage.prntscr.com%2Fimage%2FrwKJB4RXQeOggb8XdYMbcA.png" alt="follow the WeeklyUI tag on https://dev.to/t/weeklyui"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Welcome to Week 2, Day 7 of my Weekly UI challenge! Week 2 will focus on a &lt;strong&gt;search bar&lt;/strong&gt; UI component; each day throughout this following week, I will pick one subelement of the design to implement. For day seven, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Tweak, refactor, and/or fix your code
&lt;/h2&gt;

&lt;p&gt;Today is all about you and your design/code perfectionism. Did you want to change your component API to be more flexible? Did you mean to tweak spacing on Day 5 but didn't have time? Perhaps you needed more time to research how to fix a few more a11y issues before you get that perfect score on Day 6. We all have to get sleep, spend time with friends and family, and have other things pop up that may affect your workflow; today is your day to finish strong and get everything up to spec as &lt;em&gt;you&lt;/em&gt; see fit.&lt;/p&gt;

&lt;p&gt;I will be updating my dropdown list items to be focusable via the arrow keys and improving form submission behavior. As always, you can check out my coded implementation &lt;a href="https://geoffdavis92.github.io/weekly-ui/" rel="noopener noreferrer"&gt;on my Github pages site for this project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please add your repos and/or images of your designs in the comments for inspiration! I would love to see what you all created throughout the week.&lt;/p&gt;

&lt;p&gt;Happy fixing! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 2 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/15) Design component ✅&lt;/li&gt;
&lt;li&gt;Input field ✅&lt;/li&gt;
&lt;li&gt;Submit button ✅&lt;/li&gt;
&lt;li&gt;Integrate autocomplete functionality ✅&lt;/li&gt;
&lt;li&gt;Past search term indicators ✅&lt;/li&gt;
&lt;li&gt;100% a11y score ✅&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes 🎯&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Weekly UI Challenge Week 2 Day 6: Score 100% in an a11y audit</title>
      <dc:creator>Geoff Davis</dc:creator>
      <pubDate>Sat, 21 Apr 2018 01:21:30 +0000</pubDate>
      <link>https://forem.com/geoff/weekly-ui-challenge-week-2-day-6-score-100-in-an-a11y-audit-2157</link>
      <guid>https://forem.com/geoff/weekly-ui-challenge-week-2-day-6-score-100-in-an-a11y-audit-2157</guid>
      <description>&lt;p&gt;Welcome to Week 2, Day 6 of my Weekly UI challenge! Week 2 will focus on a &lt;strong&gt;search bar&lt;/strong&gt; UI component; each day throughout this following week, I will pick one subelement of the design to implement. For day six, our goal is to…&lt;/p&gt;

&lt;h2&gt;
  
  
  Score 100% in an a11y audit
&lt;/h2&gt;

&lt;p&gt;Accessibility– or a11y, pronounced "ally"– is a very important concept in modern web development. No matter whether you are building web applications or simple static landing pages, making a web page accessible should be on the forefront of every developer and designer's mind. For many, this is an afterthought, but a11y is quickly becoming a &lt;a href="https://webaim.org/blog/web-accessibility-and-seo/"&gt;metric in SEO ranking&lt;/a&gt; and vital to the &lt;a href="https://www.adatitleiii.com/2018/01/2017-website-accessibility-lawsuit-recap-a-tough-year-for-businesses/"&gt;legal integrity of your web page/app&lt;/a&gt;; it is also a good idea and strategy to make it easier for users to actually use your site/app/widget.&lt;/p&gt;

&lt;p&gt;A11y techniques span quite a few domains and disciplines, from HTML attributes and CSS states, to colors used in the design (you may notice that most colors I used in my design have WCAG contrast ratings of at least AA for their relevant domains) and text that no one will interact with unless they use a screen reader. In order to test for a web page's accessibility, there are several tools floating around the web. One such tool is &lt;strong&gt;&lt;a href="https://ffoodd.github.io/a11y.css/"&gt;a11y.css&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;a11y.css is an awesome tool that uses CSS targeting to find a11y errors, warnings, and advisable tips in your code, and show you the messages inline. You can even configure the tool to target only certain levels of warnings too. When I start working on improving accessibility, this tool is the first one I use.&lt;/p&gt;

&lt;p&gt;Another tool I use is the &lt;a href="https://developers.google.com/web/tools/lighthouse/"&gt;Google Lighthouse accessibility audit&lt;/a&gt; This tool will check all the types of things a11y.css does, and then some. It allows a little more control over debugging, as it will list offending elements, and scolling over that list will highlight those elements in the DOM, much like normal devtools do. I also find Lighthouse a &lt;em&gt;lot&lt;/em&gt; easier to figure out what to fix, since it will also link to explainer pages for each error.&lt;/p&gt;

&lt;p&gt;I've linked several tools and resources for a11y techniques and testing in the footnotes of this post, and I hope you use them and explore ways to help make the web usable for &lt;em&gt;everyone&lt;/em&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Now it's your turn
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://reactjs.org"&gt;React.js&lt;/a&gt; and &lt;a href="http://storybook.js.org"&gt;Storybook&lt;/a&gt; to develop my implementation, but you can use whatever technology stack you would like! (hint: if you use &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt; or &lt;a href="https://angularjs.org"&gt;Angular.js&lt;/a&gt;, you can still use &lt;a href="https://storybook.js.org/basics/slow-start-guide/"&gt;Storybook for those libraries&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You don't even have to use a view library if you don't want to; HTML and CSS-only (and non-view JavaScript library) components are more than possible, especially for this step.&lt;/p&gt;

&lt;p&gt;Also, please add your repos and/or images of your designs in the comments for inspiration! I would love to see what designs you all create.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;h3&gt;
  
  
  Week 2 Calendar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;(Sunday 4/15) Design component ✅&lt;/li&gt;
&lt;li&gt;Input field ✅&lt;/li&gt;
&lt;li&gt;Submit button ✅&lt;/li&gt;
&lt;li&gt;Integrate autocomplete functionality ✅&lt;/li&gt;
&lt;li&gt;Past search term indicators ✅&lt;/li&gt;
&lt;li&gt;100% a11y score 🎯&lt;/li&gt;
&lt;li&gt;Tweaks, refactors, fixes &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ffoodd.github.io/a11y.css/"&gt;a11y.css&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a11yproject.com"&gt;a11y Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques"&gt;&lt;code&gt;aria&lt;/code&gt; techniques on MDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/tools/lighthouse/"&gt;Google Lighthouse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/resources/contrastchecker/"&gt;WCAG Color Contrast Checker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ui</category>
      <category>weeklyui</category>
      <category>challenge</category>
      <category>a11y</category>
    </item>
  </channel>
</rss>
