Skip to content

Namespace native cache stats, add transformer bailout breakdown#1000

Open
matt-koko wants to merge 7 commits intomainfrom
koko/native-cache-stats
Open

Namespace native cache stats, add transformer bailout breakdown#1000
matt-koko wants to merge 7 commits intomainfrom
koko/native-cache-stats

Conversation

@matt-koko
Copy link
Copy Markdown
Contributor

Motivation

Extensibility - the native cache stats need to be structured to support multiple caching systems as we add more native caching in the future. Also providing visibility into which specific transformers are causing cache bailouts allows us to detect caching issues early via analytics events.

Changes

  • Restructured nativeCacheStats to namespace stats by cache user:
  {
    "nativeCacheStats": {
      "transformerPipelines": {
        "hits": 51972,
        "bailoutsByTransformer": { ... }
      }
    }
  }
  • Added bailoutsByTransformer field to track bailout counts per transformer
  • Improved debugging: cache stats are now logged immediately after asset graph construction
  • Created dedicated cache_stats.rs module for cache stats types
  • Updated native cache integration tests to refactored cache stats object and verify bailout tracking

Checklist

  • Existing or new tests cover this change
  • There is a changeset for this change, or one is not required
  • Added documentation for any new features to the docs/ folder

@matt-koko matt-koko requested a review from a team as a code owner February 3, 2026 06:52
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 3, 2026

🦋 Changeset detected

Latest commit: cf597bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 114 packages
Name Type
@atlaspack/types-internal Minor
@atlaspack/core Minor
@atlaspack/rust Minor
@atlaspack/bundler-default Patch
atlaspack Patch
@atlaspack/codeframe Patch
@atlaspack/fs Patch
@atlaspack/graph Patch
@atlaspack/logger Patch
@atlaspack/plugin Patch
@atlaspack/profiler Patch
@atlaspack/types Patch
@atlaspack/utils Patch
@atlaspack/workers Patch
@atlaspack/packager-css Patch
@atlaspack/reporter-bundle-buddy Patch
@atlaspack/resolver-tesseract Patch
@atlaspack/runtime-js Patch
@atlaspack/transformer-less Patch
@atlaspack/transformer-postcss Patch
@atlaspack/transformer-tokens Patch
@atlaspack/transformer-xml Patch
@atlaspack/ts-utils Patch
@atlaspack/bundler-experimental Patch
@atlaspack/config-default Major
@atlaspack/config-webextension Major
@atlaspack/cli Patch
@atlaspack/e2e-tests Patch
@atlaspack/register Patch
@atlaspack/test-utils Patch
@atlaspack/inspector Patch
@atlaspack/bundle-stats Patch
@atlaspack/packaging-test-harness Patch
@atlaspack/query Patch
@atlaspack/optimizer-image Major
@atlaspack/reporter-bundle-stats Patch
@atlaspack/transformer-html Patch
@atlaspack/transformer-image Major
@atlaspack/transformer-js Major
@atlaspack/inspector-frontend Patch
@atlaspack/cache Patch
@atlaspack/source-map Patch
@atlaspack/link Patch
@atlaspack/optimizer-inline-requires Patch
@atlaspack/packager-js Patch
@atlaspack/transformer-compiled-css-in-js Patch
@atlaspack/transformer-svg Patch
@atlaspack/node-resolver-core Patch
@atlaspack/package-manager Patch
@atlaspack/watcher-watchman-js Patch
@atlaspack/bundler-library Patch
@atlaspack/compressor-brotli Patch
@atlaspack/compressor-gzip Patch
@atlaspack/compressor-raw Patch
@atlaspack/namer-default Patch
@atlaspack/optimizer-blob-url Patch
@atlaspack/optimizer-css Patch
@atlaspack/optimizer-cssnano Patch
@atlaspack/optimizer-data-url Patch
@atlaspack/optimizer-htmlnano Patch
@atlaspack/optimizer-svgo Patch
@atlaspack/optimizer-swc Patch
@atlaspack/optimizer-terser Patch
@atlaspack/packager-html Patch
@atlaspack/packager-raw-url Patch
@atlaspack/packager-raw Patch
@atlaspack/packager-svg Patch
@atlaspack/packager-ts Patch
@atlaspack/packager-wasm Patch
@atlaspack/packager-webextension Patch
@atlaspack/packager-xml Patch
@atlaspack/reporter-build-metrics Patch
@atlaspack/reporter-bundle-analyzer Patch
@atlaspack/reporter-cli Patch
@atlaspack/reporter-compiled-css-in-js-migration-map Patch
@atlaspack/reporter-conditional-manifest Patch
@atlaspack/reporter-dev-server-sw Patch
@atlaspack/reporter-dev-server Patch
@atlaspack/reporter-json Patch
@atlaspack/reporter-lsp Patch
@atlaspack/reporter-sourcemap-visualiser Patch
@atlaspack/reporter-tracer Patch
@atlaspack/resolver-default Patch
@atlaspack/resolver-glob Patch
@atlaspack/runtime-browser-hmr Patch
@atlaspack/runtime-react-refresh Patch
@atlaspack/runtime-service-worker Patch
@atlaspack/runtime-webextension Patch
@atlaspack/transformer-babel Patch
@atlaspack/transformer-compiled-external Patch
@atlaspack/transformer-compiled Patch
@atlaspack/transformer-css Patch
@atlaspack/transformer-glsl Patch
@atlaspack/transformer-graphql Patch
@atlaspack/transformer-inline-string Patch
@atlaspack/transformer-inline Patch
@atlaspack/transformer-json Patch
@atlaspack/transformer-jsonld Patch
@atlaspack/transformer-mdx Patch
@atlaspack/transformer-posthtml Patch
@atlaspack/transformer-pug Patch
@atlaspack/transformer-raw Patch
@atlaspack/transformer-react-refresh-wrap Patch
@atlaspack/transformer-sass Patch
@atlaspack/transformer-svg-react Patch
@atlaspack/transformer-toml Patch
@atlaspack/transformer-typescript-tsc Patch
@atlaspack/transformer-typescript-types Patch
@atlaspack/transformer-webextension Patch
@atlaspack/transformer-webmanifest Patch
@atlaspack/transformer-worklet Patch
@atlaspack/transformer-yaml Patch
@atlaspack/validator-eslint Patch
@atlaspack/validator-typescript Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2026

