Performance + Update - Code with Hugo - Sep 24th 2019
Hot off the press
Performance improvements π
Classic lazydev Google PageSpeed: “Inline critical CSS” Me: inline ALL CSS, it’s only 5kb π€·
Code with Hugo now has a 100 PageSpeed score https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fcodewithhugo.com at the cost of inlining all the CSS π
There’s no new post this week since I managed to injure my knee at an international fencing (π€Ί) tournament.
Here’s last week’s post: Detect ctrl/CMD/alt/shift + Click in Vanilla JavaScript and React: Detecting control-click, command-click, alt-click and shift-click in JavaScript without listening to keydown events is straightforward.
A bit of a throwback to an earlier post/website improvement (see Record analytics events with a Zeit “micro” + SQLite3 Node.js application), I’ve written a small client script that shows me what events are being recorded on the site.
Here they are (since they started being recorded).
ββββββββββββββββββββββββββββββββββ¬ββββββββ¬βββββββββββββ β (index) β value β percentage β ββββββββββββββββββββββββββββββββββΌββββββββΌβββββββββββββ€ β total β 1651 β '100' β β overlay_close β 1500 β '90.85' β β newsletter_cta β 137 β '8.30' β β newsletter_form β 5 β '0.30' β β newsletter_ad β 4 β '0.24' β β sequelize_cheatsheet_cta β 3 β '0.18' β β home_ad β 2 β '0.12' β ββββββββββββββββββββββββββββββββββ΄ββββββββ΄βββββββββββββ
As expected, top event is overlay_close
, followed by newsletter_cta
.
If you missed it
Jest Full and Partial Mock/Spy of CommonJS and ES6 Module Imports: The example repository is available at github.com/HugoDF/mock-spy-module-import.
Detect if the current file/module is the entrypoint or import/require-d in Node.js: How does one identify whether a JavaScript file is being run directly (node file.js) or it’s being import/require-d (require(‘./file’) in another JS file).
How to run Jest tests sequentially: By default Jest runs tests in parallel with a “a worker pool of child processes that run tests” (Jest CLI docs).
Record analytics events with a Zeit “micro” + SQLite3 Node.js application: In order to finally switch off Google Analytics, I need to replace my goal conversion tracking somehow.
From the web
How I side project.ink: β¦ but then, I got busy, a few weeks passed, and it took a while for me to get back to it. On the upside, I have a new place for my ramblings now, which is dotink.co. Itβs meant to be a more technical blog for when I want to talk more about software and design, but weβll see how things go.
Watch “10 things I learned making the fastest JS server runtime in the worl by JSConf: This presentation is about server performance, which means that no time in the world would be enough to cover it all. Hopefully, I can share with you the top#10 things Iβve learned while putting JavaScript on the top of the server side benchmarks.You will learn about runtimes and engines, how some
The Myth of Consumer-Grade Security - Schneier on Security: The Department of Justice wants access to encrypted consumer devices but promises not to infiltrate business products or affect critical infrastructure. Yet that’s not possible, because there is no longer any difference between those categories of devices.
Architecting Kubernetes clusters β choosing a worker node size by learnk8s: Today’s answers are curated by Daniel Weibel. Daniel is a software engineer and instructor at Learnk8s. When you create a Kubernetes cluster, one of the first questions that pops up is: “what type of worker nodes should I use, and how many of them?”.