D
Deno

help

Most complete Deno Rust runtime?

Rrocketll11/22/2023
I’m trying to embed the Deno runtime into my Rust program. I’m looking for the most “complete” Deno runtime with TS transpilation, basic ops (fetch/console/fs/etc), imports, and most of the things a basic TS runtime would have. So far I only found: - deno_core and https://deno.com/blog/roll-your-own-javascript-runtime-pt2: too much boilerplate - deno_runtime: no TS support - deno: no public facing API What would be my best option?
DAHDeno AI Helper11/22/2023
Based on the documentation, the deno_core crate is the primary component for embedding a JavaScript runtime into your Rust application. It provides a JsRuntime struct that encapsulates a V8 engine instance and allows integration with an event loop. However, as you mentioned, it might require more boilerplate code than you'd prefer. The deno crate, on the other hand, is the main repository that provides the deno CLI and includes TypeScript support out of the box, as well as a variety of built-in development tooling. However, the documentation does not mention a public facing API for this crate. Unfortunately, the documentation does not provide a clear answer to your question. It might be best to reach out to the Deno community or maintainers for more specific advice on this topic. 🦕
NNick11/27/2023
I am looking to solve a very similar problem, did you happen to find a path forward?
Mmmastrac11/27/2023
deno_runtime is probably the best bet -- you should be able to provide the TypescriptModuleLoader from the ts_module_loader example to give it near-full functionality. If we can expose more functionality from the CLI by moving into runtime, we can definitely look at that.
Rrocketll11/29/2023
I tried the deno_runtime approach, but it’s missing quite a bit. Getting [JT]SX? evaluation with local imports is pretty easy, but the hard part is getting feature parity with the Deno CLI: things like remote modules, npm support, HMR, etc is quite complex. Keeping up with upstream is pretty hard too. My initial attempt is here: https://github.com/yklcs/Areum
GitHub
GitHub - yklcs/Areum: An experimental static site generator
An experimental static site generator. Contribute to yklcs/Areum development by creating an account on GitHub.
Rrocketll11/29/2023
Are there any plans to make the deno crate a library crate? Refactoring and exposing deno::tools::* as a library doesn’t seem too hard at first glance since everything is structured pretty nicely. One would need to fork the entire project to use parts of the Deno CLI currently as I understand

Looking for more? Join the community!

Recommended Posts
Language server crashing in VSC outside of deno projectsHow to write a new project template scriptHey, I've written a small game engine to create text adventures in Deno. The resulting project is a Seamlessly include TailwindcssIs there a recommended way of achieving this at the moment? What is the cleneast way of including tatidy up `deno.lock`Hey, is there something like `go mod tidy` (https://golangbyexample.com/go-mod-tidy/) in Deno? The bSyntaxError on Web3 packageI'm trying to use this module in my project https://deno.land/x/web3@v0.11.1 and i'm using the code how to document oak apiWhat’s the best way to document an oak api. Like swagger or some kind of thatweb based cmsIs there any web based cms system like word press based on deno or fresh?Minimal code for Preact SSRWhat's the actual code to do some Preact SSR with Deno? For example something simple like a counterHow to use recent Tensorflow.JS? TF from deno.land/x/tensorflow@v0.21 appears to work, but it's oldI've only tried the TF package from deno.land/x/tensorflow@v0.21 with the readme page example. I'm hDeno Deploy isolate startup timeis this startup time normal? https://media.discordapp.net/attachments/936130919163641856/11757670644Deno KV equivalent of 'returning'hello, in sqlite there is a way to get the new value set on an upsert like so insert into cCan't use npm package: Uncaught (in promise) TypeError: Could not resolve 'preact/hooks'I get this error when trying to import the Preact version of Auto-animate in Fresh https://auto-animLeaking resources from inbound HTTP connections in testsAnyone have any ideas why I would be getting the following error. I'm using an oak server that is stPreact Hello World is not working/** @jsxImportSource https://esm.sh/preact */ import { useState } from "https://esm.sh/preact/hooks"