@rspack-canary/browser 1.7.0-canary-be5d0ef3-20251222175046 → 1.7.0-canary-ecf3f75d-20251223084957

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.
@@ -78,6 +78,7 @@ export type CompilerHooks = {
78
78
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
79
79
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
80
80
  };
81
+ export declare const GET_COMPILER_ID: unique symbol;
81
82
  declare class Compiler {
82
83
  #private;
83
84
  hooks: CompilerHooks;
@@ -21,6 +21,10 @@ export type SwcLoaderOptions = Config & {
21
21
  * providing better TypeScript development experience and smaller output bundle size.
22
22
  */
23
23
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
24
+ /**
25
+ * Enable React Server Components support.
26
+ */
27
+ reactServerComponents?: boolean;
24
28
  };
25
29
  };
26
30
  export interface TerserCompressOptions {
@@ -72,6 +72,10 @@ export * from "./RslibPlugin";
72
72
  export * from "./RstestPlugin";
73
73
  export * from "./RuntimeChunkPlugin";
74
74
  export * from "./RuntimePlugin";
75
+ export { createRscPlugins, RSC_LAYERS_NAMES } from "./rsc";
76
+ export * from "./rsc/Coordinator";
77
+ export * from "./rsc/RscClientPlugin";
78
+ export * from "./rsc/RscServerPlugin";
75
79
  export * from "./SideEffectsFlagPlugin";
76
80
  export * from "./SizeLimitsPlugin";
77
81
  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,10 @@
1
+ import type binding from "../../binding";
2
+ import type { Compiler } from "../..";
3
+ import { RspackBuiltinPlugin } from "../base";
4
+ import { type Coordinator } from "./Coordinator";
5
+ export declare class RscClientPlugin extends RspackBuiltinPlugin {
6
+ #private;
7
+ name: string;
8
+ constructor(coordinator: Coordinator);
9
+ raw(compiler: Compiler): binding.BuiltinPlugin;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type binding from "../../binding";
2
+ import type { Compiler } from "../..";
3
+ import { RspackBuiltinPlugin } from "../base";
4
+ import { type Coordinator } from "./Coordinator";
5
+ export declare class RscServerPlugin extends RspackBuiltinPlugin {
6
+ #private;
7
+ name: string;
8
+ constructor(coordinator: Coordinator);
9
+ raw(compiler: Compiler): binding.BuiltinPlugin;
10
+ }
@@ -0,0 +1,19 @@
1
+ import type { RspackPluginInstance } from "../..";
2
+ export declare function createRscPlugins(): {
3
+ ServerPlugin: RspackPluginInstance;
4
+ ClientPlugin: RspackPluginInstance;
5
+ };
6
+ export declare const RSC_LAYERS_NAMES: {
7
+ /**
8
+ * The layer for server-only runtime and picking up `react-server` export conditions.
9
+ */
10
+ reactServerComponents: string;
11
+ /**
12
+ * Server Side Rendering layer for app.
13
+ */
14
+ serverSideRendering: string;
15
+ /**
16
+ * The browser client bundle layer for actions.
17
+ */
18
+ actionBrowser: string;
19
+ };
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 { EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
58
+ import { createRscPlugins, EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, RSC_LAYERS_NAMES, SubresourceIntegrityPlugin } from "./builtin-plugin";
59
59
  export { SubresourceIntegrityPlugin };
60
60
  interface Web {
61
61
  FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
@@ -132,7 +132,7 @@ export declare const sharing: {
132
132
  export type { FeatureOptions as LightningcssFeatureOptions, LoaderOptions as LightningcssLoaderOptions } from "./builtin-loader/lightningcss/index";
133
133
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
134
134
  export type { CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
135
- export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
135
+ export { CircularDependencyRspackPlugin, ContextReplacementPlugin, Coordinator, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, RscClientPlugin, RscServerPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
136
136
  import { EnforceExtension, ResolverFactory, async as resolveAsync, sync as resolveSync } from "./binding";
137
137
  import { createNativePlugin } from "./builtin-plugin";
138
138
  import { minify, minifySync, transform, transformSync } from "./swc";
@@ -170,5 +170,7 @@ interface Experiments {
170
170
  CssChunkingPlugin: typeof CssChunkingPlugin;
171
171
  createNativePlugin: typeof createNativePlugin;
172
172
  VirtualModulesPlugin: typeof VirtualModulesPlugin;
173
+ createRscPlugins: typeof createRscPlugins;
174
+ RSC_LAYERS_NAMES: typeof RSC_LAYERS_NAMES;
173
175
  }
174
176
  export declare const experiments: Experiments;
package/dist/index.mjs CHANGED
@@ -50568,6 +50568,7 @@ __webpack_require__.d(exports_namespaceObject, {
50568
50568
  ConcatenatedModule: ()=>external_rspack_wasi_browser_js_.ConcatenatedModule,
50569
50569
  ContextModule: ()=>external_rspack_wasi_browser_js_.ContextModule,
50570
50570
  ContextReplacementPlugin: ()=>ContextReplacementPlugin,
50571
+ Coordinator: ()=>Coordinator,
50571
50572
  CopyRspackPlugin: ()=>CopyRspackPlugin,
50572
50573
  CssExtractRspackPlugin: ()=>CssExtractRspackPlugin,
50573
50574
  DefinePlugin: ()=>DefinePlugin,
@@ -50598,6 +50599,8 @@ __webpack_require__.d(exports_namespaceObject, {
50598
50599
  NormalModuleReplacementPlugin: ()=>NormalModuleReplacementPlugin,
50599
50600
  ProgressPlugin: ()=>ProgressPlugin,
50600
50601
  ProvidePlugin: ()=>ProvidePlugin,
50602
+ RscClientPlugin: ()=>RscClientPlugin,
50603
+ RscServerPlugin: ()=>RscServerPlugin,
50601
50604
  RspackOptionsApply: ()=>RspackOptionsApply,
50602
50605
  RuntimeGlobals: ()=>DefaultRuntimeGlobals,
50603
50606
  RuntimeModule: ()=>RuntimeModule,
@@ -56683,6 +56686,238 @@ const createRuntimePluginHooksRegisters = (getCompiler, createTap)=>({
56683
56686
  };
56684
56687
  })
56685
56688
  });
56689
+ function Coordinator_check_private_redeclaration(obj, privateCollection) {
56690
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
56691
+ }
56692
+ function Coordinator_class_apply_descriptor_get(receiver, descriptor) {
56693
+ if (descriptor.get) return descriptor.get.call(receiver);
56694
+ return descriptor.value;
56695
+ }
56696
+ function Coordinator_class_apply_descriptor_set(receiver, descriptor, value) {
56697
+ if (descriptor.set) descriptor.set.call(receiver, value);
56698
+ else {
56699
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
56700
+ descriptor.value = value;
56701
+ }
56702
+ }
56703
+ function Coordinator_class_extract_field_descriptor(receiver, privateMap, action) {
56704
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
56705
+ return privateMap.get(receiver);
56706
+ }
56707
+ function Coordinator_class_private_field_get(receiver, privateMap) {
56708
+ var descriptor = Coordinator_class_extract_field_descriptor(receiver, privateMap, "get");
56709
+ return Coordinator_class_apply_descriptor_get(receiver, descriptor);
56710
+ }
56711
+ function Coordinator_class_private_field_init(obj, privateMap, value) {
56712
+ Coordinator_check_private_redeclaration(obj, privateMap);
56713
+ privateMap.set(obj, value);
56714
+ }
56715
+ function Coordinator_class_private_field_set(receiver, privateMap, value) {
56716
+ var descriptor = Coordinator_class_extract_field_descriptor(receiver, privateMap, "set");
56717
+ Coordinator_class_apply_descriptor_set(receiver, descriptor, value);
56718
+ return value;
56719
+ }
56720
+ const Coordinator_PLUGIN_NAME = "RscPlugin";
56721
+ const GET_OR_INIT_BINDING = Symbol("GET_OR_INIT_BINDING");
56722
+ var _serverCompiler = /*#__PURE__*/ new WeakMap(), _clientCompiler = /*#__PURE__*/ new WeakMap(), _clientLastCompilation = /*#__PURE__*/ new WeakMap(), _binding = /*#__PURE__*/ new WeakMap();
56723
+ class Coordinator {
56724
+ applyServerCompiler(serverCompiler) {
56725
+ Coordinator_class_private_field_set(this, _serverCompiler, serverCompiler);
56726
+ serverCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
56727
+ if (Coordinator_class_private_field_get(this, _clientLastCompilation)) {
56728
+ stats.compilation.fileDependencies.addAll(Coordinator_class_private_field_get(this, _clientLastCompilation).fileDependencies);
56729
+ stats.compilation.contextDependencies.addAll(Coordinator_class_private_field_get(this, _clientLastCompilation).contextDependencies);
56730
+ stats.compilation.missingDependencies.addAll(Coordinator_class_private_field_get(this, _clientLastCompilation).missingDependencies);
56731
+ }
56732
+ });
56733
+ serverCompiler.hooks.watchRun.tap(Coordinator_PLUGIN_NAME, ()=>{
56734
+ Coordinator_class_private_field_get(this, _clientCompiler).watching.invalidateWithChangesAndRemovals(new Set(Coordinator_class_private_field_get(this, _serverCompiler).modifiedFiles), new Set(Coordinator_class_private_field_get(this, _serverCompiler).removedFiles));
56735
+ });
56736
+ }
56737
+ applyClientCompiler(clientCompiler) {
56738
+ Coordinator_class_private_field_set(this, _clientCompiler, clientCompiler);
56739
+ const originalWatch = clientCompiler.watch;
56740
+ clientCompiler.watch = function(watchOptions, handler) {
56741
+ watchOptions.ignored = ()=>true;
56742
+ return originalWatch.call(this, watchOptions, handler);
56743
+ };
56744
+ clientCompiler.hooks.done.tap(Coordinator_PLUGIN_NAME, (stats)=>{
56745
+ Coordinator_class_private_field_set(this, _clientLastCompilation, stats.compilation);
56746
+ });
56747
+ }
56748
+ constructor(){
56749
+ Coordinator_class_private_field_init(this, _serverCompiler, {
56750
+ writable: true,
56751
+ value: void 0
56752
+ });
56753
+ Coordinator_class_private_field_init(this, _clientCompiler, {
56754
+ writable: true,
56755
+ value: void 0
56756
+ });
56757
+ Coordinator_class_private_field_init(this, _clientLastCompilation, {
56758
+ writable: true,
56759
+ value: void 0
56760
+ });
56761
+ Coordinator_class_private_field_init(this, _binding, {
56762
+ writable: true,
56763
+ value: void 0
56764
+ });
56765
+ Object.defineProperty(this, GET_OR_INIT_BINDING, {
56766
+ enumerable: false,
56767
+ configurable: false,
56768
+ writable: false,
56769
+ value: ()=>{
56770
+ if (!Coordinator_class_private_field_get(this, _binding)) Coordinator_class_private_field_set(this, _binding, new external_rspack_wasi_browser_js_.JsCoordinator(()=>{
56771
+ if (!Coordinator_class_private_field_get(this, _serverCompiler)) throw new Error("[RscPlugin] Coordinator.getOrInitBinding() called before the server compiler was attached. Call coordinator.applyServerCompiler(serverCompiler) first.");
56772
+ return Coordinator_class_private_field_get(this, _serverCompiler)[GET_COMPILER_ID]();
56773
+ }));
56774
+ return Coordinator_class_private_field_get(this, _binding);
56775
+ }
56776
+ });
56777
+ }
56778
+ }
56779
+ function RscClientPlugin_check_private_redeclaration(obj, privateCollection) {
56780
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
56781
+ }
56782
+ function RscClientPlugin_class_apply_descriptor_get(receiver, descriptor) {
56783
+ if (descriptor.get) return descriptor.get.call(receiver);
56784
+ return descriptor.value;
56785
+ }
56786
+ function RscClientPlugin_class_apply_descriptor_set(receiver, descriptor, value) {
56787
+ if (descriptor.set) descriptor.set.call(receiver, value);
56788
+ else {
56789
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
56790
+ descriptor.value = value;
56791
+ }
56792
+ }
56793
+ function RscClientPlugin_class_extract_field_descriptor(receiver, privateMap, action) {
56794
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
56795
+ return privateMap.get(receiver);
56796
+ }
56797
+ function RscClientPlugin_class_private_field_get(receiver, privateMap) {
56798
+ var descriptor = RscClientPlugin_class_extract_field_descriptor(receiver, privateMap, "get");
56799
+ return RscClientPlugin_class_apply_descriptor_get(receiver, descriptor);
56800
+ }
56801
+ function RscClientPlugin_class_private_field_init(obj, privateMap, value) {
56802
+ RscClientPlugin_check_private_redeclaration(obj, privateMap);
56803
+ privateMap.set(obj, value);
56804
+ }
56805
+ function RscClientPlugin_class_private_field_set(receiver, privateMap, value) {
56806
+ var descriptor = RscClientPlugin_class_extract_field_descriptor(receiver, privateMap, "set");
56807
+ RscClientPlugin_class_apply_descriptor_set(receiver, descriptor, value);
56808
+ return value;
56809
+ }
56810
+ function RscClientPlugin_define_property(obj, key, value) {
56811
+ if (key in obj) Object.defineProperty(obj, key, {
56812
+ value: value,
56813
+ enumerable: true,
56814
+ configurable: true,
56815
+ writable: true
56816
+ });
56817
+ else obj[key] = value;
56818
+ return obj;
56819
+ }
56820
+ var _coordinator = /*#__PURE__*/ new WeakMap();
56821
+ class RscClientPlugin extends RspackBuiltinPlugin {
56822
+ raw(compiler) {
56823
+ RscClientPlugin_class_private_field_get(this, _coordinator).applyClientCompiler(compiler);
56824
+ return createBuiltinPlugin(this.name, RscClientPlugin_class_private_field_get(this, _coordinator)[GET_OR_INIT_BINDING]());
56825
+ }
56826
+ constructor(coordinator){
56827
+ super(), RscClientPlugin_define_property(this, "name", "RscClientPlugin"), RscClientPlugin_class_private_field_init(this, _coordinator, {
56828
+ writable: true,
56829
+ value: void 0
56830
+ });
56831
+ RscClientPlugin_class_private_field_set(this, _coordinator, coordinator);
56832
+ }
56833
+ }
56834
+ function RscServerPlugin_check_private_redeclaration(obj, privateCollection) {
56835
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
56836
+ }
56837
+ function RscServerPlugin_class_apply_descriptor_get(receiver, descriptor) {
56838
+ if (descriptor.get) return descriptor.get.call(receiver);
56839
+ return descriptor.value;
56840
+ }
56841
+ function RscServerPlugin_class_apply_descriptor_set(receiver, descriptor, value) {
56842
+ if (descriptor.set) descriptor.set.call(receiver, value);
56843
+ else {
56844
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
56845
+ descriptor.value = value;
56846
+ }
56847
+ }
56848
+ function RscServerPlugin_class_extract_field_descriptor(receiver, privateMap, action) {
56849
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
56850
+ return privateMap.get(receiver);
56851
+ }
56852
+ function RscServerPlugin_class_private_field_get(receiver, privateMap) {
56853
+ var descriptor = RscServerPlugin_class_extract_field_descriptor(receiver, privateMap, "get");
56854
+ return RscServerPlugin_class_apply_descriptor_get(receiver, descriptor);
56855
+ }
56856
+ function RscServerPlugin_class_private_field_init(obj, privateMap, value) {
56857
+ RscServerPlugin_check_private_redeclaration(obj, privateMap);
56858
+ privateMap.set(obj, value);
56859
+ }
56860
+ function RscServerPlugin_class_private_field_set(receiver, privateMap, value) {
56861
+ var descriptor = RscServerPlugin_class_extract_field_descriptor(receiver, privateMap, "set");
56862
+ RscServerPlugin_class_apply_descriptor_set(receiver, descriptor, value);
56863
+ return value;
56864
+ }
56865
+ function RscServerPlugin_class_private_method_get(receiver, privateSet, fn) {
56866
+ if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
56867
+ return fn;
56868
+ }
56869
+ function RscServerPlugin_class_private_method_init(obj, privateSet) {
56870
+ RscServerPlugin_check_private_redeclaration(obj, privateSet);
56871
+ privateSet.add(obj);
56872
+ }
56873
+ function RscServerPlugin_define_property(obj, key, value) {
56874
+ if (key in obj) Object.defineProperty(obj, key, {
56875
+ value: value,
56876
+ enumerable: true,
56877
+ configurable: true,
56878
+ writable: true
56879
+ });
56880
+ else obj[key] = value;
56881
+ return obj;
56882
+ }
56883
+ var RscServerPlugin_coordinator = /*#__PURE__*/ new WeakMap(), _resolve = /*#__PURE__*/ new WeakSet();
56884
+ class RscServerPlugin extends RspackBuiltinPlugin {
56885
+ raw(compiler) {
56886
+ const bindingOptions = RscServerPlugin_class_private_method_get(this, _resolve, RscServerPlugin_resolve).call(this, compiler);
56887
+ return createBuiltinPlugin(this.name, bindingOptions);
56888
+ }
56889
+ constructor(coordinator){
56890
+ super(), RscServerPlugin_class_private_method_init(this, _resolve), RscServerPlugin_define_property(this, "name", "RscServerPlugin"), RscServerPlugin_class_private_field_init(this, RscServerPlugin_coordinator, {
56891
+ writable: true,
56892
+ value: void 0
56893
+ });
56894
+ RscServerPlugin_class_private_field_set(this, RscServerPlugin_coordinator, coordinator);
56895
+ }
56896
+ }
56897
+ function RscServerPlugin_resolve(serverCompiler) {
56898
+ RscServerPlugin_class_private_field_get(this, RscServerPlugin_coordinator).applyServerCompiler(serverCompiler);
56899
+ return RscServerPlugin_class_private_field_get(this, RscServerPlugin_coordinator)[GET_OR_INIT_BINDING]();
56900
+ }
56901
+ function createRscPlugins() {
56902
+ const coordinator = new Coordinator();
56903
+ return {
56904
+ ServerPlugin: class extends RscServerPlugin {
56905
+ constructor(){
56906
+ super(coordinator);
56907
+ }
56908
+ },
56909
+ ClientPlugin: class extends RscClientPlugin {
56910
+ constructor(){
56911
+ super(coordinator);
56912
+ }
56913
+ }
56914
+ };
56915
+ }
56916
+ const RSC_LAYERS_NAMES = {
56917
+ reactServerComponents: "react-server-components",
56918
+ serverSideRendering: "server-side-rendering",
56919
+ actionBrowser: "action-browser"
56920
+ };
56686
56921
  const SideEffectsFlagPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation");
56687
56922
  const SizeLimitsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
56688
56923
  const hints = false === options.hints ? void 0 : options.hints;
@@ -58221,7 +58456,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58221
58456
  if ("object" == typeof rspackFuture) {
58222
58457
  D(rspackFuture, "bundlerInfo", {});
58223
58458
  if ("object" == typeof rspackFuture.bundlerInfo) {
58224
- D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-be5d0ef3-20251222175046");
58459
+ D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-ecf3f75d-20251223084957");
58225
58460
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
58226
58461
  D(rspackFuture.bundlerInfo, "force", !library);
58227
58462
  }
@@ -60290,13 +60525,13 @@ function Resolver_class_private_field_set(receiver, privateMap, value) {
60290
60525
  Resolver_class_apply_descriptor_set(receiver, descriptor, value);
60291
60526
  return value;
60292
60527
  }
60293
- var _binding = /*#__PURE__*/ new WeakMap();
60528
+ var Resolver_binding = /*#__PURE__*/ new WeakMap();
60294
60529
  class Resolver {
60295
60530
  resolveSync(_context, path, request) {
60296
- return Resolver_class_private_field_get(this, _binding).resolveSync(path, request) ?? false;
60531
+ return Resolver_class_private_field_get(this, Resolver_binding).resolveSync(path, request) ?? false;
60297
60532
  }
60298
60533
  resolve(_context, path, request, resolveContext, callback) {
60299
- Resolver_class_private_field_get(this, _binding).resolve(path, request, (error, text)=>{
60534
+ Resolver_class_private_field_get(this, Resolver_binding).resolve(path, request, (error, text)=>{
60300
60535
  if (error) return void callback(error);
60301
60536
  const req = text ? JSON.parse(text) : void 0;
60302
60537
  if (req?.fileDependencies) req.fileDependencies.forEach((file)=>{
@@ -60309,11 +60544,11 @@ class Resolver {
60309
60544
  });
60310
60545
  }
60311
60546
  constructor(binding){
60312
- Resolver_class_private_field_init(this, _binding, {
60547
+ Resolver_class_private_field_init(this, Resolver_binding, {
60313
60548
  writable: true,
60314
60549
  value: void 0
60315
60550
  });
60316
- Resolver_class_private_field_set(this, _binding, binding);
60551
+ Resolver_class_private_field_set(this, Resolver_binding, binding);
60317
60552
  }
60318
60553
  }
60319
60554
  function ResolverFactory_check_private_redeclaration(obj, privateCollection) {
@@ -61713,6 +61948,7 @@ function Compiler_define_property(obj, key, value) {
61713
61948
  return obj;
61714
61949
  }
61715
61950
  const COMPILATION_WEAK_MAP = new WeakMap();
61951
+ const GET_COMPILER_ID = Symbol("getCompilerId");
61716
61952
  var _instance = /*#__PURE__*/ new WeakMap(), Compiler_initial = /*#__PURE__*/ new WeakMap(), Compiler_compilation = /*#__PURE__*/ new WeakMap(), _compilationParams = /*#__PURE__*/ new WeakMap(), _builtinPlugins = /*#__PURE__*/ new WeakMap(), _moduleExecutionResultsMap = /*#__PURE__*/ new WeakMap(), _nonSkippableRegisters = /*#__PURE__*/ new WeakMap(), _registers = /*#__PURE__*/ new WeakMap(), _ruleSet = /*#__PURE__*/ new WeakMap(), _build = /*#__PURE__*/ new WeakSet(), _resetThisCompilation = /*#__PURE__*/ new WeakSet(), _newCompilationParams = /*#__PURE__*/ new WeakSet(), _getInstance = /*#__PURE__*/ new WeakSet(), _createHooksRegisters = /*#__PURE__*/ new WeakSet(), _updateNonSkippableRegisters = /*#__PURE__*/ new WeakSet(), _decorateJsTaps = /*#__PURE__*/ new WeakSet(), _createHookRegisterTaps = /*#__PURE__*/ new WeakSet(), _createHookMapRegisterTaps = /*#__PURE__*/ new WeakSet();
61717
61953
  class Compiler {
61718
61954
  get recordsInputPath() {
@@ -62178,6 +62414,12 @@ class Compiler {
62178
62414
  this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader);
62179
62415
  new JsLoaderRspackPlugin(this).apply(this);
62180
62416
  new ExecuteModulePlugin().apply(this);
62417
+ Object.defineProperty(this, GET_COMPILER_ID, {
62418
+ writable: false,
62419
+ configurable: false,
62420
+ enumerable: false,
62421
+ value: ()=>Compiler_class_private_field_get(this, _instance).getCompilerId()
62422
+ });
62181
62423
  }
62182
62424
  }
62183
62425
  function build(callback) {
@@ -62379,7 +62621,7 @@ class MultiStats {
62379
62621
  return obj;
62380
62622
  });
62381
62623
  if (childOptions.version) {
62382
- obj.rspackVersion = "1.7.0-canary-be5d0ef3-20251222175046";
62624
+ obj.rspackVersion = "1.7.0-canary-ecf3f75d-20251223084957";
62383
62625
  obj.version = "5.75.0";
62384
62626
  }
62385
62627
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -63695,7 +63937,7 @@ const SIMPLE_EXTRACTORS = {
63695
63937
  },
63696
63938
  version: (object)=>{
63697
63939
  object.version = "5.75.0";
63698
- object.rspackVersion = "1.7.0-canary-be5d0ef3-20251222175046";
63940
+ object.rspackVersion = "1.7.0-canary-ecf3f75d-20251223084957";
63699
63941
  },
63700
63942
  env: (object, _compilation, _context, { _env })=>{
63701
63943
  object.env = _env;
@@ -66832,7 +67074,7 @@ function transformSync(source, options) {
66832
67074
  const _options = JSON.stringify(options || {});
66833
67075
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66834
67076
  }
66835
- const exports_rspackVersion = "1.7.0-canary-be5d0ef3-20251222175046";
67077
+ const exports_rspackVersion = "1.7.0-canary-ecf3f75d-20251223084957";
66836
67078
  const exports_version = "5.75.0";
66837
67079
  const exports_WebpackError = Error;
66838
67080
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -66920,7 +67162,9 @@ const exports_experiments = {
66920
67162
  },
66921
67163
  CssChunkingPlugin: CssChunkingPlugin,
66922
67164
  createNativePlugin: createNativePlugin,
66923
- VirtualModulesPlugin: VirtualModulesPlugin
67165
+ VirtualModulesPlugin: VirtualModulesPlugin,
67166
+ createRscPlugins: createRscPlugins,
67167
+ RSC_LAYERS_NAMES: RSC_LAYERS_NAMES
66924
67168
  };
66925
67169
  const ERROR_PREFIX = "Invalid Rspack configuration:";
66926
67170
  const validateContext = ({ context })=>{
@@ -67243,4 +67487,4 @@ var __webpack_exports__EntryDependency = external_rspack_wasi_browser_js_.EntryD
67243
67487
  var __webpack_exports__ExternalModule = external_rspack_wasi_browser_js_.ExternalModule;
67244
67488
  var __webpack_exports__Module = external_rspack_wasi_browser_js_.Module;
67245
67489
  var __webpack_exports__NormalModule = external_rspack_wasi_browser_js_.NormalModule;
67246
- export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, lazyCompilationMiddleware, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
67490
+ export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, Coordinator, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RscClientPlugin, RscServerPlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, lazyCompilationMiddleware, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
@@ -334,6 +334,7 @@ export declare class JsCompiler {
334
334
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
335
335
  close(): Promise<void>
336
336
  getVirtualFileStore(): VirtualFileStore | null
337
+ getCompilerId(): ExternalObject<CompilerId>
337
338
  }
338
339
 
339
340
  export declare class JsContextModuleFactoryAfterResolveData {
@@ -361,6 +362,10 @@ export declare class JsContextModuleFactoryBeforeResolveData {
361
362
  set recursive(recursive: boolean)
362
363
  }
363
364
 
365
+ export declare class JsCoordinator {
366
+ constructor(getServerCompilerIdJsFn: () => ExternalObject<CompilerId>)
367
+ }
368
+
364
369
  export declare class JsDependencies {
365
370
  get fileDependencies(): Array<string>
366
371
  get addedFileDependencies(): Array<string>
@@ -602,7 +607,9 @@ export declare enum BuiltinPluginName {
602
607
  LazyCompilationPlugin = 'LazyCompilationPlugin',
603
608
  ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
604
609
  HttpUriPlugin = 'HttpUriPlugin',
605
- CssChunkingPlugin = 'CssChunkingPlugin'
610
+ CssChunkingPlugin = 'CssChunkingPlugin',
611
+ RscServerPlugin = 'RscServerPlugin',
612
+ RscClientPlugin = 'RscClientPlugin'
606
613
  }
607
614
 
608
615
  export declare function cleanupGlobalTrace(): void
@@ -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
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.7.0-canary-be5d0ef3-20251222175046",
3
+ "version": "1.7.0-canary-ecf3f75d-20251223084957",
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.",