@rspack-debug/browser 2.0.0-rc.0 → 2.0.0-rc.3
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/dist/ModuleGraph.d.ts +2 -1
- package/dist/ModuleGraphConnection.d.ts +10 -0
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/devServer.d.ts +2 -2
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +56 -20
- package/dist/exports.d.ts +9 -1
- package/dist/index.js +181 -90
- package/dist/napi-binding.d.ts +26 -14
- package/dist/rspack.wasi-browser.js +8 -3
- package/dist/wasi-worker-browser.mjs +348 -59
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/package.json +4 -2
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
package/dist/napi-binding.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
|
|
|
25
25
|
|
|
26
26
|
export const RUST_ERROR_SYMBOL: unique symbol;
|
|
27
27
|
|
|
28
|
+
export const CIRCULAR_CONNECTION_SYMBOL: unique symbol;
|
|
29
|
+
export const TRANSITIVE_ONLY_SYMBOL: unique symbol;
|
|
30
|
+
export type ConnectionState = boolean | typeof CIRCULAR_CONNECTION_SYMBOL | typeof TRANSITIVE_ONLY_SYMBOL;
|
|
31
|
+
|
|
28
32
|
interface KnownBuildInfo {
|
|
29
33
|
[BUILD_INFO_ASSETS_SYMBOL]: Assets,
|
|
30
34
|
[BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
|
|
@@ -452,6 +456,7 @@ export declare class ModuleGraphConnection {
|
|
|
452
456
|
get module(): Module | null
|
|
453
457
|
get resolvedModule(): Module | null
|
|
454
458
|
get originModule(): Module | null
|
|
459
|
+
getActiveState(runtime: string | string[] | undefined): ConnectionState
|
|
455
460
|
}
|
|
456
461
|
|
|
457
462
|
export declare class NativeWatcher {
|
|
@@ -544,7 +549,6 @@ export declare enum BuiltinPluginName {
|
|
|
544
549
|
HotModuleReplacementPlugin = 'HotModuleReplacementPlugin',
|
|
545
550
|
LimitChunkCountPlugin = 'LimitChunkCountPlugin',
|
|
546
551
|
WorkerPlugin = 'WorkerPlugin',
|
|
547
|
-
WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
|
|
548
552
|
MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
|
|
549
553
|
SplitChunksPlugin = 'SplitChunksPlugin',
|
|
550
554
|
RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
|
|
@@ -561,6 +565,7 @@ export declare enum BuiltinPluginName {
|
|
|
561
565
|
NamedModuleIdsPlugin = 'NamedModuleIdsPlugin',
|
|
562
566
|
NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin',
|
|
563
567
|
DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin',
|
|
568
|
+
HashedModuleIdsPlugin = 'HashedModuleIdsPlugin',
|
|
564
569
|
NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
|
|
565
570
|
NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
|
|
566
571
|
DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin',
|
|
@@ -726,7 +731,7 @@ export interface JsBeforeModuleIdsArg {
|
|
|
726
731
|
}
|
|
727
732
|
|
|
728
733
|
export interface JsBeforeModuleIdsResult {
|
|
729
|
-
assignments: Record<string, string>
|
|
734
|
+
assignments: Record<string, string | number>
|
|
730
735
|
}
|
|
731
736
|
|
|
732
737
|
export interface JsBuildMeta {
|
|
@@ -734,15 +739,11 @@ export interface JsBuildMeta {
|
|
|
734
739
|
hasTopLevelAwait?: boolean
|
|
735
740
|
esm?: boolean
|
|
736
741
|
exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
|
|
737
|
-
defaultObject?: undefined | 'false' | 'redirect' |
|
|
742
|
+
defaultObject?: undefined | 'false' | 'redirect' | 'redirect-warn'
|
|
738
743
|
sideEffectFree?: boolean
|
|
739
744
|
exportsFinalName?: Array<[string, string]> | undefined
|
|
740
745
|
}
|
|
741
746
|
|
|
742
|
-
export interface JsBuildMetaDefaultObjectRedirectWarn {
|
|
743
|
-
redirectWarn: JsDefaultObjectRedirectWarnObject
|
|
744
|
-
}
|
|
745
|
-
|
|
746
747
|
export interface JsBuildTimeExecutionOption {
|
|
747
748
|
publicPath?: string
|
|
748
749
|
baseUri?: string
|
|
@@ -804,10 +805,6 @@ export interface JsCreateScriptData {
|
|
|
804
805
|
chunk: Chunk
|
|
805
806
|
}
|
|
806
807
|
|
|
807
|
-
export interface JsDefaultObjectRedirectWarnObject {
|
|
808
|
-
ignore: boolean
|
|
809
|
-
}
|
|
810
|
-
|
|
811
808
|
export interface JsDiagnostic {
|
|
812
809
|
message: string
|
|
813
810
|
help?: string
|
|
@@ -1887,6 +1884,7 @@ export interface RawCacheGroupOptions {
|
|
|
1887
1884
|
minChunks?: number
|
|
1888
1885
|
minSize?: number | RawSplitChunkSizes
|
|
1889
1886
|
minSizeReduction?: number | RawSplitChunkSizes
|
|
1887
|
+
enforceSizeThreshold?: number | RawSplitChunkSizes
|
|
1890
1888
|
maxSize?: number | RawSplitChunkSizes
|
|
1891
1889
|
maxAsyncSize?: number | RawSplitChunkSizes
|
|
1892
1890
|
maxInitialSize?: number | RawSplitChunkSizes
|
|
@@ -2234,6 +2232,7 @@ export interface RawExperiments {
|
|
|
2234
2232
|
useInputFileSystem?: false | Array<RegExp>
|
|
2235
2233
|
css?: boolean
|
|
2236
2234
|
deferImport: boolean
|
|
2235
|
+
pureFunctions: boolean
|
|
2237
2236
|
}
|
|
2238
2237
|
|
|
2239
2238
|
export interface RawExposeOptions {
|
|
@@ -2308,6 +2307,13 @@ export interface RawGeneratorOptions {
|
|
|
2308
2307
|
json?: RawJsonGeneratorOptions
|
|
2309
2308
|
}
|
|
2310
2309
|
|
|
2310
|
+
export interface RawHashedModuleIdsPluginOptions {
|
|
2311
|
+
context?: string
|
|
2312
|
+
hashFunction?: string
|
|
2313
|
+
hashDigest?: string
|
|
2314
|
+
hashDigestLength?: number
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2311
2317
|
export interface RawHtmlRspackPluginBaseOptions {
|
|
2312
2318
|
href?: string
|
|
2313
2319
|
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
@@ -2469,6 +2475,12 @@ jsx?: boolean
|
|
|
2469
2475
|
* @experimental
|
|
2470
2476
|
*/
|
|
2471
2477
|
importMetaResolve?: boolean
|
|
2478
|
+
/**
|
|
2479
|
+
* Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
|
|
2480
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2481
|
+
* @experimental
|
|
2482
|
+
*/
|
|
2483
|
+
pureFunctions?: Array<string>
|
|
2472
2484
|
}
|
|
2473
2485
|
|
|
2474
2486
|
export interface RawJsonGeneratorOptions {
|
|
@@ -2894,10 +2906,10 @@ export interface RawRslibPluginOptions {
|
|
|
2894
2906
|
*/
|
|
2895
2907
|
forceNodeShims?: boolean
|
|
2896
2908
|
/**
|
|
2897
|
-
*
|
|
2909
|
+
* Auto downgrade module external type to node-commonjs for CJS require of node builtins
|
|
2898
2910
|
* @default `false`
|
|
2899
2911
|
*/
|
|
2900
|
-
|
|
2912
|
+
autoCjsNodeBuiltin?: boolean
|
|
2901
2913
|
}
|
|
2902
2914
|
|
|
2903
2915
|
export interface RawRstestPluginOptions {
|
|
@@ -2988,7 +3000,7 @@ export interface RawSplitChunksOptions {
|
|
|
2988
3000
|
hidePathInfo?: boolean
|
|
2989
3001
|
minSize?: number | RawSplitChunkSizes
|
|
2990
3002
|
minSizeReduction?: number | RawSplitChunkSizes
|
|
2991
|
-
enforceSizeThreshold?: number
|
|
3003
|
+
enforceSizeThreshold?: number | RawSplitChunkSizes
|
|
2992
3004
|
minRemainingSize?: number | RawSplitChunkSizes
|
|
2993
3005
|
maxSize?: number | RawSplitChunkSizes
|
|
2994
3006
|
maxAsyncSize?: number | RawSplitChunkSizes
|
|
@@ -17,13 +17,14 @@ const __wasi = new __WASI({
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
-
const __wasmUrl =
|
|
20
|
+
const __wasmUrl = globalThis.RSPACK_WASM_URL || new URL('./rspack.wasm32-wasi.wasm', import.meta.url).href
|
|
21
21
|
const __emnapiContext = __emnapiGetDefaultContext()
|
|
22
22
|
__emnapiContext.feature.Buffer = Buffer
|
|
23
23
|
|
|
24
|
+
// Allocate 2GB fixed shared memory (initial == maximum to disable memory.grow).
|
|
24
25
|
const __sharedMemory = new WebAssembly.Memory({
|
|
25
|
-
initial:
|
|
26
|
-
maximum:
|
|
26
|
+
initial: 32768,
|
|
27
|
+
maximum: 32768,
|
|
27
28
|
shared: true,
|
|
28
29
|
})
|
|
29
30
|
|
|
@@ -57,6 +58,10 @@ const {
|
|
|
57
58
|
...importObject.napi,
|
|
58
59
|
...importObject.emnapi,
|
|
59
60
|
memory: __sharedMemory,
|
|
61
|
+
// Override emnapi's napi_adjust_external_memory to a no-op.
|
|
62
|
+
// emnapi implements this by calling memory.grow, but we've disabled memory.grow
|
|
63
|
+
// (initial == maximum).
|
|
64
|
+
napi_adjust_external_memory() { return 0 },
|
|
60
65
|
}
|
|
61
66
|
return importObject
|
|
62
67
|
},
|