feat!: remove default plugin export#70
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
ReactRefreshRspackPluginname. - 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.
06c876a to
06b7768
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR changes the public plugin API to expose
PreactRefreshRspackPluginas 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.import { PreactRefreshRspackPlugin } from '@rspack/plugin-preact-refresh'.