Skip to content

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Jan 8, 2026

Summary

fix #12631

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 12:19
@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 993e6d3
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/695fa0c2616bd600081018a9

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Jan 8, 2026
@ahabhgk ahabhgk enabled auto-merge (squash) January 8, 2026 12:19
@ahabhgk ahabhgk requested a review from JSerFeng January 8, 2026 12:19
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 fixes a bug where inlined export comments were placed outside parentheses, creating invalid JavaScript syntax in certain contexts (especially division operations). The fix moves comments inside the parentheses.

Key changes:

  • Modified EvaluatedInlinableValue::render() and InlinedUsedName::render() to accept a comment parameter and place it inside parentheses: (/* comment */value) instead of /* comment */ (value)
  • Updated all call sites across the codebase to pass the appropriate comment string
  • Added a new test case to verify the fix works correctly for division expressions

Reviewed changes

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

Show a summary per file
File Description
crates/rspack_core/src/exports/utils.rs Core fix: Modified render methods to accept comment parameter and place it inside parentheses
crates/rspack_core/src/concatenated_module.rs Updated all inlined value render calls to use new API with comment parameter
crates/rspack_core/src/runtime_template.rs Updated inlined value render call to use new API
crates/rspack_core/src/exports/export_info_getter.rs Updated render call with empty comment for rename info
crates/rspack_plugin_esm_library/src/link.rs Updated multiple inlined value render calls with appropriate comments
crates/rspack_plugin_javascript/src/dependency/esm/esm_export_imported_specifier_dependency.rs Updated to generate proper comment for inlined exports
crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_*.rs Updated CommonJS dependency handlers to use new render API
crates/rspack_plugin_library/src/*.rs Updated library plugin render calls with empty comments
tests/rspack-test/configCases/inline-const/generated-syntax/* New test case verifying fix for division expression syntax
tests/rspack-test/configCases/rsdoctor/assets/rspack.config.js Updated expected file sizes (1 byte reduction per file)
All other test snapshot files Updated snapshots to reflect new comment placement inside parentheses

💡 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

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.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 993e6d3 to refactor: unify artifact clear logic (#12677) by hardfist

🎉 Size decreased by 768bytes from 47.87MB to 47.87MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 8, 2026

Merging this PR will not alter performance

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing fix-inline-comment (993e6d3) with main (70ffab9)

Open in CodSpeed

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.

@ahabhgk ahabhgk merged commit b81dfa2 into main Jan 9, 2026
86 of 88 checks passed
@ahabhgk ahabhgk deleted the fix-inline-comment branch January 9, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug 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.

[Bug]: inline exports create syntax errors with division operator

3 participants