Skip to content

Commit d4919b9

Browse files
Revert "claude: Fix bundler async cycles by making CRI client import dynamic"
This reverts commit 12294b6.
1 parent 4aae62a commit d4919b9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/core/handlers/base.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import { figuresDir, inputFilesDir } from "../render.ts";
7878
import { ensureDirSync } from "../../deno_ral/fs.ts";
7979
import { mappedStringFromFile } from "../mapped-text.ts";
8080
import { error } from "../../deno_ral/log.ts";
81+
import { withCriClient } from "../cri/cri.ts";
8182
import { normalizePath } from "../path.ts";
8283
import {
8384
InvalidShortcodeError,
@@ -88,12 +89,6 @@ import { LocalizedError } from "../lib/located-error.ts";
8889

8990
const handlers: Record<string, LanguageHandler> = {};
9091

91-
// Dynamic import helper for CRI client to break async propagation chain
92-
async function getCriClient() {
93-
const { withCriClient } = await import("../cri/cri.ts");
94-
return withCriClient;
95-
}
96-
9792
let globalFigureCounter: Record<string, number> = {};
9893

9994
export function resetFigureCounter() {
@@ -148,7 +143,6 @@ function makeHandlerContext(
148143
Deno.writeTextFileSync(fileName, content);
149144
const url = `file://${fileName}`;
150145

151-
const withCriClient = await getCriClient();
152146
return await withCriClient(async (client) => {
153147
await client.open(url);
154148
return await client.contents(selector);
@@ -183,7 +177,6 @@ function makeHandlerContext(
183177
Deno.writeTextFileSync(fileName, content);
184178
const url = `file://${fileName}`;
185179

186-
const withCriClient = await getCriClient();
187180
const { elements, images } = await withCriClient(async (client) => {
188181
await client.open(url);
189182
const elements = await client.contents(selector);

0 commit comments

Comments
 (0)