DEV Community

Discussion on: Writing a simple API with Deno

Collapse
 
galkowskit profile image
Tomasz Gałkowski

Note: this article contains bad practices. When importing any library in Deno you should version lock your import statements. Otherwise, your application will break very quickly.

This is 101 of Deno and is one of the first things you'd read in "Getting started" of Deno Manual.

Collapse
 
luispa profile image
LuisPa

Thanks for the observation.

Now the post uses the latest version of oak for the same code.

import { Application, Router } from 'https://deno.land/x/oak@v4.0.0/mod.ts'
Collapse
 
iamareebjamal profile image
Areeb Jamal

Yup, Deno guides and tutorials, and preferably the runtime itself should issue a strict warning about such usages. Or else, what happened in PHP ecosystem will repeat in Deno, beginners created sites with SQL and XSS injection because PHP just allowed it. Similarly, beginners will just create projects which work for a week and then are broken, because they didn't version the imports and load them from a single file.