@rspack/dev-server 0.0.0-20230220035042 → 0.0.0-20230221112432
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.
- package/CHANGELOG.md +26 -26
- package/package.json +10 -9
- package/src/server.ts +4 -28
- package/tests/__snapshots__/normalizeOptions.test.ts.snap +1 -19
- package/tests/e2e-fixtures/react/node_modules/react/LICENSE +21 -0
- package/tests/e2e-fixtures/react/node_modules/react/README.md +37 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +1296 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +10 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +10 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +1314 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +11 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +11 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +2739 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +26 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +20 -0
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +10 -0
- package/tests/e2e-fixtures/react/node_modules/react/index.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/react/package.json +47 -0
- package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +3342 -0
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +31 -0
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +31 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +21 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +60 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +7018 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +93 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +7078 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +101 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +7003 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +96 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +7059 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +102 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +1741 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +40 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +367 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +25 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +38 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +62 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +38 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +17 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +3 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +17 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +7015 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +75 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +7000 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +76 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +1737 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +33 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +29869 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +267 -0
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +285 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
# rspack-dev-server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- Updated dependencies [
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- Updated dependencies [
|
|
17
|
-
- Updated dependencies [
|
|
18
|
-
- Updated dependencies [
|
|
19
|
-
- Updated dependencies [
|
|
20
|
-
- Updated dependencies [
|
|
21
|
-
- Updated dependencies [
|
|
22
|
-
- Updated dependencies [
|
|
23
|
-
- Updated dependencies [
|
|
24
|
-
- Updated dependencies [
|
|
25
|
-
- @rspack/core@0.0.0-
|
|
26
|
-
- @rspack/dev-client@0.0.0-
|
|
27
|
-
- @rspack/dev-middleware@0.0.0-
|
|
28
|
-
- @rspack/dev-server@0.0.0-
|
|
3
|
+
## 0.0.0-20230221112432
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b6741896: chore: 🤖 use module path instead of module id in diagnositc
|
|
8
|
+
- 962f8a25: fix: should create different module with different module rule
|
|
9
|
+
- 1c7ab6df: feat: rspack-cli and devServer support multiCompiler
|
|
10
|
+
- 766c9404: fix rust test
|
|
11
|
+
- 035c1595: basic implementation of compilation.hooks.optimizeChunkModules
|
|
12
|
+
- c1f19b81: align webpack config optimization.sideEffects
|
|
13
|
+
- Updated dependencies [b6741896]
|
|
14
|
+
- Updated dependencies [f3e0d828]
|
|
15
|
+
- Updated dependencies [962f8a25]
|
|
16
|
+
- Updated dependencies [327b600d]
|
|
17
|
+
- Updated dependencies [1c7ab6df]
|
|
18
|
+
- Updated dependencies [766c9404]
|
|
19
|
+
- Updated dependencies [e5d628ce]
|
|
20
|
+
- Updated dependencies [2d395d6b]
|
|
21
|
+
- Updated dependencies [035c1595]
|
|
22
|
+
- Updated dependencies [b694d4a5]
|
|
23
|
+
- Updated dependencies [60fb4c5b]
|
|
24
|
+
- Updated dependencies [c1f19b81]
|
|
25
|
+
- @rspack/core@0.0.0-20230221112432
|
|
26
|
+
- @rspack/dev-client@0.0.0-20230221112432
|
|
27
|
+
- @rspack/dev-middleware@0.0.0-20230221112432
|
|
28
|
+
- @rspack/dev-server@0.0.0-20230221112432
|
|
29
29
|
|
|
30
30
|
## 0.0.22
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/dev-server",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-20230221112432",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"devDependencies": {
|
|
10
|
+
"@rspack/core": "0.0.0-20230221112432",
|
|
10
11
|
"typescript": "^4.7.4",
|
|
11
12
|
"@types/ws": "8.5.3",
|
|
12
13
|
"@types/node": "16.11.7",
|
|
13
14
|
"@types/express": "4.17.14",
|
|
14
15
|
"@types/connect-history-api-fallback": "1.3.5",
|
|
15
16
|
"fs-extra": "11.1.0",
|
|
16
|
-
"puppeteer": "19.4.0"
|
|
17
|
-
"@rspack/core": "0.0.0-20230220035042"
|
|
17
|
+
"puppeteer": "19.4.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"express": "4.18.1",
|
|
21
21
|
"chokidar": "3.5.3",
|
|
22
22
|
"ws": "8.8.1",
|
|
23
|
+
"@rspack/dev-client": "0.0.0-20230221112432",
|
|
24
|
+
"@rspack/dev-middleware": "0.0.0-20230221112432",
|
|
25
|
+
"@rspack/dev-server": "0.0.0-20230221112432",
|
|
23
26
|
"webpack-dev-server": "4.11.1",
|
|
24
27
|
"connect-history-api-fallback": "2.0.0",
|
|
25
|
-
"http-proxy-middleware": "2.0.6"
|
|
26
|
-
"@rspack/dev-client": "0.0.0-20230220035042",
|
|
27
|
-
"@rspack/dev-middleware": "0.0.0-20230220035042",
|
|
28
|
-
"@rspack/dev-server": "0.0.0-20230220035042"
|
|
28
|
+
"http-proxy-middleware": "2.0.6"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@rspack/core": "0.0.0-
|
|
31
|
+
"@rspack/core": "0.0.0-20230221112432"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rm -rf dist/ && tsc",
|
|
35
35
|
"dev": "tsc -w",
|
|
36
36
|
"test": "rm -rf .test-temp && jest --verbose"
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"readme": "# rspack-dev-server\n"
|
|
38
39
|
}
|
package/src/server.ts
CHANGED
|
@@ -26,7 +26,10 @@ export class RspackDevServer extends WebpackDevServer {
|
|
|
26
26
|
|
|
27
27
|
addAdditionEntires(compiler: Compiler) {
|
|
28
28
|
const additionalEntries: string[] = [];
|
|
29
|
-
|
|
29
|
+
// TODO: align with webpack-dev-server after options.target is aligned
|
|
30
|
+
const isWebTarget =
|
|
31
|
+
compiler.options.target.includes("web") ||
|
|
32
|
+
compiler.options.target.includes("webworker");
|
|
30
33
|
if (this.options.client && isWebTarget) {
|
|
31
34
|
let webSocketURLStr = "";
|
|
32
35
|
|
|
@@ -445,30 +448,3 @@ export class RspackDevServer extends WebpackDevServer {
|
|
|
445
448
|
});
|
|
446
449
|
}
|
|
447
450
|
}
|
|
448
|
-
|
|
449
|
-
// TODO: use WebpackDevServer.isWebTarget instead of this once we have a new webpack-dev-server version
|
|
450
|
-
function isWebTarget2(compiler: Compiler): boolean {
|
|
451
|
-
if (
|
|
452
|
-
compiler.options.resolve.conditionNames &&
|
|
453
|
-
compiler.options.resolve.conditionNames.includes("browser")
|
|
454
|
-
) {
|
|
455
|
-
return true;
|
|
456
|
-
}
|
|
457
|
-
const target = compiler.options.target;
|
|
458
|
-
const webTargets = [
|
|
459
|
-
"web",
|
|
460
|
-
"webworker",
|
|
461
|
-
"electron-preload",
|
|
462
|
-
"electron-renderer",
|
|
463
|
-
"node-webkit",
|
|
464
|
-
undefined,
|
|
465
|
-
null
|
|
466
|
-
];
|
|
467
|
-
if (Array.isArray(target)) {
|
|
468
|
-
return target.some(r => webTargets.includes(r));
|
|
469
|
-
}
|
|
470
|
-
if (typeof target === "string") {
|
|
471
|
-
return webTargets.includes(target);
|
|
472
|
-
}
|
|
473
|
-
return false;
|
|
474
|
-
}
|
|
@@ -129,40 +129,22 @@ exports[`normalize options snapshot port string 1`] = `
|
|
|
129
129
|
exports[`normalize options snapshot react.development and react.refresh should be true in default when hot enabled 1`] = `
|
|
130
130
|
{
|
|
131
131
|
"builtins": {
|
|
132
|
-
"browserslist":
|
|
133
|
-
"css": {
|
|
134
|
-
"modules": {
|
|
135
|
-
"exportsOnly": false,
|
|
136
|
-
"localIdentName": "[hash]",
|
|
137
|
-
"localsConvention": "asIs",
|
|
138
|
-
},
|
|
139
|
-
"presetEnv": [],
|
|
140
|
-
},
|
|
132
|
+
"browserslist": undefined,
|
|
141
133
|
"decorator": {
|
|
142
134
|
"emitMetadata": true,
|
|
143
135
|
"legacy": true,
|
|
144
136
|
},
|
|
145
137
|
"define": {},
|
|
146
|
-
"devFriendlySplitChunks": false,
|
|
147
138
|
"emotion": undefined,
|
|
148
139
|
"html": [],
|
|
149
140
|
"minify": {
|
|
150
|
-
"dropConsole": false,
|
|
151
141
|
"enable": true,
|
|
152
142
|
"passes": 1,
|
|
153
|
-
"pureFuncs": [],
|
|
154
|
-
},
|
|
155
|
-
"noEmitAssets": false,
|
|
156
|
-
"polyfill": true,
|
|
157
|
-
"postcss": {
|
|
158
|
-
"pxtorem": undefined,
|
|
159
143
|
},
|
|
160
|
-
"progress": undefined,
|
|
161
144
|
"react": {
|
|
162
145
|
"development": true,
|
|
163
146
|
"refresh": true,
|
|
164
147
|
},
|
|
165
|
-
"treeShaking": true,
|
|
166
148
|
},
|
|
167
149
|
"devServer": {
|
|
168
150
|
"allowedHosts": "auto",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `react`
|
|
2
|
+
|
|
3
|
+
React is a JavaScript library for creating user interfaces.
|
|
4
|
+
|
|
5
|
+
The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments.
|
|
6
|
+
|
|
7
|
+
**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { useState } from 'react';
|
|
13
|
+
import { createRoot } from 'react-dom/client';
|
|
14
|
+
|
|
15
|
+
function Counter() {
|
|
16
|
+
const [count, setCount] = useState(0);
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<h1>{count}</h1>
|
|
20
|
+
<button onClick={() => setCount(count + 1)}>
|
|
21
|
+
Increment
|
|
22
|
+
</button>
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const root = createRoot(document.getElementById('root'));
|
|
28
|
+
root.render(<App />);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
See https://reactjs.org/
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
See https://reactjs.org/docs/react-api.html
|