Skip to content

Conversation

@chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Nov 12, 2025

Summary

Replaced verbose comments like /* ESM import */ and /* ESM default export */ with shorter, clearer forms.

  • /* ESM import *//* import */
  • /* ESM default export *//* export default */

This keeps the annotations readable while reducing noise in the compiled output.

  • before:
/* ESM import */var _script1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./package2/script1.js");

/* ESM default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_script1__WEBPACK_IMPORTED_MODULE_0__["default"]);
  • after:
/* import */var _script1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./package2/script1.js");

/* export default */ const __WEBPACK_DEFAULT_EXPORT__ = (_script1__WEBPACK_IMPORTED_MODULE_0__["default"]);

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 12, 2025 06:29
@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 6fef3e0
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69142e8391f5a000081eba5b

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Nov 12, 2025
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 simplifies comment annotations in compiled webpack output by removing the "ESM" prefix from import/export comments, making them shorter and clearer while maintaining readability.

  • Changed comment format from /* ESM import */ to /* import */
  • Changed comment format from /* ESM default export */ and variants to /* export default */ and corresponding variants
  • Updated all test snapshots to reflect the new comment format

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs Updated export default comment formats in code generation
crates/rspack_core/src/dependency/runtime_template.rs Updated import statement comment formats in code generation
tests/rspack-test/treeShakingCases/**/*.snap.txt (75 files) Updated test snapshots for tree shaking cases
tests/rspack-test/statsOutputCases/**/*.txt (3 files) Updated stats output snapshots with new comment format
tests/rspack-test/statsAPICases/*.js (2 files) Updated hash values due to code changes
tests/rspack-test/hookCases/**/output.snap.txt (1 file) Updated hook case snapshot
tests/rspack-test/esmOutputCases/**/*.snap.txt (6 files) Updated ESM output snapshots
tests/rspack-test/diagnosticsCases/**/stats.err (1 file) Updated error message snapshot
tests/rspack-test/builtinCases/**/*.snap.txt (20 files) Updated builtin test case snapshots

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

📦 Binary Size-limit

Comparing 6fef3e0 to feat(react-refresh-loader): generate more compact runtime code (#12160) by neverland

❌ Size increased by 128bytes from 48.09MB to 48.09MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 12, 2025

CodSpeed Performance Report

Merging #12163 will not alter performance

Comparing shorten_comments_1112 (6fef3e0) with main (0c06124)

Summary

✅ 17 untouched

@chenjiahan chenjiahan merged commit ed5f89a into main Nov 12, 2025
67 of 70 checks passed
@chenjiahan chenjiahan deleted the shorten_comments_1112 branch November 12, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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