@rspack/dev-server 0.0.21 → 0.0.23
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 +42 -0
- package/LICENSE +2 -1
- package/dist/config.d.ts +20 -14
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -52
- package/dist/config.js.map +1 -1
- package/dist/server.d.ts +14 -41
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +330 -257
- package/dist/server.js.map +1 -1
- package/jest.config.js +3 -1
- package/package.json +14 -12
- package/src/config.ts +22 -67
- package/src/server.ts +374 -311
- package/tests/__snapshots__/normalizeOptions.test.ts.snap +164 -26
- package/tests/e2e/hot-reaload.test.ts +35 -39
- package/tests/e2e-fixtures/react/node_modules/scheduler/LICENSE +21 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/README.md +9 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +700 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +20 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +207 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +14 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.development.js +634 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.production.min.js +19 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/index.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/package.json +36 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +699 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +19 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.development.js +152 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.production.min.js +146 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.profiling.min.js +146 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_mock.js +7 -0
- package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_post_task.js +7 -0
- package/tests/e2e-fixtures/react/package.json +2 -0
- package/tests/e2e-fixtures/react/webpack.config.js +6 -2
- package/tests/helpers/emitFile.ts +58 -4
- package/tests/normalizeOptions.test.ts +50 -16
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/logger.d.ts +0 -7
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -28
- package/dist/logger.js.map +0 -1
- package/dist/ws.d.ts +0 -13
- package/dist/ws.d.ts.map +0 -1
- package/dist/ws.js +0 -12
- package/dist/ws.js.map +0 -1
- package/src/logger.ts +0 -30
- package/src/ws.ts +0 -18
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* scheduler-unstable_mock.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
|
+
(function(){'use strict';(function(a,p){"object"===typeof exports&&"undefined"!==typeof module?p(exports):"function"===typeof define&&define.amd?define(["exports"],p):(a=a||self,p(a.SchedulerMock={}))})(this,function(a){function p(b,k){var c=b.length;b.push(k);a:for(;0<c;){var a=c-1>>>1,v=b[a];if(0<z(v,k))b[a]=k,b[c]=v,c=a;else break a}}function m(b){return 0===b.length?null:b[0]}function A(b){if(0===b.length)return null;var k=b[0],c=b.pop();if(c!==k){b[0]=c;a:for(var a=0,v=b.length,f=v>>>1;a<f;){var d=2*(a+
|
|
11
|
+
1)-1,g=b[d],e=d+1,h=b[e];if(0>z(g,c))e<v&&0>z(h,g)?(b[a]=h,b[e]=c,a=e):(b[a]=g,b[d]=c,a=d);else if(e<v&&0>z(h,c))b[a]=h,b[e]=c,a=e;else break a}}return k}function z(b,a){var k=b.sortIndex-a.sortIndex;return 0!==k?k:b.id-a.id}function D(b){for(var a=m(r);null!==a;){if(null===a.callback)A(r);else if(a.startTime<=b)A(r),a.sortIndex=a.expirationTime,p(n,a);else break;a=m(r)}}function E(b){y=!1;D(b);if(!u)if(null!==m(n))u=!0,f=F;else{var a=m(r);null!==a&&(b=a.startTime-b,q=E,t=g+b)}}function F(b,a){u=
|
|
12
|
+
!1;y&&(y=!1,q=null,t=-1);B=!0;var c=d;try{D(a);for(h=m(n);null!==h&&(!(h.expirationTime>a)||b&&!I());){var k=h.callback;if("function"===typeof k){h.callback=null;d=h.priorityLevel;var e=k(h.expirationTime<=a);a=g;"function"===typeof e?h.callback=e:h===m(n)&&A(n);D(a)}else A(n);h=m(n)}if(null!==h)var f=!0;else{var l=m(r);if(null!==l){var p=l.startTime-a;q=E;t=g+p}f=!1}return f}finally{h=null,d=c,B=!1}}function I(){return 0===w&&null===l||-1!==w&&null!==l&&l.length>=w||G&&C?x=!0:!1}function J(){if(e)throw Error("Already flushing work.");
|
|
13
|
+
if(null!==f){var b=f;e=!0;try{var a=!0;do a=b(!0,g);while(a);a||(f=null);return!0}finally{e=!1}}else return!1}var n=[],r=[],K=1,h=null,d=3,B=!1,u=!1,y=!1,g=0,f=null,q=null,t=-1,l=null,w=-1,x=!1,e=!1,C=!1,G=!1,H=!1;a.reset=function(){if(e)throw Error("Cannot reset while already flushing work.");g=0;q=f=null;t=-1;l=null;w=-1;C=e=x=!1};a.unstable_IdlePriority=5;a.unstable_ImmediatePriority=1;a.unstable_LowPriority=4;a.unstable_NormalPriority=3;a.unstable_Profiling=null;a.unstable_UserBlockingPriority=
|
|
14
|
+
2;a.unstable_advanceTime=function(b){"disabledLog"===console.log.name||H||(g+=b,null!==q&&t<=g&&(q(g),t=-1,q=null))};a.unstable_cancelCallback=function(b){b.callback=null};a.unstable_clearYields=function(){if(null===l)return[];var b=l;l=null;return b};a.unstable_continueExecution=function(){u||B||(u=!0,f=F)};a.unstable_flushAll=function(){if(null!==l)throw Error("Log is not empty. Assert on the log of yielded values before flushing additional work.");J();if(null!==l)throw Error("While flushing work, something yielded a value. Use an assertion helper to assert on the log of yielded values, e.g. expect(Scheduler).toFlushAndYield([...])");
|
|
15
|
+
};a.unstable_flushAllWithoutAsserting=J;a.unstable_flushExpired=function(){if(e)throw Error("Already flushing work.");if(null!==f){e=!0;try{f(!1,g)||(f=null)}finally{e=!1}}};a.unstable_flushNumberOfYields=function(b){if(e)throw Error("Already flushing work.");if(null!==f){var a=f;w=b;e=!0;try{b=!0;do b=a(!0,g);while(b&&!x);b||(f=null)}finally{w=-1,e=x=!1}}};a.unstable_flushUntilNextPaint=function(){if(e)throw Error("Already flushing work.");if(null!==f){var a=f;G=!0;C=!1;e=!0;try{var k=!0;do k=a(!0,
|
|
16
|
+
g);while(k&&!x);k||(f=null)}finally{e=x=G=!1}}};a.unstable_forceFrameRate=function(){};a.unstable_getCurrentPriorityLevel=function(){return d};a.unstable_getFirstCallbackNode=function(){return m(n)};a.unstable_next=function(a){switch(d){case 1:case 2:case 3:var b=3;break;default:b=d}var c=d;d=b;try{return a()}finally{d=c}};a.unstable_now=function(){return g};a.unstable_pauseExecution=function(){};a.unstable_requestPaint=function(){C=!0};a.unstable_runWithPriority=function(a,e){switch(a){case 1:case 2:case 3:case 4:case 5:break;
|
|
17
|
+
default:a=3}var b=d;d=a;try{return e()}finally{d=b}};a.unstable_scheduleCallback=function(a,e,c){var b=g;"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?b+c:b):c=b;switch(a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1E4;break;default:d=5E3}d=c+d;a={id:K++,callback:e,priorityLevel:a,startTime:c,expirationTime:d,sortIndex:-1};c>b?(a.sortIndex=c,p(r,a),null===m(n)&&a===m(r)&&(y?(q=null,t=-1):y=!0,q=E,t=g+(c-b))):(a.sortIndex=d,p(n,a),u||B||(u=!0,
|
|
18
|
+
f=F));return a};a.unstable_setDisableYieldValue=function(a){H=a};a.unstable_shouldYield=I;a.unstable_wrapCallback=function(a){var b=d;return function(){var c=d;d=b;try{return a.apply(this,arguments)}finally{d=c}}};a.unstable_yieldValue=function(a){"disabledLog"===console.log.name||H||(null===l?l=[a]:l.push(a))}});
|
|
19
|
+
})();
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* eslint-disable max-len */
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
(function(global, factory) {
|
|
15
|
+
// eslint-disable-next-line no-unused-expressions
|
|
16
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
17
|
+
? (module.exports = factory(require('react')))
|
|
18
|
+
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
|
|
19
|
+
? define(['react'], factory) // eslint-disable-line no-undef
|
|
20
|
+
: (global.Scheduler = factory(global));
|
|
21
|
+
})(this, function(global) {
|
|
22
|
+
function unstable_now() {
|
|
23
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
|
|
24
|
+
this,
|
|
25
|
+
arguments
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function unstable_scheduleCallback() {
|
|
30
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleCallback.apply(
|
|
31
|
+
this,
|
|
32
|
+
arguments
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function unstable_cancelCallback() {
|
|
37
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelCallback.apply(
|
|
38
|
+
this,
|
|
39
|
+
arguments
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function unstable_shouldYield() {
|
|
44
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_shouldYield.apply(
|
|
45
|
+
this,
|
|
46
|
+
arguments
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function unstable_requestPaint() {
|
|
51
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_requestPaint.apply(
|
|
52
|
+
this,
|
|
53
|
+
arguments
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function unstable_runWithPriority() {
|
|
58
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_runWithPriority.apply(
|
|
59
|
+
this,
|
|
60
|
+
arguments
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function unstable_next() {
|
|
65
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply(
|
|
66
|
+
this,
|
|
67
|
+
arguments
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function unstable_wrapCallback() {
|
|
72
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply(
|
|
73
|
+
this,
|
|
74
|
+
arguments
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function unstable_getCurrentPriorityLevel() {
|
|
79
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getCurrentPriorityLevel.apply(
|
|
80
|
+
this,
|
|
81
|
+
arguments
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function unstable_getFirstCallbackNode() {
|
|
86
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
|
|
87
|
+
this,
|
|
88
|
+
arguments
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function unstable_pauseExecution() {
|
|
93
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_pauseExecution.apply(
|
|
94
|
+
this,
|
|
95
|
+
arguments
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function unstable_continueExecution() {
|
|
100
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_continueExecution.apply(
|
|
101
|
+
this,
|
|
102
|
+
arguments
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function unstable_forceFrameRate() {
|
|
107
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply(
|
|
108
|
+
this,
|
|
109
|
+
arguments
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return Object.freeze({
|
|
114
|
+
unstable_now: unstable_now,
|
|
115
|
+
unstable_scheduleCallback: unstable_scheduleCallback,
|
|
116
|
+
unstable_cancelCallback: unstable_cancelCallback,
|
|
117
|
+
unstable_shouldYield: unstable_shouldYield,
|
|
118
|
+
unstable_requestPaint: unstable_requestPaint,
|
|
119
|
+
unstable_runWithPriority: unstable_runWithPriority,
|
|
120
|
+
unstable_next: unstable_next,
|
|
121
|
+
unstable_wrapCallback: unstable_wrapCallback,
|
|
122
|
+
unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
|
|
123
|
+
unstable_continueExecution: unstable_continueExecution,
|
|
124
|
+
unstable_pauseExecution: unstable_pauseExecution,
|
|
125
|
+
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
|
|
126
|
+
unstable_forceFrameRate: unstable_forceFrameRate,
|
|
127
|
+
get unstable_IdlePriority() {
|
|
128
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
129
|
+
.Scheduler.unstable_IdlePriority;
|
|
130
|
+
},
|
|
131
|
+
get unstable_ImmediatePriority() {
|
|
132
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
133
|
+
.Scheduler.unstable_ImmediatePriority;
|
|
134
|
+
},
|
|
135
|
+
get unstable_LowPriority() {
|
|
136
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
137
|
+
.Scheduler.unstable_LowPriority;
|
|
138
|
+
},
|
|
139
|
+
get unstable_NormalPriority() {
|
|
140
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
141
|
+
.Scheduler.unstable_NormalPriority;
|
|
142
|
+
},
|
|
143
|
+
get unstable_UserBlockingPriority() {
|
|
144
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
145
|
+
.Scheduler.unstable_UserBlockingPriority;
|
|
146
|
+
},
|
|
147
|
+
get unstable_Profiling() {
|
|
148
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
149
|
+
.Scheduler.unstable_Profiling;
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* eslint-disable max-len */
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
(function(global, factory) {
|
|
15
|
+
// eslint-disable-next-line no-unused-expressions
|
|
16
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
17
|
+
? (module.exports = factory(require('react')))
|
|
18
|
+
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
|
|
19
|
+
? define(['react'], factory) // eslint-disable-line no-undef
|
|
20
|
+
: (global.Scheduler = factory(global));
|
|
21
|
+
})(this, function(global) {
|
|
22
|
+
function unstable_now() {
|
|
23
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
|
|
24
|
+
this,
|
|
25
|
+
arguments
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function unstable_scheduleCallback() {
|
|
30
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleCallback.apply(
|
|
31
|
+
this,
|
|
32
|
+
arguments
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function unstable_cancelCallback() {
|
|
37
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelCallback.apply(
|
|
38
|
+
this,
|
|
39
|
+
arguments
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function unstable_shouldYield() {
|
|
44
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_shouldYield.apply(
|
|
45
|
+
this,
|
|
46
|
+
arguments
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function unstable_requestPaint() {
|
|
51
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_requestPaint.apply(
|
|
52
|
+
this,
|
|
53
|
+
arguments
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function unstable_runWithPriority() {
|
|
58
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_runWithPriority.apply(
|
|
59
|
+
this,
|
|
60
|
+
arguments
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function unstable_next() {
|
|
65
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply(
|
|
66
|
+
this,
|
|
67
|
+
arguments
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function unstable_wrapCallback() {
|
|
72
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply(
|
|
73
|
+
this,
|
|
74
|
+
arguments
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function unstable_getCurrentPriorityLevel() {
|
|
79
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getCurrentPriorityLevel.apply(
|
|
80
|
+
this,
|
|
81
|
+
arguments
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function unstable_getFirstCallbackNode() {
|
|
86
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
|
|
87
|
+
this,
|
|
88
|
+
arguments
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function unstable_pauseExecution() {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function unstable_continueExecution() {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function unstable_forceFrameRate() {
|
|
101
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply(
|
|
102
|
+
this,
|
|
103
|
+
arguments
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return Object.freeze({
|
|
108
|
+
unstable_now: unstable_now,
|
|
109
|
+
unstable_scheduleCallback: unstable_scheduleCallback,
|
|
110
|
+
unstable_cancelCallback: unstable_cancelCallback,
|
|
111
|
+
unstable_shouldYield: unstable_shouldYield,
|
|
112
|
+
unstable_requestPaint: unstable_requestPaint,
|
|
113
|
+
unstable_runWithPriority: unstable_runWithPriority,
|
|
114
|
+
unstable_next: unstable_next,
|
|
115
|
+
unstable_wrapCallback: unstable_wrapCallback,
|
|
116
|
+
unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
|
|
117
|
+
unstable_continueExecution: unstable_continueExecution,
|
|
118
|
+
unstable_pauseExecution: unstable_pauseExecution,
|
|
119
|
+
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
|
|
120
|
+
unstable_forceFrameRate: unstable_forceFrameRate,
|
|
121
|
+
get unstable_IdlePriority() {
|
|
122
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
123
|
+
.Scheduler.unstable_IdlePriority;
|
|
124
|
+
},
|
|
125
|
+
get unstable_ImmediatePriority() {
|
|
126
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
127
|
+
.Scheduler.unstable_ImmediatePriority;
|
|
128
|
+
},
|
|
129
|
+
get unstable_LowPriority() {
|
|
130
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
131
|
+
.Scheduler.unstable_LowPriority;
|
|
132
|
+
},
|
|
133
|
+
get unstable_NormalPriority() {
|
|
134
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
135
|
+
.Scheduler.unstable_NormalPriority;
|
|
136
|
+
},
|
|
137
|
+
get unstable_UserBlockingPriority() {
|
|
138
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
139
|
+
.Scheduler.unstable_UserBlockingPriority;
|
|
140
|
+
},
|
|
141
|
+
get unstable_Profiling() {
|
|
142
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
143
|
+
.Scheduler.unstable_Profiling;
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* eslint-disable max-len */
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
(function(global, factory) {
|
|
15
|
+
// eslint-disable-next-line no-unused-expressions
|
|
16
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
17
|
+
? (module.exports = factory(require('react')))
|
|
18
|
+
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
|
|
19
|
+
? define(['react'], factory) // eslint-disable-line no-undef
|
|
20
|
+
: (global.Scheduler = factory(global));
|
|
21
|
+
})(this, function(global) {
|
|
22
|
+
function unstable_now() {
|
|
23
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
|
|
24
|
+
this,
|
|
25
|
+
arguments
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function unstable_scheduleCallback() {
|
|
30
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleCallback.apply(
|
|
31
|
+
this,
|
|
32
|
+
arguments
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function unstable_cancelCallback() {
|
|
37
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelCallback.apply(
|
|
38
|
+
this,
|
|
39
|
+
arguments
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function unstable_shouldYield() {
|
|
44
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_shouldYield.apply(
|
|
45
|
+
this,
|
|
46
|
+
arguments
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function unstable_requestPaint() {
|
|
51
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_requestPaint.apply(
|
|
52
|
+
this,
|
|
53
|
+
arguments
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function unstable_runWithPriority() {
|
|
58
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_runWithPriority.apply(
|
|
59
|
+
this,
|
|
60
|
+
arguments
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function unstable_next() {
|
|
65
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_next.apply(
|
|
66
|
+
this,
|
|
67
|
+
arguments
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function unstable_wrapCallback() {
|
|
72
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_wrapCallback.apply(
|
|
73
|
+
this,
|
|
74
|
+
arguments
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function unstable_getCurrentPriorityLevel() {
|
|
79
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getCurrentPriorityLevel.apply(
|
|
80
|
+
this,
|
|
81
|
+
arguments
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function unstable_getFirstCallbackNode() {
|
|
86
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
|
|
87
|
+
this,
|
|
88
|
+
arguments
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function unstable_pauseExecution() {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function unstable_continueExecution() {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function unstable_forceFrameRate() {
|
|
101
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_forceFrameRate.apply(
|
|
102
|
+
this,
|
|
103
|
+
arguments
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return Object.freeze({
|
|
108
|
+
unstable_now: unstable_now,
|
|
109
|
+
unstable_scheduleCallback: unstable_scheduleCallback,
|
|
110
|
+
unstable_cancelCallback: unstable_cancelCallback,
|
|
111
|
+
unstable_shouldYield: unstable_shouldYield,
|
|
112
|
+
unstable_requestPaint: unstable_requestPaint,
|
|
113
|
+
unstable_runWithPriority: unstable_runWithPriority,
|
|
114
|
+
unstable_next: unstable_next,
|
|
115
|
+
unstable_wrapCallback: unstable_wrapCallback,
|
|
116
|
+
unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
|
|
117
|
+
unstable_continueExecution: unstable_continueExecution,
|
|
118
|
+
unstable_pauseExecution: unstable_pauseExecution,
|
|
119
|
+
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
|
|
120
|
+
unstable_forceFrameRate: unstable_forceFrameRate,
|
|
121
|
+
get unstable_IdlePriority() {
|
|
122
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
123
|
+
.Scheduler.unstable_IdlePriority;
|
|
124
|
+
},
|
|
125
|
+
get unstable_ImmediatePriority() {
|
|
126
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
127
|
+
.Scheduler.unstable_ImmediatePriority;
|
|
128
|
+
},
|
|
129
|
+
get unstable_LowPriority() {
|
|
130
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
131
|
+
.Scheduler.unstable_LowPriority;
|
|
132
|
+
},
|
|
133
|
+
get unstable_NormalPriority() {
|
|
134
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
135
|
+
.Scheduler.unstable_NormalPriority;
|
|
136
|
+
},
|
|
137
|
+
get unstable_UserBlockingPriority() {
|
|
138
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
139
|
+
.Scheduler.unstable_UserBlockingPriority;
|
|
140
|
+
},
|
|
141
|
+
get unstable_Profiling() {
|
|
142
|
+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
143
|
+
.Scheduler.unstable_Profiling;
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
/** @type { import('@rspack/core').RspackOptions } */
|
|
1
2
|
module.exports = {
|
|
2
3
|
mode: "development",
|
|
3
4
|
entry: "./index.jsx",
|
|
4
5
|
devServer: {
|
|
5
6
|
hot: true
|
|
6
7
|
},
|
|
8
|
+
caches: false,
|
|
7
9
|
stats: "none",
|
|
8
10
|
infrastructureLogging: {
|
|
9
11
|
debug: false
|
|
@@ -11,12 +13,14 @@ module.exports = {
|
|
|
11
13
|
builtins: {
|
|
12
14
|
html: [
|
|
13
15
|
{
|
|
14
|
-
template: "./index.html"
|
|
15
|
-
publicPath: "/"
|
|
16
|
+
template: "./index.html"
|
|
16
17
|
}
|
|
17
18
|
],
|
|
18
19
|
define: {
|
|
19
20
|
"process.env.NODE_ENV": JSON.stringify("development")
|
|
20
21
|
}
|
|
22
|
+
},
|
|
23
|
+
watchOptions: {
|
|
24
|
+
poll: true
|
|
21
25
|
}
|
|
22
26
|
};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import WebSocket from "ws";
|
|
3
|
+
|
|
4
|
+
async function waiting(ms: number): Promise<void> {
|
|
5
|
+
return new Promise(resolve => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
resolve(undefined);
|
|
8
|
+
}, ms);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
2
11
|
|
|
3
12
|
export async function editFile(
|
|
4
13
|
filename: string,
|
|
@@ -7,9 +16,54 @@ export async function editFile(
|
|
|
7
16
|
const content = fs.readFileSync(filename, "utf-8");
|
|
8
17
|
const modified = replacer(content);
|
|
9
18
|
fs.writeFileSync(filename, modified);
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
return waiting(1000);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function waitingForBuild(port: number | string) {
|
|
23
|
+
await new Promise(resolve => {
|
|
24
|
+
const ws = new WebSocket(`ws://127.0.0.1:${port}/ws`, {
|
|
25
|
+
headers: {
|
|
26
|
+
host: `127.0.0.1:${port}`,
|
|
27
|
+
origin: `http://127.0.0.1:${port}`
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
let opened = false;
|
|
32
|
+
let received = false;
|
|
33
|
+
let errored = false;
|
|
34
|
+
|
|
35
|
+
ws.on("error", error => {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
if (/404/.test(error)) {
|
|
38
|
+
errored = true;
|
|
39
|
+
} else {
|
|
40
|
+
errored = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ws.close();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
ws.on("open", () => {
|
|
47
|
+
opened = true;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
ws.on("message", data => {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
const message = JSON.parse(data);
|
|
53
|
+
|
|
54
|
+
if (message.type === "ok") {
|
|
55
|
+
received = true;
|
|
56
|
+
|
|
57
|
+
ws.close();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
ws.on("close", () => {
|
|
62
|
+
if (opened && received && !errored) {
|
|
63
|
+
resolve(undefined);
|
|
64
|
+
} else if (errored) {
|
|
65
|
+
resolve(undefined);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
14
68
|
});
|
|
15
69
|
}
|