DEV Community

Cover image for Great fun with Deno - My First Deno Framework

Great fun with Deno - My First Deno Framework

Ribhararnus Pracutian on June 02, 2020

We're already heard that Deno release its first major version (v1.0) about several weeks ago, and it was shakes JS world, little bit. If you read ...
Collapse
 
rezende79 profile image
Marcos Rezende

Despite your knowledge about NextJS, you have some issues with the English language. If you study a little bit more about prepositions 'with' and 'by' and the use of third-person, you will write better. Keep studying. Congratulations!

Collapse
 
oknoorap profile image
Ribhararnus Pracutian

Thanks, english is not my primary language.

Collapse
 
amaroks profile image
Mody Said

Your English is great, thank you!

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

What build tools do you use for the frontend? Do you consider non-Node.js based, like esbuild, or do you use traditional ones?

Collapse
 
oknoorap profile image
Ribhararnus Pracutian

Deno support TypeScript and I believe Deno already has bundler tooling, your source code will be compiled as ES, you can read about Deno bundler here deno.land/manual/tools/bundler

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

You don't minify, or build nomodule?

Thread Thread
 
oknoorap profile image
Ribhararnus Pracutian

I don't think TypeScript (or Deno) can compile codes into minify version 😁, but we can do that later using terser or TypeScript plugin or similar tool. That's what I know, maybe someone knows better than me ✌️

Thread Thread
 
swapnil0545 profile image
Swapnil Mhaske👨‍💻🎮☕🌄

But why to minify the backend code?

Thread Thread
 
oknoorap profile image
Ribhararnus Pracutian

I agree with you, with Deno we can run our code faster enough on the server, even we're not bundling it.

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Yes, I was referring to frontend code, with problems of

  • Bundle size and data usage on the clients
  • caniuse.com/ i.e. browser support

I almost never minify backend code. Just mere tsc. Not even Babel. Never that big compared to node_modules anyway.

node_modules is heavy.

Thread Thread
 
oknoorap profile image
Ribhararnus Pracutian

Thats why Deno is the big rescue here 😁, we don't need node_modules anymore.

Thread Thread
 
michaelcurrin profile image
Michael Currin

There's an open issue for this.

github.com/denoland/deno/issues/6900

Recommended alternative by a commenter:

$ deno bundle https://deno.land/std@0.79.0/http/file_server.ts | esbuild --minify > file_server.min.js
$ deno run --allow-net --allow-read file_server.min.js
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ekafyi profile image
Eka • Edited

Quick silly question from someone with 0 Deno knowledge: how does one connect this (or any generic Deno app) to any kind of UI/view library?

Collapse
 
oknoorap profile image
Ribhararnus Pracutian • Edited

Good question, My framework is with specific purpose, it's to build a quick REST API server, so I don't have any plan to add any views or renderer functionality, but still you can set content type as text/html in router response.

Collapse
 
turbopasi profile image
Pascal Lamers

I'm curious about Deno as well as most others in this community. However, some of your statements got me thinking:

  • You don't need dependencies in Deno ? You don't need dependencies in NodeJs either .
  • What is there that you can't do in NodeJs, but with Deno ?

I am relatively new to coding (< 5 years) and reading things like that are easily misinterpreted. Try giving examples to underline those statements.

Other than that, good read ! Jurassic sounds awesome !

Collapse
 
oknoorap profile image
Ribhararnus Pracutian

of course we need dependencies but no need to install it, you can import directly from URL 😀

Collapse
 
turbopasi profile image
Pascal Lamers

That's very true !

Collapse
 
michaelcurrin profile image
Michael Currin

Is your Jurassic package still available on Denoland?

Broken link in article and GH repo - deno.land/x/jurassic -> 404 Not Found

Collapse
 
oknoorap profile image
Ribhararnus Pracutian

Sorry 🙏 I'm not updating jurassic registry with the new database but you can clone or even fork my git. 🧑🏽‍💻

Collapse
 
michaelcurrin profile image
Michael Currin

Okay thanks.

I am using oak and abc as those are popular server packages.

Thread Thread
 
oknoorap profile image
Ribhararnus Pracutian

yeah oak / abc is the most popular framework in deno, anyway I'm treating jurassic just for my playground when I'm bored, but maybe next time I'll adding new feature, like instant GQL API and web socket API, and so on, also I will add jurassic to the new deno's registry.

But, thanks for trying my framework and playing with it, I appreciated it.

 
oknoorap profile image
Ribhararnus Pracutian

I think the difference is Java can be compiled, scripting language can't be compiled, need JIT and runtime.

 
oknoorap profile image
Ribhararnus Pracutian

yes you're correct 👍, scripting languange can't be compiled into bytecode.

Collapse
 
etienneburdet profile image
Etienne Burdet • Edited

You can serve a UI with a templating engine and web server, like: github.com/NMathar/deno-express

Collapse
 
vlasterx profile image
Vladimir Jovanović

What can you do with Deno that you can't do with Node?

Collapse
 
edinhadzovic profile image
edinhadzovic

can someone post some great open source projects build with deno ?

Collapse
 
oknoorap profile image
Ribhararnus Pracutian

It's still early, let's wait next three or six month later. But actually, every npm pkg can be imported via pika or jspm.