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:

2 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.

2 Likes

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

3 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

3 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.

5 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 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.

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!

3 Likes

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

8 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!

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:

12 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.

1 Like

Thats why it is somewhat better

1 Like

deno is a new era of Javascript and typescript. its a techy canvas right now but keeps growing

1 Like

We could always throw a copy of deno into the nodejs packages shared portion of the glitch servers but we could get in trouble for doing so

1 Like

think maybe later in time we can add main deno support

1 Like

YES! TypeScript Galore!!! looking forward to this

1 Like

Thanks @jenn for creating that Deno starter, now that I’ve moved to Typescript and Deno, I was looking for a way to run Deno on Glitch when I found this!

And yes, I just bumped a thread.

2 Likes

yes please

1 Like

While we wait for Gitch to add real Deno support, I remixed/updated @jenn’s Glitch to have Deno v1.23. It was still on 1.0.

deno-v1-23-starter

3 Likes

I decided to make an ‘evergreen’ version of the Deno Glitch. It will download the latest version of Deno every time it installs.

5 Likes

How about I invite you to the ~hello-oak so you can do the same with that one (in case folks who already bookmarked it don’t miss these updates). Let me know if you’re interested and I’ll invite you to join the project!

2 Likes

That’d be great! I’d love to participate.

1 Like

Awesome, sent you an invite to the project!

2 Likes

Hi @jenn, I must not have accepted that quickly enough because I never saw it to join. I put in a request to join the hello-oak project. Would you please approve it? Thanks.

1 Like

Hi @pseudosavant! Please don’t bump old topics: that makes them go to the top of the list!
In this situation, it’s better to email [email protected] and include the thread URL.
Thanks!
Tiago

1 Like

Hi, just saw this and resent the invite to the project ~hello-oak. If you don’t see it in your inbox, check spam. If you still don’t see it, contact me by email [email protected] saying you’re not getting the invite and mention I sent you!

By the way, for everyone else - I don’t have DM’s turned on here, so if you need to reach me for stuff like this you can email [email protected] and ask for me (and include the thread URL).

1 Like

@jenn When can we expect official support for Deno? I am planning to start my new project on Deno but I won’t be able to run it on Glitch :worried:

1 Like

No plans for it at the moment!

Still waiting for Glitch to put Deno in /usr/local/bin…

1 Like