Skip to content

feat(server): serve precompressed immutable JavaScript and CSS assets - #787

Merged
devswha merged 7 commits into
devswha:mainfrom
kilhyeonjun:feat/precompressed-assets-20261011
Oct 11, 2026
Merged

devswha merged 7 commits into
devswha:mainfrom
kilhyeonjun:feat/precompressed-assets-20261011

Conversation

@kilhyeonjun

Copy link
Copy Markdown
Contributor

Change

Built fingerprinted JavaScript/CSS assets now get Brotli and gzip sidecars, selected according to Accept-Encoding quality weights. Original identity bytes remain available; missing sidecars fall back to an acceptable representation, and unacceptable encodings return 406. MIME, immutable caching, CSP and Vary are retained. The dynamic gzip wrapper respects the already negotiated immutable representation, including explicit identity preference. Shell/manifest naming and their revalidation policy remain intact.

This is a standalone build/static-serving change from main, with no private deployment endpoints or new runtime dependency. Includes recursive deterministic build coverage, HTTP negotiation/wrapper regression tests and documentation/changelog.

Validation

  • Generated schema freshness, full typecheck and production build: pass.
  • Full unit suite: 2,510 pass, 50 skip, 0 fail (145.63s). Negotiation, fallback, 406 CSP, sidecar generation and the real compression wrapper covered.
  • Complete official browser lane: pass (492.5s).
  • Independent design/implementation review: GO. Wrapper recompression finding reproduced and fixed before re-review.

The Native integration suite was also run, not marked green: cache 397 pass/5 fail/6 skip (295.2s), compression 398 pass/4 fail/6 skip (307.7s). An unchanged same-SHA baseline with the same Bun/herdr binary reproduced all those named failures: 396 pass/6 fail/6 skip (285.1s), in the same three unchanged server contract files. No new named failure in either candidate. Main has since merged the pending-input fixture polling fix (#756); this branch is independently based on 2f6bb46.

Workflow syntax skipped (actionlint unavailable); no workflow YAML changed. Fork CI requires maintainer approval.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c7cbff2c-5bc2-40c4-a4db-b8a1a168bbdb

📥 Commits

Reviewing files that changed from the base of the PR and between 5af4a0d and 9176835.


📒 Files selected for processing (10)
  • CHANGELOG.md
  • docs/development.md
  • scripts/AGENTS.md
  • scripts/compressed-assets.test.ts
  • scripts/compressed-assets.ts
  • server/compress.ts
  • server/index.ts
  • server/static-encoding.test.ts
  • server/static.ts
  • vite.config.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af523dca-430c-4afd-8634-4a4860e982e6






📥 Commits

Reviewing files that changed from the base of the PR and between cb49d69 and 5af4a0d.







📒 Files selected for processing (10)
  • CHANGELOG.md
  • docs/development.md
  • scripts/AGENTS.md
  • scripts/compressed-assets.test.ts
  • scripts/compressed-assets.ts
  • server/compress.ts
  • server/index.ts
  • server/static-encoding.test.ts
  • server/static.ts
  • vite.config.ts






Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.








📝 Summary

Summary by CodeRabbit

  • Changed
    • Production builds now provide Brotli and gzip versions of JavaScript and CSS assets. Supported browsers receive a compressed version based on their encoding preferences; the original files remain available.
    • Requests that exclude all available versions receive a 406 response. Existing cache behavior for the app shell and service worker remains unchanged.
📝 Summary
📝 Summary
📝 Summary
📝 Summary
📝 Summary

Walkthrough

Production builds now generate Brotli and gzip sidecars for JavaScript and CSS. The static handler negotiates available representations using Accept-Encoding. Other static files, user files, and API responses remain outside this sidecar path.

Changes

Static asset compression

Layer / File(s) Summary
Generate compressed build assets
scripts/compressed-assets.ts, vite.config.ts, scripts/compressed-assets.test.ts, scripts/AGENTS.md
The Vite plugin creates Brotli and gzip sidecars for bundled JavaScript and CSS. A production-build test checks that the sidecars decompress to the original bytes and are not created for the shell or service worker.
Negotiate static asset responses
server/static.ts, server/index.ts, server/compress.ts, server/static-encoding.test.ts, docs/development.md, CHANGELOG.md
The static handler selects an acceptable sidecar or identity file for JavaScript and CSS requests under /assets/, and returns 406 if no representation is acceptable. Tests cover encoding preferences, headers, cache behavior, and interaction with the gzip wrapper. The documentation and changelog describe the behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: haeminway1, devswha

















Merge Risk: ⚪ Minimal · up to 5af4a

The asset-compression change is mergeable after normal checks; no actionable issue remains from this review.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 7 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: serving precompressed immutable JavaScript and CSS assets.
Description check Passed The description includes the required Change and Validation sections. It explains the behavior, regression coverage, build coverage, test results, and known Native integration failures with baseline c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.






Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 7 files. (3 skipped: 3 unsupported.)












✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR











  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devswha added a commit that referenced this pull request Oct 11, 2026
…791)

