@void/react 1.1.12 → 1.2.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.
- package/dist/plugin.mjs +18 -7
- package/dist/runtime/pages-client.mjs +2 -6
- package/package.json +7 -7
package/dist/plugin.mjs
CHANGED
|
@@ -52,11 +52,14 @@ const REACT_OPTIMIZE_DEPS = [
|
|
|
52
52
|
"react",
|
|
53
53
|
"react/jsx-runtime",
|
|
54
54
|
"react/jsx-dev-runtime",
|
|
55
|
-
"react-dom"
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
"react-dom"
|
|
56
|
+
];
|
|
57
|
+
const CLIENT_OPTIMIZE_DEPS = [...REACT_OPTIMIZE_DEPS, "react-dom/client"];
|
|
58
|
+
const WORKER_OPTIMIZE_DEPS = [
|
|
59
|
+
...REACT_OPTIMIZE_DEPS,
|
|
60
|
+
"react-dom/server",
|
|
61
|
+
"void/live/client"
|
|
58
62
|
];
|
|
59
|
-
const WORKER_OPTIMIZE_DEPS = [...REACT_OPTIMIZE_DEPS, "void/live/client"];
|
|
60
63
|
const REACT_REFRESH_PREAMBLE = `
|
|
61
64
|
<script type="module">
|
|
62
65
|
import RefreshRuntime from "/@react-refresh"
|
|
@@ -134,7 +137,15 @@ function pagesPlugin(pagesDir, options) {
|
|
|
134
137
|
const normalizedPath = normalizePath(path);
|
|
135
138
|
if (normalizedPath !== normalizedPagesDir && !normalizedPath.startsWith(normalizedPagesDir + "/")) return;
|
|
136
139
|
if (event === "change" && !normalizedPath.endsWith(".md")) return;
|
|
137
|
-
|
|
140
|
+
try {
|
|
141
|
+
await runRescan();
|
|
142
|
+
} catch (error) {
|
|
143
|
+
server.config.logger.error(error instanceof Error ? error.message : String(error), {
|
|
144
|
+
error: error instanceof Error ? error : void 0,
|
|
145
|
+
timestamp: true
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
138
149
|
invalidatePageModules(server);
|
|
139
150
|
};
|
|
140
151
|
server.watcher.on("add", (path) => handlePagesChange(path, "add"));
|
|
@@ -152,9 +163,9 @@ function pagesPlugin(pagesDir, options) {
|
|
|
152
163
|
resolve: { dedupe: REACT_DEDUPE },
|
|
153
164
|
optimizeDeps: {
|
|
154
165
|
exclude: ["@void/react"],
|
|
155
|
-
include:
|
|
166
|
+
include: CLIENT_OPTIMIZE_DEPS
|
|
156
167
|
},
|
|
157
|
-
ssr: { optimizeDeps: { include:
|
|
168
|
+
ssr: { optimizeDeps: { include: [...CLIENT_OPTIMIZE_DEPS, "react-dom/server"] } },
|
|
158
169
|
environments: { [WORKER_ENVIRONMENT_NAME]: { optimizeDeps: {
|
|
159
170
|
exclude: ["@void/react"],
|
|
160
171
|
entries: [pagesOptimizeEntries],
|
|
@@ -2,7 +2,7 @@ import { a as RouterContext, i as ParamsContext, o as SharedContext, r as Naviga
|
|
|
2
2
|
import { n as setActionRouter } from "../action-4EvQppia.mjs";
|
|
3
3
|
import { n as DEFERRED_SHELL_END_ID } from "../deferred-shell-DOuP2YAo.mjs";
|
|
4
4
|
import React, { Suspense, startTransition, use, useCallback, useEffect, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useState, useTransition } from "react";
|
|
5
|
-
import { createPageNavigationEngine, createRouterFacade, idleNavigationState, isAbortError, isCallSiteActionError } from "void/pages-client";
|
|
5
|
+
import { createPageNavigationEngine, createRouterFacade, idleNavigationState, isAbortError, isCallSiteActionError, refreshPage } from "void/pages-client";
|
|
6
6
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
7
7
|
//#region src/runtime/pages-client.ts
|
|
8
8
|
const deferredState = /* @__PURE__ */ new WeakMap();
|
|
@@ -158,11 +158,7 @@ function createRouter(engine) {
|
|
|
158
158
|
return scheduleVisit(normalizeUrl(url), options);
|
|
159
159
|
},
|
|
160
160
|
refresh(options = {}) {
|
|
161
|
-
return router
|
|
162
|
-
preserveState: true,
|
|
163
|
-
preserveScroll: true,
|
|
164
|
-
...options
|
|
165
|
-
});
|
|
161
|
+
return refreshPage(router, options);
|
|
166
162
|
},
|
|
167
163
|
prefetch(url, options = {}) {
|
|
168
164
|
return engine.prefetch(normalizeUrl(url), options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/react",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "React pages, server rendering, forms, and navigation for Void.",
|
|
5
5
|
"homepage": "https://void.cloud",
|
|
6
6
|
"bugs": {
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"@types/react": "^19.3.0",
|
|
46
46
|
"@types/react-dom": "^19.3.0",
|
|
47
47
|
"pathslash": "^0.1.0",
|
|
48
|
-
"react": "^19.3.
|
|
49
|
-
"react-dom": "^19.3.
|
|
50
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.
|
|
51
|
-
"vite-plus": "1.
|
|
52
|
-
"void": "1.1
|
|
48
|
+
"react": "^19.3.1",
|
|
49
|
+
"react-dom": "^19.3.1",
|
|
50
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
51
|
+
"vite-plus": "1.3.0",
|
|
52
|
+
"void": "1.2.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^19.0.0",
|
|
56
56
|
"react-dom": "^19.0.0",
|
|
57
57
|
"vite": "^8.0.0",
|
|
58
|
-
"void": "1.1
|
|
58
|
+
"void": "1.2.1"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "vp pack",
|