@vitejs/plugin-rsc 0.4.16 → 0.4.17

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
@@ -264,6 +264,9 @@ export function renderHTML(...) {}
264
264
 
265
265
  #### `import.meta.viteRsc.loadCss`
266
266
 
267
+ > [!NOTE]
268
+ > The plugin automatically injects CSS for server components. See the [CSS Support](#css-support) section for detailed information about automatic CSS injection.
269
+
267
270
  - Type: `(importer?: string) => React.ReactNode`
268
271
 
269
272
  This allows collecting css which is imported through a current server module and injecting them inside server components.
@@ -436,6 +439,40 @@ This is a wrapper of `react-server-dom` API and helper API to setup a minimal RS
436
439
 
437
440
  - `hydrate`
438
441
 
442
+ ## CSS Support
443
+
444
+ The plugin automatically handles CSS code-splitting and injection for server components. This eliminates the need to manually call [`import.meta.viteRsc.loadCss()`](#importmetaviterscloadcss) in most cases.
445
+
446
+ 1. **Component Detection**: The plugin automatically detects server components by looking for:
447
+ - Function exports with capital letter names (e.g., `export function Page() {}`)
448
+ - Default exports that are functions with capital names (e.g., `export default function Page() {}`)
449
+ - Const exports assigned to functions with capital names (e.g., `export const Page = () => {}`)
450
+
451
+ 2. **CSS Import Detection**: For detected components, the plugin checks if the module imports any CSS files (`.css`, `.scss`, `.sass`, etc.)
452
+
453
+ 3. **Automatic Wrapping**: When both conditions are met, the plugin wraps the component with a CSS injection wrapper:
454
+
455
+ ```tsx
456
+ // Before transformation
457
+ import './styles.css'
458
+
459
+ export function Page() {
460
+ return <div>Hello</div>
461
+ }
462
+
463
+ // After transformation
464
+ import './styles.css'
465
+
466
+ export function Page() {
467
+ return (
468
+ <>
469
+ {import.meta.viteRsc.loadCss()}
470
+ <div>Hello</div>
471
+ </>
472
+ )
473
+ }
474
+ ```
475
+
439
476
  ## Credits
440
477
 
441
478
  This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.
package/dist/extra/ssr.js CHANGED
@@ -2,7 +2,7 @@ import "../dist-DEF94lDJ.js";
2
2
  import "../shared-CEyKoKAb.js";
3
3
  import "../ssr-MYoobcMC.js";
4
4
  import { createFromReadableStream } from "../ssr-BLt64xPK.js";
5
- import "../ssr-B7_J2_Qh.js";
5
+ import "../ssr-ClDiSAPx.js";
6
6
  import { injectRSCPayload } from "../server-D0-DavPP.js";
7
7
  import React from "react";
8
8
  import { jsx } from "react/jsx-runtime";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./dist-DEF94lDJ.js";
2
2
  import "./plugin-CZbI4rhS.js";
3
- import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-C9id3xj5.js";
3
+ import { transformHoistInlineDirective, vitePluginRsc } from "./plugin-BxEQycAE.js";
4
4
  import "./encryption-utils-BDwwcMVT.js";
5
5
  import "./rpc-tGuLT8PD.js";
6
6
  import "./vite-utils-Vzd7cqfv.js";
@@ -9,7 +9,7 @@ import { createHash } from "node:crypto";
9
9
  import fs from "node:fs";
10
10
  import path from "node:path";
11
11
  import { fileURLToPath, pathToFileURL } from "node:url";
12
- import { createRequestListener } from "@mjackson/node-fetch-server";
12
+ import { createRequestListener } from "@remix-run/node-fetch-server";
13
13
  import * as esModuleLexer from "es-module-lexer";
14
14
  import MagicString from "magic-string";
15
15
  import { defaultServerConditions, isCSSRequest, normalizePath, parseAstAsync } from "vite";
@@ -738,7 +738,6 @@ function vitePluginRsc(rscPluginOptions = {}) {
738
738
  code = code.replaceAll("virtual:vite-rsc/assets-manifest", () => replacement);
739
739
  return { code };
740
740
  }
741
- return;
742
741
  }
743
742
  },
