From b29e3f2d65a81cefda1a0c877c70c978e4caeaff Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Wed, 19 Feb 2025 19:01:31 -0600 Subject: [PATCH 1/2] remove flag and use async.q --- .../src/components/settings/QuerySettings.tsx | 17 ----------------- apps/roam/src/utils/fireQuery.ts | 15 ++++++--------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/apps/roam/src/components/settings/QuerySettings.tsx b/apps/roam/src/components/settings/QuerySettings.tsx index 07ab8b658..988680dc2 100644 --- a/apps/roam/src/components/settings/QuerySettings.tsx +++ b/apps/roam/src/components/settings/QuerySettings.tsx @@ -62,23 +62,6 @@ const QuerySettings = ({ /> - { - const target = e.target as HTMLInputElement; - extensionAPI.settings.set("async-q", target.checked); - }} - labelElement={ - <> - Use Backend Query (Beta) - - - } - /> ); }; diff --git a/apps/roam/src/utils/fireQuery.ts b/apps/roam/src/utils/fireQuery.ts index c9f01d685..e47d4a54b 100644 --- a/apps/roam/src/utils/fireQuery.ts +++ b/apps/roam/src/utils/fireQuery.ts @@ -15,7 +15,6 @@ import { DEFAULT_RETURN_NODE } from "./parseQuery"; import { DiscourseNode } from "./getDiscourseNodes"; import { DiscourseRelation } from "./getDiscourseRelations"; import nanoid from "nanoid"; -import getExtensionApi from "roamjs-components/util/extensionApiContext"; export type QueryArgs = { returnNode?: string; @@ -327,22 +326,20 @@ const fireQuery: FireQuery = async (_args) => { try { const nodeEnv = getNodeEnv(); const queryId = nodeEnv === "development" ? nanoid(4) : ""; - const isAsyncQ = getExtensionApi().settings.get("async-q"); if (nodeEnv === "development") { - console.groupCollapsed( - `🔍 Roam Query - ${queryId} - ${isAsyncQ ? "async.q" : "fast.q"}`, - ); + console.groupCollapsed(`🔍 Roam Query - ${queryId}`); console.log("%c" + query, "color: #94a3b8; font-family: monospace;"); if (inputs.length) console.log("Inputs:", ...inputs); console.time(`Query - ${queryId}`); console.groupEnd(); } - const queryResults = await (isAsyncQ - ? //@ts-ignore - todo add async q to roamjs-components - window.roamAlphaAPI.data.async.q(query, ...inputs) - : window.roamAlphaAPI.data.fast.q(query, ...inputs)); + //@ts-ignore - todo add async q to roamjs-components + const queryResults = await window.roamAlphaAPI.data.async.q( + query, + ...inputs, + ); if (nodeEnv === "development") { console.timeEnd(`Query - ${queryId}`); From 05a4be7739b7e4bc1e875069f612425c435ff4bb Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Wed, 19 Feb 2025 19:06:24 -0600 Subject: [PATCH 2/2] version bump --- apps/roam/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/roam/package.json b/apps/roam/package.json index 65fd2adfb..358936baf 100644 --- a/apps/roam/package.json +++ b/apps/roam/package.json @@ -1,6 +1,6 @@ { "name": "roam", - "version": "0.9.1", + "version": "0.10.0", "description": "Discourse Graph Plugin for roamresearch.com", "scripts": { "postinstall": "patch-package",