Skip to content

feat(cache): add intrastructure logging to the new cache - #15338

Merged
ahabhgk merged 6 commits into
mainfrom
hgk/newcache-logger
Aug 28, 2026
Merged

feat(cache): add intrastructure logging to the new cache#15338
ahabhgk merged 6 commits into
mainfrom
hgk/newcache-logger

Conversation

@ahabhgk

@ahabhgk ahabhgk commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Rust-side infrastructure logger and route the new persistent cache lifecycle, validation, persistence, and database messages through it at key locations aligned with webpack's PackFileCacheStrategy, replacing the new-cache tracing calls.
  • Forward native infrastructure logs to JavaScript through a bounded dispatcher that sends up to 8 logs per batch or flushes every 100 ms, with a queue capacity of 32, dropped-message reporting, critical-log fallback, and a final flush during compiler shutdown.
  • Feed native logs through the existing compiler.hooks.infrastructureLog and configured infrastructure logger so filtering, formatting, and interception behave consistently with JavaScript-originated logs, including logs emitted before the first compilation.
  • Reuse a single JsLog representation for stats and infrastructure logging, and support shared hierarchical logger names with Arc<str>.
  • Treat only a completely empty persistent-cache database as fresh; reset non-empty databases when validator data is missing or invalid.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@ahabhgk

ahabhgk commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing ced6287 to chore(release):2.2.1 (#15359) by pshu

❌ Size increased by 11.75KB from 68.25MB to 68.26MB (⬆️0.02%)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e62d7bb49e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_core/src/new_cache/file_cache_strategy.rs Outdated
Comment thread crates/rspack_core/src/new_cache/mod.rs Outdated
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 556.5 KB 0 0
react-10k 5.6 MB 1.3 MB 0 0
react-1k 823.1 KB 218.4 KB 0 0
react-5k 2.7 MB 669.3 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 50 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing hgk/newcache-logger (ced6287) with main (e8ecb52)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ahabhgk
ahabhgk force-pushed the hgk/newcache-logger branch from 1ec5c8e to 961e558 Compare August 27, 2026 09:59
@ahabhgk
ahabhgk requested a review from hardfist as a code owner August 27, 2026 09:59
@ahabhgk

ahabhgk commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@ahabhgk ahabhgk changed the title feat(cache): add structured logging to the new cache feat(cache): add intrastructure logging to the new cache Aug 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42c32a2046

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_core/src/new_cache/file_cache_strategy.rs
Comment thread crates/rspack_core/src/compiler/mod.rs Outdated
@ahabhgk
ahabhgk enabled auto-merge (squash) August 27, 2026 11:33
@ahabhgk
ahabhgk merged commit 0634efc into main Aug 28, 2026
67 of 69 checks passed
@ahabhgk
ahabhgk deleted the hgk/newcache-logger branch August 28, 2026 04:30
@ahabhgk ahabhgk mentioned this pull request Aug 28, 2026
14 tasks
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