📊 Type Coverage Report

Coverage Comparison

Metric Baseline Current Change
Coverage Percentage 92.26% 92.27% 📈 +0.01%
Correctly Typed 220,706 220,876 +170
Total Expressions 239,200 239,380 +180
Untyped Expressions 18,494 18,504 +10

Files with Most Type Issues (Top 15)

File Issues Affected Lines
packages/core/integration-tests/test/javascript.ts 1152 745
packages/core/integration-tests/test/cache.ts 885 626
packages/core/integration-tests/test/scope-hoisting.ts 622 489
packages/utils/node-resolver-core/test/resolver.ts 476 177
packages/core/integration-tests/test/html.ts 468 294
packages/core/integration-tests/test/sourcemaps.ts 356 176
packages/core/test-utils/src/utils.ts 330 205
packages/core/integration-tests/test/incremental-bundling.ts 298 206
packages/core/core/src/dumpGraphToGraphViz.ts 251 108
packages/core/integration-tests/test/transpilation.ts 230 139
packages/core/integration-tests/test/output-formats.ts 227 161
packages/transformers/webextension/src/WebExtensionTransformer.ts 210 80
packages/core/core/src/requests/BundleGraphRequestRust.ts 194 67
packages/core/integration-tests/test/css-modules.ts 191 107
packages/core/core/src/requests/TargetRequest.ts 190 133

This report was generated by the Type Coverage GitHub Action

@matt-koko matt-koko changed the title Refactor native cache stats, add transformer bailout breakdown Namespace native cache stats, add transformer bailout breakdown Feb 3, 2026
@matt-koko matt-koko force-pushed the koko/cacheable-compiled-config branch from e3f3260 to dd6cb1e Compare February 4, 2026 00:31
Base automatically changed from koko/cacheable-compiled-config to main February 4, 2026 05:27
…er bailouts to transformer pipeline cache stats. Add additional log for transformer pipeline cache stats immediately after asset graph construction for better debugging experience.
@matt-koko matt-koko force-pushed the koko/native-cache-stats branch from 76b4e01 to 7a95381 Compare February 4, 2026 05:36
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