cloudflare / wrangler-legacy

🤠 Home to Wrangler v1 (deprecated)
https://workers.cloudflare.com
Apache License 2.0
3.2k stars 338 forks source link

Deno, KV and wrangler #1374

Closed mathiasrw closed 4 years ago

mathiasrw commented 4 years ago

Question / feature request

I wanted to see if I could make wrangler support javascript development in Deno.

The easy path is to use Deno for development, bundle with Deno to a single .js and bundle that as normal with wrangler. This works, but I am having issues with the KV way of including a "magic" undefined namespace as a variable.

Question:

ispivey commented 4 years ago

To your questions:

  1. There isn't any public documentation as to the rationale for injecting KV namespace bindings in the global scope. There were indeed thoughtful reasons for this at the time; however, it's something the Workers team is re-evaluating.
  2. There is not a way to connect to KV without accessing that global-scope variable.

What error are you encountering, and how can we reproduce it?

You could consider using https://github.com/cloudflare/workers-types , although I'm not sure if that will directly address your issue.

More broadly: what are you looking to achieve? The Workers runtime is different from Deno, and Node, and Chrome.

mathiasrw commented 4 years ago

Thank you @ispivey for your answer. Ill close this task and reopen of there is a specific issue.

Yes, its Deno that I would like to use for making the js ending up in the worker.