Skip to content

Removed inline source maps from image dependencies - #30706

Draft
acburdine wants to merge 3 commits into
mainfrom
codex/prune-inline-source-maps
Draft

Removed inline source maps from image dependencies#30706
acburdine wants to merge 3 commits into
mainfrom
codex/prune-inline-source-maps

Conversation

@acburdine

@acburdine acburdine commented Sep 11, 2026

Copy link
Copy Markdown
Member

Inline source maps retain large module-source strings in the production heap even though Ghost does not use them. The image prune profile now removes final inline JSON source-map comments from deployed JavaScript dependencies, including the charset=utf-8 variant. External map references and executable content are preserved; archive pruning is unchanged.

The image report includes per-package inline-map savings, and its existing surviving-byte totals reflect the reduction. Files are replaced rather than edited in place to protect hard-linked pnpm store contents.

Validation:

  • Script suite: 120 tests passed; script lint and commit hooks passed. Regression coverage includes inline/external/no maps, comment lookalikes, same-line block maps, dry runs, archive behavior, hard links, idempotence, and report JSON.
  • Before/after docker build -f Dockerfile.production --target report: 197,443,071 → 193,822,237 bytes (3,620,834 bytes smaller), with 29,232 surviving files in both builds. Inline maps account for 3,623,488 removed bytes; the updated prune script accounts for the small difference. Both native-module checks passed.
  • pnpm check encountered a missing local Firefox binary and two gift-preview test timeouts. Both timeout tests passed on isolated reruns.
  • Dedicated-runner performance comparison completed successfully for baseline e5caf4c5ed and PR merge dea004d9ed (parents are the baseline and this PR's 50fc0322b4). Same dataset and workload, profiling disabled in both runs.
Boot metric Baseline PR Change
RSS 294,817,792 bytes 282,509,312 bytes −12,308,480 bytes (−4.17%)
boot.heap_used_bytes 145,146,552 bytes 142,863,272 bytes −2,283,280 bytes (−1.57%)
Wall time, median of 5 boots 3,278 ms 3,191 ms −87 ms (−2.65%)

These are observations from one paired run, not an estimate of statistical significance. Calibration was 372 → 359 ms; both runs had zero failed load requests and negligible host steal.

CI: browser E2E checks passed. Both MySQL acceptance jobs failed when Docker could not pull minio/minio (pull access denied), after the test suite completed; this is an infrastructure failure.

Mailgun remains at its existing version. The newer 14.0.1 Node bundle has no inline map, but upgrading also changes the CommonJS import contract and crosses several major versions.

no ref

Inline maps retain large source strings in the production heap even though Ghost does not use them. Strip only trailing map comments in the image profile, preserve executable bytes and external references, and expose per-package savings in the image report.
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@nx-cloud

nx-cloud Bot commented Sep 11, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 2607c20

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 10m 9s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 3m 37s View ↗
nx run ghost:test:integration ✅ Succeeded 2m 55s View ↗
nx run ghost:test:ci:e2e ✅ Succeeded 3m 19s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 14s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 22s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 1m 51s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 41s View ↗
Additional runs (11) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-12 01:26:52 UTC

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.71%. Comparing base (07671c0) to head (2607c20).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30706      +/-   ##
==========================================
+ Coverage   67.66%   67.71%   +0.04%     
==========================================
  Files        1676     1676              
  Lines       60517    60517              
  Branches    10465    10465              
==========================================
+ Hits        40950    40980      +30     
+ Misses      17249    17218      -31     
- Partials     2318     2319       +1     
Flag Coverage Δ
e2e-tests 70.45% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant