@rspack/core 0.5.6-canary-d451d23-20240309005504 → 0.5.6-canary-11ea1bd-20240311102123

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.
@@ -2,9 +2,11 @@ import { type JsChunkGroup, type JsCompilation } from "@rspack/binding";
2
2
  export declare class ChunkGroup {
3
3
  #private;
4
4
  static __from_binding(chunk: JsChunkGroup, compilation: JsCompilation): ChunkGroup;
5
- private constructor();
5
+ protected constructor(inner: JsChunkGroup, compilation: JsCompilation);
6
6
  getFiles(): string[];
7
7
  getParents(): ChunkGroup[];
8
8
  get index(): number | undefined;
9
9
  get name(): string | undefined;
10
+ __internal_inner_ukey(): number;
11
+ __internal_inner_compilation(): JsCompilation;
10
12
  }
@@ -45,6 +45,12 @@ class ChunkGroup {
45
45
  get name() {
46
46
  return __classPrivateFieldGet(this, _ChunkGroup_inner, "f").name;
47
47
  }
48
+ __internal_inner_ukey() {
49
+ return __classPrivateFieldGet(this, _ChunkGroup_inner, "f").__inner_ukey;
50
+ }
51
+ __internal_inner_compilation() {
52
+ return __classPrivateFieldGet(this, _ChunkGroup_inner_compilation, "f");
53
+ }
48
54
  }
49
55
  exports.ChunkGroup = ChunkGroup;
50
56
  _ChunkGroup_inner = new WeakMap(), _ChunkGroup_inner_compilation = new WeakMap();
