@rspack-canary/core 1.6.0-canary-bf68c45d-20251028142310 → 1.6.0-canary-34fbd33e-20251029061020

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/dist/index.js CHANGED
@@ -1218,22 +1218,22 @@ for(var __webpack_i__ in (()=>{
1218
1218
  };
1219
1219
  }
1220
1220
  var index_js_ = __webpack_require__("webpack-sources");
1221
- class JsSource extends index_js_.Source {
1222
- static __from_binding(source) {
1223
- return Buffer.isBuffer(source.source) || !source.map ? new index_js_.RawSource(source.source) : new index_js_.SourceMapSource(source.source, "inmemory://from rust", source.map);
1224
- }
1225
- static __to_binding(source) {
1226
- if (source instanceof index_js_.RawSource) return source.isBuffer() ? {
1227
- source: source.buffer()
1228
- } : {
1229
- source: source.source()
1221
+ class SourceAdapter {
1222
+ static fromBinding(source) {
1223
+ return source.map ? new index_js_.SourceMapSource(source.source, "inmemory://from rust", source.map) : new index_js_.RawSource(source.source);
1224
+ }
1225
+ static toBinding(source) {
1226
+ let content = source.source();
1227
+ if (Buffer.isBuffer(content)) return {
1228
+ source: content,
1229
+ map: void 0
1230
1230
  };
1231
- let map = JSON.stringify(source.map?.({
1231
+ let map = source.map?.({
1232
1232
  columns: !0
1233
- })), code = source.source();
1233
+ });
1234
1234
  return {
1235
- source: "string" == typeof code ? code : Buffer.from(code).toString("utf-8"),
1236
- map
1235
+ source: content,
1236
+ map: map ? JSON.stringify(map) : void 0
1237
1237
  };
1238
1238
  }
1239
1239
  }
@@ -1375,7 +1375,7 @@ for(var __webpack_i__ in (()=>{
1375
1375
  configurable: !0,
1376
1376
  value (sourceType) {
1377
1377
  let originalSource = this._get(sourceType);
1378
- return originalSource ? JsSource.__from_binding(originalSource) : null;
1378
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
1379
1379
  }
1380
1380
  });
1381
1381
  let $proxy = Symbol.for("proxy");
@@ -1671,11 +1671,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1671
1671
  updateAsset(filename, newSourceOrFunction, assetInfoUpdateOrFunction) {
1672
1672
  let compatNewSourceOrFunction;
1673
1673
  compatNewSourceOrFunction = "function" == typeof newSourceOrFunction ? function(source) {
1674
- return JsSource.__to_binding(newSourceOrFunction(JsSource.__from_binding(source)));
1675
- } : JsSource.__to_binding(newSourceOrFunction), this.#inner.updateAsset(filename, compatNewSourceOrFunction, assetInfoUpdateOrFunction);
1674
+ return SourceAdapter.toBinding(newSourceOrFunction(SourceAdapter.fromBinding(source)));
1675
+ } : SourceAdapter.toBinding(newSourceOrFunction), this.#inner.updateAsset(filename, compatNewSourceOrFunction, assetInfoUpdateOrFunction);
1676
1676
  }
1677
1677
  emitAsset(filename, source, assetInfo) {
1678
- this.#inner.emitAsset(filename, JsSource.__to_binding(source), assetInfo);
1678
+ this.#inner.emitAsset(filename, SourceAdapter.toBinding(source), assetInfo);
1679
1679
  }
1680
1680
  deleteAsset(filename) {
1681
1681
  this.#inner.deleteAsset(filename);
@@ -1848,10 +1848,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1848
1848
  }
1849
1849
  __internal__getAssetSource(filename) {
1850
1850
  let rawSource = this.#inner.getAssetSource(filename);
1851
- if (rawSource) return JsSource.__from_binding(rawSource);
1851
+ if (rawSource) return SourceAdapter.fromBinding(rawSource);
1852
1852
  }
1853
1853
  __internal__setAssetSource(filename, source) {
1854
- this.#inner.setAssetSource(filename, JsSource.__to_binding(source));
1854
+ this.#inner.setAssetSource(filename, SourceAdapter.toBinding(source));
1855
1855
  }
1856
1856
  __internal__deleteAssetSource(filename) {
1857
1857
  this.#inner.deleteAssetSource(filename);
@@ -2566,13 +2566,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2566
2566
  configurable: !0,
2567
2567
  value () {
2568
2568
  let originalSource = this._originalSource();
2569
- return originalSource ? JsSource.__from_binding(originalSource) : null;
2569
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
2570
2570
  }
2571
2571
  }), Object.defineProperty(binding_default().NormalModule.prototype, "emitFile", {
2572
2572
  enumerable: !0,
2573
2573
  configurable: !0,
2574
2574
  value (filename, source, assetInfo) {
2575
- return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
2575
+ return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
2576
2576
  }
2577
2577
  });
2578
2578
  let deprecateAllProperties = (obj, message, code)=>{
@@ -5745,7 +5745,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5745
5745
  }, applyExperimentsDefaults = (experiments, { development })=>{
5746
5746
  F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
5747
5747
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5748
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-bf68c45d-20251028142310"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5748
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-34fbd33e-20251029061020"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5749
5749
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5750
5750
  if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { usedExports, inlineConst, deferImport })=>{
5751
5751
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
@@ -7251,13 +7251,13 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7251
7251
  configurable: !0,
7252
7252
  value () {
7253
7253
  let originalSource = this._originalSource();
7254
- return originalSource ? JsSource.__from_binding(originalSource) : null;
7254
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
7255
7255
  }
7256
7256
  }), Object.defineProperty(binding_default().Module.prototype, "emitFile", {
7257
7257
  enumerable: !0,
7258
7258
  configurable: !0,
7259
7259
  value (filename, source, assetInfo) {
7260
- return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
7260
+ return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
7261
7261
  }
7262
7262
  });
7263
7263
  let traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
@@ -7391,7 +7391,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7391
7391
  });
