Official Deno implementation to Glitch

Hello Glitchers

As some of you know, the initial creator of Node (Ryan Dahl) started a new project back in 2018 called Deno, which is supposed to fix all wrongs in Node.js (see 10 Things I Regret About Node.js - Ryan Dahl - JSConf EU).

I’m putting my vote that Glitch should allow the creation of a project with an image containing the Deno binaries, or in other words, create a Deno project.

Deno is (as Node.js) a runtime environment for JavaScript and also a runtime for typescript without the needs of compilation! Deno is written mainly in Rust and C++, and performs at a large scale better than Node.js.

Deno is very essential for Glitch when it comes to disk space, as all modules are stored online. And a single cache of modules may be used, hence there truly are no package managers in Deno, everything is loaded through ES6 imports where modules are stored and imported from the world wide web.

I think it’s time we start spreading the word about Deno, Glitch is a free platform that gives Node.js containers on demand, with this, Glitch has become a part of the learning curve in server-side javascript (to some people). With Deno there are a lot of performance fixes that Node.js never got, and Deno is just starting to grow in this world. I believe that a lot of people will sooner or later move over to Deno as it’s becoming even more powerful than Node.js, therefore I think it’s time Glitch as well encourages, or at least give people the opportunity to try out Deno.

Please feel free to write a post if you have any other opinions on why or why not Glitch should implement Deno containers.

Have a good night,
Richard.

wow, I forgot completely about deno even existing!

You have my vote!
:+1:

3 Likes

The facts you present about deno make me very comfortable. I like the fact that it’s written in Rust and C++. You have my vote as soon as I get rid of some old ones.

3 Likes

I haven’t fully researched it yet but it appears Deno may already run on Glitch? https://glitch.com/@EricEisaman/deno-🦕

4 Likes

Yes, indeed. But I do believe that this also raises your disk usage by 56 MB? I would assume using just Node would not raise this? Another bonus adding an official Glitch container image would mean less disk usage for the deno binary if added as a read-only executable volume?
image

2 Likes

Oh true. I have had this issue with Python/Go stuff as well (in some cases I use Glitch Boosted Apps which is our paid product). I think getting it managed the way we manage node modules would definitely save space and be interesting, I can talk to the team about it.

4 Likes

Indeed :slight_smile: Thank you for taking it to the team. Also congratulations on the paid plan, it has been a long requested feature! I look forward buying in on that once I’m done on some of my other business projects :smiley:

2 Likes

You’re not the only one! I’d love to see Glitch offer official support for Python, there was a thread about saving space in Python projects very recently as well.

1 Like

Yes, latest python support could help

1 Like

This would be awesome

personally already made a starter project for deno https://glitch.com/~deno-remixable

A problem with deno that i found is however that, especially when using the bundle option in Deno, it takes up a lot of CPU and usualy also a lot of RAM as well. Moreover, currently deno bundle escapes certain strings, causing it to bundle incorrectly. I don’t know if webpack/rollup/parcel users experience the same thing but above issue is definitely something people should look at before considering Deno.

Also,

Deno is very essential for Glitch when it comes to disk space, as all modules are stored online

is not true. Deno caches all the files that it downloads, so that it doesn’t have to download them again.

That can however be changed, deno is configurable.

I did infact go on:

Meaning that I also said modules are downloaded and stored for the purpose of caching.

So if used correctly you can use one common cache and verify integrity. Or simply only allow to read from the cache and have an internal way of adding modules to the cache.

Your deno implementation have already sorta been discussed, a Glitch moderator said:

Wheras I replied

And the moderator continued:

The only problem with your implementation is that the deno binary is internal to the container, meaning that it also consumes disk space, wheras the node binary is a volume, and doesn’t consume disk space. Which you can see in the screenshot below:
I also tried to remove as much as possible making the project still executable

As opposed to a remixed version of ‘hello-express’ wheras I didn’t try to remove anything.

1 Like

I got confused as when I read your post:

I read it ‘I am the initial creator of Node’ and I was bewildered! :joy: If this Deno thing saves space and fixes issues, then we may as well have it! You’ve got my vote!

1 Like

You just gave me a good laugh! Hahah, I wish I was the creator of Node and Deno, would’ve given myself a raise at that point. Anyhow, I’m not the creator either :frowning:

Thanks btw! :smiley:

1 Like

hi to those interested in deno! this week 1.0 came out and so i set up the starter dreams app some of y’all are familiar with, but with deno and oak instead of node and express: https://glitch.com/edit/#!/hello-oak

7 Likes

Awesome work @jenn!

Could the deno binary and module cache be stored inside the node_modules volume (see image) to avoid raising your disk usage?

Or perhaps adding the deno binary as a read-only executable volume to save space, or putting the deno binary outside of the app directory like with node (see below)?

# good (current node solution)
/opt/nvm/versions/node/v12/bin/node

# bad example of deno
/app/.deno/bin/deno

# good example of deno
/opt/deno/v/1/bin/deno

If the node_modules volume won’t be used, would it be an idea to remove the volume from the container, same with other node related files and directories?

I also noticed that the deno binary isn’t available in the PATH variable (as opposed to node in hello-express).

image
image

Anyhow I think that you’ve done an amazing job implementing Deno into Glitch! Good work!

1 Like

I have already created a ticket to see if I can get Deno on containers! I just don’t know if/when that will happen, Node is our first and foremost supported runtime :slight_smile:

10 Likes

Awesome! Thanks for doing so :slight_smile:

I wonder if projects using Deno (via simply downloading the binary and using glitch.json to run it, like in @jenn’s example from earlier in the thread) are experiencing fewer crashes at the moment, since all my crashes seem to involve problems with pnpm’s package-building process. If Deno projects are more stable, I’d probably spend some time porting my some of my projects across (at least the ones that don’t need Node-only modules).

Does anyone know whether Deno projects are experiencing the same problems as Node.js projects?

Deno is not prone to the same issues as Node.