@rspack/browser 1.7.7 → 1.7.8

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.
@@ -162,6 +162,7 @@ export declare class Compilation {
162
162
  Iterable<Chunk>,
163
163
  Iterable<Module>
164
164
  ], void>;
165
+ beforeModuleIds: liteTapable.SyncHook<[Iterable<Module>]>;
165
166
  finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
166
167
  chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
167
168
  chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
package/dist/index.mjs CHANGED
@@ -52665,6 +52665,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
52665
52665
  'chunks',
52666
52666
  'modules'
52667
52667
  ]),
52668
+ beforeModuleIds: new SyncHook([
52669
+ 'modules'
52670
+ ]),
52668
52671
  finishModules: new AsyncSeriesHook([
52669
52672
  'modules'
52670
52673
  ]),
@@ -58150,7 +58153,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58150
58153
  if ('object' == typeof rspackFuture) {
58151
58154
  D(rspackFuture, 'bundlerInfo', {});
58152
58155
  if ('object' == typeof rspackFuture.bundlerInfo) {
58153
- D(rspackFuture.bundlerInfo, 'version', "1.7.7");
58156
+ D(rspackFuture.bundlerInfo, 'version', "1.7.8");
58154
58157
  D(rspackFuture.bundlerInfo, 'bundler', 'rspack');
58155
58158
  D(rspackFuture.bundlerInfo, 'force', !library);
58156
58159
  }
@@ -60420,7 +60423,7 @@ class MultiStats {
60420
60423
  return obj;
60421
60424
  });
60422
60425
  if (childOptions.version) {
60423
- obj.rspackVersion = "1.7.7";
60426
+ obj.rspackVersion = "1.7.8";
60424
60427
  obj.version = "5.75.0";
60425
60428
  }
60426
60429
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
@@ -62260,7 +62263,7 @@ const SIMPLE_EXTRACTORS = {
62260
62263
  },
62261
62264
  version: (object)=>{
62262
62265
  object.version = "5.75.0";
62263
- object.rspackVersion = "1.7.7";
62266
+ object.rspackVersion = "1.7.8";
62264
62267
  },
62265
62268
  env: (object, _compilation, _context, { _env })=>{
62266
62269
  object.env = _env;
@@ -64399,6 +64402,38 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
64399
64402
  return queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
64400
64403
  };
64401
64404
  }),
