@rspack/core 1.0.0-beta.1 → 1.0.0-beta.3

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 (121) hide show
  1. package/dist/ChunkGroup.d.ts +1 -0
  2. package/dist/ChunkGroup.js +3 -0
  3. package/dist/Compilation.d.ts +38 -1
  4. package/dist/Compilation.js +109 -44
  5. package/dist/Compiler.d.ts +1 -0
  6. package/dist/Compiler.js +31 -26
  7. package/dist/ExecuteModulePlugin.d.ts +0 -1
  8. package/dist/ExecuteModulePlugin.js +0 -1
  9. package/dist/Module.d.ts +1 -2
  10. package/dist/Module.js +0 -1
  11. package/dist/MultiCompiler.js +11 -7
  12. package/dist/MultiStats.d.ts +1 -1
  13. package/dist/MultiStats.js +19 -16
  14. package/dist/NormalModule.js +3 -4
  15. package/dist/Resolver.d.ts +1 -2
  16. package/dist/RspackError.js +1 -1
  17. package/dist/Stats.d.ts +1 -1
  18. package/dist/Stats.js +22 -2
  19. package/dist/Template.d.ts +4 -4
  20. package/dist/Template.js +8 -6
  21. package/dist/Watching.js +3 -5
  22. package/dist/builtin-loader/lightningcss/index.js +1 -1
  23. package/dist/builtin-plugin/DefinePlugin.js +1 -1
  24. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +11 -10
  25. package/dist/builtin-plugin/DynamicEntryPlugin.js +26 -15
  26. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
  27. package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +1 -1
  28. package/dist/builtin-plugin/EnableLibraryPlugin.js +1 -6
  29. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +2 -2
  30. package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +1 -1
  31. package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
  32. package/dist/builtin-plugin/ExternalsPlugin.js +1 -1
  33. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +0 -1
  34. package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
  35. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +21 -4
  36. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +29 -5
  37. package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +4 -6
  38. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +17 -12
  39. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +11 -9
  40. package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +13 -11
  41. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +1 -1
  42. package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +9 -7
  43. package/dist/builtin-plugin/css-extract/loader.js +5 -12
  44. package/dist/builtin-plugin/lazy-compilation/backend.js +4 -4
  45. package/dist/config/adapter.d.ts +2 -2
  46. package/dist/config/adapter.js +1 -0
  47. package/dist/config/adapterRuleUse.d.ts +2 -6
  48. package/dist/config/adapterRuleUse.js +7 -6
  49. package/dist/config/defaults.js +21 -32
  50. package/dist/config/normalization.d.ts +1 -0
  51. package/dist/config/normalization.js +5 -2
  52. package/dist/config/zod.d.ts +762 -114
  53. package/dist/config/zod.js +29 -6
  54. package/dist/container/default.runtime.js +1 -1
  55. package/dist/exports.d.ts +4 -3
  56. package/dist/exports.js +5 -2
  57. package/dist/lib/AbstractMethodError.js +2 -3
  58. package/dist/lib/Cache.d.ts +1 -1
  59. package/dist/lib/Cache.js +6 -4
  60. package/dist/lib/CacheFacade.js +8 -9
  61. package/dist/lib/Dependency.d.ts +23 -0
  62. package/dist/lib/Dependency.js +11 -0
  63. package/dist/lib/EnvironmentPlugin.js +1 -3
  64. package/dist/lib/LoaderOptionsPlugin.d.ts +4 -2
  65. package/dist/lib/LoaderOptionsPlugin.js +0 -2
  66. package/dist/lib/ModuleFilenameHelpers.js +1 -1
  67. package/dist/lib/WebpackError.d.ts +0 -6
  68. package/dist/lib/WebpackError.js +0 -8
  69. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  70. package/dist/lib/cache/MemoryCachePlugin.js +40 -0
  71. package/dist/lib/cache/mergeEtags.d.ts +3 -3
  72. package/dist/lib/cache/mergeEtags.js +5 -3
  73. package/dist/lib/formatLocation.d.ts +1 -1
  74. package/dist/loader-runner/index.js +10 -9
  75. package/dist/loader-runner/loadLoader.js +8 -11
  76. package/dist/logging/Logger.js +3 -3
  77. package/dist/logging/createConsoleLogger.d.ts +26 -6
  78. package/dist/logging/createConsoleLogger.js +21 -58
  79. package/dist/logging/runtime.d.ts +4 -10
  80. package/dist/logging/runtime.js +8 -23
  81. package/dist/logging/truncateArgs.d.ts +4 -4
  82. package/dist/logging/truncateArgs.js +5 -10
  83. package/dist/node/NodeEnvironmentPlugin.js +2 -2
  84. package/dist/node/NodeWatchFileSystem.js +6 -6
  85. package/dist/node/nodeConsole.d.ts +7 -21
  86. package/dist/node/nodeConsole.js +31 -38
  87. package/dist/rspackOptionsApply.d.ts +0 -1
  88. package/dist/rspackOptionsApply.js +8 -7
  89. package/dist/sharing/ProvideSharedPlugin.d.ts +20 -19
  90. package/dist/sharing/ProvideSharedPlugin.js +26 -17
  91. package/dist/sharing/SharePlugin.d.ts +3 -0
  92. package/dist/sharing/SharePlugin.js +4 -1
  93. package/dist/stats/DefaultStatsFactoryPlugin.js +187 -96
  94. package/dist/stats/DefaultStatsPresetPlugin.js +2 -5
  95. package/dist/stats/DefaultStatsPrinterPlugin.js +18 -19
  96. package/dist/stats/StatsFactory.d.ts +2 -1
  97. package/dist/stats/StatsFactory.js +5 -10
  98. package/dist/stats/StatsPrinter.js +3 -4
  99. package/dist/stats/statsFactoryUtils.d.ts +155 -28
  100. package/dist/util/SizeFormatHelpers.js +1 -1
  101. package/dist/util/assertNotNil.d.ts +1 -1
  102. package/dist/util/assetCondition.d.ts +2 -0
  103. package/dist/util/assetCondition.js +2 -0
  104. package/dist/util/bindingVersionCheck.js +3 -3
  105. package/dist/util/cleverMerge.js +8 -6
  106. package/dist/util/comparators.d.ts +1 -1
  107. package/dist/util/comparators.js +5 -4
  108. package/dist/util/createHash.js +11 -6
  109. package/dist/util/fs.js +2 -2
  110. package/dist/util/hash/wasm-hash.js +5 -4
  111. package/dist/util/identifier.d.ts +4 -4
  112. package/dist/util/identifier.js +10 -10
  113. package/dist/util/index.js +1 -1
  114. package/dist/util/memoize.js +4 -6
  115. package/dist/util/smartGrouping.js +4 -6
  116. package/dist/util/webpack.d.ts +1 -1
  117. package/dist/util/webpack.js +2 -1
  118. package/module.d.ts +1 -1
  119. package/package.json +3 -3
  120. package/dist/builtin-plugin/css-extract/loader-options.json +0 -37
  121. package/dist/builtin-plugin/css-extract/plugin-options.json +0 -79
