@farm.js/core 0.1.0-beta.51 → 0.1.0-beta.53
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/{chunk-HSHA3H3U.mjs → chunk-3E2WRUR2.mjs} +15 -1
- package/dist/chunk-3E2WRUR2.mjs.map +1 -0
- package/dist/{chunk-QCSOE6HT.mjs → chunk-FCY7TXMA.mjs} +52 -9
- package/dist/chunk-FCY7TXMA.mjs.map +1 -0
- package/dist/{chunk-235ZOXDY.mjs → chunk-HAMMDSJM.mjs} +2 -2
- package/dist/{chunk-FRN7PNL4.mjs → chunk-LN2BAU5H.mjs} +2 -2
- package/dist/{chunk-ZAW3D2TI.mjs → chunk-M2DI67UZ.mjs} +2 -2
- package/dist/{chunk-7XJV5RZO.mjs → chunk-RPEYD7TD.mjs} +2 -2
- package/dist/{chunk-7XJV5RZO.mjs.map → chunk-RPEYD7TD.mjs.map} +1 -1
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +15 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +4 -4
- package/dist/index.cjs +72 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/internal/build-runtime.cjs +58 -8
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.mjs +3 -3
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/plugin.cjs +51 -8
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/renderer-client.cjs +14 -0
- package/dist/renderer-client.cjs.map +1 -1
- package/dist/renderer-client.mjs +1 -1
- package/dist/server-query-client.cjs +14 -0
- package/dist/server-query-client.cjs.map +1 -1
- package/dist/server-query-client.mjs +2 -2
- package/dist/server.cjs +51 -8
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +2 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +51 -8
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +3 -3
- package/dist/chunk-HSHA3H3U.mjs.map +0 -1
- package/dist/chunk-QCSOE6HT.mjs.map +0 -1
- /package/dist/{chunk-235ZOXDY.mjs.map → chunk-HAMMDSJM.mjs.map} +0 -0
- /package/dist/{chunk-FRN7PNL4.mjs.map → chunk-LN2BAU5H.mjs.map} +0 -0
- /package/dist/{chunk-ZAW3D2TI.mjs.map → chunk-M2DI67UZ.mjs.map} +0 -0
package/dist/plugin.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import "./chunk-RQ633A5I.mjs";
|
|
7
7
|
import {
|
|
8
8
|
farmPlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FCY7TXMA.mjs";
|
|
10
10
|
import "./chunk-XJTDE4L4.mjs";
|
|
11
11
|
import "./chunk-CAUVJN4X.mjs";
|
|
12
12
|
import "./chunk-AMZZCRQ7.mjs";
|
|
@@ -63,7 +63,7 @@ import "./chunk-RBRLLZL5.mjs";
|
|
|
63
63
|
import "./chunk-WZ5QFROO.mjs";
|
|
64
64
|
import "./chunk-7ZMKVETU.mjs";
|
|
65
65
|
import "./chunk-FXG2PS27.mjs";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-RPEYD7TD.mjs";
|
|
67
67
|
import "./chunk-CGILA3WO.mjs";
|
|
68
68
|
export {
|
|
69
69
|
FarmRuntimeShutdownError,
|
package/dist/renderer-client.cjs
CHANGED
|
@@ -2227,6 +2227,19 @@ var serverQueryClientState = serverQueryClientGlobal[FARM_SERVER_QUERY_CLIENT_ST
|
|
|
2227
2227
|
nextFunctionId: 0,
|
|
2228
2228
|
active: []
|
|
2229
2229
|
});
|
|
2230
|
+
var RAW_SERVER_QUERY_SYMBOL = /* @__PURE__ */ Symbol.for("farm.server-query");
|
|
2231
|
+
function assertNotRawServerQueryInBrowser(query) {
|
|
2232
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
2233
|
+
if (!query?.[RAW_SERVER_QUERY_SYMBOL]) return;
|
|
2234
|
+
throw new Error(
|
|
2235
|
+
[
|
|
2236
|
+
"useServerQuery received a raw server query implementation in the browser.",
|
|
2237
|
+
"Server query handlers run only on the server. Enable the server-function transform (add @farm.js/plugin/rsc and set experimental.serverActions: true in farm.config.ts) so client imports become server references,",
|
|
2238
|
+
"or call the query from server code / an API route (createAPIClient) instead."
|
|
2239
|
+
].join("\n")
|
|
2240
|
+
);
|
|
2241
|
+
}
|
|
2242
|
+
__name(assertNotRawServerQueryInBrowser, "assertNotRawServerQueryInBrowser");
|
|
2230
2243
|
function createServerQueryCallKey(query, input) {
|
|
2231
2244
|
let id = serverQueryClientState.functionIds.get(query);
|
|
2232
2245
|
if (!id) {
|
|
@@ -2252,6 +2265,7 @@ async function fetchServerQuery(query, input, options = {}) {
|
|
|
2252
2265
|
}
|
|
2253
2266
|
__name(fetchServerQuery, "fetchServerQuery");
|
|
2254
2267
|
async function executeServerQuery(query, input, provisionalKey, options) {
|
|
2268
|
+
assertNotRawServerQueryInBrowser(query);
|
|
2255
2269
|
const cache = getFarmClientDataCache();
|
|
2256
2270
|
const inflight = cache.getInflight(provisionalKey);
|
|
2257
2271
|
if (inflight) return inflight;
|