Skip to content

feat: support portable cache and disable by default#12680

Merged
chenjiahan merged 2 commits intomainfrom
jerry/portable
Jan 14, 2026
Merged

feat: support portable cache and disable by default#12680
chenjiahan merged 2 commits intomainfrom
jerry/portable

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Jan 8, 2026

Summary

  • Use rspack_cacheable::{PortableString, PortablePath} for the struct in rspack_core
#[cacheable]
struct SomeThing {
  #[cacheable(with=As<PortablePath>)]
  path: PathBuf
}
  • Define CacheCodec to ensure use same context in persistent cache.
struct CacheCodec {
  context: ...
}
impl CacheCodec {
  fn encode(...) {
     rspack_cacheable::to_bytes(...)
  }
  fn decode(...) {
     rspack_cacheable::from_bytes(...)
  }
}
  • Disable portable cache by default, I will add a configuration switch in another PR.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings January 8, 2026 11:19
@jerrykingxyz jerrykingxyz requested a review from h-a-n-a as a code owner January 8, 2026 11:19
@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Jan 8, 2026
@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit f10c86c
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6965e0106a12b400082d8315
😎 Deploy Preview https://deploy-preview-12680--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 implements portable cache functionality to enable caches to work across different project directories. The key innovation is converting absolute paths to relative paths using a <project_root> placeholder during serialization, then resolving them back to absolute paths during deserialization with the new project root.

Key changes:

  • Introduces PortablePath and PortableString utilities for path portability
  • Replaces CacheableContext with CacheCodec for encoding/decoding with project context
  • Updates path-related types (ArcPath, Identifier, PathBuf) to use portable serialization

Reviewed changes

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

Show a summary per file
File Description
tests/rspack-test/cacheCases/portable/basic/index.js New test case for portable cache with directory moves
crates/rspack_tools/src/compare/occasion/make.rs Updated to use CacheCodec instead of CacheableContext
crates/rspack_paths/src/lib.rs ArcPath now uses CustomConverter with PortablePath
crates/rspack_loader_runner/src/content.rs DescriptionData path field uses PortablePath
crates/rspack_core/src/module_profile.rs ProfileState updated for new CustomConverter signature
crates/rspack_core/src/cache/persistent/storage/mod.rs StorageOptions made cacheable with PortablePath
crates/rspack_core/src/cache/persistent/snapshot/option.rs PathMatcher and SnapshotOptions made cacheable
crates/rspack_core/src/cache/persistent/snapshot/mod.rs Snapshot now uses CacheCodec for encoding/decoding
crates/rspack_core/src/cache/persistent/occasion/meta/mod.rs MetaOccasion updated to use CacheCodec
crates/rspack_core/src/cache/persistent/occasion/make/module_graph.rs Module graph serialization uses CacheCodec
crates/rspack_core/src/cache/persistent/occasion/make/mod.rs MakeOccasion updated to use CacheCodec
crates/rspack_core/src/cache/persistent/mod.rs PersistentCache updated to create and use CacheCodec
crates/rspack_core/src/cache/persistent/codec.rs New CacheCodec for encoding/decoding with project context
crates/rspack_core/src/cache/persistent/cacheable_context.rs Removed old CacheableContext struct
crates/rspack_core/src/cache/persistent/build_dependencies/mod.rs BuildDeps updated to use CacheCodec
crates/rspack_collections/src/identifier.rs Identifier now uses CustomConverter with PortableString
crates/rspack_cacheable_test/tests/**/*.rs Multiple test files updated for new API signatures
crates/rspack_cacheable/src/with/custom.rs CustomConverter updated with new signature using ContextGuard
crates/rspack_cacheable/src/with/as_string.rs Removed PathBuf AsStringConverter implementation
crates/rspack_cacheable/src/with/as_preset/rspack_resolver.rs AliasValue now uses PortablePath
crates/rspack_cacheable/src/with/as_preset/camino.rs Utf8PathBuf now uses PortablePath
crates/rspack_cacheable/src/with/as.rs AsConverter updated with ContextGuard parameter
crates/rspack_cacheable/src/utils/portable_string.rs New PortableString utility for path-containing strings
crates/rspack_cacheable/src/utils/portable_path.rs New PortablePath utility for path portability
crates/rspack_cacheable/src/utils/mod.rs Export new portable utilities
crates/rspack_cacheable/src/serialize.rs Updated to use CacheableContext trait
crates/rspack_cacheable/src/lib.rs Export CacheableContext and ContextGuard
crates/rspack_cacheable/src/deserialize.rs Updated to use CacheableContext trait
crates/rspack_cacheable/src/context.rs New CacheableContext trait and updated ContextGuard
crates/rspack_cacheable/Cargo.toml Added regex and sugar_path dependencies
Cargo.lock Lock file updated with new dependencies

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

