Highlights 💡
🎈 Upgrade SWC
The latest version of SWC enhances the compatibility of Wasm plugins. This means future upgrades of Rspack and SWC will almost no longer break SWC Wasm plugins. Additionally, the SWC upgrade brings a 10% performance improvement to the parser.
✅ Enable lazy compilation by default
Since Rspack v1.5 has stabilized Lazy Compilation, we are now enabling it by default for dynamic imports cases when the target is web.
export default defineConfig({
lazyCompilation: {
imports: true,
},
});🎯 Stablize several experimental configurations
In the previous releases, the experimental features experiments.lazyBarrel, experiments.inlineConst, experiments.inlineEnum were introduced to enable cross-module inlining optimizations for constants. These optimizations improve minifiers' ability to perform precise static analysis, eliminate unused code branches, and further reduce bundle size.
After thorough validation, we are now promoting these features from experimental to stable.
export default {
experiments: {
- inlineConst: true,
- inlineEnum: true,
- lazyBarrel: true,
- typeReexportsPresence: true,
},
module: {
parser: {
javascript: {
- inlineConst: true,
typeReexportsPresence: true,
},
},
},
optimization: {
+ inlineExports: true,
},
}What's Changed
Performance Improvements ⚡
New Features 🎉
- feat: support dynamic URL with new URL() context mode by @LingyuCoder in #12389
- feat: stabilize lazy compilation middleware by @chenjiahan in #12429
- feat: add support for type: 'text' in asset modules by @LingyuCoder in #12457
- feat: enable lazy compilation for imports by defaults by @stormslowly in #12419
- feat(deps)!: bump
swc_corefrom 46.0.3 to 50.2.3 andswc_experimentalby @CPunisher in #12445 - feat: implement UniversalCompileAsyncWasmPlugin for universal chunk loading by @LingyuCoder in #12471
- feat: stabilize inline exports by @ahabhgk in #12475
- feat: stabilize SubresourceIntegrityPlugin by @LingyuCoder in #12483
Bug Fixes 🐞
- fix: add test/include/exclude options to EvalSourceMapDevToolPlugin by @LingyuCoder in #12392
- fix: relative-resource-path should handle output.filename by @SyMind in #12398
- fix: improve RuntimeGlobals type definition accuracy by @LingyuCoder in #12403
- fix: handle empty resource path in context module by @LingyuCoder in #12407
- fix: align webpack behavior of removing empty entry chunk by @JSerFeng in #12414
- fix: make splitChunks more stable by @JSerFeng in #12410
- fix: should use exported name of the imported module by @JSerFeng in #12423
- fix: strip ANSI codes from ignoreWarnings messages by @chenjiahan in #12435
- fix: concatenate module should use importer's 'strict' for interop by @JSerFeng in #12446
- fix: wasm plugin panic when use persistent cache by @jerrykingxyz in #12455
- fix: add Set methods to compilation dependencies by @LingyuCoder in #12459
- fix(diagnostic): avoid emitting dim-only indent lines by @chenjiahan in #12461
- fix: handle symlinks correctly in rmrf function by @LingyuCoder in #12456
- fix: add case-sensitive check for emit assets by @LingyuCoder in #12462
- fix: use RspackHash for HTML plugin content hash calculation by @LingyuCoder in #12465
- fix: re-validate HttpUriPlugin redirects against allowedUris and enforce http(s) and max redirects by @JSerFeng in #12463
- fix: extra runtime global bits are lost after js hook by @nilptr in #12275
- fix: set lazyCompilation default to web only by @stormslowly in #12473
- fix: handle ignored asset modules with proper data URL export by @LingyuCoder in #12468
- fix: reexports in arrow-only environments without const by @chenjiahan in #12484
- fix: respect matchResource when generate nameForCondition by @Austaras in #12449
Refactor 🔨
- refactor: move cacheable macros to rspack_cacheable_macros by @jerrykingxyz in #12393
- refactor: use atomic_refcell for async_module_artifact by @hardfist in #12408
- refactor: use swc_experimental on concatenated module by @CPunisher in #12369
- refactor: change dependencies_diagnostics_artifact to use atomic_refcell by @hardfist in #12415
- refactor: replace
SourceFilewith&strand replaceArc<SourceMap>withRopein rspack_plugin_javascript by @CPunisher in #12404 - refactor: extract common utility functions to rspack_util by @LingyuCoder in #12447
- refactor: remove linked_hash_set dependency by @LingyuCoder in #12451
Document Updates 📖
- docs: add docs about env to control working threads limit by @hardfist in #12383
- docs: improve AGENTS.md and add comprehensive development documentation by @LingyuCoder in #12420
- docs: upgrade rspress@2.0.0-rc.2 by @SoonIter in #12426
- docs: update FAQ to clarify Rspack's support for Wasm and RSC by @chenjiahan in #12432
- docs: enhance
ignoreWarningsoption with detailed examples by @chenjiahan in #12436 - docs: add deprecated options documentation by @chenjiahan in #12448
- docs: refactor
module.rulesoptions into a dedicated page by @chenjiahan in #12452 - docs: improve
resolve.byDependencydescription and examples by @chenjiahan in #12458 - docs: fix rules[].use example by @henryqdineen in #12466
- docs: add descriptions for built-in plugins by @chenjiahan in #12485
Other Changes
- chore: release v1.6.7 by @JSerFeng in #12391
- test: remove webpack consistency check filters from statsOutputCases by @LingyuCoder in #12394
- test: enable previously filtered test cases and update expected outputs by @LingyuCoder in #12396
- chore(ci): run Mac CI test on github hosted runner by @stormslowly in #12397
- test: update stats snapshot by @LingyuCoder in #12401
- test: enable passing normalCases tests and document failures by @LingyuCoder in #12409
- test: enable passing configCases tests and document failures by @LingyuCoder in #12412
- test: try to fix flaky test cases by @LingyuCoder in #12402
- chore(ci): fix artifact discovery logic in Rsdoctor action by @yifancong in #12405
- chore: bump
swc_experimentalto fix parsing utf8 in template by @CPunisher in #12431 - chore(ci): skip diff action for doc-only changes by @yifancong in #12437
- chore(deps): update dependency cspell to ^9.4.0 by @renovate[bot] in #12439
- chore(deps): update dependency memfs to v4.51.1 by @renovate[bot] in #12440
- chore(deps): update dependency tsx to ^4.21.0 by @renovate[bot] in #12442
- chore(deps): update dependency prettier to v3.7.4 by @renovate[bot] in #12441
- chore: skip diff CI for doc-only changes by @yifancong in #12438
- chore: enable noUnusedParameters option in tsconfig by @chenjiahan in #12464
- chore(deps): update SWC to v48.0.1 by @renovate[bot] in #12479
- chore(deps): update dependency @shikijs/transformers to ^3.20.0 by @renovate[bot] in #12480
- chore(ci): support collapsing the CI comment by @yifancong in #12472
- chore(deps): update github-actions by @renovate[bot] in #12477
Full Changelog: v1.6.7...v1.7.0-beta.0