@rspack-canary/browser 1.7.2-canary-4b68b9c2-20260107123726 → 1.7.2-canary-29642b28-20260108182846

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.
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } from '@rspack/binding';
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
11
  import binding from '@rspack/binding';
12
12
  export type { AssetInfo } from '@rspack/binding';
13
13
  import * as liteTapable from '@rspack/lite-tapable';
@@ -185,7 +185,7 @@ export declare class Compilation {
185
185
  Set<string>
186
186
  ]>;
187
187
  runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
188
- runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk]>;
188
+ runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>;
189
189
  seal: liteTapable.SyncHook<[]>;
190
190
  afterSeal: liteTapable.AsyncSeriesHook<[], void>;
191
191
  needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
@@ -1,4 +1,4 @@
1
- import type { JsAddingRuntimeModule } from '@rspack/binding';
1
+ import type { JsAddingRuntimeModule, JsRuntimeModule } from '@rspack/binding';
2
2
  import type { Chunk } from './Chunk';
3
3
  import type { ChunkGraph } from './ChunkGraph';
4
4
  import type { Compilation } from './Compilation';
@@ -30,3 +30,4 @@ export declare class RuntimeModule {
30
30
  shouldIsolate(): boolean;
31
31
  generate(): string;
32
32
  }
33
+ export declare function createRenderedRuntimeModule(module: JsRuntimeModule): RuntimeModule;
@@ -22,4 +22,4 @@ export declare enum RequestType {
22
22
  CompilationGetAssetPath = "CompilationGetAssetPath",
23
23
  CompilationGetAssetPathWithInfo = "CompilationGetAssetPathWithInfo"
24
24
  }
