MrBBot
MrBBot
CDCloudflare Developers
Created by niconiahi on 3/22/2024 in #workerd
hey guys! implementing a POC with
Looking at the documentation here (https://tinygo.org/docs/guides/webassembly/wasm/#how-it-works), I think you'll need to import and construct a Go instance from the wasm_exec.js file, then pass this to your WebAssembly.Instance:
import "wasm_exec.js"; // or `import { Go } from "wasm_exec.js";`, not sure
import app from "./app.wasm";

const go = new Go();

const instance = new WebAssembly.Instance(app, go.importObject);

...
import "wasm_exec.js"; // or `import { Go } from "wasm_exec.js";`, not sure
import app from "./app.wasm";

const go = new Go();

const instance = new WebAssembly.Instance(app, go.importObject);

...
11 replies
CDCloudflare Developers
Created by niconiahi on 3/22/2024 in #workerd
hey guys! implementing a POC with
11 replies
CDCloudflare Developers
Created by niconiahi on 3/22/2024 in #workerd
hey guys! implementing a POC with
Hey! 👋 In your entrypoint.mjs module...
import app from "./app.wasm";
const instance = new WebAssembly.Instance(app);
const response = instances.exports.myFunction(...);
import app from "./app.wasm";
const instance = new WebAssembly.Instance(app);
const response = instances.exports.myFunction(...);
11 replies
CDCloudflare Developers
Created by MisakaCloud on 3/16/2024 in #workers-help
How can I make miniflare persit R2 data on local in testing?
BINDING: name 🙂
4 replies
CDCloudflare Developers
Created by MisakaCloud on 3/16/2024 in #workers-help
How can I make miniflare persit R2 data on local in testing?
Hey! 👋 Unfortunately, this isn't possible at the moment. This was a deliberate choice to ensure that tests are reproducible, as they always start with an empty environment. If you'd like to seed data before running your tests, I'd encourage you to configure VItest setupFiles (https://vitest.dev/config/#setupfiles) with something like...
// vitest.config.ts
export default defineWorkersProject({
test: {
setupFiles: ["./test/seed-data.ts"],
poolOptions: { ... },
},
});
// vitest.config.ts
export default defineWorkersProject({
test: {
setupFiles: ["./test/seed-data.ts"],
poolOptions: { ... },
},
});
// test/seed-data.ts
import { env } from "cloudflare:test";

await env.MY_BUCKET.put("key", "value");
// ...
// test/seed-data.ts
import { env } from "cloudflare:test";

await env.MY_BUCKET.put("key", "value");
// ...
4 replies
CDCloudflare Developers
Created by BenW on 3/12/2024 in #workers-help
R2 multipart uploads do not work in local dev mode with long object keys.
Hey! Wrangler 2 is no longer supported aside from critical security updates. What issues were you seeing with Wrangler 3 and Docker? I remember there were some issues with early versions of Wrangler 3 not working in Docker, but they should be addressed now, assuming you're using images providing glibc 2.31 or higher (i.e. Ubuntu 20.04/22.04, Debian 11/12).
3 replies