Tag Archives: javascript

React v16.3.0: New Lifecycle Events and Context API

React 16.3.0 just got released. Next to being able to forward refs and some changes to the lifecycle events it also sports a new Context API which I’ve written about before. Even though the introductory blogpost over at the React … Continue reading

Elsewhere , , Leave a comment

Video Music – Make music by flashing colored items in front of your webcam

This makes music and needs access to your camera. The average hue from your camera controls which chord will play. Video Music →

Elsewhere , , , , Leave a comment

Working with Houdini’s new CSS Typed Object Model (Typed OM)

Chrome 66 will add support for Houdini’s Typed OM. Eric Bidelman from Google has documented how we can use this. CSS now has a proper object-based API for working with values in JavaScript. The days of concatenating strings and subtle … Continue reading

Elsewhere , , , Leave a comment

Using the new Async Clipboard API

Shipping with Chrome 66 is an implementation of the new Async Clipboard API. Its asynchronous nature makes it the preferred way – over document.execCommand – to perform copy-paste operations in the browser. // Write Text to the Clipboard (e.g. copy) … Continue reading

Elsewhere , , , Leave a comment

V8 internals for JavaScript developers: Arrays

This presentation demonstrates how learning just a little bit about JavaScript engine internals can help you improve the run-time performance of your JavaScript code — not just in V8 specifically, but across all JavaScript engines! A written version is also … Continue reading

Elsewhere , , , Leave a comment

Making a Deep Copy of an Object in JavaScript

In JavaScript, when cloning an object via Object.assign({}, obj) or by destructuring it (e.g.{…obj}, only shallow copies are created. Surma has explored some unusual ways – other than JSON.parse(JSON.stringify(obj)); to create an actual deep copy: MessageChannel History API Notification API … Continue reading

Elsewhere , 1 Comment

Run your tests using Jest & Puppeteer with jest-puppeteer

With jest-puppeteer – and its included expect-puppeteer assertion library – it’s possible to use Puppeteer within your Jest tests. Writing integration test can be done using Puppeteer API but it can be complicated and hard because API is not designed … Continue reading

Elsewhere , , , , Leave a comment

What’s next for React? Beyond React 16

Dan Abramov – of Redux fame – just spoke at JSConf Iceland 2018 previewing two new features that will make it in a future version of React. The first demo shows time slicing, which can be translated to async rendering: … Continue reading

Elsewhere , , Leave a comment

React’s new context (React 16.3.0)

One of the new things in React 16.3.0 is a new context API: Typically, data in a React application is passed top-down (parent to child) via props. But sometimes it’s useful to pass values through multiple levels of abstraction without … Continue reading

Original Content , 2 Comments

WTFJS with Math (or why 0.1 + 0.2 results in 0.30000000000000004)

A few fun little Math-related wtfjs examples. A classic one is adding an empty Array and an empty Object: [] + {} // ‘[object Object]’ {} + [] // 0 If you’re looking for a hint: Coercion. JS WTF with … Continue reading

Elsewhere , , , Leave a comment