Show newer

(TypeScript developers might want to look away now…) 

So fuck me, you know what it was? I got the fucking order of response and reject wrong in the arguments of the Promise() constructor *AGAIN*

:awesome: 👍

*smh*

Show thread

(TypeScript developers might want to look away now…) 

(Also, I just checked and it’s not something specific to when the datatype your promise from the constructor resolves to is a proxy. That also works in isolation.)

🤔

Show thread

(TypeScript developers might want to look away now…) 

Hmm, no, it’s not that. Just created a basic spike to test just that and ESM is perfectly happy if you return a promise from a constructor that eventually resolves to a different datatype. So it must be something else that’s triggering it. With the stack traces were more helpful.

Show thread

(TypeScript developers might want to look away now…) 

(So in case you’re wondering the resolved datatype is a proxy to the datatype. Previously, I was returning this from the synchronous constructor but since dynamic imports are asynchronous, my constructor needs to be also now. And when the promise tries to resolve, that’s when Node throws its exception. Fun times!) :)

Show thread

(TypeScript developers might want to look away now…) 

So apparently ESM doesn’t like it when you change the type of an object by resolving to a different type from a promise returned from the constructor…

(Hey, don’t judge me, I have my reasons. And yes, they’re niche.) :P

Such useful errors, Node.js… (thank goodness for NODE_DEBUG=*)

internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
{}

Alicia Kennedy: On the future and why justice is more important than innovation.

aliciakennedy.news/p/on-future

Read and absorb every delicious word of this.

New blog post: Cache busting in Node.js dynamic ESM imports

ar.al/2021/02/22/cache-busting

(Includes link to a tiny module I made that generalises this that you probably don’t even need to use: npmjs.com/package/@small-tech/)

Very interesting, I didn’t realise that subresource integrity was entirely missing from the ESM spec. So what this would mean is that, with ESM, any code loaded from any CDN could contain a potential government backdoor. How is this not a bigger issue?

github.com/skypackjs/skypack-c

(I’m saying a government backdoor because it would most likely take a state-level actor to force a CDN company to do that but it could, of course, be a disgruntled employee or cracker.)

Yay, happy to see folks using Auto Encrypt (super simple automatic Let’s Encrypt certificate provisioning for Node.js)

github.com/immers-space/immers

If you missed today’s S’update live stream, you can watch the recording on ar.al (I demonstrated the new small web place setup flow, including cloning the reference client).

Show thread

Sorry folks, elementary OS giving me grief (apps sometimes lose where they’re supposed to be – in which space/monitor and then you just can’t get them to launch properly without a reboot). Going to reboot and start a new live stream in a few minutes.

Show thread

Today’s S’update (small update about the small web stuff I’m working on) live stream is going to start in a few minutes.

Watch live at: ar.al

w00t! Just got small web place creation → serving flow working with Place, with key material being generated and the client being cloned from a remote repo. Will do a S’update live stream tomorrow to show it off :) Feels so great to have the conceptual model of what I’m building properly solidifing in my head and to be making progress again :)

Problem: you want to use Node’s promisified child_process.exec (Node 12+) but you also want to stream in progress from executed command. Solution: 

import childProcess from 'child_process'
import { promisify } from 'util'
const _exec = promisify(childProcess.exec)

async function exec(command) {
const commandPromise = _exec(command)
const commandProcess = commandPromise.child
commandProcess.stdout.pipe(process.stdout)
await commandPromise
}

// e.g.
await exec('ls -laR ~')

@aral @rho small-tech.org/videos/index.xm is the URL. Looks like the output is a little bit wonky right now (I’ll get that fixed) but it still gets you the videos and transcripts when they’re updated!

Last night’s Small is Beautiful live stream video is now up along with captions, or a transcript if that’s more your kind of thing. Thanks to Paul Frazee (and Kit) for being a fabulous guest and such an in-depth discussion of decentralised social networks.

small-tech.org/videos/small-is

I’ve no idea why I referred to @aral as “that man” multiple times… 😂

If you missed today’s live stream of Small is Beautiful with Paul Frazee (with a surprise appearance by @w3bk3rn3l) on CTZN and decentralised social networking, the recording is up on small-tech.org/small-is-beauti

Show older
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!