question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ways to automatically discover Deno ports

See original GitHub issue

It’s not something that affects me directly yet, but I find it a curious and underexplored problem.

The situation may get exponentially better as more packages expose their Deno port in some way suitable for automation. Much better than trying to keep a hand-filled dictionary of ports.

I was considering make-deno-edition along with Denoify, and their attempts to address this problem is what made me aware and curious about this problem. Although their solutions don’t fill me with confidence:

  • “deno” field in package.json pointing to an entry module takes the very basic and lucrative name and uses it for something very limited. I have a package with multiple exports and I wouldn’t be able to describe it properly. Extended spec would be needed.

    Somehow I feel extending the “exports” section to accept “deno” key besides “import”, “require”, etc. would make much more sense. Although that may have compatibility issues.

    Much simpler use for “deno” field (if ever needed) would be just to serve in the same way as “denoify.out” does - to point at the folder where Deno-targeted code resides, without specifying an entry point (that can potentially be recovered from “exports” section). Or it could be an url to the port.

  • “editions” section seems descriptive for humans but not very actionable for automation. Extra layer of conventions would require on top of what already feels taking much more cognitive load compared to what it offers. (Maybe I just don’t work with frontend to fully appreciate it though.)

Things that I think Denoify could do on it’s own with package.json of dependency packages:

  • Check the presence of “denoify” section and “repository” section;
  • If https://deno.land/x can be searched by a repository name then you’ve got the port;
  • Or https://deno.land/x can be checked for the package name and then validated by the repository name to make sure it’s the same package;
  • If “denoify.out” is available then it might be possible to check the repo for the presence of that folder and make use of it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
garronejcommented, Aug 19, 2022

@KillyMXI You are right, it’s fixed in 1.0.1

1reaction
garronejcommented, Aug 13, 2022

It shouldn’t break anything. If it dose please report. Best regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Server APIs | Manual - Deno
In order to accept requests, first you need to listen for a connection on a network port. To do this in Deno, you...
Read more >
How to access port and hostname with serve #5887 - GitHub
A quick workaround: (server.listener.addr as Deno.
Read more >
Guide To Porting Node Modules To Deno - DEV Community ‍ ‍
This is a quick guide to share how you can get started porting existing Node modules so they are compatible with Deno.
Read more >
Guide to server-side rendering with Deno and React - Sanity.io
In this tutorial, we will take a look at server-side rendering with Deno and React. To get a proper hang of the fundamental...
Read more >
Building Your First Application With Deno - GetStream.io
Learn how to build a backend server with Deno. ... Dillion M. ... Deno is a recently launched runtime environment for JavaScript and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found