diff --git a/src/components/sections/WhoDoesTheWork.astro b/src/components/sections/WhoDoesTheWork.astro index ce80d91..bd1fc85 100644 --- a/src/components/sections/WhoDoesTheWork.astro +++ b/src/components/sections/WhoDoesTheWork.astro @@ -55,8 +55,8 @@ const rows = [ .who__list { margin: 0 0 2rem; display: grid; - gap: 0; - max-width: 46rem; + grid-template-columns: repeat(2, minmax(0, 1fr)); + column-gap: clamp(2rem, 6vw, 4.5rem); } .who__row { @@ -82,10 +82,11 @@ const rows = [ } .who__row--you { + grid-column: 1 / -1; border-bottom: none; border-top: 1px solid var(--matcha); - margin-top: 0.6rem; - padding-top: 1.1rem; + margin-top: 1.4rem; + padding-top: 1.2rem; } .who__row--you dt { @@ -100,12 +101,18 @@ const rows = [ .who__punch { margin: 0; - max-width: 46rem; + max-width: 52rem; font-size: 1.05rem; line-height: 1.7; color: var(--ink); } + @media (max-width: 700px) { + .who__list { + grid-template-columns: minmax(0, 1fr); + } + } + @media (max-width: 480px) { .who__row { font-size: 0.95rem; diff --git a/src/content/blog/green-tea-26-8-0-beta-1.mdx b/src/content/blog/green-tea-26-8-0-beta-1.mdx new file mode 100644 index 0000000..ea8b5b6 --- /dev/null +++ b/src/content/blog/green-tea-26-8-0-beta-1.mdx @@ -0,0 +1,101 @@ +--- +title: "Green Tea 26.8.0-beta.1: you can see what it's doing" +description: "A correlated event stream and an injectable logger, shutdown as an extension point instead of a SIGTERM handler you write yourself, and one routing behaviour change that ends a difference between runtimes." +pubDate: 2026-08-19 +author: "Diego Reséndez" +tags: ["green-tea", "release", "observability", "shutdown"] +draft: true +--- + +The last release made the router stop guessing. This one makes the framework stop being quiet. + +Green Tea `26.8.0-beta.1` closes the gap a team hits in week one of a real evaluation: until now you could run an +application on this framework and have no idea what it was doing. That was written down as a known gap. It isn't one +any more. + +## Every request has an identity, and every event carries it + +Core emits a correlated lifecycle event stream. Each request gets an id — if a gateway already sent an +`x-request-id`, that one is adopted rather than replaced — and every event of that request carries it, alongside the +matched route **pattern** rather than the concrete URL, so `/users/:id` aggregates instead of exploding into a +million distinct strings. Each step reports its own duration. + +```ts +const app = createApp({ modules: [AppModule], logger: myLogger, logRequests: true }); +``` + +The logger is any object with `debug`, `info`, `warn` and `error`. Given none, the default writes JSON, or a +readable line when it is attached to a TTY. **Nothing in core writes to `console`** — that is enforced by a lint rule +over the whole source tree, not by intention — so every diagnostic the framework produces is something your +application can redirect. + +What is deliberately *not* here: no metrics registry, no OpenTelemetry exporter. Core keeps one runtime dependency, +and an exporter is a package, not a framework feature. A `traceparent` header is carried through untouched for one +to read. Green Tea ships an observability contract, not an observability integration. + +The cost was measured rather than assumed: about 7% of the framework's own per-request work, which is roughly 2% +once a real socket is involved. + +## Shutdown is somewhere you can hook into + +Closing what your application opened no longer means writing `process.on('SIGTERM', …)` yourself. + +```ts +@Provider({ provides: 'db' }) +class Db { + provide() { return { db: this.#pool }; } + async dispose() { await this.#pool.end(); } +} +``` + +A provider that opened a pool closes it in `dispose()`. A plugin registers `onShutdown`. An application that wants +neither passes `createApp({ hooks })`. All three land in one registry, all three are **awaited** — unlike a bus +listener, which is fire-and-forget — and they run in reverse boot order, so a `cache` that needs `db` closes before +the `db` does. A failure is logged and the rest still run, because one broken teardown must not leave a process up. + +It happens inside `close()`'s deadline, so a slow teardown cannot hold a deploy open, and +`createApp({ teardownTimeoutMs })` reserves part of that budget when a connection has to get its chance. On the edge +none of it applies — workerd has no shutdown to hook, and saying so is better than pretending otherwise. + +## One behaviour change worth reading before you upgrade + +**`.` and `..` in a request path now resolve instead of returning 404.** `GET /public/../admin` reaches a route +declared as `/admin`, and `%2e` counts as a dot. + +This changes Node only, and it exists to end a difference rather than to be lenient. Deno, Bun and Workers resolve +dot segments inside the `Request` constructor, before the framework sees anything — so the same bytes on the wire +were already reaching different routes depending on where you deployed. Rejecting instead was not implementable on +three of the four runtimes, so Node converged on resolving. + +If a proxy or WAF in front of your application matches on the literal path, it now sees something different from +what the application routes. That is worth ten minutes of your attention before you deploy this. + +## Smaller things you may have been waiting for + +- **`createApp({ shutdownTimeoutMs })`** sets the shutdown deadline app-wide, for when `close()` is reached from a + signal handler you do not own. +- **`limits.maxConnections`** caps concurrent sockets on Node, which was previously unbounded. Non-positive values + leave it unlimited. +- **A bounded `close()` on the Deno and Bun adapters.** One difference the deadline cannot hide: Node and Bun force + the remainder shut, Deno cannot — there the deadline bounds how long `close()` waits, not when connections die. +- **The documentation moved to its own repository**, so a docs fix no longer waits on a framework release. + +## Thank you + +Two people shipped code in this release. + +**[@YxnnXriel](https://github.com/YxnnXriel)** contributed the timeout on `app.close()`. Every shutdown deadline +above is built on it — the app-wide option, the bounded adapters, the teardown budget. Before it, one stuck handler +could hold a deploy open indefinitely. + +**[@hgshreyas](https://github.com/hgshreyas)** contributed the concurrent connection limit. Node's socket count was +unbounded, which meant the framework had no answer at all to load it could not serve. + +There is more on this in a longer post, because "thanks to our contributors" is worth nothing next to a sentence +someone can point at. + +## Still beta + +The API can still change before stable, mesh is still alpha, and the plugin ecosystem is still one person. The +freeze belongs to the release candidate — and freezing the API before observability landed would have frozen a +framework still missing its contract. diff --git a/src/content/blog/the-trust-release.mdx b/src/content/blog/the-trust-release.mdx new file mode 100644 index 0000000..01a7a4a --- /dev/null +++ b/src/content/blog/the-trust-release.mdx @@ -0,0 +1,119 @@ +--- +title: "Trust is a feature, and I had shipped it as a TODO" +description: "What it took to make green-tea operable: an observability contract, shutdown that actually lets go, a routing difference between runtimes I did not know I had — and two people who contributed to a project with no stars." +pubDate: 2026-08-19 +author: "Diego Reséndez" +tags: ["green-tea", "story", "observability", "contributors"] +draft: true +--- + +There is a difference between a framework you can demo and a framework you can run, and for most of this year +green-tea was firmly the first one. + +The demo was good. Declare what a route needs, get a validated execution graph, run only the slice that route +requires. That part works and I still think it is the right idea. But when someone asked me the question every +serious evaluation asks in week one — *what is it doing in production?* — the honest answer was: I don't know, and +neither will you. + +This release is about that gap and the two others hiding behind it. + +## "No observability layer" was a sentence in my README for months + +I want to be precise about how bad that was, because I was oddly proud of having written it down. + +Declaring a gap is not the same as not having one. Every request that went through green-tea was anonymous. There +was no id to correlate a slow response with the step that caused it, no per-step timing, and — worst of the three — +the framework wrote to `console` in a handful of places, which means an application had no way to redirect its own +framework's output. You could ship it, but you could not operate it. + +What shipped is a correlated event stream: an id per request, adopted from an incoming `x-request-id` when a gateway +already made one, carried on every event, alongside the matched route *pattern* rather than the concrete URL. That +last detail matters more than it looks — pattern cardinality is bounded, URL cardinality is not, and a metrics +backend fed the second one falls over. + +The `console` calls are gone, and what replaced discipline is a lint rule over `src/**`. I do not trust myself to +remember, and neither should you. + +What I did not build: a metrics registry, an OpenTelemetry exporter. Both were in the original issue and both would +have been the second runtime dependency this project has. A `traceparent` header is carried through untouched so an +exporter package can do that job. The framework ships the contract; the integration is somebody's package, +possibly mine, later. + +I measured the cost instead of guessing at it — about 7% of the framework's own per-request work, roughly 2% once a +real socket is in the path. I mention the number because the first three times I measured it I got three different +wrong answers, one with the sign inverted. That is a story for another post. + +## Shutdown: the framework was holding things it never let go of + +The second gap was quieter. Green-tea would boot your providers, hand you a database pool, and then, at shutdown, +do nothing about it. `app.close()` drained requests and closed streams — it never told your code that the process +was going away. So every application built on it re-implemented the same `process.on('SIGTERM')` block, and every +one of them got the ordering slightly wrong, because the order you need is the reverse of the order things booted +in and nothing was telling you what that order was. + +The framework already knew it. It computes a topological order to run your graph. Using it for teardown was not a +feature so much as an admission that the information was already sitting there. + +Now a provider closes its pool in `dispose()`, a plugin registers `onShutdown`, an application passes `hooks`, and +all three land in one registry that awaits them in reverse boot order inside the existing deadline. A failure gets +logged, and the rest still run. + +The part I want to flag is the one that is *not* symmetric: on the edge, none of this exists. Workerd has no +shutdown to hook into. I could have quietly no-opped it and let the docs imply parity. It says so instead. + +## The bug I found by looking, and the bug CI found by not trusting me + +While profiling the router I noticed `GET /public/../admin` returned 404 on Node. On Deno, Bun and Workers, the same +request reached `/admin`. The fetch-based runtimes resolve dot segments inside the `Request` constructor, before my +code ever sees the path. + +So the same bytes on the wire were routing differently depending on where you deployed. A framework whose entire +pitch is *the same application model everywhere* had a silent routing divergence, and my own cross-runtime parity +tests could not catch it, because they go through `fetch()` — which normalizes the path before it hits the wire. The +new tests write the request line to a socket by hand. + +The second one is more embarrassing and more useful. CI failed the observability work on Node 18 with +`ReferenceError: crypto is not defined`. The global `crypto` landed in Node 19. My `engines` field promises Node 18. +Every machine I own runs Node 20 or newer, and the other three runtimes have the global — so I had shipped code that +made the framework unusable on its own declared floor, and *nothing I could run locally would ever have told me*. + +That job exists because I pinned it to the version I promise rather than the version I use. It is the single most +valuable thing in my CI configuration. + +## The part I actually want to write + +Two people contributed code to this release. I want to be specific about why that matters, and it is not politeness. + +This project had no stars, no discussion threads, and no visibility. Contributing to a project in that state buys +you nothing — no reputation, no line on a résumé anybody has heard of, no guarantee the maintainer will even reply. +You are betting your evening on a stranger's repository on the strength of the idea alone. I have been on the other +side of that decision and I usually decided not to. + +**[@YxnnXriel](https://github.com/YxnnXriel)** added a timeout to `app.close()`. On the surface: one option. In +practice, every shutdown guarantee in this release is standing on it. The app-wide `shutdownTimeoutMs`, the bounded +`close()` on Deno and Bun, the teardown budget that stops a slow `dispose()` from holding a deploy hostage — all of +it is built on the deadline that pull request introduced. I did not plan that. It just turned out to be the piece +everything else needed. + +**[@hgshreyas](https://github.com/hgshreyas)** capped concurrent connections on Node, which had been unbounded — +the framework had no answer whatsoever to load it could not serve. Then followed it with the fix that makes a +non-positive value mean *unlimited* rather than *zero*, which is what anyone typing `0` actually intends. The review +on that one taught me something about my own architecture: the counting cannot live in the shared `app.fetch` path, +because `app.fetch` is not on Node's `listen()` route. I did not know that cleanly until someone else's patch forced +me to say it out loud. + +Both of them are still working on things. One of those pull requests is currently blocked on *me* — it needs a piece +of plumbing that does not exist yet, and telling a contributor "your change is right, the missing part is mine" is a +better use of a review than asking them to work around it. + +If you are looking for somewhere to start: unassigned issues are genuinely free, the contributing guide covers the +branch model and the sign-off, and a maintainer will write the documentation change if you would rather not. Being +early costs something. I would rather say thank you in a way that names what you built than in a badge. + +## Where this leaves the beta + +The graph is settled. The plugin API and `createApp`'s options still move. Mesh is still alpha. The API freeze +belongs to the release candidate, and freezing it before this release would have frozen a framework that still could +not tell you what it was doing. + +That's the tea. 🍵