@plasmicapp/data-sources 0.1.201 → 0.1.203
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/index.d.ts +149 -13
- package/dist/index.esm.js +715 -143
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +710 -138
- package/dist/index.js.map +4 -4
- package/package.json +6 -5
package/dist/index.esm.js
CHANGED
|
@@ -38,18 +38,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
// src/
|
|
42
|
-
import { usePlasmicDataConfig as usePlasmicDataConfig3 } from "@plasmicapp/query";
|
|
43
|
-
|
|
44
|
-
// src/components/Fetcher.tsx
|
|
45
|
-
import React3 from "react";
|
|
46
|
-
|
|
47
|
-
// src/hooks/usePlasmicDataOp.tsx
|
|
48
|
-
import { usePlasmicDataSourceContext } from "@plasmicapp/data-sources-context";
|
|
41
|
+
// src/serverQueries/client.ts
|
|
49
42
|
import {
|
|
50
|
-
|
|
43
|
+
useMutablePlasmicQueryData as useMutablePlasmicQueryData2,
|
|
44
|
+
usePlasmicDataConfig as usePlasmicDataConfig2,
|
|
45
|
+
wrapLoadingFetcher
|
|
51
46
|
} from "@plasmicapp/query";
|
|
52
|
-
import * as
|
|
47
|
+
import * as React3 from "react";
|
|
53
48
|
|
|
54
49
|
// src/common.ts
|
|
55
50
|
import {
|
|
@@ -61,6 +56,14 @@ import React from "react";
|
|
|
61
56
|
function isPlasmicUndefinedDataErrorPromise(x) {
|
|
62
57
|
return !!x && typeof x === "object" && (x == null ? void 0 : x.plasmicType) === "PlasmicUndefinedDataError";
|
|
63
58
|
}
|
|
59
|
+
function tagPlasmicUndefinedDataErrorPromise(promise) {
|
|
60
|
+
promise.plasmicType = "PlasmicUndefinedDataError";
|
|
61
|
+
promise.message = "Query is not done";
|
|
62
|
+
}
|
|
63
|
+
function untagPlasmicUndefinedDataErrorPromise(promise) {
|
|
64
|
+
delete promise.plasmicType;
|
|
65
|
+
delete promise.message;
|
|
66
|
+
}
|
|
64
67
|
function mkUndefinedDataProxy(promiseRef, fetchAndUpdateCache) {
|
|
65
68
|
let fetchAndUpdatePromise = void 0;
|
|
66
69
|
return new Proxy(
|
|
@@ -230,9 +233,694 @@ function getConfig(key, defaultValue) {
|
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
|
|
236
|
+
// src/utils.ts
|
|
237
|
+
function noopFn() {
|
|
238
|
+
}
|
|
239
|
+
function swallow(f) {
|
|
240
|
+
try {
|
|
241
|
+
return f();
|
|
242
|
+
} catch (e) {
|
|
243
|
+
return void 0;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function pick(obj, ...keys) {
|
|
247
|
+
const res = {};
|
|
248
|
+
for (const key of keys) {
|
|
249
|
+
if (key in obj) {
|
|
250
|
+
res[key] = obj[key];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return res;
|
|
254
|
+
}
|
|
255
|
+
var tuple = (...args) => args;
|
|
256
|
+
function mkIdMap(xs) {
|
|
257
|
+
return new Map(xs.map((x) => tuple(x.id, x)));
|
|
258
|
+
}
|
|
259
|
+
function notNil(x) {
|
|
260
|
+
return x !== null && x !== void 0;
|
|
261
|
+
}
|
|
262
|
+
function withoutNils(xs) {
|
|
263
|
+
return xs.filter(notNil);
|
|
264
|
+
}
|
|
265
|
+
function mapRecordEntries(callback, record1, record2, record3) {
|
|
266
|
+
return Object.entries(record1).map(([k, v1]) => {
|
|
267
|
+
const v2 = record2 == null ? void 0 : record2[k];
|
|
268
|
+
const v3 = record3 == null ? void 0 : record3[k];
|
|
269
|
+
return callback(
|
|
270
|
+
k,
|
|
271
|
+
v1,
|
|
272
|
+
v2,
|
|
273
|
+
v3
|
|
274
|
+
);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function mapRecords(callback, record1, record2, record3) {
|
|
278
|
+
return Object.fromEntries(
|
|
279
|
+
mapRecordEntries(
|
|
280
|
+
(k, v1, v2, v3) => [k, callback(k, v1, v2, v3)],
|
|
281
|
+
record1,
|
|
282
|
+
record2,
|
|
283
|
+
record3
|
|
284
|
+
)
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// src/serverQueries/common.ts
|
|
289
|
+
import React2 from "react";
|
|
290
|
+
function createDollarQueries(queryNames) {
|
|
291
|
+
return Object.fromEntries(
|
|
292
|
+
queryNames.map((queryName) => {
|
|
293
|
+
return [queryName, new StatefulQueryResult()];
|
|
294
|
+
})
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
var StatefulQueryResult = class {
|
|
298
|
+
constructor() {
|
|
299
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
300
|
+
this.current = { state: "initial", key: null };
|
|
301
|
+
this.settable = new SettablePromise();
|
|
302
|
+
tagPlasmicUndefinedDataErrorPromise(this.settable.promise);
|
|
303
|
+
}
|
|
304
|
+
transitionState(next) {
|
|
305
|
+
const prev = this.current;
|
|
306
|
+
if (prev.state === next.state && prev.key === next.key && ("data" in prev ? prev.data : void 0) === ("data" in next ? next.data : void 0) && ("error" in prev ? prev.error : void 0) === ("error" in next ? next.error : void 0)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (prev.key !== null && // the promise was already bound to a key AND
|
|
310
|
+
// NOT the loading -> done transition with the same key
|
|
311
|
+
!(prev.key === next.key && prev.state === "loading" && next.state === "done")) {
|
|
312
|
+
this.settable = new SettablePromise();
|
|
313
|
+
tagPlasmicUndefinedDataErrorPromise(this.settable.promise);
|
|
314
|
+
}
|
|
315
|
+
this.current = next;
|
|
316
|
+
this.notifyListeners(prev);
|
|
317
|
+
}
|
|
318
|
+
addListener(listener) {
|
|
319
|
+
this.listeners.add(listener);
|
|
320
|
+
}
|
|
321
|
+
removeListener(listener) {
|
|
322
|
+
this.listeners.delete(listener);
|
|
323
|
+
}
|
|
324
|
+
notifyListeners(prev) {
|
|
325
|
+
for (const listener of this.listeners) {
|
|
326
|
+
listener(this.current, prev);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
reset() {
|
|
330
|
+
this.transitionState({
|
|
331
|
+
state: "initial",
|
|
332
|
+
key: null
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
loadingPromise(key, promise) {
|
|
336
|
+
this.transitionState({
|
|
337
|
+
state: "loading",
|
|
338
|
+
key
|
|
339
|
+
});
|
|
340
|
+
promise.then(
|
|
341
|
+
(value) => this.resolvePromise(key, value),
|
|
342
|
+
(err) => this.rejectPromise(key, err)
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Resolve is allowed if:
|
|
347
|
+
* 1) no key / state is initial, which means we are resolving from cache
|
|
348
|
+
* 2) key / state is loading, which means we need to check the keys match
|
|
349
|
+
*/
|
|
350
|
+
resolvePromise(key, data) {
|
|
351
|
+
if (this.current.key === null || this.current.key === key) {
|
|
352
|
+
this.transitionState({
|
|
353
|
+
state: "done",
|
|
354
|
+
key,
|
|
355
|
+
data
|
|
356
|
+
});
|
|
357
|
+
this.settable.resolve(data);
|
|
358
|
+
untagPlasmicUndefinedDataErrorPromise(this.settable.promise);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Reject is allowed if:
|
|
363
|
+
* 1) no key / state is initial, which means params resolution failed
|
|
364
|
+
* 2) key / state is loading, which means we need to check the keys match
|
|
365
|
+
*/
|
|
366
|
+
rejectPromise(key, error) {
|
|
367
|
+
if (this.current.key === null || this.current.key === key) {
|
|
368
|
+
this.transitionState({
|
|
369
|
+
state: "done",
|
|
370
|
+
key,
|
|
371
|
+
error
|
|
372
|
+
});
|
|
373
|
+
this.settable.promise.catch(noopFn);
|
|
374
|
+
this.settable.reject(error);
|
|
375
|
+
untagPlasmicUndefinedDataErrorPromise(this.settable.promise);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
get key() {
|
|
379
|
+
return this.current.key;
|
|
380
|
+
}
|
|
381
|
+
get data() {
|
|
382
|
+
if (this.current.state === "done") {
|
|
383
|
+
if ("data" in this.current) {
|
|
384
|
+
return this.current.data;
|
|
385
|
+
} else {
|
|
386
|
+
throw this.current.error;
|
|
387
|
+
}
|
|
388
|
+
} else {
|
|
389
|
+
throw this.settable.promise;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
get isLoading() {
|
|
393
|
+
return this.current.state === "initial" || this.current.state === "loading";
|
|
394
|
+
}
|
|
395
|
+
getDoneResult() {
|
|
396
|
+
return __async(this, null, function* () {
|
|
397
|
+
yield this.settable.promise;
|
|
398
|
+
return this;
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
function safeExec(tryData, ifUndefined, ifError) {
|
|
403
|
+
try {
|
|
404
|
+
return tryData();
|
|
405
|
+
} catch (err) {
|
|
406
|
+
if (isPlasmicUndefinedDataErrorPromise(err)) {
|
|
407
|
+
return ifUndefined(err);
|
|
408
|
+
} else {
|
|
409
|
+
return ifError(err);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function resolveParams(params) {
|
|
414
|
+
return safeExec(
|
|
415
|
+
() => ({
|
|
416
|
+
status: "ready",
|
|
417
|
+
resolvedParams: params()
|
|
418
|
+
}),
|
|
419
|
+
(promise) => ({
|
|
420
|
+
status: "blocked",
|
|
421
|
+
promise
|
|
422
|
+
}),
|
|
423
|
+
(err) => ({
|
|
424
|
+
status: "error",
|
|
425
|
+
error: new Error("Error resolving function params", { cause: err })
|
|
426
|
+
})
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
function wrapDollarQueriesForMetadata($queries, ifUndefined, ifError) {
|
|
430
|
+
return wrapDollarQueriesWithFallbacks(
|
|
431
|
+
$queries,
|
|
432
|
+
ifUndefined != null ? ifUndefined : () => "\u2026",
|
|
433
|
+
ifError != null ? ifError : () => "[ERROR]"
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function wrapDollarQueriesWithFallbacks($queries, ifUndefined, ifError) {
|
|
437
|
+
return mapRecords(
|
|
438
|
+
(_queryName, $query) => new FallbackQueryResult($query, ifUndefined, ifError),
|
|
439
|
+
$queries
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
var FallbackQueryResult = class {
|
|
443
|
+
constructor($query, ifUndefined, ifError) {
|
|
444
|
+
this.$query = $query;
|
|
445
|
+
this.ifUndefined = ifUndefined;
|
|
446
|
+
this.ifError = ifError;
|
|
447
|
+
}
|
|
448
|
+
get key() {
|
|
449
|
+
return this.$query.key;
|
|
450
|
+
}
|
|
451
|
+
get data() {
|
|
452
|
+
return safeExec(
|
|
453
|
+
() => this.$query.data,
|
|
454
|
+
(promise) => createConstantProxy(this.ifUndefined(promise)),
|
|
455
|
+
(err) => createConstantProxy(this.ifError(err))
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
get isLoading() {
|
|
459
|
+
return this.$query.isLoading;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
function createConstantProxy(constant) {
|
|
463
|
+
const constantProxy = new Proxy(
|
|
464
|
+
{},
|
|
465
|
+
{
|
|
466
|
+
get(_target, prop) {
|
|
467
|
+
return prop === Symbol.toPrimitive ? () => constant : constantProxy;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
return constantProxy;
|
|
472
|
+
}
|
|
473
|
+
var SyncPromise = class {
|
|
474
|
+
constructor(promise) {
|
|
475
|
+
this.promise = promise;
|
|
476
|
+
this.result = void 0;
|
|
477
|
+
promise.then(
|
|
478
|
+
(value) => {
|
|
479
|
+
this.result = {
|
|
480
|
+
state: "resolved",
|
|
481
|
+
value
|
|
482
|
+
};
|
|
483
|
+
},
|
|
484
|
+
(error) => {
|
|
485
|
+
this.result = {
|
|
486
|
+
state: "rejected",
|
|
487
|
+
error
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
var SettablePromise = class {
|
|
494
|
+
constructor() {
|
|
495
|
+
this.promise = new Promise((resolve, reject) => {
|
|
496
|
+
this._resolve = resolve;
|
|
497
|
+
this._reject = reject;
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
resolve(value) {
|
|
501
|
+
this._resolve(value);
|
|
502
|
+
}
|
|
503
|
+
reject(error) {
|
|
504
|
+
this._reject(error);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
function useRenderEffect(effect, deps) {
|
|
508
|
+
const ref = React2.useRef({ deps: void 0, cleanup: void 0 });
|
|
509
|
+
const depsChanged = ref.current.deps === void 0 || deps.length !== ref.current.deps.length || deps.some((dep, i) => !Object.is(dep, ref.current.deps[i]));
|
|
510
|
+
if (depsChanged) {
|
|
511
|
+
if (ref.current.cleanup) {
|
|
512
|
+
ref.current.cleanup();
|
|
513
|
+
}
|
|
514
|
+
const prevDeps = ref.current.deps;
|
|
515
|
+
ref.current.cleanup = effect(prevDeps);
|
|
516
|
+
ref.current.deps = deps;
|
|
517
|
+
}
|
|
518
|
+
React2.useEffect(() => {
|
|
519
|
+
return () => {
|
|
520
|
+
if (ref.current.cleanup) {
|
|
521
|
+
ref.current.cleanup();
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
}, []);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// src/serverQueries/makeQueryCacheKey.ts
|
|
528
|
+
function makeQueryCacheKey(id, params) {
|
|
529
|
+
return `${id}:${safeStableStringify(params)}`;
|
|
530
|
+
}
|
|
531
|
+
var shortPlasmicPrefix = "\u03C1";
|
|
532
|
+
function safeStableStringify(unstableValue) {
|
|
533
|
+
const stableValue = sortObjectsDeep(unstableValue, /* @__PURE__ */ new Map());
|
|
534
|
+
const visitedPaths = /* @__PURE__ */ new Map();
|
|
535
|
+
return JSON.stringify(stableValue, function(key, value) {
|
|
536
|
+
switch (typeof value) {
|
|
537
|
+
case "undefined":
|
|
538
|
+
return `${shortPlasmicPrefix}:UNDEFINED`;
|
|
539
|
+
case "function":
|
|
540
|
+
return `${shortPlasmicPrefix}:FUNCTION:${value.name}`;
|
|
541
|
+
case "symbol":
|
|
542
|
+
return `${shortPlasmicPrefix}:SYMBOL:${value.description}`;
|
|
543
|
+
case "bigint":
|
|
544
|
+
return value.toString();
|
|
545
|
+
case "object":
|
|
546
|
+
if (value !== null) {
|
|
547
|
+
const cyclePath = visitedPaths.get(value);
|
|
548
|
+
if (cyclePath) {
|
|
549
|
+
return `${shortPlasmicPrefix}:REF:${cyclePath}`;
|
|
550
|
+
}
|
|
551
|
+
const parentPath = visitedPaths.get(this);
|
|
552
|
+
const valuePath = parentPath === void 0 ? "$" : `${parentPath}.${key}`;
|
|
553
|
+
visitedPaths.set(value, valuePath);
|
|
554
|
+
}
|
|
555
|
+
return value;
|
|
556
|
+
default:
|
|
557
|
+
return value;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
function sortObjectsDeep(value, visitedObjects) {
|
|
562
|
+
if (typeof value !== "object" || value === null) {
|
|
563
|
+
return value;
|
|
564
|
+
}
|
|
565
|
+
const visitedValue = visitedObjects.get(value);
|
|
566
|
+
if (visitedValue) {
|
|
567
|
+
return visitedValue;
|
|
568
|
+
}
|
|
569
|
+
if (Array.isArray(value)) {
|
|
570
|
+
const newArr = [];
|
|
571
|
+
visitedObjects.set(value, newArr);
|
|
572
|
+
value.forEach((item, key) => {
|
|
573
|
+
newArr[key] = sortObjectsDeep(item, visitedObjects);
|
|
574
|
+
});
|
|
575
|
+
return newArr;
|
|
576
|
+
} else {
|
|
577
|
+
const newObj = {};
|
|
578
|
+
visitedObjects.set(value, newObj);
|
|
579
|
+
Object.keys(value).sort().forEach((key) => {
|
|
580
|
+
newObj[key] = sortObjectsDeep(value[key], visitedObjects);
|
|
581
|
+
});
|
|
582
|
+
return newObj;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/serverQueries/client.ts
|
|
587
|
+
var GLOBAL_CACHE = /* @__PURE__ */ new Map();
|
|
588
|
+
function usePlasmicQueries($queries, queries) {
|
|
589
|
+
const wrappedQueries = React3.useMemo(() => wrapQueries(queries), [queries]);
|
|
590
|
+
const $queryStates = $queries;
|
|
591
|
+
const { fallback: prefetchedCache, cache: swrCache } = usePlasmicDataConfig2();
|
|
592
|
+
const [settledCount, setSettledCount] = React3.useState(0);
|
|
593
|
+
React3.useEffect(() => {
|
|
594
|
+
let cleanup = false;
|
|
595
|
+
const resultListener = (next, prev) => {
|
|
596
|
+
if (cleanup) {
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
if (prev.state === "done" || next.state === "done") {
|
|
600
|
+
queueMicrotask(() => setSettledCount((v) => v + 1));
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
mapRecords((_queryName, $query) => {
|
|
604
|
+
$query.addListener(resultListener);
|
|
605
|
+
}, $queryStates);
|
|
606
|
+
return () => {
|
|
607
|
+
cleanup = true;
|
|
608
|
+
mapRecords((_queryName, $query) => {
|
|
609
|
+
$query.removeListener(resultListener);
|
|
610
|
+
}, $queryStates);
|
|
611
|
+
};
|
|
612
|
+
}, [$queryStates]);
|
|
613
|
+
useRenderEffect(
|
|
614
|
+
(prevDeps) => {
|
|
615
|
+
if (prevDeps) {
|
|
616
|
+
const prevWrappedQueries = prevDeps[0];
|
|
617
|
+
if (!Object.is(prevWrappedQueries, wrappedQueries)) {
|
|
618
|
+
mapRecords((_queryName, $query) => {
|
|
619
|
+
$query.reset();
|
|
620
|
+
}, $queryStates);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
let cleanup = false;
|
|
624
|
+
const loop = () => __async(this, null, function* () {
|
|
625
|
+
while (true) {
|
|
626
|
+
initPlasmicQueriesSync(
|
|
627
|
+
$queryStates,
|
|
628
|
+
wrappedQueries,
|
|
629
|
+
prefetchedCache,
|
|
630
|
+
swrCache
|
|
631
|
+
);
|
|
632
|
+
const loadingQueries = mapRecordEntries((_queryName, $query) => {
|
|
633
|
+
if ($query.isLoading) {
|
|
634
|
+
return $query.getDoneResult();
|
|
635
|
+
} else {
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
}, $queryStates).filter(notNil);
|
|
639
|
+
if (loadingQueries.length === 0) {
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
yield Promise.race(loadingQueries);
|
|
643
|
+
if (cleanup) {
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
loop().catch(noopFn);
|
|
649
|
+
return () => {
|
|
650
|
+
cleanup = true;
|
|
651
|
+
};
|
|
652
|
+
},
|
|
653
|
+
[wrappedQueries, $queryStates, settledCount]
|
|
654
|
+
);
|
|
655
|
+
mapRecordEntries(
|
|
656
|
+
(_queryName, $query, query) => {
|
|
657
|
+
usePlasmicServerQuery(
|
|
658
|
+
query,
|
|
659
|
+
void 0,
|
|
660
|
+
{
|
|
661
|
+
settledCount,
|
|
662
|
+
onStarted: $query.loadingPromise.bind($query),
|
|
663
|
+
onResolved: $query.resolvePromise.bind($query),
|
|
664
|
+
onRejected: $query.rejectPromise.bind($query)
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
},
|
|
668
|
+
$queryStates,
|
|
669
|
+
wrappedQueries
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
function wrapQueries(queries) {
|
|
673
|
+
return mapRecords((_queryName, query) => {
|
|
674
|
+
const wrappedFn = (...args) => {
|
|
675
|
+
const cacheKey = makeQueryCacheKey(query.id, args);
|
|
676
|
+
const cached = GLOBAL_CACHE.get(cacheKey);
|
|
677
|
+
if (cached) {
|
|
678
|
+
return cached.promise;
|
|
679
|
+
}
|
|
680
|
+
const wrapStudioCache = getConfig(
|
|
681
|
+
"EXECUTE_SERVER_QUERY",
|
|
682
|
+
(_, fn, ...args2) => fn(...args2)
|
|
683
|
+
);
|
|
684
|
+
const promise = wrapLoadingFetcher(wrapStudioCache)(
|
|
685
|
+
query.id,
|
|
686
|
+
query.fn,
|
|
687
|
+
...args
|
|
688
|
+
);
|
|
689
|
+
GLOBAL_CACHE.set(cacheKey, new SyncPromise(promise));
|
|
690
|
+
return promise;
|
|
691
|
+
};
|
|
692
|
+
return {
|
|
693
|
+
id: query.id,
|
|
694
|
+
fn: wrappedFn,
|
|
695
|
+
execParams: query.execParams
|
|
696
|
+
};
|
|
697
|
+
}, queries);
|
|
698
|
+
}
|
|
699
|
+
function initPlasmicQueriesSync($queries, queries, prefetchedCache, clientCache) {
|
|
700
|
+
let anySettled;
|
|
701
|
+
do {
|
|
702
|
+
anySettled = false;
|
|
703
|
+
mapRecords(
|
|
704
|
+
(_queryName, $query, query) => {
|
|
705
|
+
if ($query.current.state !== "initial") {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const paramsResult = resolveParams(query.execParams);
|
|
709
|
+
if (paramsResult.status === "error") {
|
|
710
|
+
$query.rejectPromise(null, paramsResult.error);
|
|
711
|
+
anySettled = true;
|
|
712
|
+
return;
|
|
713
|
+
} else if (paramsResult.status === "blocked") {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const cacheKey = makeQueryCacheKey(
|
|
717
|
+
query.id,
|
|
718
|
+
paramsResult.resolvedParams
|
|
719
|
+
);
|
|
720
|
+
if (cacheKey in prefetchedCache) {
|
|
721
|
+
$query.resolvePromise(cacheKey, prefetchedCache[cacheKey]);
|
|
722
|
+
anySettled = true;
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
const clientCacheData = clientCache.get(cacheKey);
|
|
726
|
+
if (clientCacheData !== void 0) {
|
|
727
|
+
$query.resolvePromise(cacheKey, clientCacheData);
|
|
728
|
+
anySettled = true;
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
const clientCachedPromise = GLOBAL_CACHE.get(cacheKey);
|
|
732
|
+
if (clientCachedPromise == null ? void 0 : clientCachedPromise.result) {
|
|
733
|
+
if (clientCachedPromise.result.state === "resolved") {
|
|
734
|
+
$query.resolvePromise(cacheKey, clientCachedPromise.result.value);
|
|
735
|
+
} else {
|
|
736
|
+
$query.rejectPromise(cacheKey, clientCachedPromise.result.error);
|
|
737
|
+
}
|
|
738
|
+
anySettled = true;
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
$query.loadingPromise(
|
|
742
|
+
cacheKey,
|
|
743
|
+
query.fn(...paramsResult.resolvedParams)
|
|
744
|
+
);
|
|
745
|
+
},
|
|
746
|
+
$queries,
|
|
747
|
+
queries
|
|
748
|
+
);
|
|
749
|
+
} while (anySettled);
|
|
750
|
+
}
|
|
751
|
+
function usePlasmicServerQuery(query, fallbackData, opts) {
|
|
752
|
+
var _a, _b;
|
|
753
|
+
const paramsResult = React3.useMemo(() => {
|
|
754
|
+
return resolveParams(query.execParams);
|
|
755
|
+
}, [query.execParams, opts == null ? void 0 : opts.settledCount]);
|
|
756
|
+
const { key, fetcher } = React3.useMemo(() => {
|
|
757
|
+
switch (paramsResult.status) {
|
|
758
|
+
case "blocked":
|
|
759
|
+
case "error": {
|
|
760
|
+
return {
|
|
761
|
+
key: null,
|
|
762
|
+
fetcher: () => {
|
|
763
|
+
throw new Error("fetcher unexpectedly invoked");
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
case "ready": {
|
|
768
|
+
const cacheKey = makeQueryCacheKey(
|
|
769
|
+
query.id,
|
|
770
|
+
paramsResult.resolvedParams
|
|
771
|
+
);
|
|
772
|
+
return {
|
|
773
|
+
key: cacheKey,
|
|
774
|
+
fetcher: () => {
|
|
775
|
+
var _a2;
|
|
776
|
+
const promise = query.fn(...paramsResult.resolvedParams);
|
|
777
|
+
(_a2 = opts == null ? void 0 : opts.onStarted) == null ? void 0 : _a2.call(opts, cacheKey, promise);
|
|
778
|
+
return promise.finally(() => {
|
|
779
|
+
GLOBAL_CACHE.delete(cacheKey);
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}, [query, paramsResult]);
|
|
786
|
+
const result = useMutablePlasmicQueryData2(key, fetcher, {
|
|
787
|
+
// If revalidateIfStale is true, then if there's a cache entry with a key,
|
|
788
|
+
// but no mounted hook with that key yet, and when the hook mounts with the key,
|
|
789
|
+
// swr will revalidate. This may be reasonable behavior, but for us, this
|
|
790
|
+
// happens all the time -- we prepopulate the cache with proxy-invoked fetch,
|
|
791
|
+
// sometimes before swr had a chance to run the effect. So we turn off
|
|
792
|
+
// revalidateIfStale here, and just let the user manage invalidation.
|
|
793
|
+
revalidateIfStale: false,
|
|
794
|
+
// TODO: Remove per-hook fallbackData
|
|
795
|
+
// Only used in older server query implementation.
|
|
796
|
+
// New implementation should use prefetchedCache instead.
|
|
797
|
+
fallbackData
|
|
798
|
+
});
|
|
799
|
+
if (!result.isLoading) {
|
|
800
|
+
if (result.error) {
|
|
801
|
+
(_a = opts == null ? void 0 : opts.onRejected) == null ? void 0 : _a.call(opts, key, result.error);
|
|
802
|
+
} else if (key && result.data !== void 0) {
|
|
803
|
+
(_b = opts == null ? void 0 : opts.onResolved) == null ? void 0 : _b.call(opts, key, result.data);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return result;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// src/serverQueries/server.ts
|
|
810
|
+
function executePlasmicQueries($queries, queries) {
|
|
811
|
+
return __async(this, null, function* () {
|
|
812
|
+
const doneQueryResults = yield Promise.all(
|
|
813
|
+
mapRecordEntries(
|
|
814
|
+
(_queryName, $query, query) => {
|
|
815
|
+
return executePlasmicQuery($query, query);
|
|
816
|
+
},
|
|
817
|
+
$queries,
|
|
818
|
+
queries
|
|
819
|
+
)
|
|
820
|
+
);
|
|
821
|
+
return Object.fromEntries(
|
|
822
|
+
Object.values(doneQueryResults).map(($query) => [$query.key, $query.data])
|
|
823
|
+
);
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
function executePlasmicQuery($query, query) {
|
|
827
|
+
return __async(this, null, function* () {
|
|
828
|
+
if ($query.current.state === "loading" || $query.current.state === "done") {
|
|
829
|
+
return $query.getDoneResult();
|
|
830
|
+
}
|
|
831
|
+
do {
|
|
832
|
+
const paramsResult = resolveParams(query.execParams);
|
|
833
|
+
switch (paramsResult.status) {
|
|
834
|
+
case "blocked": {
|
|
835
|
+
try {
|
|
836
|
+
yield paramsResult.promise;
|
|
837
|
+
} catch (e) {
|
|
838
|
+
}
|
|
839
|
+
continue;
|
|
840
|
+
}
|
|
841
|
+
case "ready": {
|
|
842
|
+
const cacheKey = makeQueryCacheKey(
|
|
843
|
+
query.id,
|
|
844
|
+
paramsResult.resolvedParams
|
|
845
|
+
);
|
|
846
|
+
$query.loadingPromise(
|
|
847
|
+
cacheKey,
|
|
848
|
+
query.fn(...paramsResult.resolvedParams)
|
|
849
|
+
);
|
|
850
|
+
return $query.getDoneResult();
|
|
851
|
+
}
|
|
852
|
+
case "error": {
|
|
853
|
+
$query.rejectPromise(null, paramsResult.error);
|
|
854
|
+
throw paramsResult.error;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
} while (true);
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
var PlasmicUndefinedServerError = class extends Error {
|
|
861
|
+
constructor(msg) {
|
|
862
|
+
super(msg);
|
|
863
|
+
this.plasmicType = "PlasmicUndefinedServerError";
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
function isPlasmicUndefinedServerError(x) {
|
|
867
|
+
return !!x && typeof x === "object" && x.plasmicType === "PlasmicUndefinedServerError";
|
|
868
|
+
}
|
|
869
|
+
function mkPlasmicUndefinedServerProxy() {
|
|
870
|
+
return {
|
|
871
|
+
data: new Proxy(
|
|
872
|
+
{},
|
|
873
|
+
{
|
|
874
|
+
get: (_, prop) => {
|
|
875
|
+
if (prop === "isUndefinedServerProxy") {
|
|
876
|
+
return true;
|
|
877
|
+
} else if (prop === "then") {
|
|
878
|
+
return void 0;
|
|
879
|
+
}
|
|
880
|
+
throw new PlasmicUndefinedServerError("Data is not available yet");
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
),
|
|
884
|
+
isLoading: true
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function executeServerQuery(query) {
|
|
888
|
+
return __async(this, null, function* () {
|
|
889
|
+
const resolvedParams = resolveServerParams(query.execParams);
|
|
890
|
+
if (isPlasmicUndefinedServerError(resolvedParams)) {
|
|
891
|
+
return mkPlasmicUndefinedServerProxy();
|
|
892
|
+
}
|
|
893
|
+
return { data: yield query.fn(...resolvedParams), isLoading: false };
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
function resolveServerParams(params) {
|
|
897
|
+
try {
|
|
898
|
+
return params();
|
|
899
|
+
} catch (err) {
|
|
900
|
+
if (isPlasmicUndefinedServerError(err)) {
|
|
901
|
+
return err;
|
|
902
|
+
} else {
|
|
903
|
+
throw err;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/index.tsx
|
|
909
|
+
import { usePlasmicDataConfig as usePlasmicDataConfig4 } from "@plasmicapp/query";
|
|
910
|
+
|
|
911
|
+
// src/components/Fetcher.tsx
|
|
912
|
+
import React5 from "react";
|
|
913
|
+
|
|
914
|
+
// src/hooks/usePlasmicDataOp.tsx
|
|
915
|
+
import { usePlasmicDataSourceContext } from "@plasmicapp/data-sources-context";
|
|
916
|
+
import {
|
|
917
|
+
usePlasmicDataConfig as usePlasmicDataConfig3
|
|
918
|
+
} from "@plasmicapp/query";
|
|
919
|
+
import * as React4 from "react";
|
|
920
|
+
|
|
233
921
|
// src/executor.tsx
|
|
234
922
|
import fetch from "@plasmicapp/isomorphic-unfetch";
|
|
235
|
-
import { wrapLoadingFetcher } from "@plasmicapp/query";
|
|
923
|
+
import { wrapLoadingFetcher as wrapLoadingFetcher2 } from "@plasmicapp/query";
|
|
236
924
|
import stringify from "fast-stringify";
|
|
237
925
|
|
|
238
926
|
// src/placeholders.ts
|
|
@@ -260,7 +948,7 @@ function executePlasmicDataOp(op, opts) {
|
|
|
260
948
|
_executePlasmicDataOp
|
|
261
949
|
);
|
|
262
950
|
op.userArgs = addPlaceholdersToUserArgs(op.userArgs);
|
|
263
|
-
const res = yield
|
|
951
|
+
const res = yield wrapLoadingFetcher2(func)(op, opts);
|
|
264
952
|
return res;
|
|
265
953
|
});
|
|
266
954
|
}
|
|
@@ -304,31 +992,6 @@ function getConfig2(key, defaultValue) {
|
|
|
304
992
|
}
|
|
305
993
|
}
|
|
306
994
|
|
|
307
|
-
// src/utils.ts
|
|
308
|
-
function swallow(f) {
|
|
309
|
-
try {
|
|
310
|
-
return f();
|
|
311
|
-
} catch (e) {
|
|
312
|
-
return void 0;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
function pick(obj, ...keys) {
|
|
316
|
-
const res = {};
|
|
317
|
-
for (const key of keys) {
|
|
318
|
-
if (key in obj) {
|
|
319
|
-
res[key] = obj[key];
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return res;
|
|
323
|
-
}
|
|
324
|
-
var tuple = (...args) => args;
|
|
325
|
-
function mkIdMap(xs) {
|
|
326
|
-
return new Map(xs.map((x) => tuple(x.id, x)));
|
|
327
|
-
}
|
|
328
|
-
function withoutNils(xs) {
|
|
329
|
-
return xs.filter((x) => x != null);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
995
|
// src/hooks/usePlasmicDataOp.tsx
|
|
333
996
|
function makeCacheKey(dataOp, opts) {
|
|
334
997
|
const queryDependencies = JSON.stringify({
|
|
@@ -341,7 +1004,7 @@ function makeCacheKey(dataOp, opts) {
|
|
|
341
1004
|
return dataOp.cacheKey ? `${dataOp.cacheKey}${queryDependencies}` : queryDependencies;
|
|
342
1005
|
}
|
|
343
1006
|
function usePlasmicInvalidate() {
|
|
344
|
-
const { cache, fallback, mutate } =
|
|
1007
|
+
const { cache, fallback, mutate } = usePlasmicDataConfig3();
|
|
345
1008
|
return (invalidatedKeys) => __async(this, null, function* () {
|
|
346
1009
|
const getKeysToInvalidate = () => {
|
|
347
1010
|
var _a, _b;
|
|
@@ -436,7 +1099,7 @@ function usePlasmicDataOp(dataOp, opts) {
|
|
|
436
1099
|
function usePlasmicDataMutationOp(dataOp) {
|
|
437
1100
|
const ctx = usePlasmicDataSourceContext();
|
|
438
1101
|
const userToken = ctx == null ? void 0 : ctx.userAuthToken;
|
|
439
|
-
const getRealDataOp =
|
|
1102
|
+
const getRealDataOp = React4.useCallback(() => __async(this, null, function* () {
|
|
440
1103
|
const tryGetRealDataOp = () => __async(this, null, function* () {
|
|
441
1104
|
const resolved = resolveDataOp(dataOp);
|
|
442
1105
|
if (!resolved) {
|
|
@@ -450,7 +1113,7 @@ function usePlasmicDataMutationOp(dataOp) {
|
|
|
450
1113
|
});
|
|
451
1114
|
return yield tryGetRealDataOp();
|
|
452
1115
|
}), [dataOp]);
|
|
453
|
-
return
|
|
1116
|
+
return React4.useCallback(() => __async(this, null, function* () {
|
|
454
1117
|
var _a;
|
|
455
1118
|
const { sourceId, opId, userArgs } = (_a = yield getRealDataOp()) != null ? _a : {};
|
|
456
1119
|
if (!sourceId || !opId) {
|
|
@@ -473,7 +1136,7 @@ function Fetcher(props) {
|
|
|
473
1136
|
const data = usePlasmicDataOp(dataOp, __spreadValues({}, !!pageIndex && !!pageSize && {
|
|
474
1137
|
paginate: { pageIndex, pageSize }
|
|
475
1138
|
}));
|
|
476
|
-
const $queries =
|
|
1139
|
+
const $queries = React5.useMemo(
|
|
477
1140
|
() => __spreadProps(__spreadValues({}, props.queries), { [name != null ? name : "data"]: data }),
|
|
478
1141
|
[props.queries, name, data]
|
|
479
1142
|
);
|
|
@@ -515,7 +1178,7 @@ var FetcherMeta = {
|
|
|
515
1178
|
};
|
|
516
1179
|
|
|
517
1180
|
// src/helpers.ts
|
|
518
|
-
import { useMemo } from "react";
|
|
1181
|
+
import { useMemo as useMemo2 } from "react";
|
|
519
1182
|
function normalizeData(rawData) {
|
|
520
1183
|
var _a;
|
|
521
1184
|
if (!rawData) {
|
|
@@ -532,7 +1195,7 @@ function normalizeData(rawData) {
|
|
|
532
1195
|
return { data: dataArray, schema };
|
|
533
1196
|
}
|
|
534
1197
|
function useNormalizedData(rawData) {
|
|
535
|
-
return
|
|
1198
|
+
return useMemo2(() => normalizeData(rawData), [rawData]);
|
|
536
1199
|
}
|
|
537
1200
|
function tryGetDataArray(rawData) {
|
|
538
1201
|
if (rawData == null || typeof rawData !== "object") {
|
|
@@ -626,10 +1289,10 @@ function deriveFieldConfigs(specifiedFieldsPartial, schema, makeDefaultConfig) {
|
|
|
626
1289
|
}
|
|
627
1290
|
|
|
628
1291
|
// src/hooks/useDependencyAwareQuery.tsx
|
|
629
|
-
import
|
|
1292
|
+
import React6 from "react";
|
|
630
1293
|
function usePrevious(value) {
|
|
631
|
-
const prevValue =
|
|
632
|
-
|
|
1294
|
+
const prevValue = React6.useRef(void 0);
|
|
1295
|
+
React6.useEffect(() => {
|
|
633
1296
|
prevValue.current = value;
|
|
634
1297
|
return () => {
|
|
635
1298
|
prevValue.current = void 0;
|
|
@@ -650,7 +1313,7 @@ function useDependencyAwareQuery({
|
|
|
650
1313
|
}));
|
|
651
1314
|
const finalName = name != null ? name : "data";
|
|
652
1315
|
const prevName = usePrevious(finalName);
|
|
653
|
-
|
|
1316
|
+
React6.useEffect(() => {
|
|
654
1317
|
if (!(finalName in $queries) || $queries[finalName] !== data) {
|
|
655
1318
|
const $queries2 = __spreadProps(__spreadValues({}, $queries), {
|
|
656
1319
|
[finalName]: data
|
|
@@ -662,101 +1325,6 @@ function useDependencyAwareQuery({
|
|
|
662
1325
|
}
|
|
663
1326
|
}, [finalName, prevName, data, $queries, setDollarQueries]);
|
|
664
1327
|
}
|
|
665
|
-
|
|
666
|
-
// src/serverQueries/client.ts
|
|
667
|
-
import {
|
|
668
|
-
wrapLoadingFetcher as wrapLoadingFetcher2
|
|
669
|
-
} from "@plasmicapp/query";
|
|
670
|
-
|
|
671
|
-
// src/serverQueries/common.ts
|
|
672
|
-
function resolveParams(params, errorFn) {
|
|
673
|
-
try {
|
|
674
|
-
return params();
|
|
675
|
-
} catch (err) {
|
|
676
|
-
return errorFn(err);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// src/serverQueries/client.ts
|
|
681
|
-
function makeQueryCacheKey(id, params) {
|
|
682
|
-
return `${id}:${JSON.stringify(params)}`;
|
|
683
|
-
}
|
|
684
|
-
function usePlasmicServerQuery(serverQuery, fallbackData, opts) {
|
|
685
|
-
const resolvedParams = resolveParams(serverQuery.execParams, (err) => {
|
|
686
|
-
if (isPlasmicUndefinedDataErrorPromise(err)) {
|
|
687
|
-
return err;
|
|
688
|
-
}
|
|
689
|
-
return null;
|
|
690
|
-
});
|
|
691
|
-
const key = !resolvedParams || isPlasmicUndefinedDataErrorPromise(resolvedParams) ? null : makeQueryCacheKey(serverQuery.id, resolvedParams);
|
|
692
|
-
const wrapStudioCache = getConfig(
|
|
693
|
-
"EXECUTE_SERVER_QUERY",
|
|
694
|
-
(_, fn, ...args) => fn(...args)
|
|
695
|
-
);
|
|
696
|
-
const fetcher = (params) => {
|
|
697
|
-
return wrapLoadingFetcher2(wrapStudioCache)(
|
|
698
|
-
serverQuery.id,
|
|
699
|
-
serverQuery.fn,
|
|
700
|
-
...params
|
|
701
|
-
);
|
|
702
|
-
};
|
|
703
|
-
const resultMapper = (result) => {
|
|
704
|
-
return __spreadValues({}, pick(result, "data", "error", "isLoading"));
|
|
705
|
-
};
|
|
706
|
-
return usePlasmicFetch(
|
|
707
|
-
key,
|
|
708
|
-
resolvedParams,
|
|
709
|
-
fetcher,
|
|
710
|
-
resultMapper,
|
|
711
|
-
["data", "error"],
|
|
712
|
-
__spreadValues({
|
|
713
|
-
fallbackData
|
|
714
|
-
}, opts)
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
// src/serverQueries/server.ts
|
|
719
|
-
var PlasmicUndefinedServerError = class extends Error {
|
|
720
|
-
constructor(msg) {
|
|
721
|
-
super(msg);
|
|
722
|
-
this.plasmicType = "PlasmicUndefinedServerError";
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
function isPlasmicUndefinedServerError(x) {
|
|
726
|
-
return !!x && typeof x === "object" && x.plasmicType === "PlasmicUndefinedServerError";
|
|
727
|
-
}
|
|
728
|
-
function mkPlasmicUndefinedServerProxy() {
|
|
729
|
-
return {
|
|
730
|
-
data: new Proxy(
|
|
731
|
-
{},
|
|
732
|
-
{
|
|
733
|
-
get: (_, prop) => {
|
|
734
|
-
if (prop === "isUndefinedServerProxy") {
|
|
735
|
-
return true;
|
|
736
|
-
} else if (prop === "then") {
|
|
737
|
-
return void 0;
|
|
738
|
-
}
|
|
739
|
-
throw new PlasmicUndefinedServerError("Data is not available yet");
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
),
|
|
743
|
-
isLoading: true
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
function executeServerQuery(serverQuery) {
|
|
747
|
-
return __async(this, null, function* () {
|
|
748
|
-
const resolvedParams = resolveParams(serverQuery.execParams, (err) => {
|
|
749
|
-
if (isPlasmicUndefinedServerError(err)) {
|
|
750
|
-
return err;
|
|
751
|
-
}
|
|
752
|
-
throw err;
|
|
753
|
-
});
|
|
754
|
-
if (isPlasmicUndefinedServerError(resolvedParams)) {
|
|
755
|
-
return mkPlasmicUndefinedServerProxy();
|
|
756
|
-
}
|
|
757
|
-
return { data: yield serverQuery.fn(...resolvedParams), isLoading: false };
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
1328
|
export {
|
|
761
1329
|
Fetcher,
|
|
762
1330
|
FetcherMeta,
|
|
@@ -767,9 +1335,13 @@ export {
|
|
|
767
1335
|
makeQueryCacheKey,
|
|
768
1336
|
mkPlasmicUndefinedServerProxy,
|
|
769
1337
|
normalizeData,
|
|
1338
|
+
createDollarQueries as unstable_createDollarQueries,
|
|
1339
|
+
executePlasmicQueries as unstable_executePlasmicQueries,
|
|
1340
|
+
usePlasmicQueries as unstable_usePlasmicQueries,
|
|
1341
|
+
wrapDollarQueriesForMetadata as unstable_wrapDollarQueriesForMetadata,
|
|
770
1342
|
useDependencyAwareQuery,
|
|
771
1343
|
useNormalizedData,
|
|
772
|
-
|
|
1344
|
+
usePlasmicDataConfig4 as usePlasmicDataConfig,
|
|
773
1345
|
usePlasmicDataMutationOp,
|
|
774
1346
|
usePlasmicDataOp,
|
|
775
1347
|
usePlasmicInvalidate,
|