Skip to content

Commit c785fce

Browse files
authored
Merge branch 'main' into fix/10721
2 parents 78196b7 + 41f1148 commit c785fce

File tree

54 files changed

+748
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+748
-903
lines changed

crates/node_binding/binding.d.ts

Lines changed: 73 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,63 @@ export declare class AsyncDependenciesBlock {
109109
get blocks(): AsyncDependenciesBlock[]
110110
}
111111

112+
export declare class Chunk {
113+
get name(): string | undefined
114+
get id(): string | undefined
115+
get ids(): Array<string>
116+
get idNameHints(): Array<string>
117+
get filenameTemplate(): string | undefined
118+
get cssFilenameTemplate(): string | undefined
119+
get _files(): Array<string>
120+
get _runtime(): Array<string>
121+
get hash(): string | undefined
122+
get contentHash(): Record<string, string>
123+
get renderedHash(): string | undefined
124+
get chunkReason(): string | undefined
125+
get _auxiliaryFiles(): Array<string>
126+
isOnlyInitial(): boolean
127+
canBeInitial(): boolean
128+
hasRuntime(): boolean
129+
getAllAsyncChunks(): Chunk[]
130+
getAllInitialChunks(): Chunk[]
131+
getAllReferencedChunks(): Chunk[]
132+
get _groupsIterable(): ChunkGroup[]
133+
getEntryOptions(): EntryOptionsDTO | undefined
134+
}
135+
136+
export declare class ChunkGraph {
137+
hasChunkEntryDependentChunks(chunk: Chunk): boolean
138+
getChunkModules(chunk: Chunk): Module[]
139+
getChunkModulesIterable(chunk: Chunk): Iterable<Module>
140+
getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>
141+
getNumberOfEntryModules(chunk: Chunk): number
142+
getChunkEntryDependentChunksIterable(chunk: Chunk): Chunk[]
143+
getChunkModulesIterableBySourceType(chunk: Chunk, sourceType: string): Module[]
144+
getModuleChunks(module: Module): Chunk[]
145+
getModuleId(module: Module): string | number | null
146+
_getModuleHash(module: Module, runtime: string | string[] | undefined): string | null
147+
getBlockChunkGroup(jsBlock: AsyncDependenciesBlock): ChunkGroup | null
148+
}
149+
150+
export declare class ChunkGroup {
151+
get chunks(): Chunk[]
152+
get index(): number | undefined
153+
get name(): string | undefined
154+
get origins(): Array<JsChunkGroupOrigin>
155+
get childrenIterable(): ChunkGroup[]
156+
isInitial(): boolean
157+
getParents(): ChunkGroup[]
158+
getRuntimeChunk(): Chunk
159+
getEntrypointChunk(): Chunk
160+
getFiles(): Array<string>
161+
getModulePreOrderIndex(module: Module): number | null
162+
getModulePostOrderIndex(module: Module): number | null
163+
}
164+
112165
export declare class Chunks {
113166
get size(): number
114-
_values(): JsChunk[]
115-
_has(chunk: JsChunk): boolean
167+
_values(): Chunk[]
168+
_has(chunk: Chunk): boolean
116169
}
117170

118171
export declare class CodeGenerationResult {
@@ -210,58 +263,6 @@ export declare class ExternalModule {
210263
_emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
211264
}
212265

213-
export declare class JsChunk {
214-
get name(): string | undefined
215-
get id(): string | undefined
216-
get ids(): Array<string>
217-
get idNameHints(): Array<string>
218-
get filenameTemplate(): string | undefined
219-
get cssFilenameTemplate(): string | undefined
220-
get files(): Array<string>
221-
get runtime(): Array<string>
222-
get hash(): string | undefined
223-
get contentHash(): Record<string, string>
224-
get renderedHash(): string | undefined
225-
get chunkReason(): string | undefined
226-
get auxiliaryFiles(): Array<string>
227-
isOnlyInitial(): boolean
228-
canBeInitial(): boolean
229-
hasRuntime(): boolean
230-
getAllAsyncChunks(): JsChunk[]
231-
getAllInitialChunks(): JsChunk[]
232-
getAllReferencedChunks(): JsChunk[]
233-
groups(): JsChunkGroup[]
234-
getEntryOptions(): EntryOptionsDTO | undefined
235-
}
236-
237-
export declare class JsChunkGraph {
238-
hasChunkEntryDependentChunks(chunk: JsChunk): boolean
239-
getChunkModules(chunk: JsChunk): Module[]
240-
getChunkEntryModules(chunk: JsChunk): Module[]
241-
getNumberOfEntryModules(chunk: JsChunk): number
242-
getChunkEntryDependentChunksIterable(chunk: JsChunk): JsChunk[]
243-
getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): Module[]
244-
getModuleChunks(module: Module): JsChunk[]
245-
getModuleId(module: Module): string | number | null
246-
getModuleHash(module: Module, runtime: string | string[] | undefined): string | null
247-
getBlockChunkGroup(jsBlock: AsyncDependenciesBlock): JsChunkGroup | null
248-
}
249-
250-
export declare class JsChunkGroup {
251-
get chunks(): JsChunk[]
252-
get index(): number | undefined
253-
get name(): string | undefined
254-
get origins(): Array<JsChunkGroupOrigin>
255-
get childrenIterable(): JsChunkGroup[]
256-
isInitial(): boolean
257-
getParents(): JsChunkGroup[]
258-
getRuntimeChunk(): JsChunk
259-
getEntrypointChunk(): JsChunk
260-
getFiles(): Array<string>
261-
getModulePreOrderIndex(module: Module): number | null
262-
getModulePostOrderIndex(module: Module): number | null
263-
}
264-
265266
export declare class JsCompilation {
266267
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
267268
getAssets(): Readonly<JsAsset>[]
@@ -272,18 +273,18 @@ export declare class JsCompilation {
272273
getOptimizationBailout(): Array<JsStatsOptimizationBailout>
273274
get chunks(): Chunks
274275
getNamedChunkKeys(): Array<string>
275-
getNamedChunk(name: string): JsChunk | null
276+
getNamedChunk(name: string): Chunk
276277
getNamedChunkGroupKeys(): Array<string>
277-
getNamedChunkGroup(name: string): JsChunkGroup
278+
getNamedChunkGroup(name: string): ChunkGroup
278279
setAssetSource(name: string, source: JsCompatSource): void
279280
deleteAssetSource(name: string): void
280281
getAssetFilenames(): Array<string>
281282
hasAsset(name: string): boolean
282283
emitAsset(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
283284
deleteAsset(filename: string): void
284285
renameAsset(filename: string, newName: string): void
285-
get entrypoints(): JsChunkGroup[]
286-
get chunkGroups(): JsChunkGroup[]
286+
get entrypoints(): ChunkGroup[]
287+
get chunkGroups(): ChunkGroup[]
287288
get hash(): string | null
288289
dependencies(): JsDependencies
289290
pushDiagnostic(diagnostic: JsRspackDiagnostic): void
@@ -310,9 +311,9 @@ export declare class JsCompilation {
310311
rebuildModule(moduleIdentifiers: Array<string>, f: any): void
311312
importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string, originalModuleContext: string | undefined | null, callback: any): void
312313
get entries(): JsEntries
313-
addRuntimeModule(chunk: JsChunk, runtimeModule: JsAddingRuntimeModule): void
314+
addRuntimeModule(chunk: Chunk, runtimeModule: JsAddingRuntimeModule): void
314315
get moduleGraph(): JsModuleGraph
315-
get chunkGraph(): JsChunkGraph
316+
get chunkGraph(): ChunkGraph
316317
addEntry(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void
317318
addInclude(args: [string, EntryDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, Module][]) => void): void
318319
get codeGenerationResults(): CodeGenerationResults
@@ -574,7 +575,7 @@ export interface JsAddingRuntimeModule {
574575
}
575576

576577
export interface JsAdditionalTreeRuntimeRequirementsArg {
577-
chunk: JsChunk
578+
chunk: Chunk
578579
runtimeRequirements: JsRuntimeGlobals
579580
}
580581

@@ -642,7 +643,7 @@ export interface JsAssetInfoRelated {
642643

643644
export interface JsBannerContentFnCtx {
644645
hash: string
645-
chunk: JsChunk
646+
chunk: Chunk
646647
filename: string
647648
}
648649

@@ -691,7 +692,7 @@ export interface JsCacheGroupTestCtx {
691692
}
692693

693694
export interface JsChunkAssetArgs {
694-
chunk: JsChunk
695+
chunk: Chunk
695696
filename: string
696697
}
697698

@@ -703,7 +704,7 @@ export interface JsChunkGroupOrigin {
703704

704705
export interface JsChunkOptionNameCtx {
705706
module: Module
706-
chunks: JsChunk[]
707+
chunks: Chunk[]
707708
cacheGroupKey: string
708709
}
709710

@@ -751,7 +752,7 @@ export interface JsCreateData {
751752

752753
export interface JsCreateScriptData {
753754
code: string
754-
chunk: JsChunk
755+
chunk: Chunk
755756
}
756757

757758
export interface JsDefaultObjectRedirectWarnObject {
@@ -895,12 +896,12 @@ export interface JsLibraryOptions {
895896

896897
export interface JsLinkPrefetchData {
897898
code: string
898-
chunk: JsChunk
899+
chunk: Chunk
899900
}
900901

901902
export interface JsLinkPreloadData {
902903
code: string
903-
chunk: JsChunk
904+
chunk: Chunk
904905
}
905906

906907
export interface JsLoaderContext {
@@ -1179,11 +1180,11 @@ export interface JsRuntimeModule {
11791180

11801181
export interface JsRuntimeModuleArg {
11811182
module: JsRuntimeModule
1182-
chunk: JsChunk
1183+
chunk: Chunk
11831184
}
11841185

11851186
export interface JsRuntimeRequirementInTreeArg {
1186-
chunk: JsChunk
1187+
chunk: Chunk
11871188
allRuntimeRequirements: JsRuntimeGlobals
11881189
runtimeRequirements: JsRuntimeGlobals
11891190
}
@@ -1562,7 +1563,7 @@ export interface RawAssetResourceGeneratorOptions {
15621563
}
15631564

15641565
export interface RawBannerPluginOptions {
1565-
banner: string | ((args: { hash: string, chunk: JsChunk, filename: string }) => string)
1566+
banner: string | ((args: { hash: string, chunk: Chunk, filename: string }) => string)
15661567
entryOnly?: boolean
15671568
footer?: boolean
15681569
raw?: boolean
@@ -2697,7 +2698,7 @@ export interface RegisterJsTaps {
26972698
registerCompilationAfterOptimizeModulesTaps: (stages: Array<number>) => Array<{ function: (() => void); stage: number; }>
26982699
registerCompilationOptimizeTreeTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
26992700
registerCompilationOptimizeChunkModulesTaps: (stages: Array<number>) => Array<{ function: (() => Promise<boolean | undefined>); stage: number; }>
2700-
registerCompilationChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunk) => Buffer); stage: number; }>
2701+
registerCompilationChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
27012702
registerCompilationChunkAssetTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunkAssetArgs) => void); stage: number; }>
27022703
registerCompilationProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
27032704
registerCompilationAfterProcessAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
@@ -2711,7 +2712,7 @@ export interface RegisterJsTaps {
27112712
registerNormalModuleFactoryCreateModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise<void>); stage: number; }>
27122713
registerContextModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise<false | JsContextModuleFactoryBeforeResolveData>); stage: number; }>
27132714
registerContextModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise<false | JsContextModuleFactoryAfterResolveData>); stage: number; }>
2714-
registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: JsChunk) => Buffer); stage: number; }>
2715+
registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
27152716
registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }>
27162717
registerHtmlPluginAlterAssetTagsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }>
27172718
registerHtmlPluginAlterAssetTagGroupsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagGroupsData) => JsAlterAssetTagGroupsData); stage: number; }>

0 commit comments

Comments
 (0)