@rspack/plugin-react-refresh 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ function getSocketUrlParts(resourceQuery, metadata) {
24
24
  urlParts.port = parsedQuery.sockPort;
25
25
  // Make sure the protocol from resource query has a trailing colon
26
26
  if (parsedQuery.sockProtocol) {
27
- urlParts.protocol = parsedQuery.sockProtocol + ":";
27
+ urlParts.protocol = `${parsedQuery.sockProtocol}:`;
28
28
  }
29
29
  }
30
30
  else {
@@ -47,7 +47,7 @@ function getSocketUrlParts(resourceQuery, metadata) {
47
47
  // Result: <username> or <username>:<password>
48
48
  urlParts.auth = url.username;
49
49
  if (url.password) {
50
- urlParts.auth += ":" + url.password;
50
+ urlParts.auth += `:${url.password}`;
51
51
  }
52
52
  }
53
53
  // `file://` URLs has `'null'` origin
@@ -17,14 +17,14 @@ function urlFromParts(urlParts, metadata) {
17
17
  if (metadata.enforceWs) {
18
18
  fullProtocol = fullProtocol.replace(/^(?:http|.+-extension|file)/i, "ws");
19
19
  }
20
- fullProtocol = fullProtocol + "//";
20
+ fullProtocol = `${fullProtocol}//`;
21
21
  let fullHost = urlParts.hostname;
22
22
  if (urlParts.auth) {
23
- const fullAuth = urlParts.auth.split(":").map(encodeURIComponent).join(":") + "@";
23
+ const fullAuth = `${urlParts.auth.split(":").map(encodeURIComponent).join(":")}@`;
24
24
  fullHost = fullAuth + fullHost;
25
25
  }
26
26
  if (urlParts.port) {
27
- fullHost = fullHost + ":" + urlParts.port;
27
+ fullHost = `${fullHost}:${urlParts.port}`;
28
28
  }
29
29
  const url = new URL(urlParts.pathname, fullProtocol + fullHost);
30
30
  return url.href;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getAdditionalEntries = void 0;
7
7
  const node_querystring_1 = __importDefault(require("node:querystring"));
8
8
  function getAdditionalEntries({ devServer, options }) {
9
- /** @type {Record<string, string | number>} */
10
9
  const resourceQuery = {};
11
10
  if (devServer) {
12
11
  const { client, https, http2, sockHost, sockPath, sockPort } = devServer;
@@ -26,7 +25,7 @@ function getAdditionalEntries({ devServer, options }) {
26
25
  if (parsedUrl.username) {
27
26
  auth = parsedUrl.username;
28
27
  if (parsedUrl.password) {
29
- auth += ":" + parsedUrl.password;
28
+ auth += `:${parsedUrl.password}`;
30
29
  }
31
30
  }
32
31
  if (parsedUrl.hostname != null) {
@@ -70,12 +69,8 @@ function getAdditionalEntries({ devServer, options }) {
70
69
  }
71
70
  // We don't need to URI encode the resourceQuery as it will be parsed by Webpack
72
71
  const queryString = node_querystring_1.default.stringify(resourceQuery, undefined, undefined, {
73
- /**
74
- * @param {string} string
75
- * @returns {string}
76
- */
77
- encodeURIComponent(string) {
78
- return string;
72
+ encodeURIComponent(str) {
73
+ return str;
79
74
  }
80
75
  });
81
76
  const prependEntries = [
@@ -84,8 +79,8 @@ function getAdditionalEntries({ devServer, options }) {
84
79
  ];
85
80
  const overlayEntries = [
86
81
  // Error overlay runtime
87
- options.overlay &&
88
- options.overlay.entry &&
82
+ options.overlay !== false &&
83
+ options.overlay?.entry &&
89
84
  `${require.resolve(options.overlay.entry)}${queryString ? `?${queryString}` : ""}`
90
85
  ].filter(Boolean);
91
86
  return { prependEntries, overlayEntries };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/plugin-react-refresh",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "license": "MIT",
5
5
  "description": "React refresh plugin for rspack",
6
6
  "main": "dist/index.js",
@@ -31,8 +31,8 @@
31
31
  "devDependencies": {
32
32
  "react-refresh": "^0.14.0",
33
33
  "typescript": "5.0.2",
34
- "@rspack/core": "1.0.0-beta.1",
35
- "@rspack/plugin-react-refresh": "1.0.0-beta.1"
34
+ "@rspack/core": "1.0.0-beta.2",
35
+ "@rspack/plugin-react-refresh": "1.0.0-beta.2"
36
36
  },
37
37
  "dependencies": {
38
38
  "error-stack-parser": "^2.0.6",