7392
7392
  }
7393
7393
  }
7394
- let CORE_VERSION = "1.6.0-canary-bf68c45d-20251028142310", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7394
+ let CORE_VERSION = "1.6.0-canary-34fbd33e-20251029061020", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7395
7395
 
7396
7396
  Help:
7397
7397
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -8682,7 +8682,7 @@ Help:
8682
8682
  obj.children = this.stats.map((stat, idx)=>{
8683
8683
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8684
8684
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8685
- }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-bf68c45d-20251028142310", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8685
+ }), childOptions.version && (obj.rspackVersion = "1.6.0-canary-34fbd33e-20251029061020", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8686
8686
  let mapError = (j, obj)=>({
8687
8687
  ...obj,
8688
8688
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9581,7 +9581,7 @@ Help:
9581
9581
  object.hash = context.getStatsCompilation(compilation).hash;
9582
9582
  },
9583
9583
  version: (object)=>{
9584
- object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-bf68c45d-20251028142310";
9584
+ object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-34fbd33e-20251029061020";
9585
9585
  },
9586
9586
  env: (object, _compilation, _context, { _env })=>{
9587
9587
  object.env = _env;
@@ -10980,13 +10980,13 @@ Help:
10980
10980
  configurable: !0,
10981
10981
  value () {
10982
10982
  let originalSource = this._originalSource();
10983
- return originalSource ? JsSource.__from_binding(originalSource) : null;
10983
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
10984
10984
  }
10985
10985
  }), Object.defineProperty(binding_default().ConcatenatedModule.prototype, "emitFile", {
10986
10986
  enumerable: !0,
10987
10987
  configurable: !0,
10988
10988
  value (filename, source, assetInfo) {
10989
- return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
10989
+ return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
10990
10990
  }
10991
10991
  }), Object.defineProperty(binding_default().ContextModule.prototype, "identifier", {
10992
10992
  enumerable: !0,
@@ -10999,13 +10999,13 @@ Help:
10999
10999
  configurable: !0,
11000
11000
  value () {
11001
11001
  let originalSource = this._originalSource();
11002
- return originalSource ? JsSource.__from_binding(originalSource) : null;
11002
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
11003
11003
  }
11004
11004
  }), Object.defineProperty(binding_default().ContextModule.prototype, "emitFile", {
11005
11005
  enumerable: !0,
11006
11006
  configurable: !0,
11007
11007
  value (filename, source, assetInfo) {
11008
- return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
11008
+ return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
11009
11009
  }
11010
11010
  }), Object.defineProperty(binding_default().ExternalModule.prototype, "identifier", {
11011
11011
  enumerable: !0,
@@ -11018,13 +11018,13 @@ Help:
11018
11018
  configurable: !0,
11019
11019
  value () {
11020
11020
  let originalSource = this._originalSource();
11021
- return originalSource ? JsSource.__from_binding(originalSource) : null;
11021
+ return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
11022
11022
  }
11023
11023
  }), Object.defineProperty(binding_default().ExternalModule.prototype, "emitFile", {
11024
11024
  enumerable: !0,
11025
11025
  configurable: !0,
11026
11026
  value (filename, source, assetInfo) {
11027
- return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
11027
+ return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
11028
11028
  }
11029
11029
  });
11030
11030
  let asRegExp = (test)=>"string" == typeof test ? RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")}`) : test, matchPart = (str, test)=>!test || (Array.isArray(test) ? test.map(asRegExp).some((regExp)=>regExp.test(str)) : asRegExp(test).test(str)), matchObject = (obj, str)=>!(obj.test && !matchPart(str, obj.test) || obj.include && !matchPart(str, obj.include) || obj.exclude && matchPart(str, obj.exclude)), FlagAllModulesAsUsedPlugin = base_create(binding_.BuiltinPluginName.FlagAllModulesAsUsedPlugin, (explanation)=>({
@@ -11685,7 +11685,7 @@ Help:
11685
11685
  let _options = JSON.stringify(options || {});
11686
11686
  return binding_default().transform(source, _options);
11687
11687
  }
