Skip to content

fix(frontend): preserve generated app entrypoint - #345

Merged
mira-2026 merged 4 commits into
mainfrom
fix/frontend-entrypoint-bootstrap
Jul 28, 2026
Merged

fix(frontend): preserve generated app entrypoint#345
mira-2026 merged 4 commits into
mainfrom
fix/frontend-entrypoint-bootstrap

Conversation

@mira-2026

@mira-2026 mira-2026 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve the single generated JavaScript output that owns src/main.tsx
  • repair Bun's generated module-script target when HTML-entry builds with splitting and metafile output point at an unrelated shared chunk
  • fail closed on ambiguous app outputs or module scripts, and measure the initial bundle from the real application graph

Production incident

The deployment of PR #344 (195e665d) passed service health checks but served an empty #root. Its generated index.html loaded a 1.7 kB shared Switch chunk instead of the application bootstrap. Production was rolled back successfully to 96f613d2 before this hotfix.

Verification

  • bun run lint:frontend
  • bun test src/test/frontendBuildArtifacts.test.ts — 6 passed
  • bun test — 499 passed
  • bun run build:frontend
  • bun run build:backend
  • bun run release:manifest — 236 artifacts, both component identities on 2347976e
  • clean-build browser smoke rendered the login page with no console errors

Docs: not needed — this is an internal build-output correctness fix with no configuration, API, or operator-contract change.

@mira-2026
mira-2026 requested a review from rajohan as a code owner July 28, 2026 09:33
@mira-2026 mira-2026 added priority: critical Needs immediate attention; production-impacting or security-critical type: bugfix Fixes broken or incorrect behavior area: ops Operational actions, deploys, services, backups, and health area: frontend Frontend UI, client state, routing, and browser behavior labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The frontend build now resolves the JavaScript output for src/main.tsx, rewrites generated index.html to reference that output, and seeds initial bundle measurement from the application output. Tests update build metadata fixtures and cover HTML repair.

Changes

Frontend app entrypoint

Layer / File(s) Summary
Application output resolution and HTML repair
scripts/frontendBuildArtifacts.ts, src/test/frontendBuildArtifacts.test.ts
Adds application-output discovery, module-script validation, HTML rewriting, and coverage for repairing an unrelated script target.
Build pipeline entrypoint emission
scripts/frontendBuild.ts
Invokes writeFrontendHtmlAppEntrypoint after the build metafile is available.
Initial bundle graph seeding
scripts/frontendBuildArtifacts.ts, src/test/frontendBuildArtifacts.test.ts
Seeds initial output traversal from the src/main.tsx output and updates related metadata fixtures and expectations.

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

Sequence Diagram(s)

sequenceDiagram
  participant FrontendBuild
  participant Bun
  participant FrontendBuildArtifacts
  participant IndexHtml
  FrontendBuild->>Bun: build frontend and produce metafile
  Bun-->>FrontendBuild: return metafile
  FrontendBuild->>FrontendBuildArtifacts: writeFrontendHtmlAppEntrypoint(metafile, outdir)
  FrontendBuildArtifacts->>FrontendBuildArtifacts: resolve src/main.tsx output
  FrontendBuildArtifacts->>IndexHtml: rewrite module script src
  IndexHtml-->>FrontendBuildArtifacts: persist application bundle path
Loading

Possibly related PRs

Suggested labels: type: tests

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately summarizes the frontend entrypoint fix.
Description check ✅ Passed It covers the summary, incident context, and verification, but omits several template sections like risk checklist and deployment notes.

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.

Comment thread scripts/frontendBuildArtifacts.ts Fixed
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread scripts/frontendBuildArtifacts.ts Fixed
Comment thread scripts/frontendBuildArtifacts.ts Fixed
@mira-2026
mira-2026 merged commit 6cb015e into main Jul 28, 2026
7 checks passed
@mira-2026
mira-2026 deleted the fix/frontend-entrypoint-bootstrap branch July 28, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Frontend UI, client state, routing, and browser behavior area: ops Operational actions, deploys, services, backups, and health priority: critical Needs immediate attention; production-impacting or security-critical type: bugfix Fixes broken or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants