aglundahl

aglundahl

DenoRider - An embedded JavaScript runtime in Elixir

Hi all!

I’ve put together DenoRider, a JavaScript runtime embedded in Elixir via Rustler and the deno_runtime crate.

My use case is server side rendering of a ClojureScript app. Please let me know if you use it, because it would be interesting to hear about your use case!

Example

iex> DenoRider.eval("1 + 2")
{:ok, 3}
iex> DenoRider.eval("globalThis.foo = 'bar'")
{:ok, "bar"}
iex> DenoRider.eval("globalThis.foo")
{:ok, "bar"}

Links

https://github.com/aglundahl/deno_rider

First 10 of 22 Posts Switch mode

hxgdzyuyi

hxgdzyuyi

If I use it to implement React SSR (Server-Side Rendering), will there be any problem?

aglundahl

aglundahl OP

No, that’s basically what I use it for.

Wigny

Wigny

Do you have a example of how to achieve that? I would like to know if it’s possible to use DenoRider with a JS library such as CortexJS.

akoutmos

akoutmos

Author of Build a Weather Station with Elixir and Nerves

Thank you for doing this! I wanted to create a Rustler NIF around deno_runtime as well for https://github.com/akoutmos/deno_ex....but now it appears I won’t have to do that :smiley:. Thanks for checking that off my todo list!

hubertlepicki

hubertlepicki

this is very nice, I’ll be playing with it. This can be a basis for LiveView/React Server Components-like hybrid solution!

rekkice

rekkice

my implementation’s a bit hacky, but i made a custom SSR renderer for live_svelte with it:
https://github.com/Rekkice/chat-translate/commit/951bbb322010fb440cda2046fa54f5fdef2b598d

aglundahl

aglundahl OP

I think CortexJS would work just fine. There’s no support for npm integration yet, though, so you need a build step to convert CortexJS to something consumable by the runtime. I suggest you take a look at what @rekkice does in his repo. :slightly_smiling_face:

aglundahl

aglundahl OP

Awesome! Thanks for sharing!

Wigny

Wigny

It worked great! We are compiling our TS file using the bun lib and then passing the resulting JS file to the DenoRider supervisor. Thanks for your effort in building it!

Do you have a roadmap with the changes/features you still want to implement or may we consider this library production-ready/stable?

aglundahl

aglundahl OP

Cool! Glad to hear it’s working for you.

There’s currently no roadmap, but that’s mostly because it has everything I need for now. If you have feature requests, just put up an issue on GitHub. :slightly_smiling_face:

Where Next?

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 14960 120
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

Other Trending Topics Top

type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New

We're in Beta

About us Mission Statement