Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');A few conversations have circled around user-side structural profiling. For context, see React PR #7549: Show React events in the timeline when ReactPerf is active
One particular concern is the measurement overhead. This gist has a benchmarking script (measure.js) for evaluating overhead and initial results.
Runs about 0.65µs per mark() call. Naturally, that's ~= an overhead of 1ms for 1500 mark()s.

| // Require the version of Rx you want to use (_esm5 or _esm2015) | |
| const rxPaths = require('rxjs/_esm5/path-mapping'); | |
| var config = { | |
| // Other config options... | |
| resolve: { | |
| extensions: [".ts", ".js"], | |
| modules: [path.resolve('./src'), 'node_modules'], | |
| // Use the "alias" key to resolve to an ESM distribution |
Domenic's blöcks proposal outlines a way to conveniently define functions that run in another worker/worklet as an inline, non-capturing scope, function body.
Blöcks as proposed have a few open questions and lack a few features that could generalize them to more use cases and with more practical ergonomics.
This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.
The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files,
you just need the one file that you want to add/update.
| import { computed, signal } from "@preact/signals-core"; | |
| import { type SignalsTemplate, render } from "./signals-template"; | |
| import { SignalsWebComponent } from "./signals-web-component"; | |
| const tagName = "x-counter"; | |
| class Counter extends SignalsWebComponent { | |
| counter = signal(0); | |
| counterStr = computed(() => this.counter.value.toString()); |