Repository navigation
Closed
Labels
Description
Goal
Raise the monorepo Bun floor from 1.3.7 to 1.4.0. Measure what 1.4 changes on this repo. Then keep only the test and runtime APIs that win on our machines.
Facts (2026-08-21)
- Latest stable is Bun 1.4.0, published 20 August 2026. No
1.4.xpatch yet. Release · Blog - Root
engines.bunis>=1.3.7. README anddocs/self-hosting/README.mdsay the same. - CI
setup-bundefaults tolatest. Docker usesoven/bun:1-slim. Those may already pull 1.4 once Oven publishes the tag. bun-typesis still^1.3.13/^1.3.14.bun testruns on hocuspocus, email-templates, floating-popover, and hyperlink units. Jest and Cypress stay on Node or the browser.- Official Bun 1.4 claims (quote only; not our numbers): idle CPU down 5×; memory down up to 35%; Linux start 50% faster;
Bun.servepeak 45 MB → 36 MB (−20%). Source: bun.com/blog/bun-v1.4 --parallel,--isolate,--shard, and--changedlanded in 1.3.13. 1.4 adds--timingsand isolate bug fixes. Test parallel docs- Keep the metascraper
5.50.6pin untilbun -e "await import('metascraper')"succeeds on 1.4.0. The 1.4 post does not claim arequire(esm)fix formime@4. - Do not
export defaulta Hono app. Bun still auto-serves that on:3000. - Do not treat 1.4 as unlocking
@hocuspocusv4. The v4 Nodecrosswsadapter still throws when"Bun" in globalThis. - Do not replace Prisma, BullMQ, or ioredis with
Bun.SQL,Bun.cron, orBun.redison this ticket.
What to build
A measured upgrade. Not a rewrite.
- Soak 1.4.0 locally and in CI. Confirm Docker
1-slimis 1.4. - Smoke: REST, WS, and worker start;
import('metascraper'); Prisma engines (NODE_MODULE_VERSION147); Redis TLS names; pad persist (document:saved). - Raise
engines.bun,bun-types, README, self-hosting, andAGENTS.mdfloors in the same change. - On the
bun testsuites only: try--isolate, then--parallel, then--timingsplus--shardif CI time drops. - Profile hocuspocus with
--cpu-prof-md/--heap-prof-mdonly if RSS or idle CPU improves versus 1.3.14. Considerprocess.on("memoryPressure")only after that profile. - Re-check
idleTimeoutdefault and thewsmaxPayloadignore. Keep explicitidleTimeout: 60unless 1.4 changes the hazard.
Out of scope
- Moving Jest or Cypress onto
bun test. - Experimental HTTP/3 on
Bun.serve. - Isolated linker or
lockfileVersion: 2unlessbun installforces it. Existingbun.lockstays hoisted. @hocuspocusv4.
Acceptance criteria
- Local
bun --versionis 1.4.0 or newer.make dest-localstarts REST on:4000with no second listener on:3000. -
cd apps/hocuspocus.server && bun -e "await import('metascraper')"is recorded. Keep or drop the5.50.6overrides from that result, not from the blog. - Prisma and Redis still work. Note any
ERR_TLS_CERT_ALTNAME_INVALIDand the fix (servername). - Root
engines.bun, catalogbun-types, README,docs/self-hosting/README.md, andAGENTS.mdname the new floor. - hocuspocus
bun testis green on 1.4. The PR records whether--parallel,--isolate, or--timingsstayed. - One before/after note for REST idle RSS or a
bun testwall-clock. Official Bun numbers are not a substitute.
Blocked by
None. Can wait for the product v2.0.0 tag if the maintainer wants that first. Does not depend on the Next 16 ticket.
Activity
build(deps): raise the Bun floor to 1.4.0
build(hocuspocus): drop the metascraper 5.50.6 pin
perf(tests): run the five clean-room gates concurrently
HMarzban commentedon Aug 31, 2026
Shipped in v2.0.1. Verified on the production host in deploy
33367037524.Acceptance criteria
:4000with no second listener on:3000. Confirmed. A default-exported Hono app is still auto-served on:3000in 1.4.0, so that invariant stays.await import('metascraper')recorded; keep or drop the overrides from that result. KEEP the pin. See below — this is the most useful thing the ticket produced.process.versions.modulesmoves 137 → 147, but the N-API ABI is unchanged so Prisma is unaffected.ERR_TLS_CERT_ALTNAME_INVALIDappeared because the TLS branch is off in every environment template. It was never exercised.engines.bun, bothbun-typesentries,README.md,docs/self-hosting/README.md,apps/hocuspocus.server/Readme.md,extensions/README.mdandAGENTS.md.bun testgreen, and which flags stayed. 578 pass / 0 fail. Nobun testflag stayed.Which test flags stayed: none
--parallel--isolate--timings/--update-timings--parallel-delay=0The suite got 61% faster anyway — from removing four
Bun.sleepcalls, not from the runtime. Measured 2×2: on the unchanged tests Bun 1.3.14 took 7,256ms and Bun 1.4.0 took 7,952ms, so 1.4.0 was slightly slower. The runtime deserves no credit here.The real parallelism win was
bun run --parallelon the five clean-room suites — a different feature frombun test --parallel. 209s → 88s locally.The metascraper pin stays, and that answer cost a deploy
We dropped it at
^5.56.2. Deploy33365858244then failed Backend E2E on Bun 1.4.0, Linux x64, with the exact error the pin exists to prevent:Four local checks passed before it shipped, and all four were wrong:
await import('metascraper'), acreateRequirecall on the helpers CJS entry, a real REST start that served/api/metadatawith a scraped title, and 578 backend tests. This laptop still cannot reproduce the fault even after reverting.bun -eevaluates in an ESM context where Bun can await the module graph. The fault needs a CJS module on disk doing a synchronous barerequire()at module scope. Only the Backend E2E job on a(build):commit can settle it, andbun run check:ciskips that job. All of this is now inAGENTS.md§Dependencies.Measured
Production host, deploy
33367037524:check:ciBun.serve[email protected]also changed complexity class: a 954 KiB document went from 120,100ms on 1.3.14 to 76ms on 1.4.0.MAX_MARKDOWN_CHARSstays at 64 KiB anyway — that fixture was ordinary prose, and the cap defends against hostile input, which nobody re-tested.Not proven
document:saved) was never driven end to end.Closing. Follow-up work is tracked separately.
build(deps): raise the Bun floor to 1.4.0
build(hocuspocus): drop the metascraper 5.50.6 pin
perf(tests): run the five clean-room gates concurrently