Skip to content

Commit

Permalink
#1020: explicit expressions, runtime v3 (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller authored Oct 28, 2021
1 parent 2914608 commit 10bf7a9
Show file tree
Hide file tree
Showing 66 changed files with 2,906 additions and 1,285 deletions.
3 changes: 2 additions & 1 deletion src/actionPanel/PanelBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import ReactShadowRoot from "react-shadow-root";
import { getErrorMessage } from "@/errors";
import registerBuiltinBlocks from "@/blocks/registerBuiltinBlocks";
import registerContribBlocks from "@/contrib/registerContribBlocks";
import { BlockArg } from "@/core";

registerContribBlocks();
registerBuiltinBlocks();
Expand Down Expand Up @@ -65,7 +66,7 @@ const PanelBody: React.FunctionComponent<{ panel: PanelEntry }> = ({
const { blockId, ctxt, args } = panel.payload;
console.debug("Render panel body", panel.payload);
const block = await blockRegistry.lookup(blockId);
const body = await block.run(args, {
const body = await block.run(args as BlockArg, {
ctxt,
root: null,
logger: new ConsoleLogger(),
Expand Down
12 changes: 6 additions & 6 deletions src/background/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "@/contentScript/executor";
import { browser, Runtime, Tabs } from "webextension-polyfill-ts";
import { liftBackground, MESSAGE_PREFIX } from "@/background/protocol";
import { RegistryId, RenderedArgs } from "@/core";
import { BlockArg, RegistryId } from "@/core";
import { emitDevtools } from "@/background/devtools/internal";
import { Availability } from "@/blocks/types";
import { BusinessError, getErrorMessage } from "@/errors";
Expand Down Expand Up @@ -358,7 +358,7 @@ async function retrySend<T extends (...args: unknown[]) => Promise<unknown>>(
export async function executeForNonce(
nonce: string,
blockId: string,
blockArgs: RenderedArgs,
blockArgs: BlockArg,
options: RemoteBlockOptions
): Promise<unknown> {
console.debug(`Running ${blockId} in content script with nonce ${nonce}`);
Expand All @@ -382,7 +382,7 @@ export async function executeForNonce(

export async function executeInTarget(
blockId: string,
blockArgs: RenderedArgs,
blockArgs: BlockArg,
options: RemoteBlockOptions
): Promise<unknown> {
console.debug(`Running ${blockId} in the target tab`);
Expand All @@ -405,7 +405,7 @@ export async function executeInTarget(

export async function executeInAll(
blockId: string,
blockArgs: RenderedArgs,
blockArgs: BlockArg,
options: RemoteBlockOptions
): Promise<unknown> {
console.debug(`Running ${blockId} in all ready tabs`);
Expand All @@ -421,7 +421,7 @@ export async function executeInAll(

export async function executeInOpener(
blockId: string,
blockArgs: RenderedArgs,
blockArgs: BlockArg,
options: RemoteBlockOptions
): Promise<unknown> {
console.debug(`Running ${blockId} in the opener tab`);
Expand All @@ -437,7 +437,7 @@ export async function executeInOpener(

export const executeOnServer = liftBackground(
"EXECUTE_ON_SERVER",
async (blockId: RegistryId, blockArgs: RenderedArgs) => {
async (blockId: RegistryId, blockArgs: BlockArg) => {
console.debug(`Running ${blockId} on the server`);
return (await getLinkedApiClient()).post<{
data?: JsonObject;
Expand Down
214 changes: 0 additions & 214 deletions src/blocks/combinators.test.ts

This file was deleted.

Loading

0 comments on commit 10bf7a9

Please sign in to comment.