Friday Frontend: Optional Chaining Edition
Tags: fridayfrontend, css, javascript, webdev
Published: 2019-10-04 16:40:49

---
title: Friday Frontend: Optional Chaining Edition
published: true
tags: friday-frontend, css, javascript, webdev
canonical_url: https://zendev.com/2019/09/20/optional-chaining-edition.html
---

[Ed note: I got behind on republishing to dev.to, so this is coming out here a couple weeks late. Sorry!]

Hope you’ve had a great week! I got derailed towards the end of the week with a small family emergency, so we’re a little short on articles this week, but still some great stuff.

I particularly recommend 2 CSS articles: the one on custom properties and animations, and the one on CSS architecture. In the JavaScript section the optional chaining article shows off a very exciting addition to the language. And the dive into how different web practices impact power use in the last section is fascinating!

Have a great weekend! Enjoy!

Best,  
KBall from ZenDev

#### CSS & SCSS

##### [Using Custom Properties to Wrangle Variations in Keyframe Animations](https://css-tricks.com/using-custom-properties-to-wrangle-variations-in-keyframe-animations/)

An excellent example of using CSS custom properties to make something simpler. Looks at using scoping of properties to influence characteristics of a CSS Keyframe Animation that previously would have required multiple animations.

  

##### [Under-Engineered Text Boxen](http://adrianroselli.com/2019/09/under-engineered-text-boxen.html)

Fun look at how to use the most minimalistic CSS possible to style text boxes. With CSS getting so much more powerful and with so many more options, it’s interesting to see someone looking not at ‘how much can I do’ but ‘how can I do enough with a little as possible’.

  

##### [Ghost Buttons with Directional Awareness in CSS](https://css-tricks.com/ghost-buttons-with-directional-awareness-in-css/)

This is a great example on the other side of “how much can I do with CSS” - creating ‘ghost buttons’ (with no fill) that fill in on hover, but making that hover come from the side your mouse did. A takes combo of clip path and multiple elements, but it is truly impressive what you can do here with just HTML and CSS.

  

##### [Keeping it simple with CSS that scales](https://hankchizljaw.com/wrote/keeping-it-simple-with-css-that-scales/)

Great long-form look at CSS practices and architectural approaches to keep your CSS maintainable and effective as you scale up your project. Highly recommend a read through.

  
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7D6K7I&amp;placement=zendevcom" id="_carbonads_js"></script>
#### JavaScript

##### [😲🤯The most outstanding new feature in Javascript you need to know about: Optional Chaining](https://dev.to/lampewebdev/the-most-outstanding-new-feature-in-javascript-you-need-to-know-about-optional-chaining-2pg2)

Optional chaining is amazing, this is a great quick read to learn about what it is and how it works. And because this is JavaScript™ there is of course a babel plugin you can use to start using it right away.

  

##### [4 Ways to Safely Access Nested Objects in Vanilla Javascript](https://medium.com/better-programming/4-ways-to-safely-access-nested-objects-in-vanilla-javascript-8671d09348a8)

If you’re in an environment where you don’t want to or can’t use the babel plugin above, and you don’t want to wait for optional chaining, check out this article for some great ways to safely deal with nested objects in just Vanilla JavaScript.

  

##### [How to test JavaScript with Jest](https://www.freecodecamp.org/news/how-to-test-javascript-with-jest/)

A solid and in-depth introduction to testing with Jest. 

  

##### [RxJS Patterns: Efficiency and Performance](https://blog.bitsrc.io/rxjs-patterns-efficiency-and-performance-10bbf272c3fc)

RxJS is one of those libraries and approaches that feels like overkill until it doesn’t, and then it’s amazing. It’s a toolkit for handling and composing asynchronicity in a far more robust manner than hand managing promises and async/await, but one of the challenges is the surface area of the API is large enough it’s hard to get a handle on. If you’re not already a little familiar RxJS, I’d start at [the docs intro](https://rxjs.dev/guide/overview), but if you’ve played with it and want to get a sense of more of the API space and potential, this is a great article.

  

#### Other Awesomeness

##### [How Web Content Can Affect Power Usage](https://webkit.org/blog/8970/how-web-content-can-affect-power-usage/)

The webkit team digs into what impacts power usage, and thus that all important factor of battery life. As more and more consumption moves to mobile, this is a bigger and bigger area of concern. They do a nice job of explaining both what uses more power and what tools you can use to trace down issues.

  

##### [5G Will Definitely Make the Web Slower, Maybe](https://www.filamentgroup.com/lab/5g/)

A call to arms to resist the trend of countering every improvement in hardware technology by sending more complex software. Bangs the drum for reducing the amount of JavaScript we’re sending to clients.

  

##### [Inconsistent behavior among browsers when clicking on buttons](https://zellwk.com/blog/inconsistent-button-behavior/)

I hadn’t realized this, but apparently browsers vary widely in how they handle focus after button click. Check this out! A nice bit of research, plus some recommended JavaScript for making the situation more consistent.

  

##### [(Why) Some HTML is "optional"](https://dev.to/remy/why-some-html-is-optional-2e11)

A fun look through some of the history of HTML and why some elements have “optional” closing elements. Oh how far we’ve come...

  

* * *

#### Happy Friday!

That's it for this week's Friday Frontend newsletter. If you enjoyed this, you should probably [follow me on Twitter](https://twitter.com/kbal11) or join my mailing list. Sign up to get these newsletters straight to your inbox every Friday! Sign up here: [https://zendev.com/friday-frontend.html](https://zendev.com/friday-frontend.html)