quokka
quokka copied to clipboard
Deno support
Issue description
Deno is a secure JavaScript and TypeScript runtime https://deno.land/ created by Ryan Dahl (one of the original creators of Node) and other smart people. Deno expects a 1.0 release this month.
Many would love to see support for using Deno in Quokka. This is especially interesting for a scratchpad REPL such as Quokka because there is no node_modules
mess, instead the code specifies exactly what it wishes to import.
Sample repository link
https://github.com/denoland/deno
I'd love to see this soon. Some issues what I believe would be required to make this work:
- Allow TS to be disabled (Deno handles this in runtime. Quokka runs the TS compiler itself and it seems it can only be disabled by using Babel (again no need here)
- Allow replacing node with deno
- Quokka can statically determine if a Typescript file is for Deno by looking at the imports. Plain TypeScript doesn't allow for importing something with a
.ts
extension.
At the very least Quokka should support ignoring:
error TS2691: An import path cannot end with a '.ts' extension.
If Quokka exposed a simple preprocess function (babel free). I could then write a function would:
- Remove ".ts" from imports
- Rewrite URL imports to use cache location for example:
import * as yaml from "https://deno.land/std/encoding/yaml.ts";
becomes
import * as yaml from "/home/<user>/.cache/deno/deps/https/deno.land/std/encoding/yaml.ts"
I really wish it was possible for me to fix this myself, but since I can't that is all that is required for basic support (where files would still run in Node).
A proof-of-concept.
Some notes:
- Quokka ignores babel.config.mjs. Config had to be duplicated into config.json
- Injecting a global via babel just doesn't work. Had to be factored out into a "quokka plugin".
- Quokka refuses to resolve a plugin unless it is in
node_modules
- The implementation is limited because it is still running inside node. The Deno global shim returns bogus responses so not all Deno code will function.
- The user has to run deno externally on the file if imported URL modules do not exist in the system cache. A tighter Quokka.js integration would be more seamless.
I would LOVE to see this!!! I am writing a program in Deno right now and wish I could use Quokka.
Also encountered error TS2691: An import path cannot end with a '.ts' extension, while using deno with qoukka
As my project is deno based, no typescript installed in project. I think the problem is quokka is trying to use ts-node to compile .ts files, which fails because deno uses import paths with .ts (ts-node was installed in ~/.quokka)
@ArtemGovorov deno has now officially release stable version v1. I hope you will consider adding support for this.
@sajidali - Deno support is on our short-term list of technologies to investigate. We'll update this issue when we have more information to share.
A quick update for this issue. We spent the last week investigating deno and there are a few things we need to be able to progress with adding support. We've raised an issue with the deno team to discuss our requirements. One of our core requirements is already known to the deno team, no public API for compilers. The other items we mention in the issue are relevant to Quokka being able to provide fast feedback on subsequent executions (i.e. as you type).
Hi, @smcenlly do we have any update on this issue?
No update from us on this issue. Unfortunately right now it's not technically possible for us to support Deno. We're still waiting for Deno to add a public API for compilers; this is a similar situation for other techs (e.g. such as babel, coffeescript support, etc.). We're watching their issue and will re-evaluate and respond to this issue when there is an update to share.
@smcenlly thanks for clarifying. This issue is really hindering my personal deno adoption to tell you the truth, I bet that's the case with other wallaby/quokka users which is something that you might consider communicating to deno team.
@smcenlly thanks for clarifying. This issue is really hindering my personal deno adoption to tell you the truth, I bet that's the case with other wallaby/quokka users which is something that you might consider communicating to deno team.
@ultrox - we completely understand, lack of good tooling in a technology can certainly affect adoption. You can +1 and watch https://github.com/denoland/deno/issues/1739 for updates. It's still marked as future
milestone, which as I understand it (based on their milestones) will be after March 2021 at the earliest. We also have a couple of other requirements that we listed separately here: https://github.com/denoland/deno/issues/6694.
Just wanted to +1 this as I, too, really yearn to see Quokka
supported!
Unfortunately, nothing has changed since our response above:
Unfortunately right now it's not technically possible for us to support Deno. We're still waiting for Deno to add a public API for compilers; this is a similar situation for other techs (e.g. such as babel, coffeescript support, etc.). We're watching their issue and will re-evaluate and respond to this issue when there is an update to share.
Any updates on this? 😄
Nothing has changed that would allow us to provide Deno support for Quokka. You may refer to the Deno issues mentioned above to see the latest status.