📝 Benchmark detail: Open

Name Base (2026-01-08 f4c7791) Current Change
10000_big_production-mode_disable-minimize + exec 23.2 s ± 333 ms 22.9 s ± 160 ms -1.40 %
10000_development-mode + exec 1.29 s ± 22 ms 1.29 s ± 21 ms -0.37 %
10000_development-mode_hmr + stats 238 ms ± 3.2 ms 232 ms ± 4.9 ms -2.66 %
10000_development-mode_noop-loader + exec 2.24 s ± 64 ms 2.21 s ± 22 ms -1.39 %
10000_production-mode + exec 1.4 s ± 42 ms 1.33 s ± 29 ms -5.50 %
10000_production-mode_persistent-cold + exec 1.55 s ± 11 ms 1.62 s ± 9.3 ms +4.68 %
10000_production-mode_persistent-hot + exec 1.08 s ± 22 ms 1.11 s ± 26 ms +2.25 %
arco-pro_development-mode + exec 1.6 s ± 126 ms 1.48 s ± 138 ms -7.63 %
arco-pro_development-mode_hmr + stats 40 ms ± 0.47 ms 40 ms ± 3.5 ms +1.74 %
arco-pro_production-mode + exec 3.07 s ± 145 ms 2.9 s ± 57 ms -5.60 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.1 s ± 132 ms 2.93 s ± 104 ms -5.42 %
arco-pro_production-mode_persistent-cold + exec 3.09 s ± 68 ms 2.97 s ± 81 ms -3.83 %
arco-pro_production-mode_persistent-hot + exec 1.74 s ± 59 ms 1.71 s ± 72 ms -1.64 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.04 s ± 47 ms 2.91 s ± 61 ms -4.24 %
large-dyn-imports_development-mode + exec 1.57 s ± 34 ms 1.56 s ± 32 ms -0.24 %
large-dyn-imports_production-mode + exec 1.71 s ± 21 ms 1.68 s ± 43 ms -1.85 %
threejs_development-mode_10x + exec 1.33 s ± 23 ms 1.25 s ± 31 ms -5.94 %
threejs_development-mode_10x_hmr + stats 207 ms ± 4.6 ms 202 ms ± 4.8 ms -2.36 %
threejs_production-mode_10x + exec 4.1 s ± 47 ms 3.95 s ± 39 ms -3.81 %
threejs_production-mode_10x_persistent-cold + exec 4.24 s ± 64 ms 4.2 s ± 26 ms -1.02 %
threejs_production-mode_10x_persistent-hot + exec 3.66 s ± 64 ms 3.59 s ± 49 ms -1.98 %
10000_big_production-mode_disable-minimize + rss memory 5836 MiB ± 46.6 MiB 5935 MiB ± 306 MiB +1.70 %
10000_development-mode + rss memory 612 MiB ± 28.9 MiB 619 MiB ± 23.9 MiB +1.19 %
10000_development-mode_hmr + rss memory 766 MiB ± 26.7 MiB 765 MiB ± 14.9 MiB -0.15 %
10000_development-mode_noop-loader + rss memory 919 MiB ± 30.6 MiB 910 MiB ± 29.2 MiB -0.99 %
10000_production-mode + rss memory 639 MiB ± 16.4 MiB 634 MiB ± 36.1 MiB -0.67 %
10000_production-mode_persistent-cold + rss memory 773 MiB ± 45.5 MiB 731 MiB ± 22.5 MiB -5.48 %
10000_production-mode_persistent-hot + rss memory 735 MiB ± 61.4 MiB 721 MiB ± 26.7 MiB -1.98 %
arco-pro_development-mode + rss memory 561 MiB ± 18 MiB 585 MiB ± 53.4 MiB +4.30 %
arco-pro_development-mode_hmr + rss memory 442 MiB ± 23.4 MiB 484 MiB ± 6.15 MiB +9.41 %
arco-pro_production-mode + rss memory 652 MiB ± 40.4 MiB 671 MiB ± 19.6 MiB +2.83 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 698 MiB ± 61 MiB 696 MiB ± 51.1 MiB -0.34 %
arco-pro_production-mode_persistent-cold + rss memory 745 MiB ± 59.6 MiB 778 MiB ± 66.7 MiB +4.41 %
arco-pro_production-mode_persistent-hot + rss memory 552 MiB ± 91.3 MiB 539 MiB ± 76.8 MiB -2.46 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 689 MiB ± 56.7 MiB 704 MiB ± 63.1 MiB +2.18 %
large-dyn-imports_development-mode + rss memory 649 MiB ± 6.62 MiB 649 MiB ± 5.57 MiB -0.00 %
large-dyn-imports_production-mode + rss memory 561 MiB ± 7.6 MiB 563 MiB ± 7.49 MiB +0.37 %
threejs_development-mode_10x + rss memory 584 MiB ± 34.2 MiB 596 MiB ± 39.9 MiB +2.08 %
threejs_development-mode_10x_hmr + rss memory 814 MiB ± 28 MiB 807 MiB ± 33.5 MiB -0.85 %
threejs_production-mode_10x + rss memory 710 MiB ± 100 MiB 723 MiB ± 163 MiB +1.84 %
threejs_production-mode_10x_persistent-cold + rss memory 822 MiB ± 42.1 MiB 790 MiB ± 46.8 MiB -3.98 %
threejs_production-mode_10x_persistent-hot + rss memory 686 MiB ± 50.4 MiB 635 MiB ± 50.7 MiB -7.44 %

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 8, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing jerry/portable (f10c86c) with main (a6892fe)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-5k 2.7 MB 0
react-1k 825.4 KB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

