Friday Frontend: WebAsssembly Rising Edition
Hope you had a great week! It’s been wonderfully warm out here in California, and I am loving it.
This week, by far the most fascinating article to me is the headliner in ‘Other Awesome’, with Firefox using WebAssembly for a purpose I never would have imagined. It gives some hints of how powerful and wide-reaching of a paradigm shift WASM is going to create, and I love it. Many other good things as well, but boy, that one takes the cake.
KBall from ZenDev
CSS & SCSS
I’m not sure if I was just being dense or if this article is poorly structured, but it took me a long time to understand exactly what was being shown. That said, the techniques demonstrated are super useful, so I want to highlight here. The author demonstrates multiple different ways to achieve the same mouse-focused UI, and then provides recordings of how they are treated differently by screen readers.
Not only is the final solution super slick, but I love the way this article walks through the thought process from design all the way to outcome. Very cool!
Super fun walkthrough of how to create diagonal backgrounds without having to worry about how your content will lay out within them.
OMG this is amazing. It reminds me of the first time I saw flexbox and was like “wow, this just instantly solves problems I’ve been hacking around for years”. In this case, it’s a bit smaller and more particular, but this new piece of CSS solves a problem I’ve hacked around probably a dozen times - offsetting scroll positions of internal anchors when you have a fixed header. And it’s usable on all major browsers (so long as you can ditch/specialcase IE 11).
I agree with all of these practices, though some of them I had to learn by pain. In particular, I used to use default exports a lot because it felt simpler/cleaner, but oh boy can it set you up for a world of maintenance pain down the road. Named exports are the way to go.
Great article. As it points out, memory leaks are a huge class of problems that web developers “didn’t have to worry about” in the pre-SPA days, because every time you loaded a new page your memory would all get cleaned up. In today’s world with long-lived applications that never refresh the page, this is 100% a problem, and the tools highlighted here are critical.
Super interesting look at the expressivity of the type system of TypeScript. Introduces the concept of the “TypeScript type system (TSts)” as its own (compile-time evaluated) language, and walks through its capabilities evaluating it as a programming language.
(Bias alert - I’m in this podcast episode) If the previous article peaked your interest in Ember at all, or if you’re generally curious about this framework that has low adoption but keeps driving innovations across the ecosystem, we recently recorded this podcast episode diving deep into what the framework is, what makes it unique, and where it is going. While this is an audio, there is a transcript available as well.
This is utterly fascinating. Firefox is using the security characteristics of WebAssembly (particularly the extremely powerful sandboxing) to improve how it secures it’s own internal pieces. They’re using a new tool that lets them compiles C++ components into WebAssembly and provides an interface layer between code calling those components and the rest of the app, effectively sandboxing the components. Even more interesting, they then *recompile* down from WebAssembly to native machine code, reaping some performance benefits along the way.
Super interesting look at how patterns intended to improve time to interactive can backfire and slow down your website’s load time. In particular, if you’re using preload tricks with CSS to try to speed things up, definitely read this to see how they can backfire and how to prevent backfire. And if you’re not aware of such tricks, this article will still be interesting to give you some ideas for how you can optimize your site.
Great collection of useful tools for front-end developers. I particularly love the proliferation of available vector art. Some wonderful resources in here that I hadn’t seen before.
A fun look at a number of modern browser APIs, complete with code examples for each. You’ve probably already heard of some of these (e.g. the ResizeObserver API) but I’d be very surprised if you don’t learn something new in this article. I sure did.
A look at one of the techniques you can use to optimize the performance of a GraphQL server. As I’ve been more and more exposed to GraphQL at work I’ve increasingly realized that the naive “GraphQL makes things simpler and faster” concept that sometimes happens in the frontend is wrong. GraphQL moves your performance and complexity challenges into a new layer in the system. This can be a big win, but it necessitates its own layers of expertise and optimization.