64405
+ registerCompilationBeforeModuleIdsTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationBeforeModuleIds, function() {
64406
+ return getCompiler().__internal__get_compilation().hooks.beforeModuleIds;
64407
+ }, function(queried) {
64408
+ return function(arg) {
64409
+ const compilation = getCompiler().__internal__get_compilation();
64410
+ const assignments = new Map();
64411
+ const modulesByIdentifier = new Map();
64412
+ for (const module of compilation.modules)modulesByIdentifier.set(module.identifier(), module);
64413
+ const proxiedModules = arg.modules.map((m)=>{
64414
+ const realModule = modulesByIdentifier.get(m.identifier);
64415
+ return new Proxy(realModule, {
64416
+ get (target, prop) {
64417
+ if ('id' === prop) return assignments.get(m.identifier) ?? null;
64418
+ if ('identifier' === prop) return m.identifier;
64419
+ const value = Reflect.get(target, prop);
64420
+ return 'function' == typeof value ? value.bind(target) : value;
64421
+ },
64422
+ set (_target, prop, value) {
64423
+ if ('id' === prop && ('string' == typeof value || 'number' == typeof value)) {
64424
+ assignments.set(m.identifier, value);
64425
+ return true;
64426
+ }
64427
+ return false;
64428
+ }
64429
+ });
64430
+ });
64431
+ queried.call(proxiedModules);
64432
+ return {
64433
+ assignments: Object.fromEntries(assignments.entries())
64434
+ };
64435
+ };
64436
+ }),
64402
64437
  registerCompilationChunkHashTaps: createTap(external_rspack_wasi_browser_js_["default"].RegisterJsTapKind.CompilationChunkHash, function() {
64403
64438
  return getCompiler().__internal__get_compilation().hooks.chunkHash;
64404
64439
  }, function(queried) {
@@ -66949,7 +66984,7 @@ function transformSync(source, options) {
66949
66984
  const _options = JSON.stringify(options || {});
66950
66985
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66951
66986
  }
66952
- const exports_rspackVersion = "1.7.7";
66987
+ const exports_rspackVersion = "1.7.8";
66953
66988
  const exports_version = "5.75.0";
66954
66989
  const exports_WebpackError = Error;
66955
66990
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -707,6 +707,14 @@ export interface JsBeforeEmitData {
707
707
  uid?: number
708
708
  }
709
709
 
710
+ export interface JsBeforeModuleIdsArg {
711
+ modules: Array<JsModuleForIds>
712
+ }
713
+
714
+ export interface JsBeforeModuleIdsResult {
715
+ assignments: Record<string, string | number>
716
+ }
717
+
710
718
  export interface JsBuildMeta {
711
719
  strictEsmModule?: boolean
712
720
  hasTopLevelAwait?: boolean
@@ -970,6 +978,10 @@ export interface JsModuleDescriptor {
970
978
  id?: string | number | null
971
979
  }
972
980
 
981
+ export interface JsModuleForIds {
982
+ identifier: string
983
+ }
984
+
973
985
  export interface JsNormalModuleFactoryCreateModuleArgs {
974
986
  dependencyType: string
975
987
  rawRequest: string
@@ -1093,6 +1105,11 @@ export interface JsRsdoctorExportInfo {
1093
1105
  sideEffects: Array<number>
1094
1106
  }
1095
1107
 
1108
+ export interface JsRsdoctorJsonModuleSize {
1109
+ identifier: string
1110
+ size: number
1111
+ }
1112
+
1096
1113
  export interface JsRsdoctorModule {
1097
1114
  ukey: number
1098
1115
  identifier: string
@@ -1141,6 +1158,7 @@ export interface JsRsdoctorModuleOriginalSource {
1141
1158
 
1142
1159
  export interface JsRsdoctorModuleSourcesPatch {
1143
1160
  moduleOriginalSources: Array<JsRsdoctorModuleOriginalSource>
1161
+ jsonModuleSizes: Array<JsRsdoctorJsonModuleSize>
1144
1162
  }
1145
1163
 
1146
1164
  export interface JsRsdoctorSideEffect {
@@ -2962,39 +2980,40 @@ export declare enum RegisterJsTapKind {
2962
2980
  CompilationAfterOptimizeModules = 14,
2963
2981
  CompilationOptimizeTree = 15,
2964
2982
  CompilationOptimizeChunkModules = 16,
2965
- CompilationAdditionalTreeRuntimeRequirements = 17,
2966
- CompilationRuntimeRequirementInTree = 18,
2967
- CompilationRuntimeModule = 19,
2968
- CompilationChunkHash = 20,
2969
- CompilationChunkAsset = 21,
2970
- CompilationProcessAssets = 22,
2971
- CompilationAfterProcessAssets = 23,
2972
- CompilationSeal = 24,
2973
- CompilationAfterSeal = 25,
2974
- NormalModuleFactoryBeforeResolve = 26,
2975
- NormalModuleFactoryFactorize = 27,
2976
- NormalModuleFactoryResolve = 28,
2977
- NormalModuleFactoryAfterResolve = 29,
2978
- NormalModuleFactoryCreateModule = 30,
2979
- NormalModuleFactoryResolveForScheme = 31,
2980
- ContextModuleFactoryBeforeResolve = 32,
2981
- ContextModuleFactoryAfterResolve = 33,
2982
- JavascriptModulesChunkHash = 34,
2983
- HtmlPluginBeforeAssetTagGeneration = 35,
2984
- HtmlPluginAlterAssetTags = 36,
2985
- HtmlPluginAlterAssetTagGroups = 37,
2986
- HtmlPluginAfterTemplateExecution = 38,
2987
- HtmlPluginBeforeEmit = 39,
2988
- HtmlPluginAfterEmit = 40,
2989
- RuntimePluginCreateScript = 41,
2990
- RuntimePluginCreateLink = 42,
2991
- RuntimePluginLinkPreload = 43,
2992
- RuntimePluginLinkPrefetch = 44,
2993
- RsdoctorPluginModuleGraph = 45,
2994
- RsdoctorPluginChunkGraph = 46,
2995
- RsdoctorPluginModuleIds = 47,
2996
- RsdoctorPluginModuleSources = 48,
2997
- RsdoctorPluginAssets = 49
2983
+ CompilationBeforeModuleIds = 17,
2984
+ CompilationAdditionalTreeRuntimeRequirements = 18,
2985
+ CompilationRuntimeRequirementInTree = 19,
2986
+ CompilationRuntimeModule = 20,
2987
+ CompilationChunkHash = 21,
2988
+ CompilationChunkAsset = 22,
2989
+ CompilationProcessAssets = 23,
2990
+ CompilationAfterProcessAssets = 24,
2991
+ CompilationSeal = 25,
2992
+ CompilationAfterSeal = 26,
2993
+ NormalModuleFactoryBeforeResolve = 27,
2994
+ NormalModuleFactoryFactorize = 28,
2995
+ NormalModuleFactoryResolve = 29,
2996
+ NormalModuleFactoryAfterResolve = 30,
2997
+ NormalModuleFactoryCreateModule = 31,
2998
+ NormalModuleFactoryResolveForScheme = 32,
2999
+ ContextModuleFactoryBeforeResolve = 33,
3000
+ ContextModuleFactoryAfterResolve = 34,
3001
+ JavascriptModulesChunkHash = 35,
3002
+ HtmlPluginBeforeAssetTagGeneration = 36,
3003
+ HtmlPluginAlterAssetTags = 37,
3004
+ HtmlPluginAlterAssetTagGroups = 38,
3005
+ HtmlPluginAfterTemplateExecution = 39,
3006
+ HtmlPluginBeforeEmit = 40,
3007
+ HtmlPluginAfterEmit = 41,
3008
+ RuntimePluginCreateScript = 42,
3009
+ RuntimePluginCreateLink = 43,
3010
+ RuntimePluginLinkPreload = 44,
3011
+ RuntimePluginLinkPrefetch = 45,
3012
+ RsdoctorPluginModuleGraph = 46,
3013
+ RsdoctorPluginChunkGraph = 47,
3014
+ RsdoctorPluginModuleIds = 48,
3015
+ RsdoctorPluginModuleSources = 49,
3016
+ RsdoctorPluginAssets = 50
2998
3017
  }
2999
3018
 
3000
3019
  export interface RegisterJsTaps {
@@ -3018,6 +3037,7 @@ export interface RegisterJsTaps {
3018
3037
  registerCompilationAfterOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
3019
3038
  registerCompilationOptimizeTreeTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
3020
3039
  registerCompilationOptimizeChunkModulesTaps: (stages: Array<number>) => Array<{ function: (() => Promise<boolean | undefined>); stage: number; }>
3040
+ registerCompilationBeforeModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeModuleIdsArg) => JsBeforeModuleIdsResult); stage: number; }>
3021
3041
  registerCompilationChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
3022
3042
  registerCompilationChunkAssetTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }>
3023
3043
  registerCompilationProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/browser",
3
- "version": "1.7.7",
3
+ "version": "1.7.8",
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.",