@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.
Files changed (68) hide show
  1. package/README.md +7 -7
  2. package/compiled/http-proxy-middleware/index.d.ts +12 -10
  3. package/compiled/http-proxy-middleware/package.json +1 -1
  4. package/compiled/tinypool/dist/index.js +5 -3
  5. package/compiled/watchpack/index.js +459 -60
  6. package/compiled/watchpack/package.json +1 -1
  7. package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
  8. package/compiled/watchpack/types/index.d.ts +1 -1
  9. package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
  10. package/compiled/webpack-sources/index.d.ts +2 -0
  11. package/compiled/webpack-sources/index.js +207 -94
  12. package/compiled/webpack-sources/package.json +1 -1
  13. package/compiled/webpack-sources/types/RawSource.d.ts +0 -10
  14. package/compiled/webpack-sources/types/helpers/sourceMap.d.ts +47 -0
  15. package/compiled/webpack-sources/types/index.d.ts +1 -0
  16. package/dist/BuildInfo.d.ts +7 -0
  17. package/dist/Compilation.d.ts +3 -1
  18. package/dist/Compiler.d.ts +5 -6
  19. package/dist/ConcatenatedModule.d.ts +5 -1
  20. package/dist/ContextModule.d.ts +3 -1
  21. package/dist/ExternalModule.d.ts +7 -6
  22. package/dist/FileSystemInfo.d.ts +1 -0
  23. package/dist/Module.d.ts +12 -8
  24. package/dist/ModuleGraphConnection.d.ts +9 -3
  25. package/dist/NativeWatchFileSystem.d.ts +19 -7
  26. package/dist/NormalModule.d.ts +14 -6
  27. package/dist/RuntimeGlobals.d.ts +2 -1
  28. package/dist/RuntimeTemplate.d.ts +2 -0
  29. package/dist/Stats.d.ts +1 -1
  30. package/dist/builtin-loader/lightningcss/index.d.ts +5 -1
  31. package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -0
  32. package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -0
  33. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +5 -0
  34. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -2
  35. package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
  36. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -0
  37. package/dist/builtin-plugin/index.d.ts +1 -0
  38. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
  39. package/dist/config/adapterRuleUse.d.ts +1 -0
  40. package/dist/config/normalization.d.ts +2 -2
  41. package/dist/config/target.d.ts +6 -0
  42. package/dist/config/types.d.ts +69 -36
  43. package/dist/cssExtractHmr.js +1 -1
  44. package/dist/cssExtractLoader.js +1 -1
  45. package/dist/exports.d.ts +5 -4
  46. package/dist/index.js +1577 -1151
  47. package/dist/loader-runner/codeFilter.d.ts +9 -0
  48. package/dist/loader-runner/dependencies.d.ts +1 -1
  49. package/dist/loader-runner/index.d.ts +2 -1
  50. package/dist/loader-runner/service.d.ts +0 -4
  51. package/dist/loader-runner/worker.d.ts +4 -1
  52. package/dist/node/NodeWatchFileSystem.d.ts +7 -4
  53. package/dist/sharing/IndependentSharedPlugin.d.ts +1 -2
  54. package/dist/sharing/utils.d.ts +1 -1
  55. package/dist/sources.d.ts +3 -0
  56. package/dist/stats/statsFactoryUtils.d.ts +7 -0
  57. package/dist/util/bindingHelpers.d.ts +2 -0
  58. package/dist/util/createModule.d.ts +3 -0
  59. package/dist/util/fs.d.ts +13 -7
  60. package/dist/util/resolveLayerExternals.d.ts +1 -0
  61. package/dist/util/source.d.ts +12 -3
  62. package/dist/util/symbols.d.ts +10 -0
  63. package/dist/util/watchTimeInfo.d.ts +5 -1
  64. package/dist/worker.js +327 -326
  65. package/hot/lazy-compilation-node.js +1 -1
  66. package/hot/lazy-compilation-web.js +1 -1
  67. package/package.json +4 -4
  68. 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.2.9`. Identical JS content;
20
- the `@rspack/binding` dependency is aliased to `@ohos-ports/rspack-binding`
21
- (`"@rspack/binding": "npm:@ohos-ports/rspack-binding@2.2.9-beta.0"`), so the
22
- bundled dist code's `require('@rspack/binding')` transparently resolves to
23
- the ported loader, which probes the OpenHarmony arm64 native binary slot
24
- `@ohos-ports/rspack-binding-openharmony-arm64` (compiled from rspack v2.2.9
25
- Rust source for `aarch64-unknown-linux-ohos`, signed).
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?: any) => void> = T;
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?: string | Partial<URL>) => void;
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: any) => void;
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: any) => void;
158
- start?: (req: TReq, res: TRes, target: string | Partial<URL>) => void;
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: string | Partial<URL>) => void;
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, ProxyServerOptions['target']> | ((req: TReq, res: TRes | undefined, options: Options<TReq, TRes>) => ProxyServerOptions['target']) | ((req: TReq, res: TRes | undefined, options: Options<TReq, TRes>) => Promise<ProxyServerOptions['target']>);
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?: any;
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.0","license":"MIT","types":"index.d.ts","type":"module"}
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);