25
- export declare function run(): Promise<void>;
25
+ export declare function run(): Promise<never>;
@@ -52,6 +52,11 @@ export type HtmlRspackPluginOptions = {
52
52
  * @default "auto"
53
53
  */
54
54
  chunksSortMode?: 'auto' | 'manual';
55
+ /**
56
+ * Configure the SRI hash algorithm, which is disabled by default.
57
+ * @deprecated Use `experiments.SubresourceIntegrityPlugin` instead.
58
+ */
59
+ sri?: 'sha256' | 'sha384' | 'sha512';
55
60
  /**
56
61
  * Controls whether to minify the output, disabled by default.
57
62
  */
@@ -10,7 +10,7 @@
10
10
  import type { HttpUriPluginOptions } from '../builtin-plugin';
11
11
  import type { Compilation } from '../Compilation';
12
12
  import type WebpackError from '../lib/WebpackError';
13
- import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types';
13
+ import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types';
14
14
  export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
15
15
  export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
16
16
  export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
@@ -66,9 +66,9 @@ export interface OutputNormalized {
66
66
  devtoolModuleFilenameTemplate?: DevtoolModuleFilenameTemplate;
67
67
  devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
68
68
  environment?: Environment;
69
+ charset?: boolean;
69
70
  chunkLoadTimeout?: number;
70
71
  compareBeforeEmit?: boolean;
71
- bundlerInfo?: BundlerInfoOptions;
72
72
  }
73
73
  export interface ModuleOptionsNormalized {
74
74
  defaultRules?: RuleSetRules;
@@ -112,7 +112,9 @@ export interface ExperimentsNormalized {
112
112
  layers?: boolean;
113
113
  incremental?: false | Incremental;
114
114
  futureDefaults?: boolean;
115
+ rspackFuture?: RspackFutureOptions;
115
116
  buildHttp?: HttpUriPluginOptions;
117
+ parallelLoader?: boolean;
116
118
  useInputFileSystem?: false | RegExp[];
117
119
  /**
118
120
  * @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
@@ -499,16 +499,17 @@ export type Output = {
499
499
  * @default 120000
500
500
  * */
501
501
  chunkLoadTimeout?: number;
502
+ /**
503
+ * Add charset="utf-8" to the HTML <script> tag.
504
+ * @default true
505
+ * */
506
+ charset?: boolean;
502
507
  /** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
503
508
  environment?: Environment;
504
509
  /**
505
510
  * Check if to be emitted file already exists and have the same content before writing to output filesystem.
506
511
  */
507
512
  compareBeforeEmit?: boolean;
508
- /**
509
- * Information about the bundler.
510
- */
511
- bundlerInfo?: BundlerInfoOptions;
512
513
  };
513
514
  /**
514
515
  * Path alias
@@ -1936,21 +1937,26 @@ export type ExperimentCacheOptions = boolean | {
1936
1937
  };
1937
1938
  };
1938
1939
  /**
1939
- * Information about the bundler.
1940
+ * Options for future Rspack features.
1940
1941
  */
1941
- export type BundlerInfoOptions = {
1942
- /**
1943
- * Version of the bundler.
1944
- */
1945
- version?: string;
1942
+ export type RspackFutureOptions = {
1946
1943
  /**
1947
- * Name of the bundler.
1948
- */
1949
- bundler?: string;
1950
- /**
1951
- * Force specific features.
1944
+ * Information about the bundler.
1952
1945
  */
1953
- force?: boolean | ('version' | 'uniqueId')[];
1946
+ bundlerInfo?: {
1947
+ /**
1948
+ * Version of the bundler.
1949
+ */
1950
+ version?: string;
1951
+ /**
1952
+ * Name of the bundler.
1953
+ */
1954
+ bundler?: string;
1955
+ /**
1956
+ * Force specific features.
1957
+ */
1958
+ force?: boolean | ('version' | 'uniqueId')[];
1959
+ };
1954
1960
  };
1955
1961
  /**
1956
1962
  * Options for lazy compilation.
@@ -2129,11 +2135,20 @@ export type Experiments = {
2129
2135
  * @default false
2130
2136
  */
2131
2137
  futureDefaults?: boolean;
2138
+ /**
2139
+ * Enable future Rspack features default options.
2140
+ */
2141
+ rspackFuture?: RspackFutureOptions;
2132
2142
  /**
2133
2143
  * Enable loading of modules via HTTP/HTTPS requests.
2134
2144
  * @default false
2135
2145
  */
2136
2146
  buildHttp?: HttpUriOptions;
2147
+ /**
2148
+ * Enable parallel loader
2149
+ * @default false
2150
+ */
2151
+ parallelLoader?: boolean;
2137
2152
  /**
2138
2153
  * Enable Node.js input file system
2139
2154
  * @default false
package/dist/exports.d.ts CHANGED
@@ -147,6 +147,10 @@ interface Experiments {
147
147
  cleanup: () => Promise<void>;
148
148
  };
149
149
  RemoveDuplicateModulesPlugin: typeof RemoveDuplicateModulesPlugin;
150
+ /**
151
+ * @deprecated Use `rspack.SubresourceIntegrityPlugin` instead
152
+ */
153
+ SubresourceIntegrityPlugin: typeof SubresourceIntegrityPlugin;
150
154
  EsmLibraryPlugin: typeof EsmLibraryPlugin;
151
155
  RsdoctorPlugin: typeof RsdoctorPlugin;
152
156
  RstestPlugin: typeof RstestPlugin;
package/dist/index.mjs CHANGED
@@ -50957,6 +50957,38 @@ RuntimeModule_define_property(RuntimeModule, "STAGE_NORMAL", 0);
50957
50957
  RuntimeModule_define_property(RuntimeModule, "STAGE_BASIC", 5);
50958
50958
  RuntimeModule_define_property(RuntimeModule, "STAGE_ATTACH", 10);
50959
50959
  RuntimeModule_define_property(RuntimeModule, "STAGE_TRIGGER", 20);
50960
+ function createRenderedRuntimeModule(module1) {
50961
+ const RuntimeModuleClass = {
50962
+ [module1.constructorName]: class extends RuntimeModule {
50963
+ get constructorName() {
50964
+ return module1.constructorName;
50965
+ }
50966
+ get moduleIdentifier() {
50967
+ return module1.moduleIdentifier;
50968
+ }
50969
+ get source() {
50970
+ return this._source;
50971
+ }
50972
+ identifier() {
50973
+ return module1.moduleIdentifier;
50974
+ }
50975
+ readableIdentifier() {
50976
+ return module1.moduleIdentifier;
50977
+ }
50978
+ shouldIsolate() {
50979
+ return module1.isolate;
50980
+ }
50981
+ generate() {
50982
+ return this._source?.source.toString('utf-8') || '';
50983
+ }
50984
+ constructor(){
50985
+ super(module1.name, module1.stage), RuntimeModule_define_property(this, "_source", void 0);
50986
+ this._source = module1.source;
50987
+ }
50988
+ }
50989
+ }[module1.constructorName];
50990
+ return new RuntimeModuleClass();
50991
+ }
50960
50992
  function Stats_check_private_redeclaration(obj, privateCollection) {
50961
50993
  if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
50962
50994
  }
@@ -54370,8 +54402,8 @@ class ModuleWarning extends lib_WebpackError {
54370
54402
  this.details = getErrorDetails(err);
54371
54403
  }
54372
54404
  }
54373
- async function service_run() {
54374
- throw new Error('Not support browser');
54405
+ function service_run() {
54406
+ return Promise.reject(new Error('Not support browser'));
54375
54407
  }
54376
54408
  class LoadingLoaderError extends Error {
54377
54409
  constructor(message){
@@ -55091,7 +55123,7 @@ async function runLoaders(compiler, context) {
55091
55123
  }
55092
55124
  };
55093
55125
  };
55094
- const enableParallelism = (currentLoaderObject)=>currentLoaderObject?.parallel;
55126
+ const enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel;
55095
55127
  const isomorphoicRun = async (fn, args)=>{
55096
55128
  const currentLoaderObject = getCurrentLoader(loaderContext);
55097
55129
  const parallelism = enableParallelism(currentLoaderObject);
@@ -55843,7 +55875,7 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
55843
55875
  if ('string' == typeof item || item instanceof RegExp) return item;
55844
55876
  if ('function' == typeof item) {
55845
55877
  const processResolveResult = ExternalsPlugin_class_private_field_get(this, _processResolveResult);
55846
- return async (ctx)=>await new Promise((resolve, reject)=>{
55878
+ return async (ctx)=>new Promise((resolve, reject)=>{
55847
55879
  const data = ctx.data();
55848
55880
  const promise = item({
55849
55881
  request: data.request,
@@ -56166,6 +56198,7 @@ const HtmlRspackPluginImpl = base_create(external_rspack_wasi_browser_js_.Builti
56166
56198
  chunks: c.chunks,
56167
56199
  excludeChunks: c.excludeChunks,
56168
56200
  chunksSortMode,
56201
+ sri: c.sri,
56169
56202
  minify: c.minify,
56170
56203
  meta,
56171
56204
  scriptLoading,
@@ -56536,35 +56569,35 @@ const createRsdoctorPluginHooksRegisters = (getCompiler, createTap)=>({
56536
56569
  return RsdoctorPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleGraph;
56537
56570
  }, function(queried) {
56538
56571
  return async function(data) {
56539
- return await queried.promise(data);
56572
+ return queried.promise(data);
56540
56573
  };
56541
56574
  }),
56542
56575
  registerRsdoctorPluginChunkGraphTaps: createTap(external_rspack_wasi_browser_js_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
56543
56576
  return RsdoctorPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkGraph;
56544
56577
  }, function(queried) {
56545
56578
  return async function(data) {
56546
- return await queried.promise(data);
56579
+ return queried.promise(data);
56547
56580
  };
56548
56581
  }),
56549
56582
  registerRsdoctorPluginModuleIdsTaps: createTap(external_rspack_wasi_browser_js_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
56550
56583
  return RsdoctorPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleIds;
56551
56584
  }, function(queried) {
56552
56585
  return async function(data) {
56553
- return await queried.promise(data);
56586
+ return queried.promise(data);
56554
56587
  };
56555
56588
  }),
56556
56589
  registerRsdoctorPluginModuleSourcesTaps: createTap(external_rspack_wasi_browser_js_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
56557
56590
  return RsdoctorPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleSources;
56558
56591
  }, function(queried) {
56559
56592
  return async function(data) {
56560
- return await queried.promise(data);
56593
+ return queried.promise(data);
56561
56594
  };
56562
56595
  }),
56563
56596
  registerRsdoctorPluginAssetsTaps: createTap(external_rspack_wasi_browser_js_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
56564
56597
  return RsdoctorPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).assets;
56565
56598
  }, function(queried) {
56566
56599
  return async function(data) {
56567
- return await queried.promise(data);
56600
+ return queried.promise(data);
56568
56601
  };
56569
56602
  })
56570
56603
  });
@@ -56829,16 +56862,16 @@ class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
56829
56862
  'async-node'
56830
56863
  ].includes(compiler.options.output.chunkLoading)) return;
56831
56864
  const hwpHooks = getHooks(compilation);
56832
- hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>{
56865
+ hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, (data)=>{
56833
56866
  self1.handleHwpPluginArgs(data);
56834
- return data;
56867
+ return Promise.resolve(data);
56835
56868
  });
56836
56869
  hwpHooks.alterAssetTagGroups.tapPromise({
56837
56870
  name: SubresourceIntegrityPlugin_PLUGIN_NAME,
56838
56871
  stage: 10000
56839
- }, async (data)=>{
56872
+ }, (data)=>{
56840
56873
  self1.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading);
56841
- return data;
56874
+ return Promise.resolve(data);
56842
56875
  });
56843
56876
  });
