diff --git a/README.md b/README.md index 79e331b..001fce7 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,11 @@ The CircuitJsonPreview component provides: - Circuit JSON viewer - Error display -> Note: You should have tailwind installed in the parent project, this library -> works without installing tailwind but without the "css reset" things will look -> a bit off (e.g. you might see serif fonts), create an issue if that's -> cumbersome because we removed it to save 5kb +### Providing the Blob URL (to avoid loading webworker from CDN) + +```tsx +import evalWebWorkerBlobUrl from "@tscircuit/eval-webworker/blob-url" +``` ## Development diff --git a/bun.lockb b/bun.lockb index 71e131c..c688ce0 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/lib/components/RunFrame.tsx b/lib/components/RunFrame.tsx index c406087..e780eee 100644 --- a/lib/components/RunFrame.tsx +++ b/lib/components/RunFrame.tsx @@ -15,8 +15,6 @@ declare global { var runFrameWorker: any } -// @ts-ignore -import evalWebWorkerBlobUrl from "@tscircuit/eval-webworker/blob-url" import type { ManualEditEvent } from "@tscircuit/props" import { useRunFrameStore } from "./RunFrameWithApi/store" import { getChangesBetweenFsMaps } from "../utils/getChangesBetweenFsMaps" @@ -93,6 +91,8 @@ interface Props { defaultActiveTab?: Parameters< typeof CircuitJsonPreview >[0]["defaultActiveTab"] + + evalWebWorkerBlobUrl?: string } export const RunFrame = (props: Props) => { @@ -166,7 +166,7 @@ export const RunFrame = (props: Props) => { const worker: Awaited> = globalThis.runFrameWorker ?? (await createCircuitWebWorker({ - webWorkerUrl: evalWebWorkerBlobUrl, + webWorkerUrl: props.evalWebWorkerBlobUrl, verbose: true, })) globalThis.runFrameWorker = worker diff --git a/package.json b/package.json index fb6602a..de32fad 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "@radix-ui/react-tabs": "^1.1.2", "@tscircuit/3d-viewer": "^0.0.101", "@tscircuit/assembly-viewer": "^0.0.1", + "@tscircuit/eval-webworker": "^0.0.72", "@tscircuit/core": "^0.0.273", - "@tscircuit/eval-webworker": "^0.0.69", "@tscircuit/file-server": "^0.0.13", "@tscircuit/pcb-viewer": "^1.11.29", "@tscircuit/props": "^0.0.130", @@ -68,6 +68,7 @@ "clsx": "^2.1.1", "comlink": "^4.4.2", "cssnano": "^7.0.6", + "jscad-fiber": "^0.0.76", "lucide-react": "^0.473.0", "react-cosmos-plugin-vite": "^6.2.0", "schematic-symbols": "^0.0.111",