Skip to content

chore: update file size snapshot path#6692

Merged
chenjiahan merged 2 commits intomainfrom
cache_path_1203
Dec 3, 2025
Merged

chore: update file size snapshot path#6692
chenjiahan merged 2 commits intomainfrom
cache_path_1203

Conversation

@chenjiahan
Copy link
Member

Summary

  • Update the cache file path to be under rsbuild directory
  • Improve cache handling by returning null when cache is invalid

Checklist

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

Copilot AI review requested due to automatic review settings December 3, 2025 14:23
@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 1c91a88
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/69304b7f3a077200087d9812
😎 Deploy Preview https://deploy-preview-6692--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 59 (🔴 down 12 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

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

Choose a reason for hiding this comment

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

💡 Codex Review

if (showDiff) {
const sizeData = previousSizes[environmentName]?.[normalizedName];

P1 Badge Guard previousSizes before indexing in diff block

After loadPreviousSizes was changed to return FileSizeCache | null, the diff branch still accesses previousSizes[environmentName] without a null guard. With strict null checks enabled ("strict": true in node_modules/@rsbuild/config/tsconfig.json), TypeScript reports “Object is possibly 'null'” here and compilation fails for this plugin. Add a null check or assert non-null before indexing so the build can typecheck.

ℹ️ 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".

@chenjiahan chenjiahan changed the title chore: update file size cache path chore: update file size snapshot path Dec 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reorganizes the file size cache location and improves cache handling semantics. The cache file is moved from the root of .cache/ into a dedicated rsbuild/ subdirectory, and the cache loading function now returns null instead of an empty object when no cache exists.

  • Cache file path updated from node_modules/.cache/file-sizes-cache.json to node_modules/.cache/rsbuild/file-sizes.json
  • loadPreviousSizes return type changed from {} to null when cache is unavailable

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/en/config/performance/print-file-size.mdx Documentation updated to reflect new cache file path
packages/core/src/plugins/fileSize.ts Cache path updated in getCacheFilePath and return type improved in loadPreviousSizes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 05ebb46 into main Dec 3, 2025
11 checks passed
@chenjiahan chenjiahan deleted the cache_path_1203 branch December 3, 2025 23:21
@chenjiahan chenjiahan mentioned this pull request Dec 6, 2025
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