Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4973096ac | ||
|
|
218977cd64 | ||
|
|
f5ddbeb177 | ||
|
|
f049b9cb19 | ||
|
|
b9b97bdfc6 | ||
|
|
bcbbf7d652 | ||
|
|
4b73076aa5 | ||
|
|
739f0bf2a5 | ||
|
|
85136b7671 | ||
|
|
5576ef28bd | ||
|
|
204a6ca331 | ||
|
|
2b44150824 |
No files matched your search
@@ -16,8 +16,8 @@ jobs:
|
|||||||
if: ${{ github.server_url != 'https://github.com' }}
|
if: ${{ github.server_url != 'https://github.com' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
name: Promote → GitHub
|
name: Promote → GitHub
|
||||||
|
|
||||||
# Runs on GITEA ONLY. Mirrors only main + version tags to the public GitHub repo.
|
# Runs on GITEA ONLY. Mirrors main, and each version tag as it is created, to the public GitHub
|
||||||
|
# repo. On GitHub a v* tag runs release.yml, which attaches the dist.tar.gz the cPanel deploy uses.
|
||||||
|
#
|
||||||
|
# A tag is pushed only on its own event, by name. The branch push used to add `git push --tags`,
|
||||||
|
# which is refused whenever any old tag points at different objects on the two forges
|
||||||
|
# (v26.8.1-beta.0 and v26.8.2-beta.0 do), so every promotion of main went red even though main had
|
||||||
|
# already arrived.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
@@ -11,10 +17,10 @@ jobs:
|
|||||||
if: ${{ github.server_url != 'https://github.com' }}
|
if: ${{ github.server_url != 'https://github.com' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Push main + tags to GitHub
|
- name: Push main or the new tag to GitHub
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@@ -23,5 +29,4 @@ jobs:
|
|||||||
git push github "refs/tags/${{ github.ref_name }}"
|
git push github "refs/tags/${{ github.ref_name }}"
|
||||||
else
|
else
|
||||||
git push github "HEAD:refs/heads/main"
|
git push github "HEAD:refs/heads/main"
|
||||||
git push github --tags
|
|
||||||
fi
|
fi
|
||||||
@@ -17,8 +17,8 @@ jobs:
|
|||||||
ARCHIVE_NAME: green-tea-site-${{ github.ref_name }}.tar.gz
|
ARCHIVE_NAME: green-tea-site-${{ github.ref_name }}.tar.gz
|
||||||
RELEASE_TAG: ${{ github.ref_name }}
|
RELEASE_TAG: ${{ github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
- name: Validate release tag
|
- name: Validate release tag
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Verify .htaccess in archive
|
- name: Verify .htaccess in archive
|
||||||
run: tar -tzf "$ARCHIVE_NAME" | grep -Fx './.htaccess'
|
run: tar -tzf "$ARCHIVE_NAME" | grep -Fx './.htaccess'
|
||||||
- name: Attach to GitHub release
|
- name: Attach to GitHub release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: ${{ env.ARCHIVE_NAME }}
|
files: ${{ env.ARCHIVE_NAME }}
|
||||||
Generated
+829
-758
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "green-tea-site",
|
"name": "green-tea-site",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "26.9.0-beta.0",
|
"version": "26.9.0-beta.2",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.12.0"
|
"node": ">=22.12.0"
|
||||||
},
|
},
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^7.0.5",
|
"@astrojs/mdx": "^7.0.8",
|
||||||
"@astrojs/rss": "^4.0.19",
|
"@astrojs/rss": "^4.0.19",
|
||||||
"@astrojs/sitemap": "^3.7.3",
|
"@astrojs/sitemap": "^3.7.4",
|
||||||
"astro": "^7.1.6"
|
"astro": "^7.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ const linkColumns = [
|
|||||||
heading: 'Learn',
|
heading: 'Learn',
|
||||||
links: [
|
links: [
|
||||||
{ label: 'Docs', href: 'https://green-tea.expressive-tea.io/docs', external: true },
|
{ label: 'Docs', href: 'https://green-tea.expressive-tea.io/docs', external: true },
|
||||||
|
{ label: 'Plugins', href: '/plugins/', external: false },
|
||||||
{ label: 'Blog', href: '/blog', external: false },
|
{ label: 'Blog', href: '/blog', external: false },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Icon from './Icon.astro';
|
|||||||
// name — an icon-only link without one is a link a screen reader announces as its href.
|
// name — an icon-only link without one is a link a screen reader announces as its href.
|
||||||
const navLinks = [
|
const navLinks = [
|
||||||
{ label: 'Docs', href: 'https://green-tea.expressive-tea.io/docs', external: true },
|
{ label: 'Docs', href: 'https://green-tea.expressive-tea.io/docs', external: true },
|
||||||
|
{ label: 'Plugins', href: '/plugins/', external: false },
|
||||||
{ label: 'Blog', href: '/blog', external: false },
|
{ label: 'Blog', href: '/blog', external: false },
|
||||||
{ label: 'GitHub', href: 'https://github.com/Expressive-Tea/green-tea', external: true, icon: 'github' as const },
|
{ label: 'GitHub', href: 'https://github.com/Expressive-Tea/green-tea', external: true, icon: 'github' as const },
|
||||||
{ label: 'npm', href: 'https://www.npmjs.com/package/@green-tea/core', external: true, icon: 'npm' as const },
|
{ label: 'npm', href: 'https://www.npmjs.com/package/@green-tea/core', external: true, icon: 'npm' as const },
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
---
|
||||||
|
// The way into the plugin listing, which is its own build under /plugins (green-tea-marketplace).
|
||||||
|
// The descriptions are each package's own, as the listing shows them. When a plugin is added
|
||||||
|
// there, it does not appear here: this is a sample, and the listing is the index.
|
||||||
|
const plugins = [
|
||||||
|
{ name: '@green-tea/jwt', slug: 'jwt', body: 'Loads JWT signing keys at boot and publishes a sign/verify registry into the graph.' },
|
||||||
|
{ name: '@green-tea/metrics', slug: 'metrics', body: "Counts green-tea's lifecycle events and renders them in the Prometheus text format." },
|
||||||
|
{ name: '@green-tea/rate-limit', slug: 'rate-limit', body: 'A per-request rate limiter with a branded 429 and a swept in-memory store.' },
|
||||||
|
];
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class="plugins section--panel">
|
||||||
|
<div class="wrap">
|
||||||
|
<div class="plugins__head">
|
||||||
|
<p class="kicker">Plugins</p>
|
||||||
|
<h2>Extend it with plugins.</h2>
|
||||||
|
<p class="plugins__lede">
|
||||||
|
A plugin is one object, <code>{ name, mount }</code>, that adds providers and steps to your graph.
|
||||||
|
There are three official ones so far. Each has a page with its README, its versions and the runtimes it
|
||||||
|
supports, and yours can sit next to them.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="plugins__grid">
|
||||||
|
{
|
||||||
|
plugins.map((plugin) => (
|
||||||
|
<li class="plugins__card">
|
||||||
|
<a href={`/plugins/${plugin.slug}/`}>
|
||||||
|
<h3>{plugin.name}</h3>
|
||||||
|
<p>{plugin.body}</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="btn-row plugins__ctas">
|
||||||
|
<a class="btn btn--primary" href="/plugins/">Browse plugins</a>
|
||||||
|
<a class="btn btn--ghost" href="/plugins/#contribute">List yours</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.plugins__head {
|
||||||
|
max-width: 52ch;
|
||||||
|
margin: 0 auto 3rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__head h2 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__lede {
|
||||||
|
margin: 1rem 0 0;
|
||||||
|
color: var(--dim);
|
||||||
|
line-height: 1.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__grid {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__card a {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
padding: 1.75rem;
|
||||||
|
background: var(--base);
|
||||||
|
border: 1px solid color-mix(in srgb, var(--dim) 18%, transparent);
|
||||||
|
border-radius: 12px;
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__card a:hover,
|
||||||
|
.plugins__card a:focus-visible {
|
||||||
|
border-color: var(--matcha);
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__card h3 {
|
||||||
|
color: var(--matcha);
|
||||||
|
font-size: 0.98rem;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__card p {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--dim);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
line-height: 1.65;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugins__ctas {
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 860px) {
|
||||||
|
.plugins__grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
---
|
||||||
|
title: "The release where I took my own advice"
|
||||||
|
description: "Two breaking changes, one keyword each, both fixing the same thing: places where green-tea asked you to remember an order. Plus the benchmark claim my README carried for two months while the benchmark said otherwise."
|
||||||
|
pubDate: 2026-09-23
|
||||||
|
author: "Diego Reséndez"
|
||||||
|
tags: ["green-tea", "release", "runtimes", "benchmarks"]
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
The argument for green-tea is that order should not be something you have to get right. You declare what a step
|
||||||
|
needs and what it provides, and the framework works out what runs when. No `app.use()` in the correct sequence, no
|
||||||
|
wondering which middleware already touched the body.
|
||||||
|
|
||||||
|
`26.9.0-beta.2` is out on npm and JSR. Both of its breaking changes exist because I had shipped two places where
|
||||||
|
that argument did not apply to my own code.
|
||||||
|
|
||||||
|
## The port that bound anyway
|
||||||
|
|
||||||
|
If you serve on Deno or Bun, you wrote this:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const server = serveDeno(app, { port });
|
||||||
|
```
|
||||||
|
|
||||||
|
And `serveDeno` did not boot your app. It bound the port and waited, and the providers ran on the first request that
|
||||||
|
arrived. The documented fix — on my own docs page, in a table I wrote — was to remember `await app.boot()` first.
|
||||||
|
|
||||||
|
Think about what that meant if you forgot. A missing signing key is not a failed deploy: the boot result is
|
||||||
|
memoized, rejection included, so the port opens, every request gets a 500 from the runtime, and not one of them
|
||||||
|
reaches your `onError`. Your logs are empty because the failure never entered the framework's error path. Your
|
||||||
|
health check passes, because something *is* listening on that port. The process looks fine and serves nothing.
|
||||||
|
|
||||||
|
That is precisely the class of bug this project exists to delete, and I had put it in a core helper and then
|
||||||
|
written a paragraph asking you to work around it. A framework that says order is not your problem should not ship
|
||||||
|
an entry point whose correct use depends on you having read a page.
|
||||||
|
|
||||||
|
They boot before they bind now. Migration is one keyword:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- const server = serveDeno(app, { port });
|
||||||
|
+ const server = await serveDeno(app, { port });
|
||||||
|
```
|
||||||
|
|
||||||
|
Both runtimes have top-level `await`, so a module that serves at import time needs nothing else, and the value you
|
||||||
|
get back is unchanged. A provider that cannot start now fails your deploy, where you will see it.
|
||||||
|
|
||||||
|
`edgeHandler` is deliberately untouched. On workerd there is no startup outside a request — there is no earlier
|
||||||
|
moment to move the failure to, so pretending otherwise would be decoration.
|
||||||
|
|
||||||
|
## The event that reported nothing
|
||||||
|
|
||||||
|
The second one is smaller and the same shape. A plugin was a function, and `plugin:mounted` — the event whose
|
||||||
|
entire job is to tell you which plugins mounted — took the name from `fn.name`. That is `""` for an arrow returned
|
||||||
|
by a factory, which is how every plugin I have written is built. `"plugin"` for a `const`. Whatever survives a
|
||||||
|
minifier, in production.
|
||||||
|
|
||||||
|
So the observability event for plugins named none of them. A plugin is a named object now:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- const jwt = (options) => ({ scope }) => { scope.add(node); };
|
||||||
|
+ const jwt = (options) => ({
|
||||||
|
+ name: options.provides ?? 'jwt',
|
||||||
|
+ mount({ scope }) { scope.add(node); },
|
||||||
|
+ });
|
||||||
|
```
|
||||||
|
|
||||||
|
The name is the author's word rather than a compiler artifact, a failed mount reads
|
||||||
|
`plugin "jwt" failed to mount: …` with the original error as its `cause`, and two plugins claiming the same name
|
||||||
|
fail `createApp` instead of quietly shadowing each other.
|
||||||
|
|
||||||
|
I am keeping this short on purpose. There is a plugin marketplace coming, and the interesting half of this story —
|
||||||
|
what a plugin ecosystem needs from a contract before strangers start publishing into it — belongs in that post
|
||||||
|
rather than this one.
|
||||||
|
|
||||||
|
`app.boot()` is public now too, for when you drive `app.fetch` from a server you own. And errors are recognised by
|
||||||
|
a brand rather than `instanceof`, so an `Unauthorized` thrown by a plugin holding its own copy of core stops
|
||||||
|
rendering as a `500`. Mesh, still alpha, stopped pretending a provider could cross a wire. The
|
||||||
|
[changelog](https://github.com/Expressive-Tea/green-tea/blob/main/CHANGELOG.md) has all of it.
|
||||||
|
|
||||||
|
## The number I had been repeating for two months
|
||||||
|
|
||||||
|
Now the part I did not enjoy writing.
|
||||||
|
|
||||||
|
Since 7 July my README had said green-tea handled more requests per second than every other framework in three of
|
||||||
|
four benchmark scenarios. `BENCHMARKS.md` — the file that sentence linked to, one click away — had stopped saying
|
||||||
|
that at some point over the following two months. Fastify rows had moved. NestJS-on-Fastify had been added. Parity
|
||||||
|
controls had been tightened. Nobody re-read the sentence, because a claim written into prose is not something
|
||||||
|
anyone re-measures.
|
||||||
|
|
||||||
|
I found it while regenerating the tables for this release, which is the only reason I found it at all.
|
||||||
|
|
||||||
|
Then it got worse, in an interesting way. I re-ran the suite on my laptop and green-tea came out *ahead* of Fastify
|
||||||
|
in three of four — the exact claim I was about to delete, apparently vindicated. It would have been very easy to
|
||||||
|
keep the sentence and move on.
|
||||||
|
|
||||||
|
Except green-tea had not moved. Its four numbers were within 1% of the run three weeks earlier. What had moved was
|
||||||
|
Fastify, down 7%, and when I lined the deltas up against the order the frameworks run in, they tracked position
|
||||||
|
rather than code: measured second, down 7%; measured last, up. A browser and the window server were taking about
|
||||||
|
60% of the machine the whole time. The "win" was my laptop being busy.
|
||||||
|
|
||||||
|
I re-ran it on an idle box instead. Coefficient of variation dropped from 4–6% to 0.1–1.3%, and the honest shape
|
||||||
|
came back: green-tea sits behind Fastify on the JSON, routing and pipeline scenarios, ahead of it on
|
||||||
|
POST-plus-validation, and roughly 2.8× ahead of Express. That shape reproduced on two very different CPUs. How far
|
||||||
|
behind did not — 2–8% on one machine, 7–15% on the other — which is why the README no longer quotes a percentage
|
||||||
|
at all and points at the table instead.
|
||||||
|
|
||||||
|
There is a separate question a release has to answer, and comparing this week's numbers against a table from three
|
||||||
|
weeks ago cannot answer it: *did these commits cost anything?* For that I run both trees on one box in one sitting,
|
||||||
|
alternating which side goes first. Ten cases. Nine overlapped, which is the result you want — the breaking changes
|
||||||
|
are boot-time work and none of it reached the per-request path.
|
||||||
|
|
||||||
|
The tenth came out **+4.3% in green-tea's favour**, with the two sides' sample ranges not overlapping at all. A
|
||||||
|
real-looking win. It had no mechanism — the only change that could produce it would have to show up even more
|
||||||
|
clearly at 200 routes, and that row said +0.1% — so I re-ran that case alone with seven rounds instead of three.
|
||||||
|
**+0.5%, overlapping.** It was chance, and it is written into `BENCHMARKS.md` as chance.
|
||||||
|
|
||||||
|
I want to be clear about why I chased a result that flattered me. A benchmark is for measuring, not for producing a
|
||||||
|
line to put on a homepage. An unexplained gain deserves the same suspicion as an unexplained loss, and usually
|
||||||
|
means the benchmark stopped measuring what it claims — a route that started 404ing, a server that booted with the
|
||||||
|
wrong config. A fast number that is wrong is the worst possible outcome, precisely because it looks like good news.
|
||||||
|
|
||||||
|
Two of the three problems in this post were things I had written down and then stopped reading: a table I told you
|
||||||
|
to remember, and a sentence I never re-measured. The code was not the hard part.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
`npm i @green-tea/core@beta` — or `deno add jsr:@green-tea/core`. It is still beta, still one person's spare time,
|
||||||
|
and the [docs](https://green-tea.expressive-tea.io/docs/) describe this release.
|
||||||
@@ -8,6 +8,7 @@ import HowItCompares from '../components/sections/HowItCompares.astro';
|
|||||||
import RunsEverywhere from '../components/sections/RunsEverywhere.astro';
|
import RunsEverywhere from '../components/sections/RunsEverywhere.astro';
|
||||||
import RealTime from '../components/sections/RealTime.astro';
|
import RealTime from '../components/sections/RealTime.astro';
|
||||||
import Batteries from '../components/sections/Batteries.astro';
|
import Batteries from '../components/sections/Batteries.astro';
|
||||||
|
import Plugins from '../components/sections/Plugins.astro';
|
||||||
import SeeIt from '../components/sections/SeeIt.astro';
|
import SeeIt from '../components/sections/SeeIt.astro';
|
||||||
import Faq from '../components/sections/Faq.astro';
|
import Faq from '../components/sections/Faq.astro';
|
||||||
import HonestBeta from '../components/sections/HonestBeta.astro';
|
import HonestBeta from '../components/sections/HonestBeta.astro';
|
||||||
@@ -55,6 +56,7 @@ const structuredData = {
|
|||||||
<SeeIt />
|
<SeeIt />
|
||||||
<RealTime />
|
<RealTime />
|
||||||
<Batteries />
|
<Batteries />
|
||||||
|
<Plugins />
|
||||||
<RunsEverywhere />
|
<RunsEverywhere />
|
||||||
<HowItCompares />
|
<HowItCompares />
|
||||||
<Faq />
|
<Faq />
|
||||||
|
|||||||
Reference in new issue
Block a user