@ohos-ports/rspack-core 2.2.9-beta.0 → 2.3.4-beta.0
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/README.md +7 -7
- package/compiled/http-proxy-middleware/index.d.ts +12 -10
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/tinypool/dist/index.js +5 -3
- package/compiled/watchpack/index.js +459 -60
- package/compiled/watchpack/package.json +1 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
- package/compiled/watchpack/types/index.d.ts +1 -1
- package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
- package/compiled/webpack-sources/index.d.ts +2 -0
- package/compiled/webpack-sources/index.js +207 -94
- package/compiled/webpack-sources/package.json +1 -1
- package/compiled/webpack-sources/types/RawSource.d.ts +0 -10
- package/compiled/webpack-sources/types/helpers/sourceMap.d.ts +47 -0
- package/compiled/webpack-sources/types/index.d.ts +1 -0
- package/dist/BuildInfo.d.ts +7 -0
- package/dist/Compilation.d.ts +3 -1
- package/dist/Compiler.d.ts +5 -6
- package/dist/ConcatenatedModule.d.ts +5 -1
- package/dist/ContextModule.d.ts +3 -1
- package/dist/ExternalModule.d.ts +7 -6
- package/dist/FileSystemInfo.d.ts +1 -0
- package/dist/Module.d.ts +12 -8
- package/dist/ModuleGraphConnection.d.ts +9 -3
- package/dist/NativeWatchFileSystem.d.ts +19 -7
- package/dist/NormalModule.d.ts +14 -6
- package/dist/RuntimeGlobals.d.ts +2 -1
- package/dist/RuntimeTemplate.d.ts +2 -0
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +5 -1
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -0
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -0
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +5 -0
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -2
- package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -0
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/adapterRuleUse.d.ts +1 -0
- package/dist/config/normalization.d.ts +2 -2
- package/dist/config/target.d.ts +6 -0
- package/dist/config/types.d.ts +69 -36
- package/dist/cssExtractHmr.js +1 -1
- package/dist/cssExtractLoader.js +1 -1
- package/dist/exports.d.ts +5 -4
- package/dist/index.js +1577 -1151
- package/dist/loader-runner/codeFilter.d.ts +9 -0
- package/dist/loader-runner/dependencies.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +2 -1
- package/dist/loader-runner/service.d.ts +0 -4
- package/dist/loader-runner/worker.d.ts +4 -1
- package/dist/node/NodeWatchFileSystem.d.ts +7 -4
- package/dist/sharing/IndependentSharedPlugin.d.ts +1 -2
- package/dist/sharing/utils.d.ts +1 -1
- package/dist/sources.d.ts +3 -0
- package/dist/stats/statsFactoryUtils.d.ts +7 -0
- package/dist/util/bindingHelpers.d.ts +2 -0
- package/dist/util/createModule.d.ts +3 -0
- package/dist/util/fs.d.ts +13 -7
- package/dist/util/resolveLayerExternals.d.ts +1 -0
- package/dist/util/source.d.ts +12 -3
- package/dist/util/symbols.d.ts +10 -0
- package/dist/util/watchTimeInfo.d.ts +5 -1
- package/dist/worker.js +327 -326
- package/hot/lazy-compilation-node.js +1 -1
- package/hot/lazy-compilation-web.js +1 -1
- package/package.json +4 -4
- package/dist/loader-runner/cache.d.ts +0 -27
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@ Rspack is [MIT licensed](https://github.com/web-infra-dev/rspack/blob/main/LICEN
|
|
|
16
16
|
|
|
17
17
|
## OpenHarmony port
|
|
18
18
|
|
|
19
|
-
`@ohos-ports` distribution of `@rspack/core@2.
|
|
20
|
-
|
|
21
|
-
(`"@
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`@
|
|
25
|
-
|
|
19
|
+
`@ohos-ports` distribution of `@rspack/core@2.3.4`. The bundled dist code's
|
|
20
|
+
`@rspack/binding` references are rewritten to `@ohos-ports/rspack-binding`
|
|
21
|
+
(dependency `"@ohos-ports/rspack-binding": "2.3.4-beta.0"`), whose loader
|
|
22
|
+
probes the OpenHarmony arm64 native binary slot
|
|
23
|
+
`@ohos-ports/rspack-binding-openharmony-arm64` (binary taken from the official
|
|
24
|
+
upstream `@rspack/binding-linux-arm64-musl@2.3.4` prebuilt, exact version
|
|
25
|
+
match, signed with `binary-sign-tool`; live-verified on openharmony/arm64).
|
|
@@ -75,6 +75,8 @@ interface ProxyServerOptions {
|
|
|
75
75
|
};
|
|
76
76
|
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
|
77
77
|
proxyTimeout?: number;
|
|
78
|
+
/** Total time in milliseconds to receive upstream WebSocket response headers or an upgrade. Omitted, non-positive, and non-finite values disable the deadline. */
|
|
79
|
+
upgradeTimeout?: number;
|
|
78
80
|
/** Timeout (in milliseconds) for incoming requests */
|
|
79
81
|
timeout?: number;
|
|
80
82
|
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
|
@@ -136,7 +138,7 @@ declare class ProxyServer<Req extends http__default.IncomingMessage | http2.Http
|
|
|
136
138
|
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/6f529c6c67a447190f86bfbf894d1061e41e07b7/types/http-proxy-middleware/index.d.ts
|
|
137
139
|
*/
|
|
138
140
|
|
|
139
|
-
type NextFunction<T = (err?:
|
|
141
|
+
type NextFunction<T = (err?: unknown) => void> = T;
|
|
140
142
|
interface RequestHandler<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse, TNext = NextFunction> {
|
|
141
143
|
(req: TReq, res: TRes, next?: TNext): Promise<void>;
|
|
142
144
|
upgrade: (req: TReq, socket: net.Socket, head: Buffer) => void;
|
|
@@ -149,15 +151,15 @@ interface Plugin<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
|
|
|
149
151
|
(proxyServer: ProxyServer<TReq, TRes>, options: Options<TReq, TRes>): void;
|
|
150
152
|
}
|
|
151
153
|
interface OnProxyEvent<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse> {
|
|
152
|
-
error?: (err: Error, req: TReq, res: TRes | net.Socket, target?:
|
|
154
|
+
error?: (err: Error, req: TReq, res: TRes | net.Socket, target?: ProxyTarget) => void;
|
|
153
155
|
proxyReq?: (proxyReq: http.ClientRequest, req: TReq, res: TRes, options: ProxyServerOptions) => void;
|
|
154
|
-
proxyReqWs?: (proxyReq: http.ClientRequest, req: TReq, socket: net.Socket, options: ProxyServerOptions, head:
|
|
156
|
+
proxyReqWs?: (proxyReq: http.ClientRequest, req: TReq, socket: net.Socket, options: ProxyServerOptions, head: Buffer) => void;
|
|
155
157
|
proxyRes?: (proxyRes: TReq, req: TReq, res: TRes) => void | Promise<void>;
|
|
156
158
|
open?: (proxySocket: net.Socket) => void;
|
|
157
|
-
close?: (proxyRes: TReq, proxySocket: net.Socket, proxyHead:
|
|
158
|
-
start?: (req: TReq, res: TRes, target:
|
|
159
|
+
close?: (proxyRes: TReq, proxySocket: net.Socket, proxyHead: Buffer) => void;
|
|
160
|
+
start?: (req: TReq, res: TRes, target: ProxyTarget) => void;
|
|
159
161
|
end?: (req: TReq, res: TRes, proxyRes: TReq) => void;
|
|
160
|
-
econnreset?: (err: Error, req: TReq, res: TRes, target:
|
|
162
|
+
econnreset?: (err: Error, req: TReq, res: TRes, target: ProxyTarget) => void;
|
|
161
163
|
}
|
|
162
164
|
type Logger = Pick<Console, 'info' | 'warn' | 'error'>;
|
|
163
165
|
type PathRewriteConfig<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse> = {
|
|
@@ -254,7 +256,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
|
|
|
254
256
|
*
|
|
255
257
|
* @link https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/router.md
|
|
256
258
|
*/
|
|
257
|
-
router?: Record<string,
|
|
259
|
+
router?: Record<string, ProxyTarget> | ((req: TReq, res: TRes | undefined, options: Options<TReq, TRes>) => ProxyTarget) | ((req: TReq, res: TRes | undefined, options: Options<TReq, TRes>) => Promise<ProxyTarget>);
|
|
258
260
|
/**
|
|
259
261
|
* Log information from http-proxy-middleware
|
|
260
262
|
* @example
|
|
@@ -345,7 +347,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
|
|
|
345
347
|
* @see https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/pathRewrite.md
|
|
346
348
|
* @see https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md
|
|
347
349
|
*/
|
|
348
|
-
declare function createProxyMiddleware<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse, TNext = NextFunction>(options: Options<TReq, TRes>): RequestHandler<TReq, TRes, TNext>;
|
|
350
|
+
declare function createProxyMiddleware<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse, TNext extends (err?: unknown) => void = NextFunction>(options: Options<TReq, TRes>): RequestHandler<TReq, TRes, TNext>;
|
|
349
351
|
|
|
350
352
|
type Interceptor<TReq = http.IncomingMessage, TRes = http.ServerResponse> = (buffer: Buffer, proxyRes: http.IncomingMessage, req: TReq, res: TRes) => Promise<Buffer | string>;
|
|
351
353
|
/**
|
|
@@ -373,8 +375,8 @@ type Interceptor<TReq = http.IncomingMessage, TRes = http.ServerResponse> = (buf
|
|
|
373
375
|
*/
|
|
374
376
|
declare function responseInterceptor<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse>(interceptor: Interceptor<TReq, TRes>): (proxyRes: http.IncomingMessage, req: TReq, res: TRes) => Promise<void>;
|
|
375
377
|
|
|
376
|
-
type BodyParserLikeRequest = http.IncomingMessage & {
|
|
377
|
-
body?:
|
|
378
|
+
type BodyParserLikeRequest<TBody = unknown> = http.IncomingMessage & {
|
|
379
|
+
body?: TBody;
|
|
378
380
|
};
|
|
379
381
|
/**
|
|
380
382
|
* Fix proxied body if bodyParser is involved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"http-proxy-middleware","author":"Steven Chim","version":"4.2.
|
|
1
|
+
{"name":"http-proxy-middleware","author":"Steven Chim","version":"4.2.2","license":"MIT","types":"index.d.ts","type":"module"}
|
|
@@ -428,7 +428,7 @@ var WorkerInfo = class extends AsynchronouslyCreatedResource {
|
|
|
428
428
|
this.port.postMessage(message, taskInfo.transferList);
|
|
429
429
|
} catch (err) {
|
|
430
430
|
taskInfo.done(err);
|
|
431
|
-
return;
|
|
431
|
+
return false;
|
|
432
432
|
}
|
|
433
433
|
taskInfo.workerInfo = this;
|
|
434
434
|
this.taskInfos.set(taskInfo.taskId, taskInfo);
|
|
@@ -436,6 +436,7 @@ var WorkerInfo = class extends AsynchronouslyCreatedResource {
|
|
|
436
436
|
this.clearIdleTimeout();
|
|
437
437
|
Atomics.add(this.sharedBuffer, kRequestCountField, 1);
|
|
438
438
|
Atomics.notify(this.sharedBuffer, kRequestCountField, 1);
|
|
439
|
+
return true;
|
|
439
440
|
}
|
|
440
441
|
processPendingMessages() {
|
|
441
442
|
const actualResponseCount = Atomics.load(this.sharedBuffer, kResponseCountField);
|
|
@@ -584,9 +585,10 @@ var ThreadPool = class {
|
|
|
584
585
|
}
|
|
585
586
|
const now = performance.now();
|
|
586
587
|
taskInfo.started = now;
|
|
587
|
-
workerInfo.postTask(taskInfo);
|
|
588
|
+
const submitted = workerInfo.postTask(taskInfo);
|
|
588
589
|
this._maybeDrain();
|
|
589
|
-
return;
|
|
590
|
+
if (submitted) return;
|
|
591
|
+
// Failed submissions leave the worker available for the next queued task.
|
|
590
592
|
}
|
|
591
593
|
if (workerInfo.taskInfos.size === 0 && this.workers.size > this.options.minThreads) workerInfo.idleTimeout = setTimeout(() => {
|
|
592
594
|
assert.strictEqual(workerInfo.taskInfos.size, 0);
|