@rspack/core 1.0.0-rc.0 → 1.0.0-rc.1

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.
@@ -650,8 +650,10 @@ function getRawExperiments(experiments) {
650
650
  rspackFuture: getRawRspackFutureOptions(rspackFuture)
651
651
  };
652
652
  }
653
- function getRawRspackFutureOptions(_future) {
654
- return {};
653
+ function getRawRspackFutureOptions(future) {
654
+ return {
655
+ newIncremental: future.newIncremental
656
+ };
655
657
  }
656
658
  function getRawNode(node) {
657
659
  if (node === false) {
@@ -136,6 +136,9 @@ const applyExperimentsDefaults = (experiments) => {
136
136
  // IGNORE(experiments.rspackFuture): Rspack specific configuration
137
137
  D(experiments, "rspackFuture", {});
138
138
  // rspackFuture.bundlerInfo default value is applied after applyDefaults
139
+ if (typeof experiments.rspackFuture === "object") {
140
+ D(experiments.rspackFuture, "newIncremental", false);
141
+ }
139
142
  };
140
143
  const applybundlerInfoDefaults = (rspackFuture, library) => {
141
144
  if (typeof rspackFuture === "object") {
@@ -597,7 +600,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
597
600
  const optimistic = (v) => v || v === undefined;
598
601
  const conditionallyOptimistic = (v, c) => (v === undefined && c) || v;
599
602
  F(environment, "globalThis", () => tp?.globalThis);
600
- F(environment, "bigIntLiteral", () => tp?.bigIntLiteral);
603
+ F(environment, "bigIntLiteral", () => tp && optimistic(tp.bigIntLiteral));
601
604
  F(environment, "const", () => tp && optimistic(tp.const));
602
605
  F(environment, "arrowFunction", () => tp && optimistic(tp.arrowFunction));
603
606
  F(environment, "asyncFunction", () => tp && optimistic(tp.asyncFunction));
@@ -5967,18 +5967,21 @@ declare const rspackFutureOptions: z.ZodObject<{
5967
5967
  version?: string | undefined;
5968
5968
  bundler?: string | undefined;
5969
5969
  }>>;
5970
+ newIncremental: z.ZodOptional<z.ZodBoolean>;
5970
5971
  }, "strict", z.ZodTypeAny, {
5971
5972
  bundlerInfo?: {
5972
5973
  force?: boolean | ("version" | "uniqueId")[] | undefined;
5973
5974
  version?: string | undefined;
5974
5975
  bundler?: string | undefined;
5975
5976
  } | undefined;
5977
+ newIncremental?: boolean | undefined;
5976
5978
  }, {
5977
5979
  bundlerInfo?: {
5978
5980
  force?: boolean | ("version" | "uniqueId")[] | undefined;
5979
5981
  version?: string | undefined;
5980
5982
  bundler?: string | undefined;
5981
5983
  } | undefined;
5984
+ newIncremental?: boolean | undefined;
5982
5985
  }>;
5983
5986
  export type RspackFutureOptions = z.infer<typeof rspackFutureOptions>;
5984
5987
  declare const lazyCompilationOptions: z.ZodObject<{
@@ -6201,18 +6204,21 @@ declare const experiments: z.ZodObject<{
6201
6204
  version?: string | undefined;
6202
6205
  bundler?: string | undefined;
6203
6206
  }>>;
6207
+ newIncremental: z.ZodOptional<z.ZodBoolean>;
6204
6208
  }, "strict", z.ZodTypeAny, {
6205
6209
  bundlerInfo?: {
6206
6210
  force?: boolean | ("version" | "uniqueId")[] | undefined;
6207
6211
  version?: string | undefined;
6208
6212
  bundler?: string | undefined;
6209
6213
  } | undefined;
6214
+ newIncremental?: boolean | undefined;
6210
6215
  }, {
6211
6216
  bundlerInfo?: {
6212
6217
  force?: boolean | ("version" | "uniqueId")[] | undefined;
6213
6218
  version?: string | undefined;
6214
6219
  bundler?: string | undefined;
6215
6220
  } | undefined;
6221
+ newIncremental?: boolean | undefined;
6216
6222
  }>>;
6217
6223
  }, "strict", z.ZodTypeAny, {
6218
6224
  css?: boolean | undefined;
@@ -6246,6 +6252,7 @@ declare const experiments: z.ZodObject<{
6246
6252
  version?: string | undefined;
6247
6253
  bundler?: string | undefined;
6248
6254
  } | undefined;
6255
+ newIncremental?: boolean | undefined;
6249
6256
  } | undefined;
6250
6257
  }, {
6251
6258
  css?: boolean | undefined;
@@ -6279,6 +6286,7 @@ declare const experiments: z.ZodObject<{
6279
6286
  version?: string | undefined;
6280
6287
  bundler?: string | undefined;
6281
6288
  } | undefined;
6289
+ newIncremental?: boolean | undefined;
6282
6290
  } | undefined;
6283
6291
  }>;
6284
6292
  export type Experiments = z.infer<typeof experiments>;
@@ -7245,18 +7253,21 @@ export declare const rspackOptions: z.ZodObject<{
7245
7253
  version?: string | undefined;
7246
7254
  bundler?: string | undefined;
7247
7255
  }>>;
7256
+ newIncremental: z.ZodOptional<z.ZodBoolean>;
7248
7257
  }, "strict", z.ZodTypeAny, {
7249
7258
  bundlerInfo?: {
7250
7259
  force?: boolean | ("version" | "uniqueId")[] | undefined;
7251
7260
  version?: string | undefined;
7252
7261
  bundler?: string | undefined;
7253
7262
  } | undefined;
7263
+ newIncremental?: boolean | undefined;
7254
7264
  }, {
7255
7265
  bundlerInfo?: {
7256
7266
  force?: boolean | ("version" | "uniqueId")[] | undefined;
7257
7267
  version?: string | undefined;
7258
7268
  bundler?: string | undefined;
7259
7269
  } | undefined;
7270
+ newIncremental?: boolean | undefined;
7260
7271
  }>>;
