Skip to content

feat: add optional peer dependency for @rspack/core#96

Merged
chenjiahan merged 1 commit intomainfrom
set_peer_0407
Apr 7, 2026
Merged

feat: add optional peer dependency for @rspack/core#96
chenjiahan merged 1 commit intomainfrom
set_peer_0407

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Updates the documentation and package configuration to clarify version compatibility and peer dependency requirements for the React refresh plugin for Rspack.

Copilot AI review requested due to automatic review settings April 7, 2026 14:08
@chenjiahan chenjiahan merged commit c22c6f3 into main Apr 7, 2026
7 checks passed
@chenjiahan chenjiahan deleted the set_peer_0407 branch April 7, 2026 14:10
Copy link
Copy Markdown
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

Updates the plugin’s published metadata and documentation to clarify Rspack version compatibility and peer dependency expectations for @rspack/plugin-react-refresh.

Changes:

  • Adds a “Versions” section to the README describing which major versions map to Rspack v1 vs v2.
  • Adds @rspack/core as an (optional) peer dependency alongside react-refresh.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
README.md Documents a major-version compatibility matrix and links to v1 usage guidance.
package.json Declares @rspack/core as an optional peer dependency.

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

Comment on lines +13 to +14
- `2.x`: For Rspack v2.
- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/rstackjs/rspack-dev-server/tree/v1.x#rspackdev-server) for usage guide.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The new “Versions” section implies that users should install 2.x for Rspack v2, but this package is currently version 1.6.2 (see package.json). Either update the mapping to reflect the actual published major versions, or bump the package to 2.x as part of this change so the documentation stays accurate.

Suggested change
- `2.x`: For Rspack v2.
- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/rstackjs/rspack-dev-server/tree/v1.x#rspackdev-server) for usage guide.
- `1.x`: For Rspack v2.
- For Rspack v1, use the matching older release and refer to that release's README for the appropriate usage guide.

Copilot uses AI. Check for mistakes.
## Versions

- `2.x`: For Rspack v2.
- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/rstackjs/rspack-dev-server/tree/v1.x#rspackdev-server) for usage guide.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The 1.x usage-guide link points to the rstackjs/rspack-dev-server repository and the #rspackdev-server anchor, which appears unrelated to this plugin. Please update it to the correct location for the @rspack/plugin-react-refresh v1.x documentation (likely this repo’s v1.x branch README, with the right anchor).

Suggested change
- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/rstackjs/rspack-dev-server/tree/v1.x#rspackdev-server) for usage guide.
- `1.x`: For Rspack v1, see [v1.x - README](https://github.com/web-infra-dev/rspack/tree/v1.x/packages/rspack-plugin-react-refresh#readme) for usage guide.

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +54
"peerDependenciesMeta": {
"@rspack/core": {
"optional": true
}
},
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

@rspack/core is referenced in exported type declarations (e.g., import type { Compiler } from '@rspack/core'), so TypeScript consumers without @rspack/core installed will get “Cannot find module '@rspack/core'” errors. Marking it as an optional peer can hide the missing-peer warning from package managers; consider making it a required peer, or explicitly documenting when/why consumers can omit it (e.g., JS-only usage).

Suggested change
"peerDependenciesMeta": {
"@rspack/core": {
"optional": true
}
},

Copilot uses AI. Check for mistakes.
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.

2 participants