From 260ec17e74dd9148ea5ba1bc333a4abfd151b2d9 Mon Sep 17 00:00:00 2001 From: Muhammad Azeez Date: Thu, 5 Oct 2023 13:21:02 +0300 Subject: [PATCH 01/18] feat: export createPlugin instead of the static ExtismPlugin.new --- examples/deno.js | 4 +- examples/index.html | 7 ++-- examples/node.js | 6 +-- src/browser/index.ts | 97 ++++++++++++++++++++++++-------------------- src/deno/mod.ts | 54 ++++++++++++------------ src/node/index.ts | 72 +++++++++++++++++--------------- 6 files changed, 130 insertions(+), 110 deletions(-) diff --git a/examples/deno.js b/examples/deno.js index 6ab7ae9..1d5c10b 100644 --- a/examples/deno.js +++ b/examples/deno.js @@ -1,4 +1,4 @@ -import { ExtismPlugin, ExtismPluginOptions } from '../src/deno/mod.ts' +import { createPlugin, ExtismPluginOptions } from '../src/deno/mod.ts' async function main() { const filename = Deno.args[0] || "wasm/hello.wasm"; @@ -12,7 +12,7 @@ async function main() { .withConfig("thing", "testing") .withWasi(); - const plugin = await ExtismPlugin.new(wasm, options); + const plugin = await createPlugin(wasm, options); const res = await plugin.call(funcname, new TextEncoder().encode(input)); const s = new TextDecoder().decode(res.buffer); diff --git a/examples/index.html b/examples/index.html index 77f686a..2892f5d 100644 --- a/examples/index.html +++ b/examples/index.html @@ -58,6 +58,8 @@