Replies: 2 comments 1 reply
-
@timhanlon, nice work!
I actually think what you've done is ideal. If you're concerned it doesn't look pretty, then I agree, but it's not really ugly. It's just verbose. The only change I could see as a maybe would be to spread the In my opinion, this is ready for a PR with a note that says it's built on the PR you referenced. TypeScript-wise, the only potential improvement I see would be if we could find types for |
Beta Was this translation helpful? Give feedback.
-
Just figured out that adding |
Beta Was this translation helpful? Give feedback.
-
Newer Cloudflare Workers features like Durable Objects, service bindings and D1 require the new module syntax.
Building on this discussion and this PR, I have an initial proof of concept for module Workers. As a bonus, we get access to
waitUntil
in API routes.Before I submit a PR, I wanted to kick off a discussion about the API. Right now, I'm just stuffing the environment and context from the new module syntax into the existing event context, but this is clearly not ideal:
Note: D1 bindings in
wrangler.toml
aren't working yet,✘ [ERROR] No matching export in ".output/server/index.mjs" for import "default"
Also, I'm a complete TypeScript rookie, so if anyone can help getting types through to the Nuxt API routes that would be much appreciated.
Cloudflare docs
Beta Was this translation helpful? Give feedback.
All reactions