📦 Binary Size-limit

Comparing f10c86c to fix(context-replacement): only apply changes when regex matches (#12657) by Agney Menon

❌ Size increased by 63.00KB from 47.90MB to 47.96MB (⬆️0.13%)

@jerrykingxyz jerrykingxyz force-pushed the jerry/portable branch 2 times, most recently from a269323 to 5b67098 Compare January 9, 2026 07:58
@jerrykingxyz jerrykingxyz changed the title feat: portable cache feat: support portable caching and disable by default Jan 14, 2026
@jerrykingxyz jerrykingxyz changed the title feat: support portable caching and disable by default feat: support portable cache and disable by default Jan 14, 2026
@chenjiahan chenjiahan merged commit 25020fd into main Jan 14, 2026
76 of 83 checks passed
@chenjiahan chenjiahan deleted the jerry/portable branch January 14, 2026 09:37
LingyuCoder pushed a commit that referenced this pull request Jan 16, 2026
* feat: support portable cache

* feat: disable portable cache by default
chenjiahan pushed a commit that referenced this pull request Jan 16, 2026
* feat: support portable cache

* feat: disable portable cache by default
hardfist added a commit that referenced this pull request Feb 5, 2026
* feat: treeshake share

* fix(module-federation): correct shared module name and optimize tree shaking

fix incorrect module name in shared config and test cases
change async process_module to sync using block_on for better performance
update shared exports optimization to handle side effects properly

* feat(module-federation): add treeshakeSharedExcludedPlugins option

* chore: add watchRun

* fix(shared-modules): handle undefined moduleToHandlerMapping and prevent tree-shaking

Add fallback for undefined moduleToHandlerMapping in shared container entry
Include additional plugins in filter list and prevent tree-shaking of shared modules by adding console logs when collectShared is true

* test(container-1-5): add ui-lib package for treeshake shared infer strategy

* fix(shared_used_exports): handle scoped package names in shared exports
refactor(node_binding): remove redundant exports in wasi files

* chore: update critical file

* feat(module-federation): add target and plugins to build info for treeshaking

Add target and plugins fields to build info when treeshaking is enabled in module federation. Also rename 'reshake' to 'reShake' for consistency across the codebase. These changes support better treeshaking analysis and configuration.

* docs: update field

* feat: add treeshakeSharedPlugins

* fix: lint

* fix: lockfile

* fix: lint

* chore: rename config

* chore(deps): update patch npm dependencies (#12647)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update patch crates (#12646)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: run ci/eco-ci/eco-benchmark on v2 branch (#12650)

* fix: report error when access module_graph in loader (#12639)

* fix: report error when access module_graph in loader

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(rstest): add preserveNewUrl option to keep new URL untouched (#12632)

* feat(rstest): add preserveNewUrl option to keep new URL untouched

* fix: format Rust code with rustfmt

* fix(lint): enable @typescript-eslint/await-thenable rule (#12644)

* fix(lint): enable await-thenable rule and fix violation

- Enable @typescript-eslint/await-thenable rule (off -> error)
- Remove unnecessary await on syncTraceEvent() which returns void

* Update rslint.json

---------

Co-authored-by: neverland <jait.chen@foxmail.com>

* refactor: afterCodeGeneration hook use read only compilation ref (#12655)

* fix(lint): enable @typescript-eslint/require-await rule (#12664)

fix(lint): enable require-await rule and fix violations

- Enable @typescript-eslint/require-await rule (off -> error)
- FileSystem.ts: Add missing return for Promise, remove async
- SubresourceIntegrityPlugin.ts: Use Promise.resolve() instead of async
- browser/service.ts: Remove async from function that only throws
- loader-runner/worker.ts: Remove async from .then/.catch callbacks

* chore(deps): update github-actions (#12645)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(lint): enable @typescript-eslint/return-await rule (#12665)

* refactor: make compilation readonly for runtimeModule hook (#12670)

* feat: add constructor name for JS runtime modules (#12673)

feat: add constructor name for JS runtime module

* fix: incremental rebuild no code generation entry panic (#12643)

* fix: incremental rebuild bug

* add test case

* fix: ci

* refactor: unify artifact clear logic (#12677)

* refactor: use DerfOpt's take/replace assist artifact mutation (#12659)

* refactor: remove Default trait of DerefOption
* refactor: `replace` is better than `insert`

* feat: rspack_cacheable context expose project root (#12685)

* feat: rspack_cacheable context expose project root

* fix: comment

* feat: rspack_cacheable add portable path & portable string (#12688)

feat: add portable path & portable string

* fix: inlined export invalid syntax comment (#12681)

* feat: add `requireAlias` option to control require variable renaming (#12686)

* feat: add requireRename option to control require variable renaming

* Update packages/rspack/src/config/types.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/rspack-test/configCases/parsing/renaming-disabled/index.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* rename

* rename

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(test): flaky test due to calling toJSON while hot updating (#12694)

* feat: impl `sync_trace` for `logger` tracing layer (#12687)

* Sync node events for logger tracing

* Align sync_trace

* Remove unless info

* Cargo shear

* Use one writer

* Filter JavaScript

* Handle timestamps

* Clippy

* Clippy

* feat: add warning when requireAlias is disabled (#12700)

* refactor: rename tree shaking field name

* revert: "feat: add warning when requireAlias is disabled" (#12702)

Revert "feat: add warning when requireAlias is disabled (#12700)"

This reverts commit eb5635c.

* feat: use rspack-vue-loader to support Vue hot update (#12698)

feat: use rspack-vue-loader to support hotupdate

* chore: update artificat

* chore: replace async processAssets hooks with sync versions

* fix: `environments.importMetaDirnameAndFilename` not work (#12708)

fix: `environments.importMetaDirnameAndFilename` should work

* fix: dynamic entry panic when disable build cache (#12696)

* fix(context-replacement): only apply changes when regex matches (#12657)

fix(ContextReplacementPlugin): only apply changes when regex matches

The plugin was applying transformations (recursive, regExp, critical) to
all require.context() calls regardless of whether the configured regex
pattern matched the request. This fix ensures all transformations only
apply when the regex successfully matches.

Closes #12656

* docs: add missed doc

* fix: remove ueless dep

* chore: update lock file

* fix(mf): handle missing chunk gracefully and improve expose chunk name logic (#12709)

* fix(type): runtimeModule.source (#12713)

* fix(type): runtimeModule.source

* fix: lint

* fix: lint

* chore: release 1.7.2 (#12710)

Release 0.7.2

rspack@0.7.2
rspack_allocator@0.7.2
rspack_binding_api@0.7.2
rspack_binding_build@0.7.2
rspack_binding_builder@0.7.2
rspack_binding_builder_macros@0.7.2
rspack_browser@0.7.2
rspack_browserslist@0.7.2
rspack_cacheable@0.7.2
rspack_cacheable_macros@0.7.2
rspack_collections@0.7.2
rspack_core@0.7.2
rspack_error@0.7.2
rspack_fs@0.7.2
rspack_futures@0.7.2
rspack_hash@0.7.2
rspack_hook@0.7.2
rspack_ids@0.7.2
rspack_javascript_compiler@0.7.2
rspack_loader_lightningcss@0.7.2
rspack_loader_preact_refresh@0.7.2
rspack_loader_react_refresh@0.7.2
rspack_loader_runner@0.7.2
rspack_loader_swc@0.7.2
rspack_loader_testing@0.7.2
rspack_location@0.7.2
rspack_macros@0.7.2
rspack_napi@0.7.2
rspack_napi_macros@0.7.2
rspack_paths@0.7.2
rspack_plugin_asset@0.7.2
rspack_plugin_banner@0.7.2
rspack_plugin_case_sensitive@0.7.2
rspack_plugin_circular_dependencies@0.7.2
rspack_plugin_copy@0.7.2
rspack_plugin_css@0.7.2
rspack_plugin_css_chunking@0.7.2
rspack_plugin_devtool@0.7.2
rspack_plugin_dll@0.7.2
rspack_plugin_dynamic_entry@0.7.2
rspack_plugin_ensure_chunk_conditions@0.7.2
rspack_plugin_entry@0.7.2
rspack_plugin_esm_library@0.7.2
rspack_plugin_externals@0.7.2
rspack_plugin_extract_css@0.7.2
rspack_plugin_hmr@0.7.2
rspack_plugin_html@0.7.2
rspack_plugin_ignore@0.7.2
rspack_plugin_javascript@0.7.2
rspack_plugin_json@0.7.2
rspack_plugin_lazy_compilation@0.7.2
rspack_plugin_library@0.7.2
rspack_plugin_lightning_css_minimizer@0.7.2
rspack_plugin_limit_chunk_count@0.7.2
rspack_plugin_merge_duplicate_chunks@0.7.2
rspack_plugin_mf@0.7.2
rspack_plugin_module_info_header@0.7.2
rspack_plugin_module_replacement@0.7.2
rspack_plugin_no_emit_on_errors@0.7.2
rspack_plugin_progress@0.7.2
rspack_plugin_real_content_hash@0.7.2
rspack_plugin_remove_duplicate_modules@0.7.2
rspack_plugin_remove_empty_chunks@0.7.2
rspack_plugin_rsdoctor@0.7.2
rspack_plugin_rslib@0.7.2
rspack_plugin_rstest@0.7.2
rspack_plugin_runtime@0.7.2
rspack_plugin_runtime_chunk@0.7.2
rspack_plugin_schemes@0.7.2
rspack_plugin_size_limits@0.7.2
rspack_plugin_split_chunks@0.7.2
rspack_plugin_sri@0.7.2
rspack_plugin_swc_js_minimizer@0.7.2
rspack_plugin_wasm@0.7.2
rspack_plugin_web_worker_template@0.7.2
rspack_plugin_worker@0.7.2
rspack_regex@0.7.2
rspack_storage@0.7.2
rspack_swc_plugin_import@0.7.2
rspack_swc_plugin_ts_collector@0.7.2
rspack_tasks@0.7.2
rspack_tracing@0.7.2
rspack_tracing_perfetto@0.7.2
rspack_util@0.7.2
rspack_watcher@0.7.2
rspack_workspace@0.7.2

Generated by cargo-workspaces

* chore(deps): update dependency @rspack/plugin-react-refresh to ^1.6.0 (#12718)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @shikijs/transformers to ^3.21.0 (#12719)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update patch crates (#12716)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* test: skip recover-from-error/delete-file in watchCases (#12726)

* feat: support portable cache and disable by default (#12680)

* feat: support portable cache

* feat: disable portable cache by default

* fix: rename reShake to secondaryTreeShaking

* chore: update artificat

* test: use Rstest projects to define tests (#12729)

* test: use rstest projects

* test: update

* test: output.module

* test: update

* chore(deps): update patch npm dependencies (#12717)

* chore(deps): update patch npm dependencies

* fix: downgrade MF

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

* refactor: move pass into separate folder and driven by run_passes (#12735)

* chore: add rspack_passes.md

* refactor: move pass into separate folder and drive by run_passes

* chore: use function

* refactor: move more into run_passes

* chore: fix stats logging

* chore: fix stats.logging

* refactor(lazy-compilation): use POST request to transfer  ids of active modules (#12678)

* refactor: use post transfer module ids

* test: skip lazy active method

* test: add lazy post request help

* test: add large module id container

* test: add case introduction

* refactor: remove about controller

* test: we are using post method now

* refactor: rename

* fix body parser (vibe-kanban 09797829)

1. 如果其他中间件一个解析好了body,并挂载在req.body 上的花就直直接使用 req.body
2. packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts body 解析的时候不能简单的使用 string 的拼接,需要考虑多字节符号的截断的问题。

* refactor read module ids from body (vibe-kanban a7874ac1)

packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts 当req.body 非空时,直接假body中时一组 module ids,如果没有 body 自行拼接完,之后也 parse json string,返回 module ids 数组

* refactor: downgrading to lower web api

* test: ✅ add lazy compilation active cors cases

* chore: update test case doc

* fix: we all need cors header no matter is simple request or not

* refactor:delete cors header setting

* refactor: set cors header should set by user

* Update packages/rspack/hot/lazy-compilation-web.js

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

* test: fix case name

* chore: api-extract update

* fix: memory leak of requst listeners

* refactor: remove event source handle logic

* fix: jsdom XMLHTTPRequets need strict cors header

* refactor: node lazy compilation client use post too

---------

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>

* refactor: move logger into pass and reorg some passes (#12742)

* refactor: move logger into pass and reorg some passes

* chore: fix bench check

* chore(lint): bump @rslint/core to 0.2.0 and enable default-param-last rule (#12746)

* chore(deps): bump @rslint/core to 0.2.0 and update rslint.json

* fix(lint): enable @typescript-eslint/default-param-last rule

* test: support filter test by absolute path (#12749)

* test: support filter test by absolute path

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update tests/rspack-test/Cache.test.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: use newtype for alias artifact (#12754)

* chore: bump `swc_core` from 54 to 55 (#12758)

* chore: bump swc

* chore: bump swc exp

* chore: cargo codegen

* refactor: move all artifacts together (#12755)

* chore: limit threads for codspeed benchmark (#12763)

Limit threads

* chore(deps): update dependency cspell to ^9.6.0 (#12768)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency emnapi to ^1.8.1 (#12769)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency memfs to v4.53.0 (#12770)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* refactor: use compilation readonly ref in codegen optimization hook (#12743)

* refactor: use compilation readonly ref in code generation optimization hook

* chore: debug bench ci

* fix: 🐛 use offical codseed action

* Debug ci

* Remove debugger

* Limit tokio and rayon worker threads

* Revert "Limit tokio and rayon worker threads"

This reverts commit 10fe6ac.

* Update crates/rspack_plugin_progress/src/lib.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: CPunisher <1343316114@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(browser): update worker format and add e2e test (#12747)

* fix: remove lazyCompilationMiddleware

* chore: change worker entry to iife

* chore: add e2e test

* chore: fix format

* fix: add await for e2e

* fix: remove unused imports

* chore: fix ci yml

* chore: fix ci WASM env injection

* fix: update shared global name

* perf: reuse container plugin

* chore: fix merge conflict

* chore: use official version and update docs

* chore: fix cargo clippy

* chore: bump

* workflow: revert ci

* ci: add CodSpeed performance analysis action

Add GitHub action for continuous benchmarking with CodSpeed. The action supports multiple measurement modes and instruments, including MongoDB instrumentation and caching for faster runs. Includes validation for required inputs and custom runner installation.

* chore: revert cacahe implementation

* chore: use get_referenced_exports

* chore: revert esm depnedency change

* chore: revert esm_import_specifier_dependency change

* refactor(mf): simplify runtime module implementations

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: harpsealjs <lingyucoder@gmail.com>
Co-authored-by: hardfist <yangjianzju@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Max <fi3ework@gmail.com>
Co-authored-by: Tu Shaokun <53142663+tt-a1i@users.noreply.github.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
Co-authored-by: pshu <stormslowly@gmail.com>
Co-authored-by: jinrui <jerrykingxyz@gmail.com>
Co-authored-by: Gengkun <ahabhgk@gmail.com>
Co-authored-by: CPunisher <1343316114@qq.com>
Co-authored-by: 9aoy <9aoyuao@gmail.com>
Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
Co-authored-by: Cong-Cong Pan <dacongsama@live.com>
Co-authored-by: Agney Menon <agney.menons@live.com>
Co-authored-by: Fy <1114550440@qq.com>
Co-authored-by: senze.fan <151665030@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) 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