Skip to content

fix: should not bundle react#102

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-should-not-bundle-react
Jun 7, 2026
Merged

fix: should not bundle react#102
chenjiahan merged 1 commit into
mainfrom
chenjiahan/fix-should-not-bundle-react

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR fixes the doc-ui library build so React-related subpath imports remain external. The previous exact externals matched react and react-dom, but allowed react-dom/client from the Ant Design wave/render path to be bundled into dist/antd, which could conflict with the consuming site's React version.

Validation

  • pnpm build
  • Verified dist/antd/index.js imports react-dom/client externally and no longer contains inlined react-dom@... version-specific code.

Related Links

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 58f5c8f7-b2dc-4cbe-984a-b532a4b24e12

📥 Commits

Reviewing files that changed from the base of the PR and between 6f9a632 and b00ee3d.

📒 Files selected for processing (1)
  • rslib.config.ts

📝 Walkthrough

Walkthrough

This PR updates the Rspack/Rsbuild build configuration in rslib.config.ts. The output.externals setting has been changed from a fixed array specifying exact module IDs (such as react/jsx-runtime and @rspress/core/runtime) to regex-based matchers for react, react-dom, and @rspress/core that match imports with or without trailing paths. This affects which dependencies are treated as externals during the bundling process.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: should not bundle react' directly summarizes the main objective: preventing React from being bundled, which matches the changeset's modification to externals configuration.
Description check ✅ Passed The description clearly explains the problem (React-dom/client was being bundled), the solution (using regex matchers for externals), validation steps, and related context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenjiahan/fix-should-not-bundle-react

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

@chenjiahan chenjiahan merged commit cbb8eb3 into main Jun 7, 2026
6 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/fix-should-not-bundle-react branch June 7, 2026 10:16
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