@@ -15,7 +15,6 @@ import { RspackOptionsNormalized, StatsOptions, OutputNormalized, StatsValue, Rs
15
15
  import * as liteTapable from "./lite-tapable";
16
16
  import { ContextModuleFactory } from "./ContextModuleFactory";
17
17
  import ResolverFactory from "./ResolverFactory";
18
- import { ChunkGroup } from "./ChunkGroup";
19
18
  import { Compiler } from "./Compiler";
20
19
  import { Logger } from "./logging/Logger";
21
20
  import { NormalModuleFactory } from "./NormalModuleFactory";
@@ -27,6 +26,7 @@ import MergeCaller from "./util/MergeCaller";
27
26
  import { Chunk } from "./Chunk";
28
27
  import { CodeGenerationResult } from "./Module";
29
28
  import { ChunkGraph } from "./ChunkGraph";
29
+ import { Entrypoint } from "./Entrypoint";
30
30
  export type AssetInfo = Partial<JsAssetInfo> & Record<string, any>;
31
31
  export type Assets = Record<string, Source>;
32
32
  export interface Asset {
@@ -125,7 +125,7 @@ export declare class Compilation {
125
125
  /**
126
126
  * Get a map of all entrypoints.
127
127
  */
128
- get entrypoints(): ReadonlyMap<string, ChunkGroup>;
128
+ get entrypoints(): ReadonlyMap<string, Entrypoint>;
129
129
  getCache(name: string): import("./lib/CacheFacade");
130
130
  createStatsOptions(optionsOrPreset: StatsValue | undefined, context?: CreateStatsOptionsContext): StatsOptions;
131
131
  createStatsFactory(options: StatsOptions): StatsFactory;
@@ -50,7 +50,6 @@ exports.Compilation = void 0;
50
50
  */
51
51
  const tapable = __importStar(require("tapable"));
52
52
  const liteTapable = __importStar(require("./lite-tapable"));
53
- const ChunkGroup_1 = require("./ChunkGroup");
54
53
  const ErrorHelpers_1 = __importDefault(require("./ErrorHelpers"));
55
54
  const Logger_1 = require("./logging/Logger");
56
55
  const NormalModule_1 = require("./NormalModule");
@@ -65,6 +64,7 @@ const MergeCaller_1 = __importDefault(require("./util/MergeCaller"));
65
64
  const memoize_1 = require("./util/memoize");
66
65
  const Chunk_1 = require("./Chunk");
67
66
  const ChunkGraph_1 = require("./ChunkGraph");
67
+ const Entrypoint_1 = require("./Entrypoint");
68
68
  class Compilation {
69
69
  constructor(compiler, inner) {
70
70
  _Compilation_inner.set(this, void 0);
@@ -226,7 +226,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
226
226
  get entrypoints() {
227
227
  return new Map(Object.entries(__classPrivateFieldGet(this, _Compilation_inner, "f").entrypoints).map(([n, e]) => [
228
228
  n,
229
- ChunkGroup_1.ChunkGroup.__from_binding(e, __classPrivateFieldGet(this, _Compilation_inner, "f"))
229
+ Entrypoint_1.Entrypoint.__from_binding(e, __classPrivateFieldGet(this, _Compilation_inner, "f"))
230
230
  ]));
231
231
  }
232
232
  getCache(name) {
@@ -0,0 +1,8 @@
1
+ import { type JsChunkGroup, type JsCompilation } from "@rspack/binding";
2
+ import { ChunkGroup } from "./ChunkGroup";
3
+ import { Chunk } from "./Chunk";
4
+ export declare class Entrypoint extends ChunkGroup {
5
+ static __from_binding(chunk: JsChunkGroup, compilation: JsCompilation): Entrypoint;
6
+ protected constructor(inner: JsChunkGroup, compilation: JsCompilation);
7
+ getRuntimeChunk(): Chunk | null;
8
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Entrypoint = void 0;
4
+ const binding_1 = require("@rspack/binding");
5
+ const ChunkGroup_1 = require("./ChunkGroup");
6
+ const Chunk_1 = require("./Chunk");
7
+ class Entrypoint extends ChunkGroup_1.ChunkGroup {
8
+ static __from_binding(chunk, compilation) {
9
+ return new Entrypoint(chunk, compilation);
10
+ }
11
+ constructor(inner, compilation) {
12
+ super(inner, compilation);
13
+ }
14
+ getRuntimeChunk() {
15
+ const c = (0, binding_1.__entrypoint_inner_get_runtime_chunk)(this.__internal_inner_ukey(), this.__internal_inner_compilation());
16
+ if (c)
17
+ return Chunk_1.Chunk.__from_binding(c, this.__internal_inner_compilation());
18
+ return null;
19
+ }
20
+ }
21
+ exports.Entrypoint = Entrypoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.5.6-canary-d451d23-20240309005504",
3
+ "version": "0.5.6-canary-11ea1bd-20240311102123",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -55,9 +55,9 @@
55
55
  "styled-components": "^6.0.8",
56
56
  "terser": "5.27.2",
57
57
  "wast-loader": "^1.11.4",
58
- "@rspack/core": "0.5.6-canary-d451d23-20240309005504",
59
- "@rspack/plugin-node-polyfill": "^0.5.6-canary-d451d23-20240309005504",
60
- "@rspack/plugin-minify": "^0.5.6-canary-d451d23-20240309005504"
58
+ "@rspack/plugin-minify": "^0.5.6-canary-11ea1bd-20240311102123",
59
+ "@rspack/plugin-node-polyfill": "^0.5.6-canary-11ea1bd-20240311102123",
60
+ "@rspack/core": "0.5.6-canary-11ea1bd-20240311102123"
61
61
  },
62
62
  "dependencies": {
63
63
  "@module-federation/runtime-tools": "0.0.8",
@@ -72,7 +72,7 @@
72
72
  "webpack-sources": "3.2.3",
73
73
  "zod": "^3.21.4",
74
74
  "zod-validation-error": "1.3.1",
75
- "@rspack/binding": "0.5.6-canary-d451d23-20240309005504"
75
+ "@rspack/binding": "0.5.6-canary-11ea1bd-20240311102123"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@swc/helpers": ">=0.5.1"