7261
7272
  }, "strict", z.ZodTypeAny, {
7262
7273
  css?: boolean | undefined;
@@ -7290,6 +7301,7 @@ export declare const rspackOptions: z.ZodObject<{
7290
7301
  version?: string | undefined;
7291
7302
  bundler?: string | undefined;
7292
7303
  } | undefined;
7304
+ newIncremental?: boolean | undefined;
7293
7305
  } | undefined;
7294
7306
  }, {
7295
7307
  css?: boolean | undefined;
@@ -7323,6 +7335,7 @@ export declare const rspackOptions: z.ZodObject<{
7323
7335
  version?: string | undefined;
7324
7336
  bundler?: string | undefined;
7325
7337
  } | undefined;
7338
+ newIncremental?: boolean | undefined;
7326
7339
  } | undefined;
7327
7340
  }>>;
7328
7341
  externals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>]>>]>, z.ZodFunction<z.ZodTuple<[z.ZodObject<{
@@ -9354,6 +9367,7 @@ export declare const rspackOptions: z.ZodObject<{
9354
9367
  version?: string | undefined;
9355
9368
  bundler?: string | undefined;
9356
9369
  } | undefined;
9370
+ newIncremental?: boolean | undefined;
9357
9371
  } | undefined;
9358
9372
  } | undefined;
9359
9373
  externals?: string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
@@ -9927,6 +9941,7 @@ export declare const rspackOptions: z.ZodObject<{
9927
9941
  version?: string | undefined;
9928
9942
  bundler?: string | undefined;
9929
9943
  } | undefined;
9944
+ newIncremental?: boolean | undefined;
9930
9945
  } | undefined;
9931
9946
  } | undefined;
9932
9947
  externals?: string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
@@ -861,7 +861,8 @@ const rspackFutureOptions = zod_1.z.strictObject({
861
861
  .or(zod_1.z.array(zod_1.z.enum(["version", "uniqueId"])))
862
862
  .optional()
863
863
  })
864
- .optional()
864
+ .optional(),
865
+ newIncremental: zod_1.z.boolean().optional()
865
866
  });
866
867
  const listenOptions = zod_1.z.object({
867
868
  port: zod_1.z.number().optional(),
@@ -82,7 +82,9 @@ function createLoaderObject(loader, compiler) {
82
82
  }
83
83
  obj.ident = ident;
84
84
  }
85
- obj.type = value.type;
85
+ // CHANGE: `rspack_core` returns empty string for `undefined` type.
86
+ // Comply to webpack test case: tests/webpack-test/cases/loaders/cjs-loader-type/index.js
87
+ obj.type = value.type === "" ? undefined : value.type;
86
88
  if (obj.options === null)
87
89
  obj.query = "";
88
90
  else if (obj.options === undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -60,7 +60,7 @@
60
60
  "@module-federation/runtime-tools": "0.5.1",
61
61
  "@rspack/lite-tapable": "1.0.0",
62
62
  "caniuse-lite": "^1.0.30001616",
63
- "@rspack/binding": "1.0.0-rc.0"
63
+ "@rspack/binding": "1.0.0-rc.1"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@swc/helpers": ">=0.5.1"