744
743
  createVirtualPlugin("vite-rsc/bootstrap-script-content", function() {
@@ -788,7 +787,13 @@ window.__vite_plugin_react_preamble_installed__ = true;
788
787
  code += `await import(${JSON.stringify(resolvedEntry.id)});`;
789
788
  code += `
790
789
  const ssrCss = document.querySelectorAll("link[rel='stylesheet']");
791
- import.meta.hot.on("vite:beforeUpdate", () => ssrCss.forEach(node => node.remove()));
790
+ import.meta.hot.on("vite:beforeUpdate", () => {
791
+ ssrCss.forEach(node => {
792
+ if (node.dataset.precedence?.startsWith("vite-rsc/")) {
793
+ node.remove();
794
+ }
795
+ });
796
+ });
792
797
  `;
793
798
  code += `
794
799
  import.meta.hot.on("rsc:update", () => {
@@ -815,6 +820,7 @@ globalThis.AsyncLocalStorage = __viteRscAyncHooks.AsyncLocalStorage;
815
820
  ...vitePluginFindSourceMapURL(),
816
821
  ...vitePluginRscCss({ rscCssTransform: rscPluginOptions.rscCssTransform }),
817
822
  ...rscPluginOptions.validateImports !== false ? [validateImportPlugin()] : [],
823
+ ...vendorUseSyncExternalStorePlugin(),
818
824
  scanBuildStripPlugin(),
819
825
  detectNonOptimizedCjsPlugin()
820
826
  ];
@@ -1583,7 +1589,6 @@ function validateImportPlugin() {
1583
1589
  moduleSideEffects: false
1584
1590
  };
1585
1591
  }
1586
- return;
1587
1592
  }
1588
1593
  },
1589
1594
  load(id) {
@@ -1591,6 +1596,24 @@ function validateImportPlugin() {
1591
1596
  }
1592
1597
  };
1593
1598
  }
1599
+ function vendorUseSyncExternalStorePlugin() {
1600
+ const exports = [
1601
+ "use-sync-external-store",
1602
+ "use-sync-external-store/with-selector",
1603
+ "use-sync-external-store/with-selector.js",
1604
+ "use-sync-external-store/shim",
1605
+ "use-sync-external-store/shim/index.js",
1606
+ "use-sync-external-store/shim/with-selector",
1607
+ "use-sync-external-store/shim/with-selector.js"
1608
+ ];
1609
+ return [{
1610
+ name: "rsc:vendor-use-sync-external-store",
1611
+ apply: "serve",
1612
+ config() {
1613
+ return { environments: { ssr: { optimizeDeps: { include: exports.map((e) => `${PKG_NAME} > ${e}`) } } } };
1614
+ }
1615
+ }];
1616
+ }
1594
1617
  function sortObject(o) {
1595
1618
  return Object.fromEntries(Object.entries(o).sort(([a], [b]) => a.localeCompare(b)));
1596
1619
  }
package/dist/plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./dist-DEF94lDJ.js";
2
2
  import "./plugin-CZbI4rhS.js";
3
- import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-C9id3xj5.js";
3
+ import { __fix_cloudflare, findSourceMapURL, transformRscCssExport, vitePluginFindSourceMapURL, vitePluginRsc, vitePluginRscCss, vitePluginRscMinimal } from "./plugin-BxEQycAE.js";
4
4
  import "./encryption-utils-BDwwcMVT.js";
5
5
  import "./rpc-tGuLT8PD.js";
6
6
  import "./vite-utils-Vzd7cqfv.js";
@@ -43,7 +43,10 @@ function preloadDeps(deps) {
43
43
  as: "script",
44
44
  crossOrigin: ""
45
45
  });
46
- for (const href of deps.css) ReactDOM.preinit(href, { as: "style" });
46
+ for (const href of deps.css) ReactDOM.preinit(href, {
47
+ as: "style",
48
+ precedence: "vite-rsc/client-reference"
49
+ });
47
50
  }
48
51
 
49
52
  //#endregion
package/dist/ssr.js CHANGED
@@ -2,6 +2,6 @@ import "./dist-DEF94lDJ.js";
2
2
  import "./shared-CEyKoKAb.js";
3
3
  import { createServerConsumerManifest, setRequireModule } from "./ssr-MYoobcMC.js";
4
4
  import { callServer, createFromReadableStream, createServerReference, findSourceMapURL } from "./ssr-BLt64xPK.js";
5
- import "./ssr-B7_J2_Qh.js";
5
+ import "./ssr-ClDiSAPx.js";
6
6
 
7
7
  export { callServer, createFromReadableStream, createServerConsumerManifest, createServerReference, findSourceMapURL, setRequireModule };
@@ -2089,7 +2089,7 @@
2089
2089
  (stack = stack.slice(29));
2090
2090
  var idx = stack.indexOf("\n");
2091
2091
  -1 !== idx && (stack = stack.slice(idx + 1));
2092
- idx = stack.indexOf("react-stack-bottom-frame");
2092
+ idx = stack.indexOf("react_stack_bottom_frame");
2093
2093
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
2094
2094
  var JSCompiler_inline_result =
2095
2095
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -2587,11 +2587,7 @@
2587
2587
  fakeFunctionCache = new Map(),
2588
2588
  fakeFunctionIdx = 0,
2589
2589
  createFakeJSXCallStack = {
2590
- "react-stack-bottom-frame": function (
2591
- response,
2592
- stack,
2593
- environmentName
2594
- ) {
2590
+ react_stack_bottom_frame: function (response, stack, environmentName) {
2595
2591
  return buildFakeCallStack(
2596
2592
  response,
2597
2593
  stack,
@@ -2600,12 +2596,13 @@
2600
2596
  )();
2601
2597
  }
2602
2598
  },
2603
- createFakeJSXCallStackInDEV = createFakeJSXCallStack[
2604
- "react-stack-bottom-frame"
2605
- ].bind(createFakeJSXCallStack),
2599
+ createFakeJSXCallStackInDEV =
2600
+ createFakeJSXCallStack.react_stack_bottom_frame.bind(
2601
+ createFakeJSXCallStack
2602
+ ),
2606
2603
  currentOwnerInDEV = null,
2607
2604
  replayConsoleWithCallStack = {
2608
- "react-stack-bottom-frame": function (
2605
+ react_stack_bottom_frame: function (
2609
2606
  response,
2610
2607
  methodName,
2611
2608
  stackTrace,
@@ -2678,9 +2675,10 @@
2678
2675
  }
2679
2676
  }
2680
2677
  },
2681
- replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[
2682
- "react-stack-bottom-frame"
2683
- ].bind(replayConsoleWithCallStack);
2678
+ replayConsoleWithCallStackInDEV =
2679
+ replayConsoleWithCallStack.react_stack_bottom_frame.bind(
2680
+ replayConsoleWithCallStack
2681
+ );
2684
2682
  (function (internals) {
2685
2683
  if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
2686
2684
  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -2693,10 +2691,10 @@
2693
2691
  return hook.checkDCE ? !0 : !1;
2694
2692
  })({
2695
2693
  bundleType: 1,
2696
- version: "19.1.0",
2694
+ version: "19.1.1",
2697
2695
  rendererPackageName: "react-server-dom-webpack",
2698
2696
  currentDispatcherRef: ReactSharedInternals,
2699
- reconcilerVersion: "19.1.0",
2697
+ reconcilerVersion: "19.1.1",
2700
2698
  getCurrentComponentInfo: function () {
2701
2699
  return currentOwnerInDEV;
2702
2700
  }
@@ -2309,7 +2309,7 @@
2309
2309
  (stack = stack.slice(29));
2310
2310
  var idx = stack.indexOf("\n");
2311
2311
  -1 !== idx && (stack = stack.slice(idx + 1));
2312
- idx = stack.indexOf("react-stack-bottom-frame");
2312
+ idx = stack.indexOf("react_stack_bottom_frame");
2313
2313
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
2314
2314
  var JSCompiler_inline_result =
2315
2315
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -2807,11 +2807,7 @@
2807
2807
  fakeFunctionCache = new Map(),
2808
2808
  fakeFunctionIdx = 0,
2809
2809
  createFakeJSXCallStack = {
2810
- "react-stack-bottom-frame": function (
2811
- response,
2812
- stack,
2813
- environmentName
2814
- ) {
2810
+ react_stack_bottom_frame: function (response, stack, environmentName) {
2815
2811
  return buildFakeCallStack(
2816
2812
  response,
2817
2813
  stack,
@@ -2820,12 +2816,13 @@
2820
2816
  )();
2821
2817
  }
2822
2818
  },
2823
- createFakeJSXCallStackInDEV = createFakeJSXCallStack[
2824
- "react-stack-bottom-frame"
2825
- ].bind(createFakeJSXCallStack),
2819
+ createFakeJSXCallStackInDEV =
2820
+ createFakeJSXCallStack.react_stack_bottom_frame.bind(
2821
+ createFakeJSXCallStack
2822
+ ),
2826
2823
  currentOwnerInDEV = null,
2827
2824
  replayConsoleWithCallStack = {
2828
- "react-stack-bottom-frame": function (
2825
+ react_stack_bottom_frame: function (
2829
2826
  response,
2830
2827
  methodName,
2831
2828
  stackTrace,
@@ -2898,9 +2895,10 @@
2898
2895
  }
2899
2896
  }
2900
2897
  },
2901
- replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[
2902
- "react-stack-bottom-frame"
2903
- ].bind(replayConsoleWithCallStack);
2898
+ replayConsoleWithCallStackInDEV =
2899
+ replayConsoleWithCallStack.react_stack_bottom_frame.bind(
2900
+ replayConsoleWithCallStack
2901
+ );
2904
2902
  exports.createFromFetch = function (promiseForResponse, options) {
2905
2903
  var response = createResponseFromOptions(options);
2906
2904
  promiseForResponse.then(
@@ -2309,7 +2309,7 @@
2309
2309
  (stack = stack.slice(29));
2310
2310
  var idx = stack.indexOf("\n");
2311
2311
  -1 !== idx && (stack = stack.slice(idx + 1));
2312
- idx = stack.indexOf("react-stack-bottom-frame");
2312
+ idx = stack.indexOf("react_stack_bottom_frame");
2313
2313
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
2314
2314
  var JSCompiler_inline_result =
2315
2315
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -2695,11 +2695,7 @@
2695
2695
  fakeFunctionCache = new Map(),
2696
2696
  fakeFunctionIdx = 0,
2697
2697
  createFakeJSXCallStack = {
2698
- "react-stack-bottom-frame": function (
2699
- response,
2700
- stack,
2701
- environmentName
2702
- ) {
2698
+ react_stack_bottom_frame: function (response, stack, environmentName) {
2703
2699
  return buildFakeCallStack(
2704
2700
  response,
2705
2701
  stack,
@@ -2708,12 +2704,13 @@
2708
2704
  )();
2709
2705
  }
2710
2706
  },
2711
- createFakeJSXCallStackInDEV = createFakeJSXCallStack[
2712
- "react-stack-bottom-frame"
2713
- ].bind(createFakeJSXCallStack),
2707
+ createFakeJSXCallStackInDEV =
2708
+ createFakeJSXCallStack.react_stack_bottom_frame.bind(
2709
+ createFakeJSXCallStack
2710
+ ),
2714
2711
  currentOwnerInDEV = null,
2715
2712
  replayConsoleWithCallStack = {
2716
- "react-stack-bottom-frame": function (
2713
+ react_stack_bottom_frame: function (
2717
2714
  response,
2718
2715
  methodName,
2719
2716
  stackTrace,
@@ -2786,9 +2783,10 @@
2786
2783
  }
2787
2784
  }
2788
2785
  },
2789
- replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[
2790
- "react-stack-bottom-frame"
2791
- ].bind(replayConsoleWithCallStack);
2786
+ replayConsoleWithCallStackInDEV =
2787
+ replayConsoleWithCallStack.react_stack_bottom_frame.bind(
2788
+ replayConsoleWithCallStack
2789
+ );
2792
2790
  exports.createFromNodeStream = function (
2793
2791
  stream,
2794
2792
  serverConsumerManifest,
@@ -2271,7 +2271,7 @@
2271
2271
  (stack = stack.slice(29));
2272
2272
  var idx = stack.indexOf("\n");
2273
2273
  -1 !== idx && (stack = stack.slice(idx + 1));
2274
- idx = stack.indexOf("react-stack-bottom-frame");
2274
+ idx = stack.indexOf("react_stack_bottom_frame");
2275
2275
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
2276
2276
  var JSCompiler_inline_result =
2277
2277
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -2657,11 +2657,7 @@
2657
2657
  fakeFunctionCache = new Map(),
2658
2658
  fakeFunctionIdx = 0,
2659
2659
  createFakeJSXCallStack = {
2660
- "react-stack-bottom-frame": function (
2661
- response,
2662
- stack,
2663
- environmentName
2664
- ) {
2660
+ react_stack_bottom_frame: function (response, stack, environmentName) {
2665
2661
  return buildFakeCallStack(
2666
2662
  response,
2667
2663
  stack,
@@ -2670,12 +2666,13 @@
2670
2666
  )();
2671
2667
  }
2672
2668
  },
2673
- createFakeJSXCallStackInDEV = createFakeJSXCallStack[
2674
- "react-stack-bottom-frame"
2675
- ].bind(createFakeJSXCallStack),
2669
+ createFakeJSXCallStackInDEV =
2670
+ createFakeJSXCallStack.react_stack_bottom_frame.bind(
2671
+ createFakeJSXCallStack
2672
+ ),
2676
2673
  currentOwnerInDEV = null,
2677
2674
  replayConsoleWithCallStack = {
2678
- "react-stack-bottom-frame": function (
2675
+ react_stack_bottom_frame: function (
2679
2676
  response,
2680
2677
  methodName,
2681
2678
  stackTrace,
@@ -2748,9 +2745,10 @@
2748
2745
  }
2749
2746
  }
2750
2747
  },
2751
- replayConsoleWithCallStackInDEV = replayConsoleWithCallStack[
2752
- "react-stack-bottom-frame"
2753
- ].bind(replayConsoleWithCallStack);
2748
+ replayConsoleWithCallStackInDEV =
2749
+ replayConsoleWithCallStack.react_stack_bottom_frame.bind(
2750
+ replayConsoleWithCallStack
2751
+ );
2754
2752
  exports.createFromNodeStream = function (
2755
2753
  stream,
2756
2754
  serverConsumerManifest,
@@ -211,7 +211,7 @@
211
211
  }
212
212
  stack.startsWith("Error: react-stack-top-frame\n") &&
213
213
  (stack = stack.slice(29));
214
- error = stack.indexOf("react-stack-bottom-frame");
214
+ error = stack.indexOf("react_stack_bottom_frame");
215
215
  -1 !== error && (error = stack.lastIndexOf("\n", error));
216
216
  -1 !== error && (stack = stack.slice(0, error));
217
217
  stack = stack.split("\n");
@@ -594,7 +594,7 @@
594
594
  (stack = stack.slice(29));
595
595
  var idx = stack.indexOf("\n");
596
596
  -1 !== idx && (stack = stack.slice(idx + 1));
597
- idx = stack.indexOf("react-stack-bottom-frame");
597
+ idx = stack.indexOf("react_stack_bottom_frame");
598
598
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
599
599
  var JSCompiler_inline_result =
600
600
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -3801,7 +3801,7 @@
3801
3801
  };
3802
3802
  }
3803
3803
  var callComponent = {
3804
- "react-stack-bottom-frame": function (
3804
+ react_stack_bottom_frame: function (
3805
3805
  Component,
3806
3806
  props,
3807
3807
  componentDebugInfo
@@ -3815,22 +3815,22 @@
3815
3815
  }
3816
3816
  },
3817
3817
  callComponentInDEV =
3818
- callComponent["react-stack-bottom-frame"].bind(callComponent),
3818
+ callComponent.react_stack_bottom_frame.bind(callComponent),
3819
3819
  callLazyInit = {
3820
- "react-stack-bottom-frame": function (lazy) {
3820
+ react_stack_bottom_frame: function (lazy) {
3821
3821
  var init = lazy._init;
3822
3822
  return init(lazy._payload);
3823
3823
  }
3824
3824
  },
3825
3825
  callLazyInitInDEV =
3826
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
3826
+ callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
3827
3827
  callIterator = {
3828
- "react-stack-bottom-frame": function (iterator, progress, error) {
3828
+ react_stack_bottom_frame: function (iterator, progress, error) {
3829
3829
  iterator.next().then(progress, error);
3830
3830
  }
3831
3831
  },
3832
3832
  callIteratorInDEV =
3833
- callIterator["react-stack-bottom-frame"].bind(callIterator),
3833
+ callIterator.react_stack_bottom_frame.bind(callIterator),
3834
3834
  isArrayImpl = Array.isArray,
3835
3835
  getPrototypeOf = Object.getPrototypeOf,
3836
3836
  jsxPropsParents = new WeakMap(),
@@ -221,7 +221,7 @@
221
221
  }
222
222
  stack.startsWith("Error: react-stack-top-frame\n") &&
223
223
  (stack = stack.slice(29));
224
- error = stack.indexOf("react-stack-bottom-frame");
224
+ error = stack.indexOf("react_stack_bottom_frame");
225
225
  -1 !== error && (error = stack.lastIndexOf("\n", error));
226
226
  -1 !== error && (stack = stack.slice(0, error));
227
227
  stack = stack.split("\n");
@@ -601,7 +601,7 @@
601
601
  (stack = stack.slice(29));
602
602
  var idx = stack.indexOf("\n");
603
603
  -1 !== idx && (stack = stack.slice(idx + 1));
604
- idx = stack.indexOf("react-stack-bottom-frame");
604
+ idx = stack.indexOf("react_stack_bottom_frame");
605
605
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
606
606
  var JSCompiler_inline_result =
607
607
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -3879,7 +3879,7 @@
3879
3879
  };
3880
3880
  }
3881
3881
  var callComponent = {
3882
- "react-stack-bottom-frame": function (
3882
+ react_stack_bottom_frame: function (
3883
3883
  Component,
3884
3884
  props,
3885
3885
  componentDebugInfo
@@ -3893,22 +3893,22 @@
3893
3893
  }
3894
3894
  },
3895
3895
  callComponentInDEV =
3896
- callComponent["react-stack-bottom-frame"].bind(callComponent),
3896
+ callComponent.react_stack_bottom_frame.bind(callComponent),
3897
3897
  callLazyInit = {
3898
- "react-stack-bottom-frame": function (lazy) {
3898
+ react_stack_bottom_frame: function (lazy) {
3899
3899
  var init = lazy._init;
3900
3900
  return init(lazy._payload);
3901
3901
  }
3902
3902
  },
3903
3903
  callLazyInitInDEV =
3904
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
3904
+ callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
3905
3905
  callIterator = {
3906
- "react-stack-bottom-frame": function (iterator, progress, error) {
3906
+ react_stack_bottom_frame: function (iterator, progress, error) {
3907
3907
  iterator.next().then(progress, error);
3908
3908
  }
3909
3909
  },
3910
3910
  callIteratorInDEV =
3911
- callIterator["react-stack-bottom-frame"].bind(callIterator),
3911
+ callIterator.react_stack_bottom_frame.bind(callIterator),
3912
3912
  isArrayImpl = Array.isArray,
3913
3913
  getPrototypeOf = Object.getPrototypeOf,
3914
3914
  jsxPropsParents = new WeakMap(),
@@ -240,7 +240,7 @@
240
240
  }
241
241
  stack.startsWith("Error: react-stack-top-frame\n") &&
242
242
  (stack = stack.slice(29));
243
- error = stack.indexOf("react-stack-bottom-frame");
243
+ error = stack.indexOf("react_stack_bottom_frame");
244
244
  -1 !== error && (error = stack.lastIndexOf("\n", error));
245
245
  -1 !== error && (stack = stack.slice(0, error));
246
246
  stack = stack.split("\n");
@@ -625,7 +625,7 @@
625
625
  (stack = stack.slice(29));
626
626
  var idx = stack.indexOf("\n");
627
627
  -1 !== idx && (stack = stack.slice(idx + 1));
628
- idx = stack.indexOf("react-stack-bottom-frame");
628
+ idx = stack.indexOf("react_stack_bottom_frame");
629
629
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
630
630
  var JSCompiler_inline_result =
631
631
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -3876,7 +3876,7 @@
3876
3876
  };
3877
3877
  }
3878
3878
  var callComponent = {
3879
- "react-stack-bottom-frame": function (
3879
+ react_stack_bottom_frame: function (
3880
3880
  Component,
3881
3881
  props,
3882
3882
  componentDebugInfo
@@ -3890,22 +3890,22 @@
3890
3890
  }
3891
3891
  },
3892
3892
  callComponentInDEV =
3893
- callComponent["react-stack-bottom-frame"].bind(callComponent),
3893
+ callComponent.react_stack_bottom_frame.bind(callComponent),
3894
3894
  callLazyInit = {
3895
- "react-stack-bottom-frame": function (lazy) {
3895
+ react_stack_bottom_frame: function (lazy) {
3896
3896
  var init = lazy._init;
3897
3897
  return init(lazy._payload);
3898
3898
  }
3899
3899
  },
3900
3900
  callLazyInitInDEV =
3901
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
3901
+ callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
3902
3902
  callIterator = {
3903
- "react-stack-bottom-frame": function (iterator, progress, error) {
3903
+ react_stack_bottom_frame: function (iterator, progress, error) {
3904
3904
  iterator.next().then(progress, error);
3905
3905
  }
3906
3906
  },
3907
3907
  callIteratorInDEV =
3908
- callIterator["react-stack-bottom-frame"].bind(callIterator),
3908
+ callIterator.react_stack_bottom_frame.bind(callIterator),
3909
3909
  isArrayImpl = Array.isArray,
3910
3910
  getPrototypeOf = Object.getPrototypeOf,
3911
3911
  jsxPropsParents = new WeakMap(),
@@ -240,7 +240,7 @@
240
240
  }
241
241
  stack.startsWith("Error: react-stack-top-frame\n") &&
242
242
  (stack = stack.slice(29));
243
- error = stack.indexOf("react-stack-bottom-frame");
243
+ error = stack.indexOf("react_stack_bottom_frame");
244
244
  -1 !== error && (error = stack.lastIndexOf("\n", error));
245
245
  -1 !== error && (stack = stack.slice(0, error));
246
246
  stack = stack.split("\n");
@@ -625,7 +625,7 @@
625
625
  (stack = stack.slice(29));
626
626
  var idx = stack.indexOf("\n");
627
627
  -1 !== idx && (stack = stack.slice(idx + 1));
628
- idx = stack.indexOf("react-stack-bottom-frame");
628
+ idx = stack.indexOf("react_stack_bottom_frame");
629
629
  -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
630
630
  var JSCompiler_inline_result =
631
631
  -1 !== idx ? (stack = stack.slice(0, idx)) : "";
@@ -3839,7 +3839,7 @@
3839
3839
  };
3840
3840
  }
3841
3841
  var callComponent = {
3842
- "react-stack-bottom-frame": function (
3842
+ react_stack_bottom_frame: function (
3843
3843
  Component,
3844
3844
  props,
3845
3845
  componentDebugInfo
@@ -3853,22 +3853,22 @@
3853
3853
  }
3854
3854
  },
3855
3855
  callComponentInDEV =
3856
- callComponent["react-stack-bottom-frame"].bind(callComponent),
3856
+ callComponent.react_stack_bottom_frame.bind(callComponent),
3857
3857
  callLazyInit = {
3858
- "react-stack-bottom-frame": function (lazy) {
3858
+ react_stack_bottom_frame: function (lazy) {
3859
3859
  var init = lazy._init;
3860
3860
  return init(lazy._payload);
3861
3861
  }
3862
3862
  },
3863
3863
  callLazyInitInDEV =
3864
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
3864
+ callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
3865
3865
  callIterator = {
3866
- "react-stack-bottom-frame": function (iterator, progress, error) {
3866
+ react_stack_bottom_frame: function (iterator, progress, error) {
3867
3867
  iterator.next().then(progress, error);
3868
3868
  }
3869
3869
  },
3870
3870
  callIteratorInDEV =
3871
- callIterator["react-stack-bottom-frame"].bind(callIterator),
3871
+ callIterator.react_stack_bottom_frame.bind(callIterator),
3872
3872
  isArrayImpl = Array.isArray,
3873
3873
  getPrototypeOf = Object.getPrototypeOf,
3874
3874
  jsxPropsParents = new WeakMap(),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-server-dom-webpack",
3
3
  "description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
4
- "version": "19.1.0",
4
+ "version": "19.1.1",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -99,8 +99,8 @@
99
99
  "node": ">=0.10.0"
100
100
  },
101
101
  "peerDependencies": {
102
- "react": "^19.1.0",
103
- "react-dom": "^19.1.0",
102
+ "react": "^19.1.1",
103
+ "react-dom": "^19.1.1",
104
104
  "webpack": "^5.59.0"
105
105
  },
106
106
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-rsc",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "React Server Components (RSC) support for Vite.",
5
5
  "keywords": [
6
6
  "vite",
@@ -38,29 +38,30 @@
38
38
  "prepack": "tsdown"
39
39
  },
40
40
  "dependencies": {
41
- "@mjackson/node-fetch-server": "^0.7.0",
41
+ "@remix-run/node-fetch-server": "^0.8.0",
42
42
  "es-module-lexer": "^1.7.0",
43
43
  "estree-walker": "^3.0.3",
44
44
  "magic-string": "^0.30.17",
45
45
  "periscopic": "^4.0.2",
46
46
  "turbo-stream": "^3.1.0",
47
+ "use-sync-external-store": "^1.5.0",
47
48
  "vitefu": "^1.1.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@hiogawa/utils": "^1.7.0",
51
- "@playwright/test": "^1.54.1",
52
+ "@playwright/test": "^1.54.2",
52
53
  "@tsconfig/strictest": "^2.0.5",
53
54
  "@types/estree": "^1.0.8",
54
- "@types/node": "^22.16.5",
55
- "@types/react": "^19.1.8",
56
- "@types/react-dom": "^19.1.6",
55
+ "@types/node": "^22.17.0",
56
+ "@types/react": "^19.1.9",
57
+ "@types/react-dom": "^19.1.7",
57
58
  "@vitejs/plugin-react": "workspace:*",
58
- "react": "^19.1.0",
59
- "react-dom": "^19.1.0",
60
- "react-server-dom-webpack": "^19.1.0",
59
+ "react": "^19.1.1",
60
+ "react-dom": "^19.1.1",
61
+ "react-server-dom-webpack": "^19.1.1",
61
62
  "rsc-html-stream": "^0.0.7",
62
63
  "tinyexec": "^1.0.1",
63
- "tsdown": "^0.13.0",
64
+ "tsdown": "^0.13.2",
64
65
  "vite-plugin-inspect": "^11.3.2"
65
66
  },
66
67
  "peerDependencies": {