@rspack/binding 1.6.0-beta.0 → 1.6.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/napi-binding.d.ts +46 -32
  2. package/package.json +11 -11
package/napi-binding.d.ts CHANGED
@@ -90,6 +90,11 @@ export interface RspackError extends Error {
90
90
  }
91
91
 
92
92
  export type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
93
+
94
+ export interface JsSource {
95
+ source: string | Buffer
96
+ map?: string
97
+ }
93
98
  /* -- banner.d.ts end -- */
94
99
 
95
100
  /* -- napi-rs generated below -- */
@@ -180,24 +185,24 @@ export declare class ConcatenatedModule {
180
185
  get rootModule(): Module
181
186
  get modules(): Module[]
182
187
  readableIdentifier(): string
183
- _originalSource(): JsCompatSource | undefined
188
+ _originalSource(): JsSource
184
189
  nameForCondition(): string | undefined
185
190
  get blocks(): AsyncDependenciesBlock[]
186
191
  get dependencies(): Dependency[]
187
192
  size(ty?: string | undefined | null): number
188
193
  libIdent(options: JsLibIdentOptions): string | null
189
- _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
194
+ _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
190
195
  }
191
196
 
192
197
  export declare class ContextModule {
193
198
  readableIdentifier(): string
194
- _originalSource(): JsCompatSource | undefined
199
+ _originalSource(): JsSource
195
200
  nameForCondition(): string | undefined
196
201
  get blocks(): AsyncDependenciesBlock[]
197
202
  get dependencies(): Dependency[]
198
203
  size(ty?: string | undefined | null): number
199
204
  libIdent(options: JsLibIdentOptions): string | null
200
- _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
205
+ _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
201
206
  }
202
207
 
203
208
  export declare class Dependency {
@@ -254,20 +259,20 @@ export type EntryOptionsDTO = EntryOptionsDto
254
259
 
255
260
  export declare class ExternalModule {
256
261
  readableIdentifier(): string
257
- _originalSource(): JsCompatSource | undefined
262
+ _originalSource(): JsSource
258
263
  nameForCondition(): string | undefined
259
264
  get blocks(): AsyncDependenciesBlock[]
260
265
  get dependencies(): Dependency[]
261
266
  size(ty?: string | undefined | null): number
262
267
  libIdent(options: JsLibIdentOptions): string | null
263
- _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
268
+ _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
264
269
  }
265
270
 
266
271
  export declare class JsCompilation {
267
- updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSourceOwned) => JsCompatSourceOwned), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
272
+ updateAsset(filename: string, newSourceOrFunction: JsSource | ((source: JsSource) => JsSource), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
268
273
  getAssets(): Readonly<JsAsset>[]
269
274
  getAsset(name: string): JsAsset | null
270
- getAssetSource(name: string): JsCompatSource | null
275
+ getAssetSource(name: string): JsSource | null
271
276
  get modules(): Array<Module>
272
277
  get builtModules(): Array<Module>
273
278
  getOptimizationBailout(): Array<JsStatsOptimizationBailout>
@@ -276,11 +281,11 @@ export declare class JsCompilation {
276
281
  getNamedChunk(name: string): Chunk
277
282
  getNamedChunkGroupKeys(): Array<string>
278
283
  getNamedChunkGroup(name: string): ChunkGroup
279
- setAssetSource(name: string, source: JsCompatSource): void
284
+ setAssetSource(name: string, source: JsSource): void
280
285
  deleteAssetSource(name: string): void
281
286
  getAssetFilenames(): Array<string>
282
287
  hasAsset(name: string): boolean
283
- emitAsset(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
288
+ emitAsset(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
284
289
  deleteAsset(filename: string): void
285
290
  renameAsset(filename: string, newName: string): void
286
291
  get entrypoints(): ChunkGroup[]
@@ -321,7 +326,7 @@ export declare class JsCompilation {
321
326
  }
322
327
 
323
328
  export declare class JsCompiler {
324
- constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
329
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean)
325
330
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
326
331
  /** Build with the given option passed to the constructor */
327
332
  build(callback: (err: null | Error) => void): void
@@ -425,13 +430,13 @@ export declare class KnownBuildInfo {
425
430
 
426
431
  export declare class Module {
427
432
  readableIdentifier(): string
428
- _originalSource(): JsCompatSource | undefined
433
+ _originalSource(): JsSource
429
434
  nameForCondition(): string | undefined
430
435
  get blocks(): AsyncDependenciesBlock[]
431
436
  get dependencies(): Dependency[]
432
437
  size(ty?: string | undefined | null): number
433
438
  libIdent(options: JsLibIdentOptions): string | null
434
- _emitFile(filename: string, source: JsCompatSource, assetInfo?: AssetInfo | undefined | null): void
439
+ _emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
435
440
  }
436
441
 
437
442
  export declare class ModuleGraphConnection {
@@ -486,7 +491,7 @@ export declare class ResolverFactory {
486
491
  }
487
492
 
488
493
  export declare class Sources {
489
- _get(sourceType: string): JsCompatSourceOwned | null
494
+ _get(sourceType: string): JsSource | null
490
495
  }
491
496
 
492
497
  export declare class VirtualFileStore {
@@ -565,6 +570,7 @@ export declare enum BuiltinPluginName {
565
570
  SideEffectsFlagPlugin = 'SideEffectsFlagPlugin',
566
571
  FlagDependencyExportsPlugin = 'FlagDependencyExportsPlugin',
567
572
  FlagDependencyUsagePlugin = 'FlagDependencyUsagePlugin',
573
+ InlineExportsPlugin = 'InlineExportsPlugin',
568
574
  MangleExportsPlugin = 'MangleExportsPlugin',
569
575
  ModuleConcatenationPlugin = 'ModuleConcatenationPlugin',
570
576
  CssModulesPlugin = 'CssModulesPlugin',
@@ -759,23 +765,6 @@ export interface JsCodegenerationResults {
759
765
  map: Record<string, Record<string, JsCodegenerationResult>>
760
766
  }
761
767
 
762
- /**
763
- * Zero copy `JsCompatSource` slice shared between Rust and Node.js if buffer is used.
764
- *
765
- * It can only be used in non-async context and the lifetime is bound to the fn closure.
766
- *
767
- * If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsCompatSourceOwned` instead.
768
- */
769
- export interface JsCompatSource {
770
- source: string | Buffer
771
- map?: string
772
- }
773
-
774
- export interface JsCompatSourceOwned {
775
- source: string | Buffer
776
- map?: string
777
- }
778
-
779
768
  export interface JsCreateData {
780
769
  request: string
781
770
  userRequest: string
@@ -1205,7 +1194,7 @@ export interface JsRuntimeGlobals {
1205
1194
  }
1206
1195
 
1207
1196
  export interface JsRuntimeModule {
1208
- source?: JsCompatSourceOwned
1197
+ source?: JsSource
1209
1198
  moduleIdentifier: string
1210
1199
  constructorName: string
1211
1200
  name: string
@@ -1226,6 +1215,23 @@ export interface JsRuntimeRequirementInTreeResult {
1226
1215
  allRuntimeRequirements: JsRuntimeGlobals
1227
1216
  }
1228
1217
 
1218
+ /**
1219
+ * Zero copy `JsSourceFromJs` slice shared between Rust and Node.js if buffer is used.
1220
+ *
1221
+ * It can only be used in non-async context and the lifetime is bound to the fn closure.
1222
+ *
1223
+ * If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsSourceToJs` instead.
1224
+ */
1225
+ export interface JsSourceFromJs {
1226
+ source: string | Buffer
1227
+ map?: string
1228
+ }
1229
+
1230
+ export interface JsSourceToJs {
1231
+ source: string | Buffer
1232
+ map?: string
1233
+ }
1234
+
1229
1235
  export interface JsStatsAsset {
1230
1236
  type: string
1231
1237
  name: string
@@ -2087,6 +2093,10 @@ export interface RawEnvironment {
2087
2093
  dynamicImportInWorker?: boolean
2088
2094
  }
2089
2095
 
2096
+ export interface RawEsmLibraryPlugin {
2097
+ preserveModules?: string
2098
+ }
2099
+
2090
2100
  export interface RawEvalDevToolModulePluginOptions {
2091
2101
  namespace?: string
2092
2102
  moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
@@ -2112,6 +2122,7 @@ inlineConst: boolean
2112
2122
  inlineEnum: boolean
2113
2123
  typeReexportsPresence: boolean
2114
2124
  lazyBarrel: boolean
2125
+ deferImport: boolean
2115
2126
  }
2116
2127
 
2117
2128
  export interface RawExperimentSnapshotOptions {
@@ -2348,6 +2359,7 @@ typeReexportsPresence?: string
2348
2359
  * @experimental
2349
2360
  */
2350
2361
  jsx?: boolean
2362
+ deferImport?: boolean
2351
2363
  }
2352
2364
 
2353
2365
  export interface RawJsonGeneratorOptions {
@@ -2451,6 +2463,7 @@ export interface RawModuleOptions {
2451
2463
  parser?: Record<string, RawParserOptions>
2452
2464
  generator?: Record<string, RawGeneratorOptions>
2453
2465
  noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2466
+ unsafeCache?: boolean | RegExp
2454
2467
  }
2455
2468
 
2456
2469
  export interface RawModuleRule {
@@ -3003,6 +3016,7 @@ export interface SourceMapDevToolPluginOptions {
3003
3016
  fallbackModuleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
3004
3017
  fileContext?: string
3005
3018
  filename?: (false | null) | string
3019
+ ignoreList?: string | RegExp | (string | RegExp)[]
3006
3020
  module?: boolean
3007
3021
  moduleFilenameTemplate?: string | ((info: RawModuleFilenameTemplateFnCtx) => string)
3008
3022
  namespace?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.6.0-beta.0",
3
+ "version": "1.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -51,16 +51,16 @@
51
51
  }
52
52
  },
53
53
  "optionalDependencies": {
54
- "@rspack/binding-darwin-arm64": "1.6.0-beta.0",
55
- "@rspack/binding-win32-arm64-msvc": "1.6.0-beta.0",
56
- "@rspack/binding-linux-arm64-gnu": "1.6.0-beta.0",
57
- "@rspack/binding-win32-ia32-msvc": "1.6.0-beta.0",
58
- "@rspack/binding-darwin-x64": "1.6.0-beta.0",
59
- "@rspack/binding-linux-arm64-musl": "1.6.0-beta.0",
60
- "@rspack/binding-wasm32-wasi": "1.6.0-beta.0",
61
- "@rspack/binding-win32-x64-msvc": "1.6.0-beta.0",
62
- "@rspack/binding-linux-x64-gnu": "1.6.0-beta.0",
63
- "@rspack/binding-linux-x64-musl": "1.6.0-beta.0"
54
+ "@rspack/binding-linux-arm64-gnu": "1.6.0",
55
+ "@rspack/binding-win32-arm64-msvc": "1.6.0",
56
+ "@rspack/binding-linux-arm64-musl": "1.6.0",
57
+ "@rspack/binding-win32-ia32-msvc": "1.6.0",
58
+ "@rspack/binding-darwin-x64": "1.6.0",
59
+ "@rspack/binding-wasm32-wasi": "1.6.0",
60
+ "@rspack/binding-linux-x64-gnu": "1.6.0",
61
+ "@rspack/binding-win32-x64-msvc": "1.6.0",
62
+ "@rspack/binding-linux-x64-musl": "1.6.0",
63
+ "@rspack/binding-darwin-arm64": "1.6.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build:dev": "node scripts/build.js",