Skip to content

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Dec 3, 2025

Summary

Cache test cases support NEXT_MOVE_DIR_START for testing Portable cache.

Relevant RFC: #12218

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 3, 2025 03:43
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Dec 3, 2025
@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit ec2e5dc
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/692fb3765e49c4000844c7b2
😎 Deploy Preview https://deploy-preview-12359--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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 refactors the cache test infrastructure to support NEXT_MOVE_DIR_START, a new test helper that enables testing portable cache scenarios where the build directory is relocated between compiler runs. The change includes refactoring the cache options generation logic and adding a method to move the temporary directory while updating all related file paths.

Key changes:

  • Added NEXT_MOVE_DIR_START function to test cache behavior when moving directories
  • Refactored defaultOptions and overrideOptions into a single generateOptions function
  • Added moveTempDir() method to HotUpdatePlugin for directory relocation
  • Moved MAX_UPDATE_INDEX constant from cache.ts to plugin.ts for better organization

Reviewed changes

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

Show a summary per file
File Description
tests/rspack-test/cacheCases/portable/basic/rspack.config.js New test configuration with immutablePaths to verify portable cache behavior
tests/rspack-test/cacheCases/portable/basic/index.js Test case demonstrating NEXT_MOVE_DIR_START functionality with cache invalidation
tests/rspack-test/cacheCases/portable/basic/file.js Test file with three versions separated by '---' delimiters
packages/rspack-test-tools/src/helper/hot-update/plugin.ts Added moveTempDir() method and MAX_UPDATE_INDEX guard in goNext()
packages/rspack-test-tools/src/case/cache.ts Refactored options generation, added nextMoveDirStart function, and extracted checkStats helper
Comments suppressed due to low confidence (1)

packages/rspack-test-tools/src/helper/hot-update/plugin.ts:120

			this.tempDir.replace(/(___[0-9]+)?[//]*$/, "") + "___" + this.updateIndex;

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 822.6 KB - -
📄 JavaScript 822.6 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 984.3 KB - -
📄 JavaScript 984.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.1 MB - -
📄 JavaScript 2.0 MB - -
🎨 CSS 83.0 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

📦 Binary Size-limit

Comparing ec2e5dc to fix: don't use sync fs api (#12353) by pshu

🙈 Size remains the same at 47.71MB

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 3, 2025

CodSpeed Performance Report

Merging #12359 will not alter performance

Comparing jerry/portable (ec2e5dc) with main (e5ae2be)

Summary

✅ 17 untouched

@jerrykingxyz jerrykingxyz merged commit cc261ac into main Dec 3, 2025
76 of 78 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/portable branch December 3, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants