Skip to content

feat!: remove default plugin export#70

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/remove-default-export
Jun 1, 2026
Merged

feat!: remove default plugin export#70
chenjiahan merged 1 commit into
mainfrom
chenjiahan/remove-default-export

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

This PR changes the public plugin API to expose PreactRefreshRspackPlugin as the named runtime export and removes the package entry's plugin default export. The README and test configurations now consume the named export so the documented usage matches the actual public API.

Breaking Changes

  • import PreactRefreshPlugin from '@rspack/plugin-preact-refresh' no longer works.
  • Consumers must migrate to import { PreactRefreshRspackPlugin } from '@rspack/plugin-preact-refresh'.

@chenjiahan chenjiahan marked this pull request as ready for review June 1, 2026 06:49
Copilot AI review requested due to automatic review settings June 1, 2026 06:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates @rspack/plugin-preact-refresh’s public API to drop the default export and standardize usage on a named export (ReactRefreshRspackPlugin), updating documentation and test configs accordingly.

Changes:

  • Remove the plugin’s default export and export the plugin under the ReactRefreshRspackPlugin name.
  • Update README examples to use import { ReactRefreshRspackPlugin } ....
  • Update test Rspack configs to require the named export from dist/index.js.

Reviewed changes

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

Show a summary per file
File Description
test/hotCases/with-worker/basic/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/jsx/with-same-name-component/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/jsx/value/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/jsx/child/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/jsx/basic/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/hook/useState_reset/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/hook/useState_keep/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/hook/useContext_provide/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/hook/useContext_keep/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/hotCases/hook/useContext_initial/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/configCases/condition/include/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
test/configCases/condition/exclude/rspack.config.js Switch test config to use the named export ReactRefreshRspackPlugin from dist/index.js.
src/index.ts Remove default export and export plugin under ReactRefreshRspackPlugin.
README.md Update documented usage to import/instantiate ReactRefreshRspackPlugin as a named export.

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

Comment thread src/index.ts Outdated
@chenjiahan chenjiahan force-pushed the chenjiahan/remove-default-export branch from 06c876a to 06b7768 Compare June 1, 2026 07:58
@chenjiahan chenjiahan marked this pull request as draft June 1, 2026 07:58
@chenjiahan chenjiahan marked this pull request as ready for review June 1, 2026 08:00
@chenjiahan chenjiahan merged commit c481f8d into main Jun 1, 2026
4 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/remove-default-export branch June 1, 2026 08:04
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