56844
56877
  }
@@ -58082,6 +58115,7 @@ const applyRspackOptionsDefaults = (options)=>{
58082
58115
  outputModule: options.experiments.outputModule,
58083
58116
  entry: options.entry
58084
58117
  });
58118
+ applybundlerInfoDefaults(options.experiments.rspackFuture, options.output.library);
58085
58119
  applyExternalsPresetsDefaults(options.externalsPresets, {
58086
58120
  targetProperties,
58087
58121
  buildHttp: Boolean(options.experiments.buildHttp)
@@ -58158,12 +58192,24 @@ const applyExperimentsDefaults = (experiments, { development })=>{
58158
58192
  D(experiments.incremental, 'chunksRender', true);
58159
58193
  D(experiments.incremental, 'emitAssets', true);
58160
58194
  }
58195
+ D(experiments, 'rspackFuture', {});
58196
+ D(experiments, 'parallelLoader', false);
58161
58197
  D(experiments, 'useInputFileSystem', false);
58162
58198
  D(experiments, 'inlineConst', true);
58163
58199
  D(experiments, 'inlineEnum', false);
58164
58200
  D(experiments, 'typeReexportsPresence', false);
58165
58201
  D(experiments, 'lazyBarrel', true);
58166
58202
  };
58203
+ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58204
+ if ('object' == typeof rspackFuture) {
58205
+ D(rspackFuture, 'bundlerInfo', {});
58206
+ if ('object' == typeof rspackFuture.bundlerInfo) {
58207
+ D(rspackFuture.bundlerInfo, 'version', "1.7.2-canary-29642b28-20260108182846");
58208
+ D(rspackFuture.bundlerInfo, 'bundler', 'rspack');
58209
+ D(rspackFuture.bundlerInfo, 'force', !library);
58210
+ }
58211
+ }
58212
+ };
58167
58213
  const applySnapshotDefaults = (_snapshot, _env)=>{};
