@jxsuite/runtime 1.3.1 → 1.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/runtime",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "JSON-native reactive web component runtime",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "upgrade": "bunx npm-check-updates -u && bun install"
31
31
  },
32
32
  "dependencies": {
33
- "@jxsuite/schema": "^1.4.0",
33
+ "@jxsuite/schema": "^1.5.0",
34
34
  "@vue/reactivity": "3.5.40"
35
35
  },
36
36
  "devDependencies": {
package/src/runtime.ts CHANGED
@@ -170,6 +170,25 @@ export function setSkipServerFunctions(v: boolean) {
170
170
  _serverFnConfig.skip = v;
171
171
  }
172
172
 
173
+ /** @type {{ skip: boolean }} */
174
+ const _autoRequestConfig = { skip: false };
175
+ /**
176
+ * Set to true to suppress AUTOMATIC `$prototype: "Request"` fetches — the sibling of
177
+ * {@link setSkipServerFunctions}, and used by Studio for the same reason.
178
+ *
179
+ * `buildScope` re-resolves every `state` entry on each full canvas render, so an auto-request
180
+ * re-issued its HTTP call every time the canvas rebuilt. In edit/design mode that meant authoring
181
+ * actions — a signal edit, or pressing Enter inside component-wrapped content, both of which force
182
+ * a full render — fired network requests. Live data belongs to preview and to the deployed site.
183
+ *
184
+ * Only non-`manual` requests are gated: a `manual` one fires from an event handler, and edit mode
185
+ * strips handlers before rendering. The returned ref is unchanged either way — it simply stays at
186
+ * its initial `null`, which is the same state bindings observe before any fetch resolves.
187
+ */
188
+ export function setSkipAutoRequests(v: boolean) {
189
+ _autoRequestConfig.skip = v;
190
+ }
191
+
173
192
  // ─── Dev-proxy auth token (Studio cross-origin canvas) ────────────────────────
174
193
  // The Studio canvas iframe is served from a token-gated loopback origin (createProjectServer): its
175
194
  // POST /__jx_resolve__ + /__jx_server__ routes 403 without ?token=<rpcToken>. The iframe boot reads
@@ -1323,7 +1342,7 @@ export async function resolvePrototype(
1323
1342
  const debounceMs = def.debounce ?? 0;
1324
1343
  let debounceTimer: ReturnType<typeof setTimeout> | null = null;
1325
1344
 
1326
- if (!def.manual) {
1345
+ if (!def.manual && !_autoRequestConfig.skip) {
1327
1346
  effect(() => {
1328
1347
  let url: string | undefined;
1329
1348
  if (isTemplateString(def.url)) {