Skip to content

Comments

feat!: change exports presence default to true#13002

Merged
ahabhgk merged 3 commits intomainfrom
default-exports-presence-true
Feb 9, 2026
Merged

feat!: change exports presence default to true#13002
ahabhgk merged 3 commits intomainfrom
default-exports-presence-true

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Feb 9, 2026

Summary

change exports presence default to true

Related links

Checklist

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

Copilot AI review requested due to automatic review settings February 9, 2026 08:25
@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 Feb 9, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 9, 2026

@ahabhgk ahabhgk requested review from chenjiahan and removed request for h-a-n-a February 9, 2026 08:27
@ahabhgk ahabhgk enabled auto-merge (squash) February 9, 2026 08:27
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 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.exportsPresence to 'error' and remove strictExportPresence from 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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

📦 Binary Size-limit

Comparing 2823bd8 to feat: add the map of json data size to rspack_plugin_rsdoctor for use rsdoctor (#12950) by yifancong

❌ Size increased by 25.75KB from 48.63MB to 48.65MB (⬆️0.05%)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 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-1k 825.4 KB 0
react-5k 2.7 MB 0
rome 984.2 KB 0
ui-components 2.2 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 9, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing default-exports-presence-true (2823bd8) with main (22f282a)

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.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ahabhgk ahabhgk merged commit 8590102 into main Feb 9, 2026
50 checks passed
@ahabhgk ahabhgk deleted the default-exports-presence-true branch February 9, 2026 09:09
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.

2 participants