58168
58214
  const applyJavascriptParserOptionsDefaults = (parserOptions, { deferImport })=>{
58169
58215
  D(parserOptions, 'dynamicImportMode', 'lazy');
@@ -58545,6 +58591,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
58545
58591
  D(output, 'workerPublicPath', '');
58546
58592
  D(output, 'sourceMapFilename', '[file].map[query]');
58547
58593
  F(output, "scriptType", ()=>output.module ? 'module' : false);
58594
+ D(output, 'charset', false);
58548
58595
  D(output, 'chunkLoadTimeout', 120000);
58549
58596
  const { trustedTypes } = output;
58550
58597
  if (trustedTypes) {
@@ -58581,12 +58628,6 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
58581
58628
  });
58582
58629
  return Array.from(enabledWasmLoadingTypes);
58583
58630
  });
58584
- D(output, 'bundlerInfo', {});
58585
- if ('object' == typeof output.bundlerInfo) {
58586
- D(output.bundlerInfo, 'version', "1.7.2-canary-4b68b9c2-20260107123726");
58587
- D(output.bundlerInfo, 'bundler', 'rspack');
58588
- D(output.bundlerInfo, 'force', !output.library);
58589
- }
58590
58631
  };
58591
58632
  const applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp })=>{
58592
58633
  D(externalsPresets, 'web', !buildHttp && targetProperties?.web);
@@ -58971,9 +59012,9 @@ const getNormalizedRspackOptions = (config)=>({
58971
59012
  devtoolModuleFilenameTemplate: output.devtoolModuleFilenameTemplate,
58972
59013
  devtoolFallbackModuleFilenameTemplate: output.devtoolFallbackModuleFilenameTemplate,
58973
59014
  chunkLoadTimeout: output.chunkLoadTimeout,
59015
+ charset: output.charset,
58974
59016
  environment: cloneObject(output.environment),
58975
- compareBeforeEmit: output.compareBeforeEmit,
58976
- bundlerInfo: output.bundlerInfo
59017
+ compareBeforeEmit: output.compareBeforeEmit
58977
59018
  };
58978
59019
  }),
