The ECMAScript proposal “Shared memory and atomics” by Lars T. Hansen has reached stage 4 this week and will be part of ECMAScript 2017. It introduces a new constructor SharedArrayBuffer
and a namespace object Atomics
with helper functions. This blog post explains the details.
A proposed “spec mode” for Babel makes transpiled ES modules more spec-compliant. That’s a crucial step in preparing for native ES modules. You’ll also learn how ES modules and CommonJS modules will interoperate on Node.js and how far along ES module support is on browsers and Node.js.
MessageChannel
Occasionally, you want Web Workers to communicate with each other. Doing so is not obvious as most Web Worker examples are about communicating between the main thread and a Web Worker. There, one uses postMessage()
to send messages directly to the Worker. Alas, that doesn’t work for communicating between two Workers, because you can’t pass references to Workers around.
import()
– dynamically importing ES modulesThe ECMAScript proposal “import()
” by Domenic Denicola is at stage 4 and part of ECMAScript 2020. It enables dynamic loading of ECMAScript modules and is explained in this blog post.
I got my new MacBook Pro this week. These are my first impressions of the machine. I’ve moved from a MacBook Air 13" to a MacBook Pro 13".
My dream notebook would have been a 13" version of the 12" MacBook. It’s a shame that Apple didn’t introduce such a machine, but I understand the decision to keep things simple. Accordingly, I changed the planning for my setup:
One benefit of this switch is that I won’t have to wait until new iMacs come out in order to have a large high-resolution display at home.
The following function evalCode()
traces the global variables that are accessed while evaluating a piece of JavaScript code.
[].concat[1,2,3]
In this blog post, we look at a syntactic puzzle. This is just for fun; there is nothing useful you can do with what we examine. It may, however, make you more aware of how JavaScript works, syntactically.
A proxy object can be seen as intercepting operations performed on its target object – the proxy wraps the target. The proxy’s handler object is like an observer or listener for the proxy. It specifies which operations should be intercepted by implementing corresponding methods (get
for reading a property, etc.). If the handler method for an operation is missing then that operation is not intercepted. It is simply forwarded to the target.
Therefore, if the handler is the empty object, the proxy should transparently wrap the target. Alas, that doesn’t always work, as this blog post explains.
This blog post describes what you can do with functions that return tag functions for ES6 template literals.
For an introduction to template literals, tagged template literals and tag functions, consult chapter “Template literals” in “Exploring ES6”.
This blog post covers three ways of understanding Promises.