Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know enough about this to make any real nuanced comments, but I hope they clean up this import cuz this is ugly:

> import { Semaphore } from "https://deno.land/x/semaphore@v1.1.2/semaphore.ts";

Should just be~

> import { Semaphore } from "deno/utils";

Or something like that.



Deno has various mechanisms[0] for abbreviating your imports if/how you want to, but I like the fact that the canonical paths are plain, full URLs

[0] https://deno.land/manual@v1.36.4/basics/import_maps


Yeah, it's actually a _feature_ if you've never been lost in the shit show that is node_modules before. I highly prefer Deno's style.


What syntax would you suggest for importing a specific version of a library?


import ... from "dino@1.1/utils"

idk i just think there's many options besides a full url in your code


In Deno you can load your code from any URL on the Internet, instead of relying on a namespace within a single package manager.


Unfortunately, having a URL is only the beginning. After that it gets complicated, because the "source" you get by following a URL in Deno (or a web browser) has often been put through the blender, repackaged and minified by some CDN. It's hard to read and VS Code's debugger doesn't handle it well. Sometimes I'm left just looking at type definitions and it's unclear where the source code for the implementation is at all. Aren't source maps supposed to help here?

So, I look at the repo instead, but now I don't know how it matches up with the code I'm actually running.

I find Go modules to be easier to understand. They are similarly distributed (many source repos will work), but when you navigate to the source code, you get the actual source.


Yes, people do all kinds of things to their code, but this makes it possible for you to download your own.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: