@rspack/binding 1.4.0-beta.0 → 1.4.0-rc.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.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <picture>
2
- <img alt="Rspack Banner" src="https://assets.rspack.rs/rspack/rspack-banner.png">
2
+ <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner.png">
3
3
  </picture>
4
4
 
5
5
  # @rspack/binding
package/binding.d.ts CHANGED
@@ -41,7 +41,6 @@ export interface Module {
41
41
  set factoryMeta(factoryMeta: JsFactoryMeta);
42
42
  get useSourceMap(): boolean;
43
43
  get useSimpleSourceMap(): boolean;
44
- get _readableIdentifier(): string;
45
44
  buildInfo: BuildInfo;
46
45
  buildMeta: Record<string, any>;
47
46
  }
@@ -111,6 +110,7 @@ export declare class CodeGenerationResults {
111
110
  export declare class ConcatenatedModule {
112
111
  get rootModule(): Module
113
112
  get modules(): Module[]
113
+ readableIdentifier(): string
114
114
  _originalSource(): JsCompatSource | undefined
115
115
  nameForCondition(): string | undefined
116
116
  get blocks(): AsyncDependenciesBlock[]
@@ -121,6 +121,7 @@ export declare class ConcatenatedModule {
121
121
  }
122
122
 
123
123
  export declare class ContextModule {
124
+ readableIdentifier(): string
124
125
  _originalSource(): JsCompatSource | undefined
125
126
  nameForCondition(): string | undefined
126
127
  get blocks(): AsyncDependenciesBlock[]
@@ -183,6 +184,7 @@ export declare class EntryOptionsDto {
183
184
  export type EntryOptionsDTO = EntryOptionsDto
184
185
 
185
186
  export declare class ExternalModule {
187
+ readableIdentifier(): string
186
188
  _originalSource(): JsCompatSource | undefined
187
189
  nameForCondition(): string | undefined
188
190
  get blocks(): AsyncDependenciesBlock[]
@@ -404,6 +406,7 @@ export declare class KnownBuildInfo {
404
406
  }
405
407
 
406
408
  export declare class Module {
409
+ readableIdentifier(): string
407
410
  _originalSource(): JsCompatSource | undefined
408
411
  nameForCondition(): string | undefined
409
412
  get blocks(): AsyncDependenciesBlock[]
@@ -1059,7 +1062,7 @@ export interface JsRsdoctorModule {
1059
1062
  belongModules: Array<number>
1060
1063
  chunks: Array<number>
1061
1064
  issuerPath: Array<number>
1062
- bailoutReason?: string
1065
+ bailoutReason: Array<string>
1063
1066
  }
1064
1067
 
1065
1068
  export interface JsRsdoctorModuleGraph {
@@ -1479,6 +1482,8 @@ export declare function loadBrowserslist(input: string | undefined | null, conte
1479
1482
 
1480
1483
  export declare function minify(source: string, options: string): Promise<TransformOutput>
1481
1484
 
1485
+ export declare function minifySync(source: string, options: string): TransformOutput
1486
+
1482
1487
  export interface NodeFsStats {
1483
1488
  isFile: boolean
1484
1489
  isDirectory: boolean
@@ -1883,6 +1888,7 @@ parallelCodeSplitting: boolean
1883
1888
  rspackFuture?: RawRspackFuture
1884
1889
  cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
1885
1890
  useInputFileSystem?: false | Array<RegExp>
1891
+ inlineConst: boolean
1886
1892
  }
1887
1893
 
1888
1894
  export interface RawExperimentSnapshotOptions {
@@ -2092,6 +2098,16 @@ export interface RawJavascriptParserOptions {
2092
2098
  * @experimental
2093
2099
  */
2094
2100
  importDynamic?: boolean
2101
+ /**
2102
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2103
+ * @experimental
2104
+ */
2105
+ inlineConst?: boolean
2106
+ /**
2107
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2108
+ * @experimental
2109
+ */
2110
+ typeReexportsPresence?: string
2095
2111
  }
2096
2112
 
2097
2113
  export interface RawJsonGeneratorOptions {
@@ -2455,6 +2471,9 @@ export interface RawRspackFuture {
2455
2471
 
2456
2472
  export interface RawRstestPluginOptions {
2457
2473
  injectModulePathName: boolean
2474
+ importMetaPathName: boolean
2475
+ hoistMockModule: boolean
2476
+ manualMockRoot: string
2458
2477
  }
2459
2478
 
2460
2479
  export interface RawRuleSetCondition {
@@ -2692,14 +2711,6 @@ export interface RegisterJsTaps {
2692
2711
  registerRsdoctorPluginAssetsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorAssetPatch) => Promise<boolean | undefined>); stage: number; }>
2693
2712
  }
2694
2713
 
2695
- /**
2696
- * Shutdown the tokio runtime manually.
2697
- *
2698
- * This is required for the wasm target with `tokio_unstable` cfg.
2699
- * In the wasm runtime, the `park` threads will hang there until the tokio::Runtime is shutdown.
2700
- */
2701
- export declare function shutdownAsyncRuntime(): void
2702
-
2703
2714
  export interface SourceMapDevToolPluginOptions {
2704
2715
  append?: (false | null) | string | Function
2705
2716
  columns?: boolean
@@ -2723,14 +2734,6 @@ export interface SourcePosition {
2723
2734
  column?: number
2724
2735
  }
2725
2736
 
2726
- /**
2727
- * Start the async runtime manually.
2728
- *
2729
- * This is required when the async runtime is shutdown manually.
2730
- * Usually it's used in test.
2731
- */
2732
- export declare function startAsyncRuntime(): void
2733
-
2734
2737
  export declare function syncTraceEvent(events: Array<RawTraceEvent>): void
2735
2738
 
2736
2739
  export interface SyntheticDependencyLocation {
@@ -2765,3 +2768,5 @@ export interface TransformOutput {
2765
2768
  map?: string
2766
2769
  diagnostics: Array<string>
2767
2770
  }
2771
+
2772
+ export declare function transformSync(source: string, options: string): TransformOutput
package/binding.js CHANGED
@@ -1,4 +1,4 @@
1
- const { existsSync, readFileSync } = require('fs')
1
+ const { existsSync } = require('fs')
2
2
  const { join } = require('path')
3
3
 
4
4
  const { platform, arch } = process
@@ -8,18 +8,8 @@ let localFileExisted = false
8
8
  let loadError = null
9
9
 
10
10
  function isMusl() {
11
- // For Node 10
12
- if (!process.report || typeof process.report.getReport !== 'function') {
13
- try {
14
- const lddPath = require('child_process').execSync('which ldd').toString().trim();
15
- return readFileSync(lddPath, 'utf8').includes('musl')
16
- } catch (e) {
17
- return true
18
- }
19
- } else {
20
- const { glibcVersionRuntime } = process.report.getReport().header
21
- return !glibcVersionRuntime
22
- }
11
+ const { glibcVersionRuntime } = process.report.getReport().header
12
+ return !glibcVersionRuntime
23
13
  }
24
14
 
25
15
  switch (platform) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.4.0-beta.0",
3
+ "version": "1.4.0-rc.0",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -47,15 +47,16 @@
47
47
  }
48
48
  },
49
49
  "optionalDependencies": {
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"
50
+ "@rspack/binding-darwin-arm64": "1.4.0-rc.0",
51
+ "@rspack/binding-linux-arm64-gnu": "1.4.0-rc.0",
52
+ "@rspack/binding-win32-arm64-msvc": "1.4.0-rc.0",
53
+ "@rspack/binding-linux-arm64-musl": "1.4.0-rc.0",
54
+ "@rspack/binding-wasm32-wasi": "1.4.0-rc.0",
55
+ "@rspack/binding-win32-ia32-msvc": "1.4.0-rc.0",
56
+ "@rspack/binding-darwin-x64": "1.4.0-rc.0",
57
+ "@rspack/binding-win32-x64-msvc": "1.4.0-rc.0",
58
+ "@rspack/binding-linux-x64-gnu": "1.4.0-rc.0",
59
+ "@rspack/binding-linux-x64-musl": "1.4.0-rc.0"
59
60
  },
60
61
  "scripts": {
61
62
  "build:dev": "node scripts/build.js",