Skip to content

feat!: migrate to esm-only - #2765

Merged
kettanaito merged 5 commits into
feat/3.0from
feat/esm-only
Jul 18, 2026
Merged

feat!: migrate to esm-only#2765
kettanaito merged 5 commits into
feat/3.0from
feat/esm-only

Conversation

@kettanaito

@kettanaito kettanaito commented Jul 18, 2026

Copy link
Copy Markdown
Member

Migrates MSW to be ESM-only 🎉 Finally.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8fc308e5-29a1-4bd5-a384-9b2926d402b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/esm-only

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Jul 18, 2026

Copy link
Copy Markdown

@kettanaito kettanaito mentioned this pull request Jul 18, 2026
30 tasks
@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/msw@2765

commit: dabe4b3

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/plugins/rolldown/forceFileExtensionsPlugin.ts`:
- Around line 21-35: Update ESM_RELATIVE_IMPORT_EXP and modifyRelativeImports to
rewrite both from-clause and side-effect relative imports, while preserving
existing non-JavaScript extensions such as .json instead of appending
ESM_EXTENSION. Retain directory handling with /index and support
import-attribute syntax, then add coverage for side-effect, JSON, directory, and
import-attribute cases before publishing chunks.

In `@config/plugins/rolldown/resolveCoreImportsPlugin.ts`:
- Around line 3-31: Update resolveCoreImportsPlugin and replaceCoreImports so
the rewritten `#core` import path is calculated relative to each emitted chunk’s
fileName rather than hardcoding ../core. Pass the chunk fileName into the
replacement logic and preserve the existing submodule and semicolon handling
while resolving the correct relative path for nested output chunks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d0ec95d8-e1f9-4809-993c-7be555318409

📥 Commits

Reviewing files that changed from the base of the PR and between 5283bf7 and dabe4b3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .oxlintrc.json
  • browser/package.json
  • cli/package.json
  • commitlint.config.js
  • config/package.json
  • config/plugins/rolldown/copyWorkerPlugin.ts
  • config/plugins/rolldown/forceFileExtensionsPlugin.ts
  • config/plugins/rolldown/resolveCoreImportsPlugin.ts
  • config/replaceCoreImports.js
  • config/scripts/patch-ts.js
  • config/scripts/postinstall.js
  • graphql/package.json
  • native/package.json
  • node/package.json
  • package.json
  • src/package.json
  • test/modules/node/esm-node.test.ts
  • test/support/alias.ts
  • test/support/msw-esm/package.json
  • tsdown.config.mts
💤 Files with no reviewable changes (10)
  • config/replaceCoreImports.js
  • node/package.json
  • cli/package.json
  • src/package.json
  • config/scripts/patch-ts.js
  • browser/package.json
  • graphql/package.json
  • config/package.json
  • native/package.json
  • test/support/msw-esm/package.json

Comment thread config/plugins/rolldown/forceFileExtensionsPlugin.ts
Comment thread config/plugins/rolldown/resolveCoreImportsPlugin.ts
@kettanaito
kettanaito merged commit be2ae7c into feat/3.0 Jul 18, 2026
21 checks passed
@kettanaito
kettanaito deleted the feat/esm-only branch July 18, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant