@rspack/binding 1.1.0-beta.0 → 1.1.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 +67 -85
  2. package/package.json +10 -10
package/binding.d.ts CHANGED
@@ -19,28 +19,6 @@ export class ExternalObject<T> {
19
19
  [K: symbol]: T
20
20
  }
21
21
  }
22
- export class DependenciesBlockDto {
23
- get dependencies(): Array<JsDependency>
24
- get blocks(): Array<DependenciesBlockDto>
25
- }
26
- export type DependenciesBlockDTO = DependenciesBlockDto
27
-
28
- export class DependenciesDto {
29
- get fileDependencies(): Array<string>
30
- get addedFileDependencies(): Array<string>
31
- get removedFileDependencies(): Array<string>
32
- get contextDependencies(): Array<string>
33
- get addedContextDependencies(): Array<string>
34
- get removedContextDependencies(): Array<string>
35
- get missingDependencies(): Array<string>
36
- get addedMissingDependencies(): Array<string>
37
- get removedMissingDependencies(): Array<string>
38
- get buildDependencies(): Array<string>
39
- get addedBuildDependencies(): Array<string>
40
- get removedBuildDependencies(): Array<string>
41
- }
42
- export type DependenciesDTO = DependenciesDto
43
-
44
22
  export class EntryDataDto {
45
23
  get dependencies(): Array<JsDependency>
46
24
  get includeDependencies(): Array<JsDependency>
@@ -73,8 +51,8 @@ export class JsCompilation {
73
51
  getAssets(): Readonly<JsAsset>[]
74
52
  getAsset(name: string): JsAsset | null
75
53
  getAssetSource(name: string): JsCompatSource | null
76
- get modules(): Array<ModuleDTO>
77
- get builtModules(): Array<ModuleDTO>
54
+ get modules(): Array<JsModule>
55
+ get builtModules(): Array<JsModule>
78
56
  getOptimizationBailout(): Array<JsStatsOptimizationBailout>
79
57
  getChunks(): Array<JsChunk>
80
58
  getNamedChunkKeys(): Array<string>
@@ -92,7 +70,7 @@ export class JsCompilation {
92
70
  get entrypoints(): Record<string, JsChunkGroup>
93
71
  get chunkGroups(): Array<JsChunkGroup>
94
72
  get hash(): string | null
95
- dependencies(): DependenciesDto
73
+ dependencies(): JsDependencies
96
74
  pushDiagnostic(diagnostic: JsRspackDiagnostic): void
97
75
  spliceDiagnostic(start: number, end: number, replaceWith: Array<JsRspackDiagnostic>): void
98
76
  pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void
@@ -121,8 +99,8 @@ export class JsContextModuleFactoryAfterResolveData {
121
99
  set context(context: string)
122
100
  get request(): string
123
101
  set request(request: string)
124
- get regExp(): RawRegex | undefined
125
- set regExp(rawRegExp: RawRegex | undefined)
102
+ get regExp(): RegExp | undefined
103
+ set regExp(rawRegExp: RegExp | undefined)
126
104
  get recursive(): boolean
127
105
  set recursive(recursive: boolean)
128
106
  get dependencies(): Array<JsDependencyMut>
@@ -133,12 +111,32 @@ export class JsContextModuleFactoryBeforeResolveData {
133
111
  set context(context: string)
134
112
  get request(): string
135
113
  set request(request: string)
136
- get regExp(): RawRegex | undefined
137
- set regExp(rawRegExp: RawRegex | undefined)
114
+ get regExp(): RegExp | undefined
115
+ set regExp(rawRegExp: RegExp | undefined)
138
116
  get recursive(): boolean
139
117
  set recursive(recursive: boolean)
140
118
  }
141
119
 
120
+ export class JsDependencies {
121
+ get fileDependencies(): Array<string>
122
+ get addedFileDependencies(): Array<string>
123
+ get removedFileDependencies(): Array<string>
124
+ get contextDependencies(): Array<string>
125
+ get addedContextDependencies(): Array<string>
126
+ get removedContextDependencies(): Array<string>
127
+ get missingDependencies(): Array<string>
128
+ get addedMissingDependencies(): Array<string>
129
+ get removedMissingDependencies(): Array<string>
130
+ get buildDependencies(): Array<string>
131
+ get addedBuildDependencies(): Array<string>
132
+ get removedBuildDependencies(): Array<string>
133
+ }
134
+
135
+ export class JsDependenciesBlock {
136
+ get dependencies(): Array<JsDependency>
137
+ get blocks(): Array<JsDependenciesBlock>
138
+ }
139
+
142
140
  export class JsDependency {
143
141
  get type(): string
144
142
  get category(): string
@@ -165,6 +163,26 @@ export class JsEntries {
165
163
  values(): Array<EntryDataDto>
166
164
  }
167
165
 
166
+ export class JsModule {
167
+ get context(): string | undefined
168
+ get originalSource(): JsCompatSource | undefined
169
+ get resource(): string | undefined
170
+ get moduleIdentifier(): string
171
+ get nameForCondition(): string | undefined
172
+ get request(): string | undefined
173
+ get userRequest(): string | undefined
174
+ set userRequest(val: string)
175
+ get rawRequest(): string | undefined
176
+ get factoryMeta(): JsFactoryMeta | undefined
177
+ get type(): string
178
+ get layer(): string | undefined
179
+ get blocks(): Array<JsDependenciesBlock>
180
+ get dependencies(): Array<JsDependency>
181
+ size(ty?: string | undefined | null): number
182
+ get modules(): JsModule[] | undefined
183
+ get useSourceMap(): boolean
184
+ }
185
+
168
186
  export class JsResolver {
169
187
  resolveSync(path: string, request: string): string | false
170
188
  withOptions(raw?: RawResolveOptionsWithDependencyType | undefined | null): this
@@ -182,24 +200,6 @@ export class JsStats {
182
200
  getLogging(acceptedTypes: number): Array<JsStatsLogging>
183
201
  }
184
202
 
185
- export class ModuleDto {
186
- get context(): string | undefined
187
- get originalSource(): JsCompatSource | undefined
188
- get resource(): string | undefined
189
- get moduleIdentifier(): string
190
- get nameForCondition(): string | undefined
191
- get request(): string | undefined
192
- get userRequest(): string | undefined
193
- get rawRequest(): string | undefined
194
- get factoryMeta(): JsFactoryMeta | undefined
195
- get type(): string
196
- get layer(): string | undefined
197
- get blocks(): Array<DependenciesBlockDto>
198
- size(ty?: string | undefined | null): number
199
- get modules(): ModuleDTO[] | undefined
200
- }
201
- export type ModuleDTO = ModuleDto
202
-
203
203
  export class Rspack {
204
204
  constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
205
205
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
@@ -209,29 +209,29 @@ export class Rspack {
209
209
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
210
210
  }
211
211
 
212
- export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, compilation: JsCompilation): Array<JsChunk>
212
+ export function __chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
213
213
 
214
- export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, compilation: JsCompilation): Array<JsModule>
214
+ export function __chunk_graph_inner_get_chunk_entry_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
215
215
 
216
- export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, compilation: JsCompilation): ModuleDTO[]
216
+ export function __chunk_graph_inner_get_chunk_modules(jsChunkUkey: number, jsCompilation: JsCompilation): JsModule[]
217
217
 
218
- export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, compilation: JsCompilation): Array<JsModule>
218
+ export function __chunk_graph_inner_get_chunk_modules_iterable_by_source_type(jsChunkUkey: number, sourceType: string, jsCompilation: JsCompilation): JsModule[]
219
219
 
220
- export function __chunk_group_inner_get_chunk_group(ukey: number, compilation: JsCompilation): JsChunkGroup
220
+ export function __chunk_group_inner_get_chunk_group(ukey: number, jsCompilation: JsCompilation): JsChunkGroup
221
221
 
222
- export function __chunk_inner_can_be_initial(jsChunkUkey: number, compilation: JsCompilation): boolean
222
+ export function __chunk_inner_can_be_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
223
223
 
224
- export function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, compilation: JsCompilation): Array<JsChunk>
224
+ export function __chunk_inner_get_all_async_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
225
225
 
226
- export function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, compilation: JsCompilation): Array<JsChunk>
226
+ export function __chunk_inner_get_all_initial_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
227
227
 
228
- export function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, compilation: JsCompilation): Array<JsChunk>
228
+ export function __chunk_inner_get_all_referenced_chunks(jsChunkUkey: number, jsCompilation: JsCompilation): Array<JsChunk>
229
229
 
230
- export function __chunk_inner_has_runtime(jsChunkUkey: number, compilation: JsCompilation): boolean
230
+ export function __chunk_inner_has_runtime(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
231
231
 
232
- export function __chunk_inner_is_only_initial(jsChunkUkey: number, compilation: JsCompilation): boolean
232
+ export function __chunk_inner_is_only_initial(jsChunkUkey: number, jsCompilation: JsCompilation): boolean
233
233
 
234
- export function __entrypoint_inner_get_runtime_chunk(ukey: number, compilation: JsCompilation): JsChunk
234
+ export function __entrypoint_inner_get_runtime_chunk(ukey: number, jsCompilation: JsCompilation): JsChunk
235
235
 
236
236
  export interface BuiltinPlugin {
237
237
  name: BuiltinPluginName
@@ -325,7 +325,8 @@ export function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diag
325
325
  export interface JsAddingRuntimeModule {
326
326
  name: string
327
327
  generator: () => String
328
- cacheable: boolean
328
+ dependentHash: boolean
329
+ fullHash: boolean
329
330
  isolate: boolean
330
331
  stage: number
331
332
  }
@@ -451,7 +452,7 @@ export interface JsBuildTimeExecutionOption {
451
452
  }
452
453
 
453
454
  export interface JsCacheGroupTestCtx {
454
- module: ModuleDTO
455
+ module: JsModule
455
456
  }
456
457
 
457
458
  export interface JsChunk {
@@ -488,7 +489,7 @@ export interface JsChunkGroup {
488
489
  }
489
490
 
490
491
  export interface JsChunkGroupOrigin {
491
- module?: ModuleDTO
492
+ module?: JsModule | undefined
492
493
  request?: string
493
494
  }
494
495
 
@@ -659,6 +660,7 @@ export interface JsLoaderContext {
659
660
  loaderItems: Array<JsLoaderItem>
660
661
  loaderIndex: number
661
662
  loaderState: Readonly<JsLoaderState>
663
+ __internal__error?: JsRspackError
662
664
  }
663
665
 
664
666
  export interface JsLoaderItem {
@@ -674,21 +676,6 @@ export enum JsLoaderState {
674
676
  Normal = 'Normal'
675
677
  }
676
678
 
677
- export interface JsModule {
678
- context?: string
679
- originalSource?: JsCompatSource
680
- resource?: string
681
- moduleIdentifier: string
682
- nameForCondition?: string
683
- request?: string
684
- userRequest?: string
685
- rawRequest?: string
686
- factoryMeta?: JsFactoryMeta
687
- type: string
688
- layer?: string
689
- useSourceMap?: boolean
690
- }
691
-
692
679
  export interface JsModuleDescriptor {
693
680
  identifier: string
694
681
  name: string
@@ -1204,10 +1191,10 @@ export interface RawContainerReferencePluginOptions {
1204
1191
  }
1205
1192
 
1206
1193
  export interface RawContextReplacementPluginOptions {
1207
- resourceRegExp: RawRegex
1194
+ resourceRegExp: RegExp
1208
1195
  newContentResource?: string
1209
1196
  newContentRecursive?: boolean
1210
- newContentRegExp?: RawRegex
1197
+ newContentRegExp?: RegExp
1211
1198
  newContentCreateContextMap?: Record<string, string>
1212
1199
  }
1213
1200
 
@@ -1738,11 +1725,6 @@ export interface RawProvideOptions {
1738
1725
  strictVersion?: boolean
1739
1726
  }
1740
1727
 
1741
- export interface RawRegex {
1742
- source: string
1743
- flags: string
1744
- }
1745
-
1746
1728
  export interface RawRelated {
1747
1729
  sourceMap?: string
1748
1730
  }
@@ -1816,7 +1798,7 @@ export interface RawRspackFuture {
1816
1798
  export interface RawRuleSetCondition {
1817
1799
  type: RawRuleSetConditionType
1818
1800
  string?: string
1819
- regexp?: RawRegex
1801
+ regexp?: RegExp
1820
1802
  logical?: Array<RawRuleSetLogicalConditions>
1821
1803
  array?: Array<RawRuleSetCondition>
1822
1804
  func?: (value: string) => boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.1.0-beta.0",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -24,15 +24,15 @@
24
24
  "binaryName": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@rspack/binding-win32-arm64-msvc": "1.1.0-beta.0",
28
- "@rspack/binding-darwin-arm64": "1.1.0-beta.0",
29
- "@rspack/binding-linux-arm64-gnu": "1.1.0-beta.0",
30
- "@rspack/binding-linux-arm64-musl": "1.1.0-beta.0",
31
- "@rspack/binding-win32-ia32-msvc": "1.1.0-beta.0",
32
- "@rspack/binding-darwin-x64": "1.1.0-beta.0",
33
- "@rspack/binding-win32-x64-msvc": "1.1.0-beta.0",
34
- "@rspack/binding-linux-x64-gnu": "1.1.0-beta.0",
35
- "@rspack/binding-linux-x64-musl": "1.1.0-beta.0"
27
+ "@rspack/binding-darwin-arm64": "1.1.0",
28
+ "@rspack/binding-win32-arm64-msvc": "1.1.0",
29
+ "@rspack/binding-linux-arm64-musl": "1.1.0",
30
+ "@rspack/binding-linux-arm64-gnu": "1.1.0",
31
+ "@rspack/binding-win32-ia32-msvc": "1.1.0",
32
+ "@rspack/binding-darwin-x64": "1.1.0",
33
+ "@rspack/binding-linux-x64-gnu": "1.1.0",
34
+ "@rspack/binding-win32-x64-msvc": "1.1.0",
35
+ "@rspack/binding-linux-x64-musl": "1.1.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build:debug": "node scripts/build.js",