@rspack-debug/browser 2.0.0-alpha.0 → 2.0.0-alpha.1

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.
@@ -79,6 +79,7 @@ export type CompilerHooks = {
79
79
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
80
80
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
81
81
  };
82
+ export declare const GET_COMPILER_ID: unique symbol;
82
83
  declare class Compiler {
83
84
  #private;
84
85
  hooks: CompilerHooks;
@@ -21,6 +21,10 @@ export type SwcLoaderOptions = Config & {
21
21
  */
22
22
  rspackExperiments?: {
23
23
  import?: PluginImportOptions;
24
+ /**
25
+ * Enable React Server Components support.
26
+ */
27
+ reactServerComponents?: boolean;
24
28
  };
25
29
  };
26
30
  export interface TerserCompressOptions {
@@ -73,6 +73,7 @@ export * from './RslibPlugin';
73
73
  export * from './RstestPlugin';
74
74
  export * from './RuntimeChunkPlugin';
75
75
  export * from './RuntimePlugin';
76
+ export { rsc } from './rsc';
76
77
  export * from './SideEffectsFlagPlugin';
77
78
  export * from './SizeLimitsPlugin';
78
79
  export * from './SourceMapDevToolPlugin';
@@ -0,0 +1,8 @@
1
+ import { type Compiler } from '../../Compiler';
2
+ export declare const GET_OR_INIT_BINDING: unique symbol;
3
+ export declare class Coordinator {
4
+ #private;
5
+ constructor();
6
+ applyServerCompiler(serverCompiler: Compiler): void;
7
+ applyClientCompiler(clientCompiler: Compiler): void;
8
+ }
@@ -0,0 +1,13 @@
1
+ import type binding from '../../binding';
2
+ import type { Compiler } from '../..';
3
+ import { RspackBuiltinPlugin } from '../base';
4
+ import { type Coordinator } from './Coordinator';
5
+ export type RscClientPluginOptions = {
6
+ coordinator: Coordinator;
7
+ };
8
+ export declare class RscClientPlugin extends RspackBuiltinPlugin {
9
+ #private;
10
+ name: string;
11
+ constructor(options: RscClientPluginOptions);
12
+ raw(compiler: Compiler): binding.BuiltinPlugin;
13
+ }
@@ -0,0 +1,14 @@
1
+ import type binding from '../../binding';
2
+ import type { Compiler } from '../..';
3
+ import { RspackBuiltinPlugin } from '../base';
4
+ import { type Coordinator } from './Coordinator';
5
+ export type RscServerPluginOptions = {
6
+ coordinator: Coordinator;
7
+ onServerComponentChanges?: () => Promise<void>;
8
+ };
9
+ export declare class RscServerPlugin extends RspackBuiltinPlugin {
10
+ #private;
11
+ name: string;
12
+ constructor(options: RscServerPluginOptions);
13
+ raw(compiler: Compiler): binding.BuiltinPlugin;
14
+ }
@@ -0,0 +1,24 @@
1
+ import { RscClientPlugin, type RscClientPluginOptions } from './RscClientPlugin';
2
+ import { RscServerPlugin } from './RscServerPlugin';
3
+ declare class ServerPlugin extends RscServerPlugin {
4
+ constructor(options?: Omit<RscClientPluginOptions, 'coordinator'>);
5
+ }
6
+ declare class ClientPlugin extends RscClientPlugin {
7
+ }
8
+ export declare const rsc: {
9
+ createPlugins: () => {
10
+ ServerPlugin: new (options?: Omit<RscClientPluginOptions, "coordinator">) => ServerPlugin;
11
+ ClientPlugin: new () => ClientPlugin;
12
+ };
13
+ Layers: {
14
+ /**
15
+ * The layer for server-only runtime and picking up `react-server` export conditions.
16
+ */
17
+ readonly rsc: "react-server-components";
18
+ /**
19
+ * Server Side Rendering layer for app.
20
+ */
21
+ readonly ssr: "server-side-rendering";
22
+ };
23
+ };
24
+ export {};
@@ -1989,25 +1989,17 @@ export type Incremental = {
1989
1989
  */
1990
1990
  silent?: boolean;
1991
1991
  /**
1992
- * Enable incremental make.
1992
+ * Enable incremental build module graph.
1993
1993
  */
1994
- make?: boolean;
1994
+ buildModuleGraph?: boolean;
1995
1995
  /**
1996
- * Enable inference of async modules.
1996
+ * Enable incremental finish modules.
1997
1997
  */
1998
- inferAsyncModules?: boolean;
1998
+ finishModules?: boolean;
1999
1999
  /**
2000
- * Enable incremental provided exports.
2000
+ * Enable incremental optimize dependencies.
2001
2001
  */
2002
- providedExports?: boolean;
2003
- /**
2004
- * Enables diagnostics for dependencies.
2005
- */
2006
- dependenciesDiagnostics?: boolean;
2007
- /**
2008
- * Enables incremental side effects optimization.
2009
- */
2010
- sideEffects?: boolean;
2002
+ optimizeDependencies?: boolean;
2011
2003
  /**
2012
2004
  * Enable incremental build chunk graph.
2013
2005
  */
@@ -2041,11 +2033,11 @@ export type Incremental = {
2041
2033
  */
2042
2034
  chunksHashes?: boolean;
2043
2035
  /**
2044
- * Enable incremental chunk render.
2036
+ * Enable incremental chunk asset.
2045
2037
  */
2046
- chunksRender?: boolean;
2038
+ chunkAsset?: boolean;
2047
2039
  /**
2048
- * Enable incremental asset emission.
2040
+ * Enable incremental emit assets.
2049
2041
  */
2050
2042
  emitAssets?: boolean;
2051
2043
  };
package/dist/exports.d.ts CHANGED
@@ -55,7 +55,7 @@ export { EnvironmentPlugin } from './lib/EnvironmentPlugin';
55
55
  export { LoaderOptionsPlugin } from './lib/LoaderOptionsPlugin';
56
56
  export { LoaderTargetPlugin } from './lib/LoaderTargetPlugin';
57
57
  export type { OutputFileSystem, WatchFileSystem } from './util/fs';
58
- import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from './builtin-plugin';
58
+ import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, rsc, SubresourceIntegrityPlugin } from './builtin-plugin';
59
59
  export { SubresourceIntegrityPlugin };
60
60
  interface Web {
61
61
  FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
@@ -161,5 +161,6 @@ interface Experiments {
161
161
  CssChunkingPlugin: typeof CssChunkingPlugin;
162
162
  createNativePlugin: typeof createNativePlugin;
163
163
  VirtualModulesPlugin: typeof VirtualModulesPlugin;
164
+ rsc: typeof rsc;
164
165
  }
165
166
  export declare const experiments: Experiments;
package/dist/index.js CHANGED
@@ -50754,6 +50754,17 @@ class Stats {
50754
50754
  compilation: this.compilation,
50755
50755
  getStatsCompilation: (compilation)=>{
50756
50756
  if (statsCompilationMap.has(compilation)) return statsCompilationMap.get(compilation);
50757
+ if (this.compilation !== this.compilation.compiler._lastCompilation) return {
50758
+ assets: [],
50759
+ assetsByChunkName: [],
50760
+ chunks: [],
50761
+ entrypoints: [],
50762
+ errors: [],
50763
+ hash: 'XXXX',
50764
+ modules: [],
50765
+ namedChunkGroups: [],
50766
+ warnings: []
50767
+ };
50757
50768
  const innerStats = this.#getInnerByCompilation(compilation);
50758
50769
  options.warnings = false;
50759
50770
  const innerStatsCompilation = innerStats.toJson(options);
@@ -50775,6 +50786,17 @@ class Stats {
50775
50786
  compilation: this.compilation,
50776
50787
  getStatsCompilation: (compilation)=>{
50777
50788
  if (statsCompilationMap.has(compilation)) return statsCompilationMap.get(compilation);
50789
+ if (this.compilation !== this.compilation.compiler._lastCompilation) return {
50790
+ assets: [],
50791
+ assetsByChunkName: [],
50792
+ chunks: [],
50793
+ entrypoints: [],
50794
+ errors: [],
50795
+ hash: 'XXXX',
50796
+ modules: [],
50797
+ namedChunkGroups: [],
50798
+ warnings: []
50799
+ };
50778
50800
  const innerStats = this.#getInnerByCompilation(compilation);
50779
50801
  const innerStatsCompilation = innerStats.toJson(options);
50780
50802
  statsCompilationMap.set(compilation, innerStatsCompilation);
@@ -55882,6 +55904,110 @@ const createRuntimePluginHooksRegisters = (getCompiler, createTap)=>({
55882
55904
  };
55883
55905
  })
55884
55906
  });
55907
+ const Coordinator_PLUGIN_NAME = 'RscPlugin';
55908
+ const GET_OR_INIT_BINDING = Symbol('GET_OR_INIT_BINDING');
55909
+ class Coordinator {
55910
+ #serverCompiler;
55911
+ #clientCompiler;
55912
+ #clientLastCompilation;
55913
+ #isProxyingClientWatching = false;
55914
+ #binding;
55915
+ constructor(){
55916
+ Object.defineProperty(this, GET_OR_INIT_BINDING, {
55917
+ enumerable: false,
55918
+ configurable: false,
55919
+ writable: false,
55920
+ value: ()=>{
55921
+ if (!this.#binding) this.#binding = new external_rspack_wasi_browser_js_.JsCoordinator(()=>{
55922
+ if (!this.#serverCompiler) throw new Error("[RscPlugin] Coordinator.getOrInitBinding() called before the server compiler was attached. Call coordinator.applyServerCompiler(serverCompiler) first.");
55923
+ return this.#serverCompiler[GET_COMPILER_ID]();
55924
+ });
55925
+ return this.#binding;
55926
+ }
55927
+ });
55928
+ }
55929
+ applyServerCompiler(serverCompiler) {
55930
+ this.#serverCompiler = serverCompiler;
55931
+ serverCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
55932
+ this.#isProxyingClientWatching = true;
55933
+ if (this.#clientLastCompilation) {
55934
+ stats.compilation.fileDependencies.addAll(this.#clientLastCompilation.fileDependencies);
55935
+ stats.compilation.contextDependencies.addAll(this.#clientLastCompilation.contextDependencies);
55936
+ stats.compilation.missingDependencies.addAll(this.#clientLastCompilation.missingDependencies);
55937
+ }
55938
+ });
55939
+ serverCompiler.hooks.watchRun.tap(Coordinator_PLUGIN_NAME, ()=>{
55940
+ if (!this.#isProxyingClientWatching) return;
55941
+ this.#clientCompiler.watching.invalidateWithChangesAndRemovals(new Set(this.#serverCompiler.modifiedFiles), new Set(this.#serverCompiler.removedFiles));
55942
+ });
55943
+ }
55944
+ applyClientCompiler(clientCompiler) {
55945
+ this.#clientCompiler = clientCompiler;
55946
+ const originalWatch = clientCompiler.watch;
55947
+ clientCompiler.watch = function(watchOptions, handler) {
55948
+ watchOptions.ignored = ()=>true;
55949
+ return originalWatch.call(this, watchOptions, handler);
55950
+ };
55951
+ clientCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
55952
+ this.#clientLastCompilation = stats.compilation;
55953
+ });
55954
+ }
55955
+ }
55956
+ class RscClientPlugin extends RspackBuiltinPlugin {
55957
+ name = 'RscClientPlugin';
55958
+ #options;
55959
+ constructor(options){
55960
+ super();
55961
+ this.#options = options;
55962
+ }
55963
+ raw(compiler) {
55964
+ this.#options.coordinator.applyClientCompiler(compiler);
55965
+ return createBuiltinPlugin(this.name, {
55966
+ coordinator: this.#options.coordinator[GET_OR_INIT_BINDING]()
55967
+ });
55968
+ }
55969
+ }
55970
+ class RscServerPlugin extends RspackBuiltinPlugin {
55971
+ name = 'RscServerPlugin';
55972
+ #options;
55973
+ constructor(options){
55974
+ super();
55975
+ this.#options = options;
55976
+ }
55977
+ raw(compiler) {
55978
+ this.#options.coordinator.applyServerCompiler(compiler);
55979
+ return createBuiltinPlugin(this.name, {
55980
+ coordinator: this.#options.coordinator[GET_OR_INIT_BINDING](),
55981
+ onServerComponentChanges: this.#options.onServerComponentChanges
55982
+ });
55983
+ }
55984
+ }
55985
+ const rsc = {
55986
+ createPlugins: ()=>{
55987
+ const coordinator = new Coordinator();
55988
+ return {
55989
+ ServerPlugin: class extends RscServerPlugin {
55990
+ constructor(options = {}){
55991
+ super({
55992
+ coordinator,
55993
+ ...options
55994
+ });
55995
+ }
55996
+ },
55997
+ ClientPlugin: class extends RscClientPlugin {
55998
+ constructor(){
55999
+ super({
56000
+ coordinator
56001
+ });
56002
+ }
56003
+ }
56004
+ };
56005
+ },
56006
+ Layers: {
56007
+ rsc: 'react-server-components',
56008
+ ssr: 'server-side-rendering'
56009
+ }
56010
+ };
55885
56011
  const SideEffectsFlagPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, 'compilation');
55886
56012
  const SizeLimitsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
55887
56013
  const hints = false === options.hints ? void 0 : options.hints;
@@ -57625,11 +57751,9 @@ const applyIncrementalDefaults = (options)=>{
57625
57751
  D(options, 'incremental', {});
57626
57752
  if ('object' == typeof options.incremental) {
57627
57753
  D(options.incremental, 'silent', true);
57628
- D(options.incremental, 'make', true);
57629
- D(options.incremental, 'inferAsyncModules', true);
57630
- D(options.incremental, 'providedExports', true);
57631
- D(options.incremental, 'dependenciesDiagnostics', true);
57632
- D(options.incremental, 'sideEffects', true);
57754
+ D(options.incremental, 'buildModuleGraph', true);
57755
+ D(options.incremental, 'finishModules', true);
57756
+ D(options.incremental, 'optimizeDependencies', true);
57633
57757
  D(options.incremental, 'buildChunkGraph', false);
57634
57758
  D(options.incremental, 'moduleIds', true);
57635
57759
  D(options.incremental, 'chunkIds', true);
@@ -57638,7 +57762,7 @@ const applyIncrementalDefaults = (options)=>{
57638
57762
  D(options.incremental, 'modulesRuntimeRequirements', true);
57639
57763
  D(options.incremental, 'chunksRuntimeRequirements', true);
57640
57764
  D(options.incremental, 'chunksHashes', true);
57641
- D(options.incremental, 'chunksRender', true);
57765
+ D(options.incremental, 'chunkAsset', true);
57642
57766
  D(options.incremental, 'emitAssets', true);
57643
57767
  }
57644
57768
  };
@@ -58042,7 +58166,7 @@ const applyOutputDefaults = (options, { context, outputModule, targetProperties:
58042
58166
  });
58043
58167
  D(output, 'bundlerInfo', {});
58044
58168
  if ('object' == typeof output.bundlerInfo) {
58045
- D(output.bundlerInfo, 'version', "2.0.0-alpha.0");
58169
+ D(output.bundlerInfo, 'version', "2.0.0-alpha.1");
58046
58170
  D(output.bundlerInfo, 'bundler', 'rspack');
58047
58171
  D(output.bundlerInfo, 'force', !output.library);
58048
58172
  }
@@ -58592,11 +58716,9 @@ const getNormalizedIncrementalOptions = (incremental)=>{
58592
58716
  if (false === incremental || 'none' === incremental) return false;
58593
58717
  if ('safe' === incremental) return {
58594
58718
  silent: true,
58595
- make: true,
58596
- inferAsyncModules: false,
58597
- providedExports: false,
58598
- dependenciesDiagnostics: false,
58599
- sideEffects: false,
58719
+ buildModuleGraph: true,
58720
+ finishModules: false,
58721
+ optimizeDependencies: false,
58600
58722
  buildChunkGraph: false,
58601
58723
  moduleIds: false,
58602
58724
  chunkIds: false,
@@ -58605,7 +58727,7 @@ const getNormalizedIncrementalOptions = (incremental)=>{
58605
58727
  modulesRuntimeRequirements: false,
58606
58728
  chunksRuntimeRequirements: false,
58607
58729
  chunksHashes: false,
58608
- chunksRender: false,
58730
+ chunkAsset: false,
58609
58731
  emitAssets: true
58610
58732
  };
58611
58733
  if (true === incremental || 'advance-silent' === incremental) return {};
@@ -59704,7 +59826,7 @@ class MultiStats {
59704
59826
  return obj;
59705
59827
  });
59706
59828
  if (childOptions.version) {
59707
- obj.rspackVersion = "2.0.0-alpha.0";
59829
+ obj.rspackVersion = "2.0.0-alpha.1";
59708
59830
  obj.version = "5.75.0";
59709
59831
  }
59710
59832
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
@@ -61258,17 +61380,25 @@ const SIMPLE_EXTRACTORS = {
61258
61380
  if (!context.makePathsRelative) context.makePathsRelative = makePathsRelative.bindContextCache(compilation.compiler.context, compilation.compiler.root);
61259
61381
  if (!context.cachedGetErrors) {
61260
61382
  const map = new WeakMap();
61261
- context.cachedGetErrors = (compilation)=>map.get(compilation) || ((errors)=>{
61262
- map.set(compilation, errors);
61263
- return errors;
61264
- })(statsCompilation.errors);
61383
+ context.cachedGetErrors = (compilation)=>{
61384
+ if (compilation.compiler._lastCompilation !== compilation) return [];
61385
+ const cache = map.get(compilation);
61386
+ if (cache) return cache;
61387
+ const errors = statsCompilation.errors;
61388
+ map.set(compilation, errors);
61389
+ return errors;
61390
+ };
61265
61391
  }
61266
61392
  if (!context.cachedGetWarnings) {
61267
61393
  const map = new WeakMap();
61268
- context.cachedGetWarnings = (compilation)=>map.get(compilation) || ((warnings)=>{
61269
- map.set(compilation, warnings);
61270
- return warnings;
61271
- })(compilation.__internal_getInner().createStatsWarnings(compilation.getWarnings(), !!options.colors));
61394
+ context.cachedGetWarnings = (compilation)=>{
61395
+ if (compilation.compiler._lastCompilation !== compilation) return [];
61396
+ const cache = map.get(compilation);
61397
+ if (cache) return cache;
61398
+ const warnings = compilation.__internal_getInner().createStatsWarnings(compilation.getWarnings(), !!options.colors);
61399
+ map.set(compilation, warnings);
61400
+ return warnings;
61401
+ };
61272
61402
  }
61273
61403
  if (compilation.name) object.name = compilation.name;
61274
61404
  const logging = options.logging;
@@ -61382,7 +61512,7 @@ const SIMPLE_EXTRACTORS = {
61382
61512
  },
61383
61513
  version: (object)=>{
61384
61514
  object.version = "5.75.0";
61385
- object.rspackVersion = "2.0.0-alpha.0";
61515
+ object.rspackVersion = "2.0.0-alpha.1";
61386
61516
  },
61387
61517
  env: (object, _compilation, _context, { _env })=>{
61388
61518
  object.env = _env;
@@ -64039,26 +64169,28 @@ class Watching {
64039
64169
  compilation.endTime = Date.now();
64040
64170
  const cbs = this.callbacks;
64041
64171
  this.callbacks = [];
64042
- const fileDependencies = new Set([
64043
- ...compilation.fileDependencies
64044
- ]);
64045
- fileDependencies.added = new Set(compilation.__internal__addedFileDependencies);
64046
- fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
64047
- const contextDependencies = new Set([
64048
- ...compilation.contextDependencies
64049
- ]);
64050
- contextDependencies.added = new Set(compilation.__internal__addedContextDependencies);
64051
- contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
64052
- const missingDependencies = new Set([
64053
- ...compilation.missingDependencies
64054
- ]);
64055
- missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies);
64056
- missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies);
64057
64172
  this.compiler.hooks.done.callAsync(stats, (err)=>{
64058
64173
  if (err) return handleError(err, cbs);
64059
64174
  this.handler(null, stats);
64060
64175
  Watching_process.nextTick(()=>{
64061
- if (!this.#closed) this.watch(fileDependencies, contextDependencies, missingDependencies);
64176
+ if (!this.#closed) {
64177
+ const fileDependencies = new Set([
64178
+ ...compilation.fileDependencies
64179
+ ]);
64180
+ fileDependencies.added = new Set(compilation.__internal__addedFileDependencies);
64181
+ fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
64182
+ const contextDependencies = new Set([
64183
+ ...compilation.contextDependencies
64184
+ ]);
64185
+ contextDependencies.added = new Set(compilation.__internal__addedContextDependencies);
64186
+ contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
64187
+ const missingDependencies = new Set([
64188
+ ...compilation.missingDependencies
64189
+ ]);
64190
+ missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies);
64191
+ missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies);
64192
+ this.watch(fileDependencies, contextDependencies, missingDependencies);
64193
+ }
64062
64194
  });
64063
64195
  for (const cb of cbs)cb(null);
64064
64196
  this.compiler.hooks.afterDone.call(stats);
@@ -64089,6 +64221,7 @@ class Watching {
64089
64221
  }
64090
64222
  }
64091
64223
  }
64224
+ const GET_COMPILER_ID = Symbol('getCompilerId');
64092
64225
  class Compiler {
64093
64226
  #instance;
64094
64227
  #initial;
@@ -64264,6 +64397,12 @@ class Compiler {
64264
64397
  this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader);
64265
64398
  new JsLoaderRspackPlugin(this).apply(this);
64266
64399
  new ExecuteModulePlugin().apply(this);
64400
+ Object.defineProperty(this, GET_COMPILER_ID, {
64401
+ writable: false,
64402
+ configurable: false,
64403
+ enumerable: false,
64404
+ value: ()=>this.#instance.getCompilerId()
64405
+ });
64267
64406
  }
64268
64407
  get recordsInputPath() {
64269
64408
  return unsupported('Compiler.recordsInputPath');
@@ -65600,7 +65739,7 @@ function transformSync(source, options) {
65600
65739
  const _options = JSON.stringify(options || {});
65601
65740
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
65602
65741
  }
65603
- const exports_rspackVersion = "2.0.0-alpha.0";
65742
+ const exports_rspackVersion = "2.0.0-alpha.1";
65604
65743
  const exports_version = "5.75.0";
65605
65744
  const exports_WebpackError = Error;
65606
65745
  const exports_config = {
@@ -65684,7 +65823,8 @@ const exports_experiments = {
65684
65823
  },
65685
65824
  CssChunkingPlugin: CssChunkingPlugin,
65686
65825
  createNativePlugin: createNativePlugin,
65687
- VirtualModulesPlugin: VirtualModulesPlugin
65826
+ VirtualModulesPlugin: VirtualModulesPlugin,
65827
+ rsc: rsc
65688
65828
  };
65689
65829
  const src_fn = Object.assign(rspack, exports_namespaceObject);
65690
65830
  src_fn.rspack = src_fn;
@@ -95,6 +95,8 @@ export interface JsSource {
95
95
  source: string | Buffer
96
96
  map?: string
97
97
  }
98
+
99
+ export type CompilerId = void;
98
100
  /* -- banner.d.ts end -- */
99
101
 
100
102
  /* -- napi-rs generated below -- */
@@ -213,6 +215,7 @@ export declare class Dependency {
213
215
  get critical(): boolean
214
216
  set critical(val: boolean)
215
217
  get ids(): Array<string> | undefined
218
+ get loc(): DependencyLocation | null
216
219
  }
217
220
 
218
221
  export declare class Diagnostics {
@@ -334,6 +337,7 @@ export declare class JsCompiler {
334
337
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
335
338
  close(): Promise<void>
336
339
  getVirtualFileStore(): VirtualFileStore | null
340
+ getCompilerId(): ExternalObject<CompilerId>
337
341
  }
338
342
 
339
343
  export declare class JsContextModuleFactoryAfterResolveData {
@@ -361,6 +365,10 @@ export declare class JsContextModuleFactoryBeforeResolveData {
361
365
  set recursive(recursive: boolean)
362
366
  }
363
367
 
368
+ export declare class JsCoordinator {
369
+ constructor(getServerCompilerIdJsFn: () => ExternalObject<CompilerId>)
370
+ }
371
+
364
372
  export declare class JsDependencies {
365
373
  get fileDependencies(): Array<string>
366
374
  get addedFileDependencies(): Array<string>
@@ -602,7 +610,9 @@ export declare enum BuiltinPluginName {
602
610
  LazyCompilationPlugin = 'LazyCompilationPlugin',
603
611
  ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
604
612
  HttpUriPlugin = 'HttpUriPlugin',
605
- CssChunkingPlugin = 'CssChunkingPlugin'
613
+ CssChunkingPlugin = 'CssChunkingPlugin',
614
+ RscServerPlugin = 'RscServerPlugin',
615
+ RscClientPlugin = 'RscClientPlugin'
606
616
  }
607
617
 
608
618
  export declare function cleanupGlobalTrace(): void
@@ -1028,6 +1038,15 @@ export interface JsResourceData {
1028
1038
  descriptionFilePath?: string
1029
1039
  }
1030
1040
 
1041
+ export interface JsRscClientPluginOptions {
1042
+ coordinator: JsCoordinator
1043
+ }
1044
+
1045
+ export interface JsRscServerPluginOptions {
1046
+ coordinator: JsCoordinator
1047
+ onServerComponentChanges?: (() => void) | undefined | null
1048
+ }
1049
+
1031
1050
  export interface JsRsdoctorAsset {
1032
1051
  ukey: number
1033
1052
  path: string
@@ -2259,11 +2278,9 @@ export interface RawIgnorePluginOptions {
2259
2278
 
2260
2279
  export interface RawIncremental {
2261
2280
  silent: boolean
2262
- make: boolean
2263
- inferAsyncModules: boolean
2264
- providedExports: boolean
2265
- dependenciesDiagnostics: boolean
2266
- sideEffects: boolean
2281
+ buildModuleGraph: boolean
2282
+ finishModules: boolean
2283
+ optimizeDependencies: boolean
2267
2284
  buildChunkGraph: boolean
2268
2285
  moduleIds: boolean
2269
2286
  chunkIds: boolean
@@ -2272,7 +2289,7 @@ export interface RawIncremental {
2272
2289
  modulesRuntimeRequirements: boolean
2273
2290
  chunksRuntimeRequirements: boolean
2274
2291
  chunksHashes: boolean
2275
- chunksRender: boolean
2292
+ chunkAsset: boolean
2276
2293
  emitAssets: boolean
2277
2294
  }
2278
2295
 
@@ -85,6 +85,7 @@ export const JsCompilation = __napiModule.exports.JsCompilation
85
85
  export const JsCompiler = __napiModule.exports.JsCompiler
86
86
  export const JsContextModuleFactoryAfterResolveData = __napiModule.exports.JsContextModuleFactoryAfterResolveData
87
87
  export const JsContextModuleFactoryBeforeResolveData = __napiModule.exports.JsContextModuleFactoryBeforeResolveData
88
+ export const JsCoordinator = __napiModule.exports.JsCoordinator
88
89
  export const JsDependencies = __napiModule.exports.JsDependencies
89
90
  export const JsEntries = __napiModule.exports.JsEntries
90
91
  export const JsExportsInfo = __napiModule.exports.JsExportsInfo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/browser",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",