11688
- let exports_rspackVersion = "1.6.0-canary-bf68c45d-20251028142310", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11688
+ let exports_rspackVersion = "1.6.0-canary-34fbd33e-20251029061020", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
11689
11689
  getNormalizedRspackOptions: getNormalizedRspackOptions,
11690
11690
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
11691
11691
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -1,7 +1,6 @@
1
- import type { JsCompatSourceOwned } from "@rspack/binding";
2
- import { Source } from "../../compiled/webpack-sources";
3
- declare class JsSource extends Source {
4
- static __from_binding(source: JsCompatSourceOwned): Source;
5
- static __to_binding(source: Source): JsCompatSourceOwned;
1
+ import type { JsSource } from "@rspack/binding";
2
+ import { type Source } from "../../compiled/webpack-sources";
3
+ export declare class SourceAdapter {
4
+ static fromBinding(source: JsSource): Source;
5
+ static toBinding(source: Source): JsSource;
6
6
  }
7
- export { JsSource };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.6.0-canary-bf68c45d-20251028142310",
3
+ "version": "1.6.0-canary-34fbd33e-20251029061020",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,12 +37,12 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.39.6",
40
+ "@ast-grep/napi": "^0.39.7",
41
41
  "@napi-rs/wasm-runtime": "1.0.7",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
43
43
  "@rslib/core": "0.16.1",
44
44
  "@swc/types": "0.1.25",
45
- "@types/node": "^20.19.23",
45
+ "@types/node": "^20.19.24",
46
46
  "@types/watchpack": "^2.4.4",
47
47
  "browserslist-load-config": "^1.0.1",
48
48
  "enhanced-resolve": "5.18.3",
@@ -56,9 +56,9 @@
56
56
  "webpack-sources": "3.3.3"
57
57
  },
58
58
  "dependencies": {
59
- "@module-federation/runtime-tools": "0.21.1",
59
+ "@module-federation/runtime-tools": "0.21.2",
60
60
  "@rspack/lite-tapable": "1.0.1",
61
- "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-bf68c45d-20251028142310"
61
+ "@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-34fbd33e-20251029061020"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"