## Change

When an agent's structured conversation is not yet available, ChatView
used to await a terminal read even while its terminal-output disclosure
was folded. A stalled read held the serialized conversation reader and
delayed initial display and later structured answers.

Agent terminal fallback now reads independently, only while its
disclosure is open and the page is visible. Non-agent scrollback stays
inline. Conversation/terminal HTTP headers and JSON/error bodies share a
15-second deadline; a timed-out late answer cannot replace the
conversation ETag cache. Changing the agent in the same pane reinstalls
and immediately refreshes the reader.

This standalone change is separate from #650's Codex session identity
work and #783's Send now behavior. It adds ko/ja/zh timeout labels,
documentation/changelog and registered/typechecked browser coverage
without private APIs or deployment configuration.

## Validation

- Generated schema freshness, full typecheck and production build: pass.
- Full unit suite: 2,508 pass, 50 skip, 0 fail (138.02s). Header/body
stalls, ignored-abort late body and ETag identity/recovery covered.
- Actual ChatView browser: no hidden terminal read; an opened stalled
fallback cannot block structured refresh; late cleanup; same-pane
agent-kind change resumes reads; non-agent output remains inline.
- Complete official browser lane: pass (492.2s), including the new
regression.
- Independent implementation review: GO; agent-change polling finding
reproduced and fixed before re-review.
- Workflow syntax skipped (actionlint unavailable); no workflow YAML
changed. No separate Native integration pass is claimed:
unchanged-server baseline comparison is recorded in #787/#788. Fork CI
requires maintainer approval.

Synthetic [closed fallback
screenshot](https://github.com/kilhyeonjun/herdr-web-ui/blob/fix/chat-read-fallback-20261011/docs/screenshots/chat-fallback/terminal-fallback-closed.png).

## Review follow-up

Addressed both posted review findings: agent terminal fallback no longer
presents an empty-conversation prompt, and terminal-read failures use
`role="alert"`. The actual ChatView browser regression reproduced both
before the fixes and now verifies fallback/failure, the ordinary empty
structured-conversation prompt, non-agent inline output and stale
cleanup.

Frozen final commit `a1ff9a3`: generated freshness, typecheck, build and
full unit pass (2508 pass, 50 skip, zero failures; unit 138.33s). The
previously reported full browser lane ran on `22f707b`; the updated
focused actual-component browser regression passed for the two UI fixes,
with refreshed synthetic evidence. Changelog now links this PR and
credits its author. Validation remains against public baseline
`2f6bb46`; latest observed main `5eafefc` is separate, and full
Native/Windows/updated-main integration is not claimed.

---------

Co-authored-by: Hako <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: devswha <[email protected]>
devswha and others added 5 commits October 12, 2026 08:13
Review finding (Codex, pre-merge): the negotiation weighed x-gzip apart
from gzip, so "x-gzip, identity;q=0" got 406 where the gzip wrapper used
to answer, and a wildcard with x-gzip excluded still chose gzip.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The changelog entry moves under Unreleased: the branch was cut before
0.4.6 and 0.4.7 were released. Unreleased had two Fixed headings on main
since a clean auto-merge; they are one again here.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The unit lane runs four files at a time in CI, where the build took 23 s
against the test's 20 s limit.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@devswha
devswha merged commit ca6db6e into devswha:main Oct 11, 2026
9 checks passed
devswha added a commit that referenced this pull request Oct 12, 2026
## Change

Release 0.4.8, from main at ca6db6e (20 PRs since v0.4.7: the 0.4.7
mobile walk-through fixes, two contributor PRs and the revived #793).

- `package.json` and `herdr-plugin.toml`: 0.4.8.
- CHANGELOG: `[Unreleased]` becomes `[0.4.8] - 2026-10-12`, with the
compare links. Twelve entries that had no PR link get theirs (#835 #837
#838 #840 #842 #843 #844+#848 #845 #847 #849 #851 #852). A Maintenance
line says the remote-PC runtime is now version 27.
- `release-summaries.json`: 0.4.8 in en/ko/ja/zh/tr (3 new, 6 improved,
8 fixed). The Turkish lines are not checked by a native speaker.
- `REMOTE_BUNDLE_VERSION` 26 -> 27: #836 adds the `pending-hold` server
feature and #787 serves precompressed assets, so `remote-v27` is
published before the app release.

Every PR merged since v0.4.7 is linked in the section: #787 #788 #793
#835 #836 #837 #838 #839 #840 #841 #842 #843 #844 #845 #846 #847 #848
#849 #851 #852.

## Validation

- `bun scripts/release-notes.ts 0.4.8` renders the summaries and the
full changelog (116 lines).
- `bun run check fast`: generated types, typecheck, build and 2800+ unit
tests pass.

## Release

After this merges and its CI on `main` passes: push `remote-v27`, wait
for its release, then run the Release workflow with `0.4.8`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants