Friday Frontend: Hooks Are Appearing Everywhere Edition
Tags: fridayfrontend, webdev, css, javascript
Published: 2019-04-05 16:15:31

---
title: Friday Frontend: Hooks Are Appearing Everywhere Edition
published: true
tags: friday-frontend, webdev, css, javascript
canonical_url: https://zendev.com/2019/04/05/hooks-are-appearing-everywhere-edition.html
---

Happy April! This week’s newsletter includes a couple really interesting examples of how React Hooks are starting to explode into prominence. The API has been live in a production release for just 2 months, but we’re starting to see a ton of really interesting open source packages providing custom hooks.

Enjoy!

Best,  
KBall from ZenDev

#### CSS & SCSS

##### [Breaking CSS Custom Properties out of :root Might Be a Good Idea](https://css-tricks.com/breaking-css-custom-properties-out-of-root-might-be-a-good-idea/)

As CSS Properties have become more common, we’ve seen tutorial after tutorial defining them at the `:root` level. This is fine, and consistent with the typically global nature of CSS (and the way most folks have used SCSS variables), but it’s neat to see an article digging into the ways we can actually scope CSS variables and use that to create encapsulation without any fancy CSS-in-JS or even BEM-style naming.

  

##### [Managing Z-Index In A Component-Based Web Application](https://www.smashingmagazine.com/2019/04/z-index-component-based-web-application/)

Both an in-depth explanation of z-index and stacking contexts and a solid recommended approach for preventing z-index problems in a component-based application. Very much worth a read!

  

##### [How To Align Things In CSS](https://www.smashingmagazine.com/2019/03/css-alignment/)

A great look at the various ways we can align things on the page with CSS. Doesn’t go super in depth on any one way, but highlights the different approaches, when you’d use them, and what some common sticking points are before pointing off to other resources for anyone who wants to go deeper on a particular approach.

  

##### [A Guide to CSS counter](https://medium.com/@samanthaming/a-guide-to-css-counter-8e80039ac547)

CSS Counters are a really weird thing to wrap your head around… they are implicitly incremented based on matching of selectors… this article will give you all the info about how they work, though I still am not sure I understand when you’d want to use them.

  

#### JavaScript

##### [12 JavaScript Tricks You Won’t Find in Most Tutorials](https://medium.com/@bretcameron/12-javascript-tricks-you-wont-find-in-most-tutorials-a9c9331f169d)

A great set of short recipes and tricks for writing more concise and performant code. Some of these I use every day, but there’s some that were still new to me (the bitwise ‘or’ as a shortcut for rounding is something I’d never seen before. TIL.)

  

##### [What is `this`? The Inner Workings of JavaScript Objects](https://medium.com/javascript-scene/what-is-this-the-inner-workings-of-javascript-objects-d397bfa0708a)

A fascinating mind-bender of an article that gets you exploring how well you really understand `this`. Take a look at this when you have a little time because you will get exponentially more out of it if you try the exercises than just read through.

  

##### [10 React Hooks you Should Have in Your Toolbox](https://blog.bitsrc.io/10-react-custom-hooks-you-should-have-in-your-toolbox-aa27d3f5564d)

Hooks have only been truly “production live” for a couple months now but we’re starting to see a rich ecosystem of open source custom hooks emerging. This post goes through a set of nice ones.

  

##### [Modern and clean routing with hooks](https://parastudios.de/modern-and-clean-routing-with-hooks/)

Another very interesting example of what folks are starting to do with hooks. This time, they’re used to implement a super simple routing system for a React application.

  

##### [Free Nuxt.js Tutorial — Vue Mastery Course](https://medium.com/vue-mastery/free-nuxt-js-tutorial-creating-an-app-1a531bc6045)

The last two major client projects I’ve built, the front-end has been built with Nuxt.js. This is a higher-level framework built on top of Vue.js that makes setting up a “Universal JavaScript” (SSR with client-side hydration) super easy, with a lot of additional great features as well. I highly recommend exploring Nuxt, and if you haven’t yet this article is a decent place to start.

  

#### Other Awesome

##### [Morning Cup of Coding](https://www.humanreadablemag.com/morningcupofcoding)

For those who can't get enough learning and aren't restricting themselves to the frontend I highly recommend this newsletter. Morning Cup of Coding is a newsletter of similar structure to this one but covering all fields of programming. Curated by [Pek](https://www.pekalicious.com/) and delivered every workday, it is designed to be your morning reading list.

  

##### [14 of the best JavaScript APIs](https://www.creativebloq.com/features/best-javascript-apis)

The title is slightly misleading, these are really more browser APIs than JavaScript broadly (most wouldn’t make any sense in Node) but this is still a super-cool look at a set of new and in some cases still-under-development browser capabilities that we can start to use in our websites and applications.

  

##### [Stop using so many divs! An intro to semantic HTML](https://dev.to/kenbellows/stop-using-so-many-divs-an-intro-to-semantic-html-3i9i)

An excellent introduction to semantic tags and HTML. If your web sites (or components) still look like div soup, you should definitely give this a read through.

  

##### [Responsible JavaScript: Part I](https://alistapart.com/article/responsible-javascript-part-1)

Another look at the cost of framework-first development practices and the downsides of the developer ergonomic focused approach to web development. Interesting read.

  

##### [How to use JSDelivr](https://zellwk.com/blog/jsdelivr/)

One of the frequently bemoaned issues with modern web development is how build & CLI intensive it is. You need to understand npm, and build systems, and so much stuff just to get a simple web app up? In fact, for many things you do not… and you can load most open source packages straight from free CDNs like JSDelivr. This post explains that and how to go about doing it.

  

##### [A Future Without Webpack](https://www.pikapkg.com/blog/pika-web-a-future-without-webpack)

A provocative title, and an interesting idea. A look at how we might be able to use the fact that JavaScript now has native modules to back away from the bundler requirement and be able to ship modern web apps (with dependencies) without a bundler. Interested readers might also check out [this interview](https://changelog.com/jsparty/69) with the author on the same subject.

  
  

#### 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)