58979
59020
  resolve: nestedConfig(config.resolve, (resolve)=>({
@@ -59082,6 +59123,7 @@ const getNormalizedRspackOptions = (config)=>({
59082
59123
  lazyCompilation: optionalNestedConfig(experiments.lazyCompilation, (options)=>true === options ? {} : options),
59083
59124
  incremental: optionalNestedConfig(experiments.incremental, (options)=>getNormalizedIncrementalOptions(options)),
59084
59125
  buildHttp: experiments.buildHttp,
59126
+ parallelLoader: experiments.parallelLoader,
59085
59127
  useInputFileSystem: experiments.useInputFileSystem
59086
59128
  };
59087
59129
  }),
@@ -59766,26 +59808,25 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
59766
59808
  this.close = memoizeFn(()=>util_0_default().promisify(fs.close.bind(fs)));
59767
59809
  this.write = memoizeFn(()=>{
59768
59810
  const writeFn = util_0_default().promisify(fs.write.bind(fs));
59769
- return async (fd, content, position)=>await writeFn(fd, content, {
59811
+ return async (fd, content, position)=>writeFn(fd, content, {
59770
59812
  position
59771
59813
  });
59772
59814
  });
59773
59815
  this.writeAll = memoizeFn(()=>{
59774
59816
  const writeFn = util_0_default().promisify(fs.writeFile.bind(fs));
59775
- return async (fd, content)=>await writeFn(fd, content);
59817
+ return async (fd, content)=>writeFn(fd, content);
59776
59818
  });
59777
59819
  this.read = memoizeFn(()=>{
59778
59820
  const readFn = fs.read.bind(fs);
59779
- return async (fd, length, position)=>{
59780
- new Promise((resolve)=>{
59821
+ return (fd, length, position)=>new Promise((resolve, reject)=>{
59781
59822
  readFn(fd, {
59782
59823
  position,
59783
59824
  length
59784
59825
  }, (err, _bytesRead, buffer)=>{
59785
- err ? resolve(err) : resolve(buffer);
59826
+ if (err) reject(err);
59827
+ else resolve(buffer);
59786
59828
  });
59787
59829
  });
59788
- };
59789
59830
  });
59790
59831
  this.readUntil = memoizeFn(()=>async (fd, delim, position)=>{
59791
59832
  const res = [];
@@ -60431,7 +60472,7 @@ class MultiStats {
60431
60472
  return obj;
60432
60473
  });
60433
60474
  if (childOptions.version) {
60434
- obj.rspackVersion = "1.7.2-canary-4b68b9c2-20260107123726";
60475
+ obj.rspackVersion = "1.7.2-canary-29642b28-20260108182846";
60435
60476
  obj.version = "5.75.0";
60436
60477
  }
60437
60478
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
@@ -62263,7 +62304,7 @@ const SIMPLE_EXTRACTORS = {
62263
62304
  },
62264
62305
  version: (object)=>{
62265
62306
  object.version = "5.75.0";
62266
- object.rspackVersion = "1.7.2-canary-4b68b9c2-20260107123726";
62307
+ object.rspackVersion = "1.7.2-canary-29642b28-20260108182846";
62267
62308
  },
62268
62309
  env: (object, _compilation, _context, { _env })=>{
62269
62310
  object.env = _env;
@@ -63912,7 +63953,7 @@ class RspackOptionsApply {
63912
63953
  assertNotNill(options.context);
63913
63954
  compiler.hooks.entryOption.call(options.context, options.entry);
63914
63955
  new RuntimePlugin().apply(compiler);
63915
- if (options.output.bundlerInfo) new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler);
63956
+ if (options.experiments.rspackFuture.bundlerInfo) new BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler);
63916
63957
  new InferAsyncModulesPlugin().apply(compiler);
63917
63958
  new APIPlugin().apply(compiler);
63918
63959
  new DataUriPlugin().apply(compiler);
@@ -64291,8 +64332,11 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64291
64332
  return getCompiler().__internal__get_compilation().hooks.runtimeModule;
64292
64333
  }, function(queried) {
64293
64334
  return function({ module: module1, chunk }) {
64335
+ const runtimeModule = createRenderedRuntimeModule(module1);
64336
+ const compilation = getCompiler().__internal__get_compilation();
64337
+ runtimeModule.attach(compilation, chunk, compilation.chunkGraph);
64294
64338
  const originSource = module1.source?.source;
64295
- queried.call(module1, chunk);
64339
+ queried.call(runtimeModule, chunk);
64296
64340
  const newSource = module1.source?.source;
64297
64341
  if (newSource && newSource !== originSource) return module1;
64298
64342
  };
@@ -64368,7 +64412,7 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64368
64412
  return getCompiler().__internal__get_compilation().hooks.finishModules;
64369
64413
  }, function(queried) {
64370
64414
  return async function() {
64371
- return await queried.promise(getCompiler().__internal__get_compilation().modules);
64415
+ return queried.promise(getCompiler().__internal__get_compilation().modules);
64372
64416
  };
64373
64417
  }),
64374
64418
  registerCompilationOptimizeModulesTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationOptimizeModules, function() {
@@ -64389,14 +64433,14 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64389
64433
  return getCompiler().__internal__get_compilation().hooks.optimizeTree;
64390
64434
  }, function(queried) {
64391
64435
  return async function() {
64392
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
64436
+ return queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
64393
64437
  };
64394
64438
  }),
64395
64439
  registerCompilationOptimizeChunkModulesTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
64396
64440
  return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
64397
64441
  }, function(queried) {
64398
64442
  return async function() {
64399
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
64443
+ return queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
64400
64444
  };
64401
64445
  }),
64402
64446
  registerCompilationChunkHashTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationChunkHash, function() {
@@ -64422,7 +64466,7 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64422
64466
  return getCompiler().__internal__get_compilation().hooks.processAssets;
64423
64467
  }, function(queried) {
64424
64468
  return async function() {
64425
- return await queried.promise(getCompiler().__internal__get_compilation().assets);
64469
+ return queried.promise(getCompiler().__internal__get_compilation().assets);
64426
64470
  };
64427
64471
  }),
64428
64472
  registerCompilationAfterProcessAssetsTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationAfterProcessAssets, function() {
@@ -64443,7 +64487,7 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64443
64487
  return getCompiler().__internal__get_compilation().hooks.afterSeal;
64444
64488
  }, function(queried) {
64445
64489
  return async function() {
64446
- return await queried.promise();
64490
+ return queried.promise();
64447
64491
  };
64448
64492
  })
