@rspack/dev-server 0.1.1 → 0.1.3

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/server.d.ts.map +1 -1
  3. package/dist/server.js +26 -40
  4. package/dist/server.js.map +1 -1
  5. package/package.json +6 -6
  6. package/src/server.ts +35 -52
  7. package/tests/__snapshots__/normalizeOptions.test.ts.snap +6 -8
  8. package/tests/normalizeOptions.test.ts +6 -1
  9. package/tsconfig.tsbuildinfo +1 -1
  10. package/tests/e2e/hot-reaload.test.ts +0 -115
  11. package/tests/e2e-fixtures/react/app.jsx +0 -14
  12. package/tests/e2e-fixtures/react/index.css +0 -3
  13. package/tests/e2e-fixtures/react/index.html +0 -12
  14. package/tests/e2e-fixtures/react/index.jsx +0 -6
  15. package/tests/e2e-fixtures/react/node_modules/react/LICENSE +0 -21
  16. package/tests/e2e-fixtures/react/node_modules/react/README.md +0 -37
  17. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +0 -1296
  18. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +0 -10
  19. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +0 -10
  20. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1314
  21. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -11
  22. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +0 -11
  23. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +0 -2739
  24. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +0 -26
  25. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +0 -20
  26. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +0 -10
  27. package/tests/e2e-fixtures/react/node_modules/react/index.js +0 -7
  28. package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +0 -7
  29. package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +0 -7
  30. package/tests/e2e-fixtures/react/node_modules/react/package.json +0 -47
  31. package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +0 -7
  32. package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +0 -3342
  33. package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +0 -31
  34. package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +0 -31
  35. package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +0 -21
  36. package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +0 -60
  37. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -7018
  38. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -93
  39. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +0 -7078
  40. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0 -101
  41. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -7003
  42. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -96
  43. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +0 -7059
  44. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +0 -102
  45. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +0 -1741
  46. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +0 -40
  47. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +0 -29868
  48. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +0 -323
  49. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +0 -367
  50. package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +0 -25
  51. package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +0 -38
  52. package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +0 -62
  53. package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +0 -38
  54. package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +0 -17
  55. package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +0 -3
  56. package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +0 -17
  57. package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +0 -7
  58. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +0 -7015
  59. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0 -75
  60. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +0 -7000
  61. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +0 -76
  62. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +0 -1737
  63. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +0 -33
  64. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +0 -29869
  65. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +0 -267
  66. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +0 -285
  67. package/tests/e2e-fixtures/react/node_modules/scheduler/LICENSE +0 -21
  68. package/tests/e2e-fixtures/react/node_modules/scheduler/README.md +0 -9
  69. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +0 -700
  70. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +0 -20
  71. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +0 -207
  72. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +0 -14
  73. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.development.js +0 -634
  74. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.production.min.js +0 -19
  75. package/tests/e2e-fixtures/react/node_modules/scheduler/index.js +0 -7
  76. package/tests/e2e-fixtures/react/node_modules/scheduler/package.json +0 -36
  77. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +0 -699
  78. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +0 -19
  79. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.development.js +0 -152
  80. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.production.min.js +0 -146
  81. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.profiling.min.js +0 -146
  82. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_mock.js +0 -7
  83. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_post_task.js +0 -7
  84. package/tests/e2e-fixtures/react/package.json +0 -8
  85. package/tests/e2e-fixtures/react/webpack.config.js +0 -26
  86. package/tests/helpers/emitFile.ts +0 -69
  87. package/tests/helpers/runBrowser.ts +0 -85
  88. package/tests/helpers/tempDir.ts +0 -58
