6th week of 2021

Published on

React server-side rendering, being an inspiration, JavaScript closures, exploring GitHub repos with VS Code.

Table of contents

👨‍💼 Work

Gave a presentation on React server-side rendering

Last year I implemented server-side rendering (SSR) to our team's React Single Page Apps. SSR is apparently a rarity in our company (so far), so I was asked to give a 30-minute presentation on the topic to a group of about ten other developers. I covered:

  • What SSR is
  • Benefits and drawbacks of SSR
  • How to implement SSR (general steps)
  • Lessons learned and tips from my last year's implementation.

I'm very happy that I managed to stay chill during the presentation. Had I given the same presentation a year or two earlier, I would have been very nervous. Guess I have grown in that sense.

Plus I'm happy that I got another good topic for a new blog post.

👨‍🚀 Personal

I inspired someone!

I got email from Victor Ofoegbu, who had found my weekly log via Stefan Judis's web dev newsletter. Victor recently started writing weekly notes as well, and I got mentioned in Victor's Weekly Notes 001:

This weekly note was hugely inspired by Jim Nielsen's and Matias Kinnunen's weekly notes.

It's nice to know that my humble weekly notes have inspired someone. And I was very delighted to receive an email from an internet stranger.

So, dear reader: if you send me an email to hello@mtsknn.fi, you'll make me happy!

Then go check out Victor's weekly notes. 🙂

👨‍🎓 Learnings

JavaScript: Definition of closures

I was reading 7 Interview Questions on JavaScript Closures by Dmitri Pavlutin and got stuck in the first question: "Which of the given functions are closures and why?"

I had to look up what MDN says about closures:

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function.

After reading that, answering the question was easy.

Dmitri says it maybe more clearly in the answer section:

A simple rule to identifying a closure is checking whether the function accesses variables from the outer scopes.

Self-defense: I got the other six questions right without having to look up any more info, so I'd say I know my closures. It was just the definition of closures that I had trouble with. 😜

🕵️‍♂️ Cool stuff

github1s: One second to read GitHub code with VS Code

Change "github.com" to "github1s.com" to open a GitHub repo in VS Code (in the browser). Example using my website repo:

Why this is cool:

  • Provides a handy, easy and familiar way to browse the files of a repo.
  • Opens very quickly (in ~1 second 🙂).

See github1s on GitHub. Found via Hacker News.

💁‍♂️ More Weekly log entries

Next week: 7th week of 2021

Previous week: 5th week of 2021