64449
64493
  });
@@ -64467,14 +64511,14 @@ const createCompilerHooksRegisters = (getCompiler, createTap)=>({
64467
64511
  return getCompiler().hooks.make;
64468
64512
  }, function(queried) {
64469
64513
  return async function() {
64470
- return await queried.promise(getCompiler().__internal__get_compilation());
64514
+ return queried.promise(getCompiler().__internal__get_compilation());
64471
64515
  };
64472
64516
  }),
64473
64517
  registerCompilerFinishMakeTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilerFinishMake, function() {
64474
64518
  return getCompiler().hooks.finishMake;
64475
64519
  }, function(queried) {
64476
64520
  return async function() {
64477
- return await queried.promise(getCompiler().__internal__get_compilation());
64521
+ return queried.promise(getCompiler().__internal__get_compilation());
64478
64522
  };
64479
64523
  }),
64480
64524
  registerCompilerShouldEmitTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilerShouldEmit, function() {
@@ -64488,14 +64532,14 @@ const createCompilerHooksRegisters = (getCompiler, createTap)=>({
64488
64532
  return getCompiler().hooks.emit;
64489
64533
  }, function(queried) {
64490
64534
  return async function() {
64491
- return await queried.promise(getCompiler().__internal__get_compilation());
64535
+ return queried.promise(getCompiler().__internal__get_compilation());
64492
64536
  };
64493
64537
  }),
64494
64538
  registerCompilerAfterEmitTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilerAfterEmit, function() {
64495
64539
  return getCompiler().hooks.afterEmit;
64496
64540
  }, function(queried) {
64497
64541
  return async function() {
64498
- return await queried.promise(getCompiler().__internal__get_compilation());
64542
+ return queried.promise(getCompiler().__internal__get_compilation());
64499
64543
  };
64500
64544
  }),
