Skip to content

Commit

Permalink
chore: replace @rspack/dev-client with @rspack/plugin-react-refresh (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy authored Dec 5, 2023
1 parent 91059e4 commit 898f325
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 53 deletions.
8 changes: 8 additions & 0 deletions .changeset/small-moles-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@modern-js/builder-rspack-provider': patch
'@modern-js/storybook-builder': patch
---

chore: replace @rspack/dev-client with @rspack/plugin-react-refresh

chore: 将 @rspack/dev-client 替换为 @rspack/plugin-react-refresh
2 changes: 1 addition & 1 deletion packages/builder/builder-rspack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@modern-js/utils": "workspace:*",
"@babel/preset-typescript": "^7.22.15",
"@rspack/core": "0.4.1",
"@rspack/dev-client": "0.4.1",
"@rspack/plugin-react-refresh": "0.4.1",
"@rspack/plugin-html": "0.4.1",
"@swc/helpers": "0.5.3",
"rspack-manifest-plugin": "5.0.0-alpha0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getHotRuntimeEntries(compiler: Compiler) {

if (hot && refresh) {
const reactRefreshEntryPath = require.resolve(
'@rspack/dev-client/react-refresh-entry',
'@rspack/plugin-react-refresh/react-refresh-entry',
);
return [reactRefreshEntryPath];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const builderPluginReact = (): BuilderPlugin => ({
chain.plugin('ReactRefreshRuntime').use(bundler.ProvidePlugin, [
{
$ReactRefreshRuntime$: [
require.resolve('@rspack/dev-client/react-refresh'),
require.resolve('@rspack/plugin-react-refresh/react-refresh'),
],
},
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
ProvidePlugin {
"_options": {
"$ReactRefreshRuntime$": [
"<WORKSPACE>/node_modules/<PNPM_INNER>/@rspack/dev-client/src/reactRefresh.js",
"<WORKSPACE>/node_modules/<PNPM_INNER>/@rspack/plugin-react-refresh/client/reactRefresh.js",
],
},
"name": "ProvidePlugin",
Expand Down Expand Up @@ -2682,7 +2682,7 @@ exports[`tools.rspack > should match snapshot 1`] = `
ProvidePlugin {
"_options": {
"$ReactRefreshRuntime$": [
"<WORKSPACE>/node_modules/<PNPM_INNER>/@rspack/dev-client/src/reactRefresh.js",
"<WORKSPACE>/node_modules/<PNPM_INNER>/@rspack/plugin-react-refresh/client/reactRefresh.js",
],
},
"name": "ProvidePlugin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For example, if you are using pnpm, you can update the Rspack version with `over
"pnpm": {
"overrides": {
"@rspack/core": "nightly",
"@rspack/dev-client": "nightly",
"@rspack/plugin-react-refresh": "nightly",
"@rspack/plugin-html": "nightly"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import RspackPrecautions from '@modern-js/builder-doc/docs/zh/shared/rspackPreca
"pnpm": {
"overrides": {
"@rspack/core": "nightly",
"@rspack/dev-client": "nightly",
"@rspack/plugin-react-refresh": "nightly",
"@rspack/plugin-html": "nightly"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@modern-js/core": "workspace:*",
"@modern-js/runtime": "workspace:*",
"@modern-js/utils": "workspace:*",
"@rspack/dev-client": "0.4.1",
"@rspack/plugin-react-refresh": "0.4.1",
"@storybook/components": "~7.6.1",
"@storybook/core-common": "~7.6.1",
"@storybook/csf-plugin": "~7.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/builder/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const entries = async (_: unknown, options: Options) => {
)}?reload=true&quiet=false&noInfo=${options.quiet}`,

bundler === 'rspack'
? require.resolve('@rspack/dev-client/react-refresh-entry')
? require.resolve('@rspack/plugin-react-refresh/react-refresh-entry')
: null,
].filter(Boolean) as string[]),
);
Expand Down
48 changes: 4 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 898f325

Please sign in to comment.