@rspack/core 0.5.9-canary-1fbcb90-20240408152758 → 0.5.9-canary-39b53e7-20240409044942

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.
@@ -168,7 +168,6 @@ export declare class Compilation {
168
168
  __internal__pushNativeDiagnostics(diagnostics: ExternalObject<any>): void;
169
169
  get errors(): {
170
170
  push: (...errs: (Error | JsStatsError | string)[]) => void;
171
- readonly length: number;
172
171
  [Symbol.iterator](): {
173
172
  next(): {
174
173
  done: boolean;
@@ -275,7 +275,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
275
275
  options.modulesSpace || (context.forToString ? 15 : Infinity);
276
276
  options.ids = optionOrLocalFallback(options.ids, !context.forToString);
277
277
  options.children = optionOrLocalFallback(options.children, !context.forToString);
278
- options.orphanModules = optionOrLocalFallback(options.orphanModules, context.forToString ? false : true);
279
278
  return options;
280
279
  }
281
280
  createStatsFactory(options) {
@@ -381,9 +380,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
381
380
  }
382
381
  }
383
382
  },
384
- get length() {
385
- return inner.getStats().getErrors().length;
386
- },
387
383
  [Symbol.iterator]() {
388
384
  // TODO: this is obviously a bad design, optimize this after finishing angular prototype
389
385
  const errors = inner.getStats().getErrors();
@@ -39,8 +39,8 @@ class CssExtractRspackPlugin {
39
39
  this.options.pathinfo = true;
40
40
  }
41
41
  compiler.__internal__registerBuiltinPlugin({
42
- // @ts-expect-error CssExtractRspackPlugin is a constant value of BuiltinPlugin
43
- name: "CssExtractRspackPlugin",
42
+ // @ts-expect-error CssExtractPlugin is a constant value of BuiltinPlugin
43
+ name: "CssExtractPlugin",
44
44
  options: this.normalizeOptions(this.options)
45
45
  });
46
46
  }
@@ -30,6 +30,7 @@ function hotLoader(content, context) {
30
30
  }
31
31
  `;
32
32
  }
33
+ // mini-css-extract-plugin
33
34
  const loader = function loader(content) {
34
35
  if (this._compiler &&
35
36
  this._compiler.options &&
@@ -43,17 +44,7 @@ const pitch = function (request, _, data) {
43
44
  this._compiler.options &&
44
45
  this._compiler.options.experiments &&
45
46
  this._compiler.options.experiments.css) {
46
- let e = new Error("You can't use `experiments.css` and `css-extract-rspack-plugin` together, please set `experiments.css` to `false`");
47
- e.stack = undefined;
48
- this.emitWarning(e);
49
- return;
50
- }
51
- if (this._compiler &&
52
- this._compiler.options &&
53
- this._compiler.options.experiments &&
54
- this._compiler.options.experiments.rspackFuture &&
55
- this._compiler.options.experiments.rspackFuture.newTreeshaking === false) {
56
- this.emitError(new Error("Cannot use CssExtractRspackPlugin without newTreeshaking"));
47
+ this.emitWarning(new Error("You can't use `experiments.css` and `mini-css-extract-plugin` together, please set `experiments.css` to `false`"));
57
48
  return;
58
49
  }
59
50
  const options = this.getOptions(loader_options_json_1.default);
@@ -113,8 +104,7 @@ const pitch = function (request, _, data) {
113
104
  }
114
105
  if (Array.isArray(exports) && emit) {
115
106
  const identifierCountMap = new Map();
116
- dependencies = exports
117
- .map(([id, content, media, sourceMap, supports, layer]) => {
107
+ dependencies = exports.map(([id, content, media, sourceMap, supports, layer]) => {
118
108
  let identifier = id;
119
109
  let context = this.rootContext;
120
110
  const count = identifierCountMap.get(identifier) || 0;
@@ -133,8 +123,7 @@ const pitch = function (request, _, data) {
133
123
  undefined,
134
124
  filepath
135
125
  };
136
- })
137
- .filter(item => item !== null);
126
+ });
138
127
  }
139
128
  }
140
129
  catch (e) {
@@ -47,7 +47,6 @@ export * from "./MangleExportsPlugin";
47
47
  export * from "./BundlerInfoRspackPlugin";
48
48
  export * from "./ModuleConcatenationPlugin";
49
49
  export * from "./CssModulesPlugin";
50
- export * from "./APIPlugin";
51
50
  export * from "./HtmlRspackPlugin";
52
51
  export * from "./CopyRspackPlugin";
53
52
  export * from "./SwcJsMinimizerPlugin";
@@ -65,7 +65,6 @@ __exportStar(require("./MangleExportsPlugin"), exports);
65
65
  __exportStar(require("./BundlerInfoRspackPlugin"), exports);
66
66
  __exportStar(require("./ModuleConcatenationPlugin"), exports);
67
67
  __exportStar(require("./CssModulesPlugin"), exports);
68
- __exportStar(require("./APIPlugin"), exports);
69
68
  __exportStar(require("./HtmlRspackPlugin"), exports);
70
69
  __exportStar(require("./CopyRspackPlugin"), exports);
71
70
  __exportStar(require("./SwcJsMinimizerPlugin"), exports);
@@ -3182,7 +3182,6 @@ declare const statsOptions: z.ZodObject<{
3182
3182
  usedExports: z.ZodOptional<z.ZodBoolean>;
3183
3183
  providedExports: z.ZodOptional<z.ZodBoolean>;
3184
3184
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
3185
- orphanModules: z.ZodOptional<z.ZodBoolean>;
3186
3185
  }, "strict", z.ZodTypeAny, {
3187
3186
  all?: boolean | undefined;
3188
3187
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3218,7 +3217,6 @@ declare const statsOptions: z.ZodObject<{
3218
3217
  usedExports?: boolean | undefined;
3219
3218
  providedExports?: boolean | undefined;
3220
3219
  optimizationBailout?: boolean | undefined;
3221
- orphanModules?: boolean | undefined;
3222
3220
  }, {
3223
3221
  all?: boolean | undefined;
3224
3222
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3254,7 +3252,6 @@ declare const statsOptions: z.ZodObject<{
3254
3252
  usedExports?: boolean | undefined;
3255
3253
  providedExports?: boolean | undefined;
3256
3254
  optimizationBailout?: boolean | undefined;
3257
- orphanModules?: boolean | undefined;
3258
3255
  }>;
3259
3256
  export type StatsOptions = z.infer<typeof statsOptions>;
3260
3257
  declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-only", "errors-warnings", "normal", "verbose"]>, z.ZodBoolean]>, z.ZodObject<{
@@ -3292,7 +3289,6 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3292
3289
  usedExports: z.ZodOptional<z.ZodBoolean>;
3293
3290
  providedExports: z.ZodOptional<z.ZodBoolean>;
3294
3291
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
3295
- orphanModules: z.ZodOptional<z.ZodBoolean>;
3296
3292
  }, "strict", z.ZodTypeAny, {
3297
3293
  all?: boolean | undefined;
3298
3294
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3328,7 +3324,6 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3328
3324
  usedExports?: boolean | undefined;
3329
3325
  providedExports?: boolean | undefined;
3330
3326
  optimizationBailout?: boolean | undefined;
3331
- orphanModules?: boolean | undefined;
3332
3327
  }, {
3333
3328
  all?: boolean | undefined;
3334
3329
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3364,7 +3359,6 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3364
3359
  usedExports?: boolean | undefined;
3365
3360
  providedExports?: boolean | undefined;
3366
3361
  optimizationBailout?: boolean | undefined;
3367
- orphanModules?: boolean | undefined;
3368
3362
  }>]>;
3369
3363
  export type StatsValue = z.infer<typeof statsValue>;
3370
3364
  export interface RspackPluginInstance {
@@ -4835,7 +4829,6 @@ export declare const rspackOptions: z.ZodObject<{
4835
4829
  usedExports: z.ZodOptional<z.ZodBoolean>;
4836
4830
  providedExports: z.ZodOptional<z.ZodBoolean>;
4837
4831
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
4838
- orphanModules: z.ZodOptional<z.ZodBoolean>;
4839
4832
  }, "strict", z.ZodTypeAny, {
4840
4833
  all?: boolean | undefined;
4841
4834
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -4871,7 +4864,6 @@ export declare const rspackOptions: z.ZodObject<{
4871
4864
  usedExports?: boolean | undefined;
4872
4865
  providedExports?: boolean | undefined;
4873
4866
  optimizationBailout?: boolean | undefined;
4874
- orphanModules?: boolean | undefined;
4875
4867
  }, {
4876
4868
  all?: boolean | undefined;
4877
4869
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -4907,7 +4899,6 @@ export declare const rspackOptions: z.ZodObject<{
4907
4899
  usedExports?: boolean | undefined;
4908
4900
  providedExports?: boolean | undefined;
4909
4901
  optimizationBailout?: boolean | undefined;
4910
- orphanModules?: boolean | undefined;
4911
4902
  }>]>>;
4912
4903
  snapshot: z.ZodOptional<z.ZodObject<{
4913
4904
  module: z.ZodOptional<z.ZodObject<{
@@ -5944,7 +5935,6 @@ export declare const rspackOptions: z.ZodObject<{
5944
5935
  usedExports?: boolean | undefined;
5945
5936
  providedExports?: boolean | undefined;
5946
5937
  optimizationBailout?: boolean | undefined;
5947
- orphanModules?: boolean | undefined;
5948
5938
  } | undefined;
5949
5939
  snapshot?: {
5950
5940
  module?: {
@@ -6329,7 +6319,6 @@ export declare const rspackOptions: z.ZodObject<{
6329
6319
  usedExports?: boolean | undefined;
6330
6320
  providedExports?: boolean | undefined;
6331
6321
  optimizationBailout?: boolean | undefined;
6332
- orphanModules?: boolean | undefined;
6333
6322
  } | undefined;
6334
6323
  snapshot?: {
6335
6324
  module?: {
@@ -626,8 +626,7 @@ const statsOptions = zod_1.z.strictObject({
626
626
  children: zod_1.z.boolean().optional(),
627
627
  usedExports: zod_1.z.boolean().optional(),
628
628
  providedExports: zod_1.z.boolean().optional(),
629
- optimizationBailout: zod_1.z.boolean().optional(),
630
- orphanModules: zod_1.z.boolean().optional()
629
+ optimizationBailout: zod_1.z.boolean().optional()
631
630
  });
632
631
  const statsValue = zod_1.z
633
632
  .enum(["none", "errors-only", "errors-warnings", "normal", "verbose"])
package/dist/exports.d.ts CHANGED
@@ -261,7 +261,6 @@ export declare const config: {
261
261
  usedExports?: boolean | undefined;
262
262
  providedExports?: boolean | undefined;
263
263
  optimizationBailout?: boolean | undefined;
264
- orphanModules?: boolean | undefined;
265
264
  } | undefined;
266
265
  snapshot?: {
267
266
  module?: {
@@ -648,7 +647,6 @@ export declare const config: {
648
647
  usedExports?: boolean | undefined;
649
648
  providedExports?: boolean | undefined;
650
649
  optimizationBailout?: boolean | undefined;
651
- orphanModules?: boolean | undefined;
652
650
  } | undefined;
653
651
  snapshot?: {
654
652
  module?: {
@@ -134,7 +134,6 @@ class RspackOptionsApply {
134
134
  new builtin_plugin_1.BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler);
135
135
  }
136
136
  new builtin_plugin_1.InferAsyncModulesPlugin().apply(compiler);
137
- new builtin_plugin_1.APIPlugin().apply(compiler);
138
137
  new builtin_plugin_1.DataUriPlugin().apply(compiler);
139
138
  new builtin_plugin_1.FileUriPlugin().apply(compiler);
140
139
  new builtin_plugin_1.EnsureChunkConditionsPlugin().apply(compiler);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.5.9-canary-1fbcb90-20240408152758",
3
+ "version": "0.5.9-canary-39b53e7-20240409044942",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -37,15 +37,12 @@
37
37
  "babel-plugin-import": "^1.13.5",
38
38
  "copy-webpack-plugin": "5.1.2",
39
39
  "cross-env": "^7.0.3",
40
- "del": "^6.0.0",
41
40
  "file-loader": "^6.2.0",
42
41
  "glob": "^10.3.10",
43
42
  "html-loader": "^5.0.0",
44
43
  "html-webpack-plugin": "^5.5.0",
45
44
  "identity-obj-proxy": "3.0.0",
46
- "jest-environment-jsdom": "^29",
47
45
  "jest-serializer-path": "^0.1.15",
48
- "jsdom": "^24.0.0",
49
46
  "less": "4.2.0",
50
47
  "less-loader": "^12.0.0",
51
48
  "node-polyfill-webpack-plugin": "3.0.0",
@@ -59,8 +56,8 @@
59
56
  "styled-components": "^6.0.8",
60
57
  "terser": "5.27.2",
61
58
  "wast-loader": "^1.11.4",
62
- "@rspack/core": "0.5.9-canary-1fbcb90-20240408152758",
63
- "@rspack/plugin-minify": "^0.5.9-canary-1fbcb90-20240408152758"
59
+ "@rspack/core": "0.5.9-canary-39b53e7-20240409044942",
60
+ "@rspack/plugin-minify": "^0.5.9-canary-39b53e7-20240409044942"
64
61
  },
65
62
  "dependencies": {
66
63
  "@module-federation/runtime-tools": "0.0.8",
@@ -75,7 +72,7 @@
75
72
  "webpack-sources": "3.2.3",
76
73
  "zod": "^3.21.4",
77
74
  "zod-validation-error": "1.3.1",
78
- "@rspack/binding": "0.5.9-canary-1fbcb90-20240408152758"
75
+ "@rspack/binding": "0.5.9-canary-39b53e7-20240409044942"
79
76
  },
80
77
  "peerDependencies": {
81
78
  "@swc/helpers": ">=0.5.1"
@@ -1,10 +0,0 @@
1
- import { BuiltinPluginName } from "@rspack/binding";
2
- export declare const APIPlugin: {
3
- new (): {
4
- name: BuiltinPluginName;
5
- _options: void;
6
- affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
7
- raw(): import("@rspack/binding").BuiltinPlugin;
8
- apply(compiler: import("../Compiler").Compiler): void;
9
- };
10
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIPlugin = void 0;
4
- const binding_1 = require("@rspack/binding");
5
- const base_1 = require("./base");
6
- exports.APIPlugin = (0, base_1.create)(binding_1.BuiltinPluginName.APIPlugin, () => { });