@@ -1,207 +0,0 @@
1
- /**
2
- * @license React
3
- * scheduler-unstable_post_task.development.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
-
17
- // TODO: Use symbols?
18
- var ImmediatePriority = 1;
19
- var UserBlockingPriority = 2;
20
- var NormalPriority = 3;
21
- var LowPriority = 4;
22
- var IdlePriority = 5;
23
-
24
- var perf = window.performance;
25
- var setTimeout = window.setTimeout; // Use experimental Chrome Scheduler postTask API.
26
-
27
- var scheduler = global.scheduler;
28
- var getCurrentTime = perf.now.bind(perf);
29
- var unstable_now = getCurrentTime; // Scheduler periodically yields in case there is other work on the main
30
- // thread, like user events. By default, it yields multiple times per frame.
31
- // It does not attempt to align with frame boundaries, since most tasks don't
32
- // need to be frame aligned; for those that do, use requestAnimationFrame.
33
-
34
- var yieldInterval = 5;
35
- var deadline = 0;
36
- var currentPriorityLevel_DEPRECATED = NormalPriority; // `isInputPending` is not available. Since we have no way of knowing if
37
- // there's pending input, always yield at the end of the frame.
38
-
39
- function unstable_shouldYield() {
40
- return getCurrentTime() >= deadline;
41
- }
42
- function unstable_requestPaint() {// Since we yield every frame regardless, `requestPaint` has no effect.
43
- }
44
- function unstable_scheduleCallback(priorityLevel, callback, options) {
45
- var postTaskPriority;
46
-
47
- switch (priorityLevel) {
48
- case ImmediatePriority:
49
- case UserBlockingPriority:
50
- postTaskPriority = 'user-blocking';
51
- break;
52
-
53
- case LowPriority:
54
- case NormalPriority:
55
- postTaskPriority = 'user-visible';
56
- break;
57
-
58
- case IdlePriority:
59
- postTaskPriority = 'background';
60
- break;
61
-
62
- default:
63
- postTaskPriority = 'user-visible';
64
- break;
65
- }
66
-
67
- var controller = new TaskController();
68
- var postTaskOptions = {
69
- priority: postTaskPriority,
70
- delay: typeof options === 'object' && options !== null ? options.delay : 0,
71
- signal: controller.signal
72
- };
73
- var node = {
74
- _controller: controller
75
- };
76
- scheduler.postTask(runTask.bind(null, priorityLevel, postTaskPriority, node, callback), postTaskOptions).catch(handleAbortError);
77
- return node;
78
- }
79
-
80
- function runTask(priorityLevel, postTaskPriority, node, callback) {
81
- deadline = getCurrentTime() + yieldInterval;
82
-
83
- try {
84
- currentPriorityLevel_DEPRECATED = priorityLevel;
85
- var _didTimeout_DEPRECATED = false;
86
- var result = callback(_didTimeout_DEPRECATED);
87
-
88
- if (typeof result === 'function') {
89
- // Assume this is a continuation
90
- var continuation = result;
91
- var continuationController = new TaskController();
92
- var continuationOptions = {
93
- priority: postTaskPriority,
94
- signal: continuationController.signal
95
- }; // Update the original callback node's controller, since even though we're
96
- // posting a new task, conceptually it's the same one.
97
-
98
- node._controller = continuationController;
99
- scheduler.postTask(runTask.bind(null, priorityLevel, postTaskPriority, node, continuation), continuationOptions).catch(handleAbortError);
100
- }
101
- } catch (error) {
102
- // We're inside a `postTask` promise. If we don't handle this error, then it
103
- // will trigger an "Unhandled promise rejection" error. We don't want that,
104
- // but we do want the default error reporting behavior that normal
105
- // (non-Promise) tasks get for unhandled errors.
106
- //
107
- // So we'll re-throw the error inside a regular browser task.
108
- setTimeout(function () {
109
- throw error;
110
- });
111
- } finally {
112
- currentPriorityLevel_DEPRECATED = NormalPriority;
113
- }
114
- }
115
-
116
- function handleAbortError(error) {// Abort errors are an implementation detail. We don't expose the
117
- // TaskController to the user, nor do we expose the promise that is returned
118
- // from `postTask`. So we should suppress them, since there's no way for the
119
- // user to handle them.
120
- }
121
-
122
- function unstable_cancelCallback(node) {
123
- var controller = node._controller;
124
- controller.abort();
125
- }
126
- function unstable_runWithPriority(priorityLevel, callback) {
127
- var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
128
- currentPriorityLevel_DEPRECATED = priorityLevel;
129
-
130
- try {
131
- return callback();
132
- } finally {
133
- currentPriorityLevel_DEPRECATED = previousPriorityLevel;
134
- }
135
- }
136
- function unstable_getCurrentPriorityLevel() {
137
- return currentPriorityLevel_DEPRECATED;
138
- }
139
- function unstable_next(callback) {
140
- var priorityLevel;
141
-
142
- switch (currentPriorityLevel_DEPRECATED) {
143
- case ImmediatePriority:
144
- case UserBlockingPriority:
145
- case NormalPriority:
146
- // Shift down to normal priority
147
- priorityLevel = NormalPriority;
148
- break;
149
-
150
- default:
151
- // Anything lower than normal priority should remain at the current level.
152
- priorityLevel = currentPriorityLevel_DEPRECATED;
153
- break;
154
- }
155
-
156
- var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
157
- currentPriorityLevel_DEPRECATED = priorityLevel;
158
-
159
- try {
160
- return callback();
161
- } finally {
162
- currentPriorityLevel_DEPRECATED = previousPriorityLevel;
163
- }
164
- }
165
- function unstable_wrapCallback(callback) {
166
- var parentPriorityLevel = currentPriorityLevel_DEPRECATED;
167
- return function () {
168
- var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
169
- currentPriorityLevel_DEPRECATED = parentPriorityLevel;
170
-
171
- try {
172
- return callback();
173
- } finally {
174
- currentPriorityLevel_DEPRECATED = previousPriorityLevel;
175
- }
176
- };
177
- }
178
- function unstable_forceFrameRate() {}
179
- function unstable_pauseExecution() {}
180
- function unstable_continueExecution() {}
181
- function unstable_getFirstCallbackNode() {
182
- return null;
183
- } // Currently no profiling build
184
-
185
- var unstable_Profiling = null;
186
-
187
- exports.unstable_IdlePriority = IdlePriority;
188
- exports.unstable_ImmediatePriority = ImmediatePriority;
189
- exports.unstable_LowPriority = LowPriority;
190
- exports.unstable_NormalPriority = NormalPriority;
191
- exports.unstable_Profiling = unstable_Profiling;
192
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
193
- exports.unstable_cancelCallback = unstable_cancelCallback;
194
- exports.unstable_continueExecution = unstable_continueExecution;
195
- exports.unstable_forceFrameRate = unstable_forceFrameRate;
196
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
197
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
198
- exports.unstable_next = unstable_next;
199
- exports.unstable_now = unstable_now;
200
- exports.unstable_pauseExecution = unstable_pauseExecution;
201
- exports.unstable_requestPaint = unstable_requestPaint;
202
- exports.unstable_runWithPriority = unstable_runWithPriority;
203
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
204
- exports.unstable_shouldYield = unstable_shouldYield;
205
- exports.unstable_wrapCallback = unstable_wrapCallback;
206
- })();
207
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * @license React
3
- * scheduler-unstable_post_task.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- 'use strict';var a=window.performance,g=window.setTimeout,h=global.scheduler,k=a.now.bind(a),l=0,m=3;function p(c,d,b,f){l=k()+5;try{m=c;var e=f(!1);if("function"===typeof e){var n=new TaskController,r={priority:d,signal:n.signal};b._controller=n;h.postTask(p.bind(null,c,d,b,e),r).catch(q)}}catch(t){g(function(){throw t;})}finally{m=3}}function q(){}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;
11
- exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(c){c._controller.abort()};exports.unstable_continueExecution=function(){};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return m};exports.unstable_getFirstCallbackNode=function(){return null};exports.unstable_next=function(c){switch(m){case 1:case 2:case 3:var d=3;break;default:d=m}var b=m;m=d;try{return c()}finally{m=b}};
12
- exports.unstable_now=k;exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(c,d){var b=m;m=c;try{return d()}finally{m=b}};
13
- exports.unstable_scheduleCallback=function(c,d,b){switch(c){case 1:case 2:var f="user-blocking";break;case 4:case 3:f="user-visible";break;case 5:f="background";break;default:f="user-visible"}var e=new TaskController;b={priority:f,delay:"object"===typeof b&&null!==b?b.delay:0,signal:e.signal};e={_controller:e};h.postTask(p.bind(null,c,f,e,d),b).catch(q);return e};exports.unstable_shouldYield=function(){return k()>=l};
14
- exports.unstable_wrapCallback=function(c){var d=m;return function(){var b=m;m=d;try{return c()}finally{m=b}}};