This is my current best attempt to allow iterating on the user experience of a UI that loads streaming responses from an LLM and may have some interesting intermediate states while the response trickles in.
Supposedly, the prefers-*
media features represent the preferences of the user. And in some cases, that is true: User agents dutifully report what the user configured at the OS- or browser-level. And websites are encouraged to accommodate those wishes.
But the model breaks when the user has site-specific preferences. Suddenly the responsibility of keeping track and faithfully representing the user's preferences falls on the site and the user agent's view of the "preference" is plain wrong.
This leaves websites two options:
- Ignore the user's real preference for their site and only honor the system-level configuration.
- (Mostly) ignore the CSS media feature, outside of gathering initial default values via JS.
# Usage: gh <org-or-user>/<repo> | |
# Example: gh nodejs/node | |
gh () { | |
local repo=$1 | |
local target="$HOME/code/src/github.com/$1" | |
local url="[email protected]:$repo.git" | |
if [[ ! -d "$target" ]] | |
then | |
git clone "$url" "$target" | |
fi |
module.exports = 'ok'; |
- Start the server via
node server.js
. - Open http://localhost:3000.
- If the compilation cache leads to bad meta data in dynamic import, the message should only be logged once.
/node_modules | |
/input.js |
{ | |
"scripts": [], | |
"showConsole": true, | |
"scriptType": "module" | |
} |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<h1>RegLang</h1> | |
<pre id="result"></pre> | |
<script src="/script.mjs" type="module"></script> | |
</body> |
class ResolvedRef { | |
#href; | |
#signature; | |
static get protocol() { | |
return 'resolved-ref:'; | |
} | |
constructor(href, signature) { | |
this.#href = href; |
There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.
For many people writing JavaScript that gets passed into build tools,