@vitejs/plugin-rsc 0.5.29 → 0.5.30

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
@@ -27,6 +27,7 @@ npm create vite@latest -- --template rsc
27
27
 
28
28
  - [`./examples/basic`](./examples/basic) - Advanced RSC features and testing
29
29
  - This is mainly used for e2e testing and includes various advanced RSC usages (e.g. `"use cache"` example).
30
+ - [`./examples/performance-track`](./examples/performance-track) - Minimal React Server Components performance track probe.
30
31
  - [`./examples/ssg`](./examples/ssg) - Static site generation with MDX and client components for interactivity.
31
32
  - [`./examples/react-router`](./examples/react-router) - React Router RSC integration
32
33
  - Demonstrates how to integrate [experimental React Router RSC API](https://remix.run/blog/rsc-preview). React Router now provides [official RSC support](https://reactrouter.com/how-to/react-server-components), so it's recommended to follow React Router's official documentation for the latest integration.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { r as vitePluginRsc, t as getPluginApi } from "./plugin-DPZnhMn5.js";
1
+ import { r as vitePluginRsc, t as getPluginApi } from "./plugin-ByvxS0by.js";
2
2
  export { vitePluginRsc as default, getPluginApi };
@@ -1,4 +1,4 @@
1
- import { a as __commonJSMin } from "./plugin-DPZnhMn5.js";
1
+ import { a as __commonJSMin } from "./plugin-ByvxS0by.js";
2
2
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
3
3
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
4
  let p = process || {};
@@ -636,7 +636,7 @@ function vitePluginRscMinimal(rscPluginOptions = {}, manager = new RscPluginMana
636
636
  function vitePluginRsc(rscPluginOptions = {}) {
637
637
  const manager = new RscPluginManager();
638
638
  const buildApp = async (builder) => {
639
- const colors = await import("./picocolors-nYPB6lHj.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
639
+ const colors = await import("./picocolors-D_Y2lyXp.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
640
640
  const logStep = (msg) => {
641
641
  builder.config.logger.info(colors.blue(msg));
642
642
  };
@@ -895,8 +895,13 @@ function vitePluginRsc(rscPluginOptions = {}) {
895
895
  }
896
896
  if (this.environment.name === "client") {
897
897
  if (ctx.server.environments.rsc.moduleGraph.getModuleById(ctx.file)) {
898
- for (const clientMod of ctx.modules) for (const importer of clientMod.importers) if (importer.id && isCSSRequest(importer.id)) await this.environment.reloadModule(importer);
899
- return [];
898
+ let hasNonCssImporter = false;
899
+ for (const clientMod of ctx.modules) for (const importer of clientMod.importers) {
900
+ if (!importer.id) continue;
901
+ if (isCSSRequest(importer.id)) await this.environment.reloadModule(importer);
902
+ else hasNonCssImporter = true;
903
+ }
904
+ if (!hasNonCssImporter) return [];
900
905
  }
901
906
  }
902
907
  }
@@ -1435,7 +1440,8 @@ function vitePluginUseClient(useClientPluginOptions, manager) {
1435
1440
  if (this.environment.name === serverEnvironmentName && bareImportRE.test(source) && !(source === "client-only" || source === "server-only")) {
1436
1441
  const resolved = await this.resolve(source, importer, options);
1437
1442
  if (resolved && resolved.id.includes("/node_modules/")) {
1438
- const resolvedAtRoot = await this.resolve(source, void 0, options);
1443
+ const rootImporter = path.join(this.environment.config.root, "index.html");
1444
+ const resolvedAtRoot = await this.resolve(source, rootImporter, options);
1439
1445
  if (!resolvedAtRoot || resolvedAtRoot.id !== resolved.id) return;
1440
1446
  packageSources.set(resolved.id, source);
1441
1447
  return resolved;
package/dist/plugin.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-DPZnhMn5.js";
1
+ import { i as vitePluginRscMinimal, n as transformRscCssExport, r as vitePluginRsc, t as getPluginApi } from "./plugin-ByvxS0by.js";
2
2
  export { vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-rsc",
3
- "version": "0.5.29",
3
+ "version": "0.5.30",
4
4
  "description": "React Server Components (RSC) support for Vite.",
5
5
  "keywords": [
6
6
  "react",