@rspack/core 0.7.3-canary-a741c8d-20240611125339 → 0.7.3-canary-a17997a-20240614063055

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 (32) hide show
  1. package/dist/Compiler.js +1 -0
  2. package/dist/RuleSetCompiler.d.ts +1 -0
  3. package/dist/RuleSetCompiler.js +1 -0
  4. package/dist/builtin-loader/swc/index.d.ts +3 -1
  5. package/dist/builtin-loader/swc/index.js +3 -1
  6. package/dist/builtin-loader/swc/preact.d.ts +7 -0
  7. package/dist/builtin-loader/swc/preact.js +15 -0
  8. package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -2
  9. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  10. package/dist/builtin-plugin/ProgressPlugin.js +5 -1
  11. package/dist/builtin-plugin/RSCClientEntryRspackPlugin.d.ts +10 -0
  12. package/dist/builtin-plugin/RSCClientEntryRspackPlugin.js +6 -0
  13. package/dist/builtin-plugin/RSCClientReferenceManifestRspackPlugin.d.ts +21 -0
  14. package/dist/builtin-plugin/RSCClientReferenceManifestRspackPlugin.js +60 -0
  15. package/dist/builtin-plugin/RSCProxyRspackPlugin.d.ts +12 -0
  16. package/dist/builtin-plugin/RSCProxyRspackPlugin.js +28 -0
  17. package/dist/builtin-plugin/index.d.ts +6 -0
  18. package/dist/builtin-plugin/index.js +6 -0
  19. package/dist/config/adapter.js +9 -9
  20. package/dist/config/adapterRuleUse.d.ts +3 -39
  21. package/dist/config/adapterRuleUse.js +14 -7
  22. package/dist/config/normalization.d.ts +1 -0
  23. package/dist/config/zod.d.ts +310 -302
  24. package/dist/config/zod.js +2 -1
  25. package/dist/container/ContainerReferencePlugin.d.ts +1 -1
  26. package/dist/exports.d.ts +3 -0
  27. package/dist/exports.js +7 -0
  28. package/dist/loader-runner/index.d.ts +25 -2
  29. package/dist/loader-runner/index.js +333 -345
  30. package/dist/loader-runner/loadLoader.js +1 -53
  31. package/dist/util/index.d.ts +1 -1
  32. package/package.json +4 -4
@@ -8,9 +8,7 @@
8
8
  * Copyright (c) JS Foundation and other contributors
9
9
  * https://github.com/webpack/loader-runner/blob/main/LICENSE
10
10
  */
11
- var assert = require("assert");
12
11
  var LoaderLoadingError = require("./LoaderLoadingError");
13
- var { toBuffer, serializeObject, isNil, toObject, stringifyLoaderObject } = require("../util");
14
12
  /** @type {undefined | import('node:url')} */
15
13
  var url;
16
14
  // @ts-expect-error
@@ -33,57 +31,7 @@ module.exports = function loadLoader(loader, callback) {
33
31
  }
34
32
  else {
35
33
  try {
36
- var module;
37
- if (loader.path.startsWith("builtin:")) {
38
- // @ts-expect-error
39
- module = async function (content, sourceMap, additionalData) {
40
- // @ts-expect-error
41
- assert(!this.__internal__context.isPitching);
42
- // @ts-expect-error
43
- const callback = this.async();
44
- const { runBuiltinLoader } = require("@rspack/binding");
45
- // @ts-expect-error
46
- let options = this.getOptions() ?? {};
47
- // This is used an hack to tell `builtin:swc-loader` whether to return AST or source.
48
- // @ts-expect-error
49
- this.__internal__context.loaderIndexFromJs = this.loaderIndex;
50
- try {
51
- const context = await runBuiltinLoader(stringifyLoaderObject(loader), JSON.stringify(options),
52
- // @ts-expect-error
53
- Object.assign({}, this.__internal__context, {
54
- content: isNil(content) ? undefined : toBuffer(content),
55
- sourceMap: serializeObject(sourceMap),
56
- additionalData
57
- }));
58
- // @ts-expect-error
59
- this.__internal__context.additionalDataExternal =
60
- context.additionalDataExternal;
61
- // @ts-expect-error
62
- context.fileDependencies.forEach(this.addDependency);
63
- // @ts-expect-error
64
- context.contextDependencies.forEach(this.addContextDependency);
65
- // @ts-expect-error
66
- context.missingDependencies.forEach(this.addMissingDependency);
67
- // @ts-expect-error
68
- context.buildDependencies.forEach(this.addBuildDependency);
69
- callback(null, context.content, isNil(context.sourceMap)
70
- ? undefined
71
- : toObject(context.sourceMap), isNil(context.additionalData) ? undefined : context.additionalData);
72
- // @ts-expect-error
73
- this._compilation.__internal__pushNativeDiagnostics(context.diagnosticsExternal);
74
- }
75
- catch (e) {
76
- return callback(e);
77
- }
78
- };
79
- // @ts-expect-error
80
- module.pitch = function () {
81
- // Pitching for builtin loader is not supported
82
- };
83
- }
84
- else {
85
- module = require(loader.path);
86
- }
34
+ var module = require(loader.path);
87
35
  }
88
36
  catch (e) {
89
37
  // it is possible for node to choke on a require if the FD descriptor
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { JsStatsError } from "@rspack/binding";
3
- import { LoaderObject } from "../config/adapterRuleUse";
3
+ import { LoaderObject } from "../loader-runner";
4
4
  export declare function mapValues(record: Record<string, string>, fn: (key: string) => string): {
5
5
  [k: string]: string;
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.7.3-canary-a741c8d-20240611125339",
3
+ "version": "0.7.3-canary-a17997a-20240614063055",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -72,15 +72,15 @@
72
72
  "watchpack": "^2.4.0",
73
73
  "zod": "^3.21.4",
74
74
  "zod-validation-error": "1.3.1",
75
- "@rspack/plugin-minify": "^0.7.3-canary-a741c8d-20240611125339",
76
- "@rspack/core": "0.7.3-canary-a741c8d-20240611125339"
75
+ "@rspack/core": "0.7.3-canary-a17997a-20240614063055",
76
+ "@rspack/plugin-minify": "^0.7.3-canary-a17997a-20240614063055"
77
77
  },
78
78
  "dependencies": {
79
79
  "@module-federation/runtime-tools": "0.1.6",
80
80
  "caniuse-lite": "^1.0.30001616",
81
81
  "tapable": "2.2.1",
82
82
  "webpack-sources": "3.2.3",
83
- "@rspack/binding": "0.7.3-canary-a741c8d-20240611125339"
83
+ "@rspack/binding": "0.7.3-canary-a17997a-20240614063055"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "@swc/helpers": ">=0.5.1"