Skip to content

Commit

Permalink
feat: use the interpreter for eval
Browse files Browse the repository at this point in the history
Signed-off-by: Drew Hess <[email protected]>
  • Loading branch information
dhess committed Apr 23, 2024
1 parent 48f40e9 commit 2daaad8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/components/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
useGetActionOptions,
useCreateDefinition,
useCreateTypeDef,
useEvalFull,
useEvalBoundedInterp,
Level,
useUndo,
useRedo,
Expand Down Expand Up @@ -250,10 +250,10 @@ const AppNoError = ({

const [evalTarget, setEvalTarget] = useState<string | undefined>();
const evalResult = useInvalidateOnChange(
useEvalFull(
useEvalBoundedInterp(
p.sessionId,
{ qualifiedModule: p.module.modname, baseName: evalTarget || "" },
{ stepLimit: 300 },
{ timeoutMicroseconds: 100000 },
{ query: { enabled: !!evalTarget } }
),
[p.module]
Expand Down Expand Up @@ -344,7 +344,7 @@ const AppNoError = ({
// Note: these offsets are rather arbitrary.
initialPosition={{ x: 10, y: 10 }}
moduleName={p.module.modname}
evalFull={{
evalBoundedInterp={{
request: setEvalTarget,
...(evalResult.isSuccess ? { result: evalResult.data } : {}),
}}
Expand Down
8 changes: 4 additions & 4 deletions src/components/PictureInPicture/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import classNames from "classnames";
import { useRef, useState } from "react";
import { useDraggable, DragOptions } from "@neodrag/react";
import { Tab } from "@headlessui/react";
import type { EvalFullProps } from "@/components/EvalFull";
import type { EvalBoundedInterpProps } from "@/components/EvalBoundedInterp";
import type { SelectionInfoProps } from "@/components/SelectionInfo";
import { EvalFull, SelectionInfo } from "@/components";
import { EvalBoundedInterp, SelectionInfo } from "@/components";

export type PictureInPictureTab = "Eval" | "Info";

export type PictureInPictureProps = {
initialTab: PictureInPictureTab;
initialPosition: { x: number; y: number };
} & EvalFullProps &
} & EvalBoundedInterpProps &
SelectionInfoProps;

const tabClasses = (selected: boolean, extra?: string) =>
Expand Down Expand Up @@ -96,7 +96,7 @@ export const PictureInPicture = (p: PictureInPictureProps): JSX.Element => {
<Tab.Panels>
<Tab.Panel>
<div className="h-60">
<EvalFull {...p} />
<EvalBoundedInterp {...p} />
</div>
</Tab.Panel>
<Tab.Panel>
Expand Down

0 comments on commit 2daaad8

Please sign in to comment.