feat!: change exports presence default to true#13002
Conversation
Deploying rspack with
|
| Latest commit: |
2823bd8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d4d4458.rspack-v2.pages.dev |
| Branch Preview URL: | https://default-exports-presence-tru.rspack-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR makes missing/invalid export usage default to an error (instead of warn/auto behavior), removes the legacy strictExportPresence option, and updates tests/docs to match the new default diagnostics behavior.
Changes:
- Change default
module.parser.javascript.exportsPresenceto'error'and removestrictExportPresencefrom public config/types/bindings. - Adjust Rust ESM dependency diagnostics defaulting to
ExportPresenceMode::Error. - Update/extend test fixtures and snapshots so cases expecting warnings/errors continue to pass under the new default.
Reviewed changes
Copilot reviewed 28 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/config/module.mdx | Removes strictExportPresence docs section (needs default update for exportsPresence). |
| website/docs/en/config/module.mdx | Removes strictExportPresence docs section (needs default update for exportsPresence). |
| tests/rspack-test/watchCases/collect-modules-diagnostics/removed-modules/1/errors.js | Adds expected errors for watch diagnostics case. |
| tests/rspack-test/treeShakingCases/inherit_export_map_should_lookup_in_dfs_order/rspack.config.js | Forces exportsPresence: 'auto' to keep prior behavior for this case. |
| tests/rspack-test/treeShakingCases/conflicted_name_by_re_export_all_should_be_hidden/rspack.config.js | Forces exportsPresence: 'auto' to keep prior behavior for this case. |
| tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js | Forces exportsPresence: 'auto' so warnings-focused stats test remains warnings-based. |
| tests/rspack-test/statsOutputCases/ignore-warning/rspack.config.js | Forces exportsPresence: 'auto' to keep ignoreWarnings-based behavior stable. |
| tests/rspack-test/normalCases/side-effects/dynamic-reexports/errors.js | Updates expectations from warnings to errors. |
| tests/rspack-test/normalCases/parsing/missing-export-warning-nested/errors.js | Updates expectations to errors for missing nested exports. |
| tests/rspack-test/normalCases/parsing/harmony-star-conflict/errors.js | Updates expectations to errors for conflicting star exports. |
| tests/rspack-test/normalCases/parsing/harmony-info/errors.js | Updates expectations to errors for missing exports in harmony info case. |
| tests/rspack-test/normalCases/parsing/harmony-export-precedence/errors.js | Updates expectations to errors for export precedence case. |
| tests/rspack-test/normalCases/parsing/harmony-duplicate-export/errors.js | Updates expectations to errors for duplicate export case. |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/warnings.js | Removes warning expectation file (behavior now errors). |
| tests/rspack-test/normalCases/parsing/esm-commonjs-interop/errors.js | Adds error expectation for ESM/CJS interop case. |
| tests/rspack-test/normalCases/interop/basic/errors.js | Adds expected errors for interop case under new default. |
| tests/rspack-test/normalCases/cjs-tree-shaking/mutate/errors.js | Adds expected errors for mutate case under new default. |
| tests/rspack-test/normalCases/cjs-interop/non-existing-export/errors.js | Adds expected errors for CJS interop missing exports. |
| tests/rspack-test/exampleCases/lazy-compilation/rspack.config.js | Forces exportsPresence: "auto" to preserve example behavior. |
| tests/rspack-test/diagnosticsCases/factorize/export_star_error/stats.err | Switches expected output from warning to error. |
| tests/rspack-test/diagnosticsCases/factorize/export_star_error/raw-warning.err | Updates raw warnings expectation (now empty). |
| tests/rspack-test/diagnosticsCases/factorize/export_star_error/raw-error.err | Updates raw errors expectation (now populated). |
| tests/rspack-test/defaultsCases/default/base.js | Updates default snapshot to include exportsPresence: error and remove strictExportPresence. |
| tests/rspack-test/configCases/type-reexports-presence/tolerant/errors.js | Updates type re-export presence expectations under new defaults. |
| tests/rspack-test/configCases/type-reexports-presence/no-tolerant/errors.js | Updates type re-export presence expectations under new defaults. |
| tests/rspack-test/configCases/parsing/non-enumerable/weird-module.js | Adds fixture module with symbols/prototype/non-enumerable props. |
| tests/rspack-test/configCases/parsing/non-enumerable/warnings.js | Adds expected warnings for the non-enumerable parsing suite. |
| tests/rspack-test/configCases/parsing/non-enumerable/test.mjs | Adds mjs tests for non-enumerable export presence behavior. |
| tests/rspack-test/configCases/parsing/non-enumerable/test.js | Adds non-mjs tests for non-enumerable export presence behavior. |
| tests/rspack-test/configCases/parsing/non-enumerable/rspack.config.js | Adds config for the non-enumerable parsing suite. |
| tests/rspack-test/configCases/parsing/non-enumerable/index.js | Adds entry that runs concatenated/non-concatenated variants. |
| tests/rspack-test/configCases/parsing/non-enumerable/esModule.js | Adds fixture module defining __esModule and non-enumerable props. |
| tests/rspack-test/configCases/parsing/non-enumerable/errors.js | Adds expected errors for the non-enumerable parsing suite. |
| tests/rspack-test/configCases/parsing/non-enumerable/analyzable-module.js | Adds analyzable fixture module with non-enumerable props. |
| tests/rspack-test/configCases/library/module-and-child-compilation/rspack.config.js | Replaces module.strictExportPresence usage with parser.javascript.exportsPresence. |
| tests/rspack-test/configCases/library/modern-module-reexport-type/rspack.config.js | Forces exportsPresence: 'auto' for this library case. |
| tests/rspack-test/configCases/compiletime/warn-not-found/errors.js | Adds expected errors for warn-not-found compiletime config case. |
| tests/rspack-test/configCases/compiletime/error-not-found/rspack.config.js | Migrates from strictExportPresence to exportsPresence: 'error'. |
| tests/rspack-test/configCases/builtins/should_not_warn_export_destructring/errors.js | Adds expected errors for destructuring missing exports case. |
| tests/rspack-test/builtinCases/plugin-wasm/v128/rspack.config.js | Forces exportsPresence: 'auto' for wasm builtin test case. |
| packages/rspack/src/config/types.ts | Updates TS config types: default exportsPresence is 'error', removes strictExportPresence. |
| packages/rspack/src/config/defaults.ts | Sets JS parser default exportsPresence to 'error'. |
| packages/rspack/src/config/adapter.ts | Removes raw option mapping for strictExportPresence. |
| packages/rspack/etc/core.api.md | Updates generated API docs to remove strictExportPresence. |
| crates/rspack_plugin_javascript/src/dependency/esm/esm_import_specifier_dependency.rs | Defaults export presence mode to Error when unset. |
| crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs | Defaults re-export presence mode to Error when unset. |
| crates/rspack_core/src/options/module.rs | Removes strict_export_presence from Rust options struct. |
| crates/rspack_binding_api/src/raw_options/raw_module/mod.rs | Removes strict_export_presence from raw options + conversion. |
| crates/rspack/tests/snapshots/defaults__default_options.snap | Updates defaults snapshot to reflect removal of strict_export_presence. |
| crates/rspack/src/builder/mod.rs | Removes strict_export_presence from builder defaults. |
| crates/node_binding/napi-binding.d.ts | Removes strictExportPresence from Node binding types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/statsOutputCases/warnings-space-warning/rspack.config.js
Show resolved
Hide resolved
📦 Binary Size-limit
❌ Size increased by 25.75KB from 48.63MB to 48.65MB (⬆️0.05%) |
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
Summary
change exports presence default to true
Related links
Checklist