@@ -78,13 +78,11 @@ const smartGrouping = (items, groupConfigs) => {
78
78
  if (options === undefined) {
79
79
  const groupConfig = group.config;
80
80
  state.options = options =
81
- (groupConfig.getOptions &&
82
- groupConfig.getOptions(group.name, Array.from(items, ({ item }) => item))) ||
83
- false;
81
+ groupConfig.getOptions?.(group.name, Array.from(items, ({ item }) => item)) || false;
84
82
  }
85
- const force = options && options.force;
83
+ const force = options !== false && options.force;
86
84
  if (!force) {
87
- if (bestGroupOptions && bestGroupOptions.force)
85
+ if (bestGroupOptions !== false && bestGroupOptions?.force)
88
86
  continue;
89
87
  if (used)
90
88
  continue;
@@ -92,7 +90,7 @@ const smartGrouping = (items, groupConfigs) => {
92
90
  continue;
93
91
  }
94
92
  }
95
- const targetGroupCount = (options && options.targetGroupCount) || 4;
93
+ const targetGroupCount = (options !== false && options.targetGroupCount) || 4;
96
94
  const sizeValue = force
97
95
  ? items.size
98
96
  : Math.min(items.size, (totalSize * 2) / targetGroupCount +
@@ -1,4 +1,4 @@
1
1
  declare const _default: {
2
- readonly createHash: any;
2
+ readonly createHash: (algorithm: (string & {}) | "debug" | "xxhash64" | "md4" | "native-md4" | (new () => import("./hash").default)) => import("./hash").default;
3
3
  };
4
4
  export default _default;
@@ -4,9 +4,10 @@
4
4
  // const { NormalModuleReplacementPlugin, WebpackError, util } = compiler.webpack;
5
5
  // ```
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ const createHash_1 = require("./createHash");
7
8
  exports.default = {
8
9
  get createHash() {
9
- return require("./createHash");
10
+ return createHash_1.createHash;
10
11
  }
11
12
  // get comparators() {
12
13
  // return require("./comparators");
package/module.d.ts CHANGED
@@ -109,7 +109,7 @@ declare namespace Rspack {
109
109
  onErrored?: (event: ErroredEvent) => void;
110
110
  }
111
111
 
112
- const enum HotUpdateStatus {
112
+ enum HotUpdateStatus {
113
113
  idle = "idle",
114
114
  check = "check",
115
115
  prepare = "prepare",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.3",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -59,8 +59,8 @@
59
59
  "dependencies": {
60
60
  "@module-federation/runtime-tools": "0.2.3",
61
61
  "caniuse-lite": "^1.0.30001616",
62
- "@rspack/lite-tapable": "1.0.0-beta.1",
63
- "@rspack/binding": "1.0.0-beta.1"
62
+ "@rspack/binding": "1.0.0-beta.3",
63
+ "@rspack/lite-tapable": "1.0.0-beta.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@swc/helpers": ">=0.5.1"
@@ -1,37 +0,0 @@
1
- {
2
- "title": "Mini CSS Extract Plugin Loader options",
3
- "type": "object",
4
- "additionalProperties": false,
5
- "properties": {
6
- "publicPath": {
7
- "anyOf": [
8
- {
9
- "type": "string"
10
- },
11
- {
12
- "instanceof": "Function"
13
- }
14
- ],
15
- "description": "Specifies a custom public path for the external resources like images, files, etc inside CSS.",
16
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#publicpath"
17
- },
18
- "emit": {
19
- "type": "boolean",
20
- "description": "If true, emits a file (writes a file to the filesystem). If false, the plugin will extract the CSS but will not emit the file",
21
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#emit"
22
- },
23
- "esModule": {
24
- "type": "boolean",
25
- "description": "Generates JS modules that use the ES modules syntax.",
26
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#esmodule"
27
- },
28
- "layer": {
29
- "type": "string"
30
- },
31
- "defaultExport": {
32
- "type": "boolean",
33
- "description": "Duplicate the named export with CSS modules locals to the default export (only when `esModules: true` for css-loader).",
34
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#defaultexports"
35
- }
36
- }
37
- }
@@ -1,79 +0,0 @@
1
- {
2
- "title": "Mini CSS Extract Plugin options",
3
- "type": "object",
4
- "additionalProperties": false,
5
- "properties": {
6
- "filename": {
7
- "anyOf": [
8
- {
9
- "type": "string",
10
- "absolutePath": false,
11
- "minLength": 1
12
- },
13
- {
14
- "instanceof": "Function"
15
- }
16
- ],
17
- "description": "This option determines the name of each output CSS file.",
18
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#filename"
19
- },
20
- "chunkFilename": {
21
- "anyOf": [
22
- {
23
- "type": "string",
24
- "absolutePath": false,
25
- "minLength": 1
26
- },
27
- {
28
- "instanceof": "Function"
29
- }
30
- ],
31
- "description": "This option determines the name of non-entry chunk files.",
32
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#chunkfilename"
33
- },
34
- "experimentalUseImportModule": {
35
- "type": "boolean",
36
- "description": "Enable the experimental importModule approach instead of using child compilers. This uses less memory and is faster.",
37
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#experimentaluseimportmodule"
38
- },
39
- "ignoreOrder": {
40
- "type": "boolean",
41
- "description": "Remove Order Warnings.",
42
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#ignoreorder"
43
- },
44
- "insert": {
45
- "description": "Inserts the `link` tag at the given position for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
46
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#insert",
47
- "anyOf": [
48
- {
49
- "type": "string"
50
- },
51
- {
52
- "instanceof": "Function"
53
- }
54
- ]
55
- },
56
- "attributes": {
57
- "description": "Adds custom attributes to the `link` tag for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
58
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#attributes",
59
- "type": "object"
60
- },
61
- "linkType": {
62
- "anyOf": [
63
- {
64
- "enum": ["text/css"]
65
- },
66
- {
67
- "type": "boolean"
68
- }
69
- ],
70
- "description": "This option allows loading asynchronous chunks with a custom link type",
71
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#linktype"
72
- },
73
- "runtime": {
74
- "type": "boolean",
75
- "description": "Enabled/Disables runtime generation. CSS will be still extracted and can be used for a custom loading methods.",
76
- "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#noRuntime"
77
- }
78
- }
79
- }