@rspack/binding 1.3.14 → 1.4.0-beta.0

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 (2) hide show
  1. package/binding.d.ts +57 -21
  2. package/package.json +13 -12
package/binding.d.ts CHANGED
@@ -14,6 +14,24 @@ export const MODULE_IDENTIFIER_SYMBOL: unique symbol;
14
14
 
15
15
  export const COMPILATION_HOOKS_MAP_SYMBOL: unique symbol;
16
16
 
17
+ export const BUILD_INFO_ASSETS_SYMBOL: unique symbol;
18
+ export const BUILD_INFO_FILE_DEPENDENCIES_SYMBOL: unique symbol;
19
+ export const BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL: unique symbol;
20
+ export const BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL: unique symbol;
21
+ export const BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL: unique symbol;
22
+ export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
23
+
24
+ interface KnownBuildInfo {
25
+ [BUILD_INFO_ASSETS_SYMBOL]: Assets,
26
+ [BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
27
+ [BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[],
28
+ [BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[],
29
+ [BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[],
30
+ [COMMIT_CUSTOM_FIELDS_SYMBOL](): void;
31
+ }
32
+
33
+ export type BuildInfo = KnownBuildInfo & Record<string, any>;
34
+
17
35
  export interface Module {
18
36
  [MODULE_IDENTIFIER_SYMBOL]: string;
19
37
  readonly type: string;
@@ -24,8 +42,8 @@ export interface Module {
24
42
  get useSourceMap(): boolean;
25
43
  get useSimpleSourceMap(): boolean;
26
44
  get _readableIdentifier(): string;
27
- buildInfo: KnownBuildInfo & Record<string, any>;
28
- buildMeta: KnownBuildInfo & Record<string, any>;
45
+ buildInfo: BuildInfo;
46
+ buildMeta: Record<string, any>;
29
47
  }
30
48
 
31
49
  interface NormalModuleConstructor {
@@ -55,6 +73,8 @@ export interface ContextModule extends Module {
55
73
  export interface ExternalModule extends Module {
56
74
  readonly userRequest: string;
57
75
  }
76
+
77
+ export type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
58
78
  /* -- banner.d.ts end -- */
59
79
 
60
80
  /* -- napi-rs generated below -- */
@@ -281,7 +301,7 @@ export declare class JsCompilation {
281
301
  }
282
302
 
283
303
  export declare class JsCompiler {
284
- constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
304
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
285
305
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
286
306
  /** Build with the given option passed to the constructor */
287
307
  build(callback: (err: null | Error) => void): void
@@ -380,11 +400,7 @@ export declare class JsStats {
380
400
  }
381
401
 
382
402
  export declare class KnownBuildInfo {
383
- get _assets(): Assets
384
- get _fileDependencies(): Array<string>
385
- get _contextDependencies(): Array<string>
386
- get _missingDependencies(): Array<string>
387
- get _buildDependencies(): Array<string>
403
+
388
404
  }
389
405
 
390
406
  export declare class Module {
@@ -660,7 +676,7 @@ export interface JsChunkAssetArgs {
660
676
  export interface JsChunkGroupOrigin {
661
677
  module?: Module | undefined
662
678
  request?: string
663
- loc?: string | JsRealDependencyLocation
679
+ loc?: string | RealDependencyLocation
664
680
  }
665
681
 
666
682
  export interface JsChunkOptionNameCtx {
@@ -940,11 +956,6 @@ export interface JsPathDataChunkLike {
940
956
  id?: string
941
957
  }
942
958
 
943
- export interface JsRealDependencyLocation {
944
- start: JsSourcePosition
945
- end?: JsSourcePosition
946
- }
947
-
948
959
  export interface JsResolveArgs {
949
960
  request: string
950
961
  context: string
@@ -1048,6 +1059,7 @@ export interface JsRsdoctorModule {
1048
1059
  belongModules: Array<number>
1049
1060
  chunks: Array<number>
1050
1061
  issuerPath: Array<number>
1062
+ bailoutReason?: string
1051
1063
  }
1052
1064
 
1053
1065
  export interface JsRsdoctorModuleGraph {
@@ -1131,7 +1143,7 @@ export interface JsRspackError {
1131
1143
  name: string
1132
1144
  message: string
1133
1145
  moduleIdentifier?: string
1134
- loc?: string
1146
+ loc?: DependencyLocation
1135
1147
  file?: string
1136
1148
  stack?: string
1137
1149
  hideStack?: boolean
@@ -1168,11 +1180,6 @@ export interface JsRuntimeRequirementInTreeResult {
1168
1180
  allRuntimeRequirements: JsRuntimeGlobals
1169
1181
  }
1170
1182
 
1171
- export interface JsSourcePosition {
1172
- line: number
1173
- column: number
1174
- }
1175
-
1176
1183
  export interface JsStatsAsset {
1177
1184
  type: string
1178
1185
  name: string
@@ -1875,6 +1882,7 @@ incremental?: false | { [key: string]: boolean }
1875
1882
  parallelCodeSplitting: boolean
1876
1883
  rspackFuture?: RawRspackFuture
1877
1884
  cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
1885
+ useInputFileSystem?: false | Array<RegExp>
1878
1886
  }
1879
1887
 
1880
1888
  export interface RawExperimentSnapshotOptions {
@@ -2550,11 +2558,27 @@ export interface RawToOptions {
2550
2558
  absoluteFilename?: string
2551
2559
  }
2552
2560
 
2561
+ export interface RawTraceEvent {
2562
+ name: string
2563
+ trackName?: string
2564
+ processName?: string
2565
+ args?: Record<string, string>
2566
+ uuid: number
2567
+ ts: bigint
2568
+ ph: string
2569
+ categories?: Array<string>
2570
+ }
2571
+
2553
2572
  export interface RawTrustedTypes {
2554
2573
  policyName?: string
2555
2574
  onPolicyCreationFailure?: string
2556
2575
  }
2557
2576
 
2577
+ export interface RealDependencyLocation {
2578
+ start: SourcePosition
2579
+ end?: SourcePosition
2580
+ }
2581
+
2558
2582
  /**
2559
2583
  * Some code is modified based on
2560
2584
  * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
@@ -2562,7 +2586,7 @@ export interface RawTrustedTypes {
2562
2586
  * Author Donny/강동윤
2563
2587
  * Copyright (c)
2564
2588
  */
2565
- export declare function registerGlobalTrace(filter: string, layer: "chrome" | "logger" , output: string): void
2589
+ export declare function registerGlobalTrace(filter: string, layer: "logger" | "perfetto" , output: string): void
2566
2590
 
2567
2591
  export declare enum RegisterJsTapKind {
2568
2592
  CompilerThisCompilation = 0,
@@ -2694,6 +2718,11 @@ export interface SourceMapDevToolPluginOptions {
2694
2718
  debugIds?: boolean
2695
2719
  }
2696
2720
 
2721
+ export interface SourcePosition {
2722
+ line: number
2723
+ column?: number
2724
+ }
2725
+
2697
2726
  /**
2698
2727
  * Start the async runtime manually.
2699
2728
  *
@@ -2702,6 +2731,12 @@ export interface SourceMapDevToolPluginOptions {
2702
2731
  */
2703
2732
  export declare function startAsyncRuntime(): void
2704
2733
 
2734
+ export declare function syncTraceEvent(events: Array<RawTraceEvent>): void
2735
+
2736
+ export interface SyntheticDependencyLocation {
2737
+ name: string
2738
+ }
2739
+
2705
2740
  export interface ThreadsafeNodeFS {
2706
2741
  writeFile: (name: string, content: Buffer) => Promise<void>
2707
2742
  removeFile: (name: string) => Promise<void>
@@ -2712,6 +2747,7 @@ export interface ThreadsafeNodeFS {
2712
2747
  readFile: (name: string) => Promise<Buffer | string | void>
2713
2748
  stat: (name: string) => Promise<NodeFsStats | void>
2714
2749
  lstat: (name: string) => Promise<NodeFsStats | void>
2750
+ realpath: (name: string) => Promise<string | void>
2715
2751
  open: (name: string, flags: string) => Promise<number | void>
2716
2752
  rename: (from: string, to: string) => Promise<void>
2717
2753
  close: (fd: number) => Promise<void>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.3.14",
3
+ "version": "1.4.0-beta.0",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -17,8 +17,8 @@
17
17
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
18
18
  "repository": "web-infra-dev/rspack",
19
19
  "devDependencies": {
20
- "@napi-rs/cli": "3.0.0-alpha.84",
21
- "@napi-rs/wasm-runtime": "^0.2.10",
20
+ "@napi-rs/cli": "3.0.0-alpha.88",
21
+ "@napi-rs/wasm-runtime": "^0.2.11",
22
22
  "emnapi": "^1.4.3",
23
23
  "typescript": "^5.8.3",
24
24
  "@emnapi/core": "^1.4.3"
@@ -47,18 +47,19 @@
47
47
  }
48
48
  },
49
49
  "optionalDependencies": {
50
- "@rspack/binding-darwin-arm64": "1.3.14",
51
- "@rspack/binding-win32-arm64-msvc": "1.3.14",
52
- "@rspack/binding-linux-arm64-gnu": "1.3.14",
53
- "@rspack/binding-linux-arm64-musl": "1.3.14",
54
- "@rspack/binding-win32-ia32-msvc": "1.3.14",
55
- "@rspack/binding-linux-x64-gnu": "1.3.14",
56
- "@rspack/binding-darwin-x64": "1.3.14",
57
- "@rspack/binding-linux-x64-musl": "1.3.14",
58
- "@rspack/binding-win32-x64-msvc": "1.3.14"
50
+ "@rspack/binding-darwin-arm64": "1.4.0-beta.0",
51
+ "@rspack/binding-linux-arm64-gnu": "1.4.0-beta.0",
52
+ "@rspack/binding-linux-arm64-musl": "1.4.0-beta.0",
53
+ "@rspack/binding-win32-arm64-msvc": "1.4.0-beta.0",
54
+ "@rspack/binding-win32-ia32-msvc": "1.4.0-beta.0",
55
+ "@rspack/binding-darwin-x64": "1.4.0-beta.0",
56
+ "@rspack/binding-win32-x64-msvc": "1.4.0-beta.0",
57
+ "@rspack/binding-linux-x64-musl": "1.4.0-beta.0",
58
+ "@rspack/binding-linux-x64-gnu": "1.4.0-beta.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build:dev": "node scripts/build.js",
62
+ "build:debug": "node scripts/build.js --profile release-debug",
62
63
  "build:ci": "node scripts/build.js --profile ci",
63
64
  "build:profiling": "node scripts/build.js --profile profiling",
64
65
  "build:release": "node scripts/build.js --profile release",