ReviewOS

home-lang/home

Bun.serve HTML assets: remove excess parent segments from generated URLs

#675
Closed chris opened this 9 days ago ·
9 days ago

Follow-up to #66. The exact pinned test/js/bun/http/bun-serve-html.test.ts corpus passes 16/16 with 102 assertions and 9 snapshots in pinned Bun 1.4.0 (4982b91), but current Home ReleaseFast passes 14/16. The two failures are the ordinary serve-html and basic-plugin snapshots: generated CSS and JS URLs are /../../../../../../../../chunk-HASH.css and .js instead of /chunk-HASH.css and .js. The other 14 cases pass, including failing-plugin cleanup, ten concurrent plugin-backed routes, production/development routes, and large outputs. Trace the public-path/output destination normalization through the HTML bundle/linker path and make Home emit the pinned Bun URLs for temporary absolute entrypoints. Preserve legitimate relative and configured public-path behavior. Acceptance: the unchanged full file passes 16/16 with all 102 assertions and 9 snapshots in Home and pinned Bun; no snapshot rewrite, fixture relocation, cwd special case, path clamping, or assertion weakening.

9 days ago

Fixed on main by 016a60c (fix(runtime): root served HTML assets).

The port now:

  • roots lazy Bun.serve HTML builds at the HTML entrypoint directory;
  • keeps resolver options coherent with Bun.build JS API overrides;
  • generates in-memory source maps from the explicit output/root boundary;
  • restores Bun-compatible CSS display parsing and canonical serialization, including legacy flex/box aliases and omission of the default flow component;
  • adds native-bun-serve-html-assets.test.mjs for root-relative JS/CSS URLs, entry-relative source-map sources, and display: block output.

Validation:

  • exact upstream js/bun/http/bun-serve-html.test.ts: 16/16, 102 assertions, 9 snapshots in Debug and ReleaseFast;
  • exact upstream bun-serve-html-manifest.test.ts: 4/4, 16 assertions, 1 snapshot in ReleaseFast;
  • installation-shaped ReleaseFast runtime regression: 67/67;
  • native home_rt: 1,827 passed, 19 skipped, 0 failed;
  • focused new regression passed in Debug and ReleaseFast;
  • scoped Pickier: 0 errors;
  • Zig formatting and git diff checks passed.

No upstream fixture, snapshot, assertion, timeout, workload, or skip was changed.

Sign in to comment on this issue.