Skip to content

Conversation

@JSerFeng
Copy link
Contributor

Summary

support render import and export string specifier

import {"a.b" as foo}  from "lib"

export { foo as "b.c" }

Related links

Checklist

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

@JSerFeng JSerFeng enabled auto-merge (squash) January 16, 2026 07:42
@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Jan 16, 2026
@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for rspack-v2 canceled.

Name Link
🔨 Latest commit 7d0cf92
🔍 Latest deploy log https://app.netlify.com/projects/rspack-v2/deploys/696f3ca0032423000874b06a

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Jan 16, 2026
ahabhgk
ahabhgk previously approved these changes Jan 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 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
ui-components 2.1 MB 0
rome 984.2 KB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

📦 Binary Size-limit

Comparing 6e4f76e to fix: sort css by sourceorder, esm import comes first (#12778) by Fy

❌ Size increased by 5.50KB from 47.99MB to 48.00MB (⬆️0.01%)

Timeless0911
Timeless0911 previously approved these changes Jan 16, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 20, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing feat/export-string-specifier (6e4f76e) with main (83e9044)

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.

@JSerFeng JSerFeng changed the base branch from v2 to main January 20, 2026 09:35
@JSerFeng JSerFeng dismissed stale reviews from Timeless0911 and ahabhgk January 20, 2026 09:35

The base branch was changed.

@JSerFeng JSerFeng force-pushed the feat/export-string-specifier branch from 7d0cf92 to 6e4f76e Compare January 20, 2026 09:35
Copilot AI review requested due to automatic review settings January 20, 2026 09:35
@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 6e4f76e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/696f4c50163a010008472e72

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 adds support for rendering ES module import and export statements with string specifiers, which allows using identifiers that are not valid JavaScript variable names (e.g., import {"a.b" as foo} or export {foo as "b.c"}).

Changes:

  • Introduced export_name utility function to properly quote export/import specifiers when needed
  • Updated ESM library rendering to use export_name for all import/export specifier generation
  • Added comprehensive test case demonstrating string specifier support with module splitting

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rspack_core/src/utils/property_name.rs Adds export_name function to handle quoting of ES module specifiers
crates/rspack_plugin_esm_library/src/render.rs Updates all import/export statement generation to use export_name for proper string specifier handling
tests/rspack-test/esmOutputCases/re-exports/string-specifier/rspack.config.js Configures test with module rules and chunk splitting
tests/rspack-test/esmOutputCases/re-exports/string-specifier/lib.js Test library exporting with string specifier
tests/rspack-test/esmOutputCases/re-exports/string-specifier/index.js Test entry point importing and re-exporting with string specifiers
tests/rspack-test/esmOutputCases/re-exports/string-specifier/snapshots/esm.snap.txt Expected output snapshot verifying correct rendering of string specifiers

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

@JSerFeng JSerFeng merged commit 5a9e27f into main Jan 21, 2026
82 of 85 checks passed
@JSerFeng JSerFeng deleted the feat/export-string-specifier branch January 21, 2026 05:41
LingyuCoder pushed a commit that referenced this pull request Jan 21, 2026
chenjiahan pushed a commit that referenced this pull request Jan 21, 2026
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.

4 participants