64501
64545
  registerCompilerAssetEmittedTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilerAssetEmitted, function() {
@@ -66930,7 +66974,7 @@ function transformSync(source, options) {
66930
66974
  const _options = JSON.stringify(options || {});
66931
66975
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66932
66976
  }
66933
- const exports_rspackVersion = "1.7.2-canary-4b68b9c2-20260107123726";
66977
+ const exports_rspackVersion = "1.7.2-canary-29642b28-20260108182846";
66934
66978
  const exports_version = "5.75.0";
66935
66979
  const exports_WebpackError = Error;
66936
66980
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -66993,11 +67037,12 @@ const exports_experiments = {
66993
67037
  },
66994
67038
  async cleanup () {
66995
67039
  await trace_JavaScriptTracer.cleanupJavaScriptTrace();
66996
- await (0, external_rspack_wasi_browser_js_.syncTraceEvent)(trace_JavaScriptTracer.events);
67040
+ (0, external_rspack_wasi_browser_js_.syncTraceEvent)(trace_JavaScriptTracer.events);
66997
67041
  (0, external_rspack_wasi_browser_js_.cleanupGlobalTrace)();
66998
67042
  }
66999
67043
  },
67000
67044
  RemoveDuplicateModulesPlugin: RemoveDuplicateModulesPlugin,
67045
+ SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
67001
67046
  EsmLibraryPlugin: EsmLibraryPlugin,
67002
67047
  RsdoctorPlugin: RsdoctorPlugin,
67003
67048
  RstestPlugin: RstestPlugin,
@@ -1205,6 +1205,8 @@ export interface JsRuntimeModule {
1205
1205
  moduleIdentifier: string
1206
1206
  constructorName: string
1207
1207
  name: string
1208
+ stage: number
1209
+ isolate: boolean
1208
1210
  }
1209
1211
 
1210
1212
  export interface JsRuntimeModuleArg {
@@ -2132,6 +2134,7 @@ export interface RawExperimentCacheOptionsPersistent {
2132
2134
  export interface RawExperiments {
2133
2135
  topLevelAwait: boolean
2134
2136
  incremental?: false | { [key: string]: boolean }
2137
+ rspackFuture?: RawRspackFuture
2135
2138
  cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
2136
2139
  useInputFileSystem?: false | Array<RegExp>
2137
2140
  css?: boolean
@@ -2239,6 +2242,7 @@ export interface RawHtmlRspackPluginOptions {
2239
2242
  chunks?: Array<string>
2240
2243
  excludeChunks?: Array<string>
2241
2244
  chunksSortMode: "auto" | "manual"
2245
+ sri?: "sha256" | "sha384" | "sha512"
2242
2246
  minify?: boolean
2243
2247
  title?: string
2244
2248
  favicon?: string
@@ -2634,6 +2638,7 @@ export interface RawOutputOptions {
2634
2638
  module: boolean
2635
2639
  chunkLoading: string | false
2636
2640
  chunkLoadTimeout: number
2641
+ charset: boolean
2637
2642
  enabledChunkLoadingTypes?: Array<string>
2638
2643
  trustedTypes?: RawTrustedTypes
2639
2644
  sourceMapFilename: string
@@ -2778,11 +2783,16 @@ export interface RawRslibPluginOptions {
2778
2783
  forceNodeShims?: boolean
2779
2784
  }
2780
2785
 
2786
+ export interface RawRspackFuture {
2787
+
2788
+ }
2789
+
2781
2790
  export interface RawRstestPluginOptions {
2782
2791
  injectModulePathName: boolean
2783
2792
  importMetaPathName: boolean
2784
2793
  hoistMockModule: boolean
2785
2794
  manualMockRoot: string
2795
+ preserveNewUrl?: Array<string>
2786
2796
  }
2787
2797
 
2788
2798
  export interface RawRuleSetCondition {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.7.2-canary-4b68b9c2-20260107123726",
3
+ "version": "1.7.2-canary-29642b28-20260108182846",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",