Big and slow, but powerful

08/31/2020

38,470 Subscribers. Every Monday.

It was a slow week in JavaScript world, but speaking of slow things…

Electron released v.10.0.0

Snorlax and Electron

Snorlax and Electron: big and slow, but powerful

Electron hit double digits last week and celebrated by… (checks notes) updating to Chromium 85?

Ok, this release might not be jam-packed with exciting new features, but it’s another solid update that should continue to make Electron the framework of choice for creating cross-platform desktop apps.

Highlights:

  • API changes: New session-persistent API enhancements, a new contents.getBackgroundThrottling() method and contents.backgroundThrottling property, and the removal a few deprecated APIs.
  • Stack updates: V10 steps up to Chromium 85, V8 8.5, and Node.js 12.16. It doesn’t sound super thrilling, but keeping Electron current with all of these technologies is a big undertaking.
  • Other notable features: New and improved window event handling, the addition of a new sameSite property to the Cookie structure, and enabling native Electron handling and passing of Node.js cli options. Check out the release notes for the full breakdown.

The bottom line

It’s easy to criticize and/or make jokes about Electron being big and slow (like we just did). And it will probably continue to be big and slow (relatively speaking) for as long as it bundles Chromium and Node.js to enable cross-platform desktop app development. (So probably forever, since that’s kind of Electron’s thing.)

This update didn’t do much to address performance concerns, but that doesn’t mean you should throw out the entire Electron baby with the less-performant bath water. There’s still tons of value in being able to use one codebase to build desktop apps for Linux, Windows, and Mac - just ask Slack (once you restart it).


TWIH

A star was born

A star was born

29 years ago this week, Linus Torvalds announced “Freax” to the world, or at least to his University of Helsinki classmates. Not commonly known, “Freax” originally stood for “I’m a huge dick but was later re-branded to Linux.

His original message described Linux as, “a free operating system that’s just a hobby and won’t be big.” Turns out, like Linus’ ego, it got pretty big.

Linux is the most widely-used OS in the world, because it powers Android and most embedded systems (everything from in-flight entertainment screens on planes to the Tesla Cyber Truck). Last week, the Linux kernel accepted its one millionth commit.

Not bad for “just a hobby.”

The Linux community has come together to state their goals for the next 29 years. Check out this brief inspirational video from their very official spokesman for more info.


JS Quiz - Answer below

What will be logged to the console after the code is finished executing?

function first () {
  var name = 'Jordyn'

  console.log(name)
}

function second () {
  var name = 'Jake'

  console.log(name)
}

console.log(name)
var name = 'Tyler'
first()
second()
console.log(name)

Cool bits

  1. Harry filmed a video about why he’s “jumping off the GraphQL hype train” in the cupboard under the stairs his basement. Blink twice if you’re being held hostage, Harry.
  2. Bryan wrote a great tutorial on how to build a plugin system from scratch in JavaScript.
  3. theheadless.dev is a new collection of free, in-depth guides to help your learn Puppeteer and Playwright. You might want to pump yourself up before jumping into these by blasting “Master of Puppets” on your iPod Shuffle from middle school.
  4. ztext.js is a slick new JavaScript library that lets you make any font 3D. In case you’ve been really itching to create your own WordArt™ but just didn’t know where to begin.
  5. Low-level JavaScript made a cool video about how audio is encoded and stored in WAV files and how you can read and create these files in JavaScript. Cue Kanye voice: “Because waves don’t dieee”
  6. Milko wrote about how he got started contributing to Angular components.
  7. Two Storybook maintainers just released a new edition of Intro to Storybook that walks through all the new features, while still covering the fundamentals.
  8. EffectfulJS is a new JavaScript/TypeScript debugger with hot-swapping, API & Persistent state, time traveling and more.

JS Quiz - Answer

We get undefined, Jordyn, Jake, then Tyler. What this shows us is that you can think of each new Execution Context as having its own unique variable environment. Even though there are other Execution Contexts that contain the variable name, the JavaScript engine will first look to the current Execution Context for that variable.

For more info (and to see a cool GIF on how the JS interpreter evaluates the code above that I would include here but honestly I’m not sure how different email clients support GIFs), visit The Ultimate Guide to Hoisting, Scopes, and Closures in JavaScript


38,470 Subscribers. Every Monday.