Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] support deno #736

Closed
pinghe opened this issue Jan 7, 2020 · 11 comments
Closed

[RFC] support deno #736

pinghe opened this issue Jan 7, 2020 · 11 comments
Labels
bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release

Comments

@pinghe
Copy link

pinghe commented Jan 7, 2020

Whether to support running on deno ?

https://github.com/denoland/deno

@pinghe pinghe changed the title [feat] support deno [RFC] support deno Jan 7, 2020
@Qix-
Copy link
Member

Qix- commented Jan 7, 2020

I've never used Deno, is there some reason why this doesn't work on Deno?

@Qix- Qix- added the question This issue asks a question or requests usage support label Jan 7, 2020
@pinghe
Copy link
Author

pinghe commented Jan 8, 2020

q1: import error

myprj.js

import debugdef from 'https://unpkg.com/debug'
const debug = debugdef('myapp:Index')

debug('testing.....')

output error:

Uncaught SyntaxError: The requested module 'https://unpkg.com/debug' does not provide an export named 'default'

fix:
bundles the debug modules for use with deno. https://github.com/reggi/node-to-deno

q2: The environment variable set does not take effect.

DEBUG=myapp:* deno my.js

@Qix-
Copy link
Member

Qix- commented Jan 12, 2020

Would exports.default = exports work here? @sindresorhus what was the rationale behind not doing this? I can't remember what the arguments were and Google wasn't pulling anything up.

@pinghe ultimately, the Deno community needs to have a workaround for legacy modules they wish to use on Deno. You can't create a new runtime with different standards and expect modules/packages/plugins/whatever from other, incompatible runtimes to magically work with it.

v5 will use modules, but I won't be changing v4 to do so.

@sindresorhus
Copy link
Contributor

sindresorhus/memoize#31

@Qix-
Copy link
Member

Qix- commented Jan 13, 2020

Thanks, that's what I needed.

I'll fix this within the week.

@Qix- Qix- added bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release and removed question This issue asks a question or requests usage support labels Jan 13, 2020
@pinghe
Copy link
Author

pinghe commented Jan 15, 2020

Thanks.

@trivikr
Copy link

trivikr commented Aug 9, 2020

Any update on this request for supporting Deno?
Latest update was in Jan 2020 #736 (comment)

sindresorhus/memoize#31

Thanks, that's what I needed.
I'll fix this within the week.

@trivikr
Copy link

trivikr commented Sep 13, 2020

Update: Deno community built it's equivalent debug utility https://deno.land/x/debug@0.1.1
GitHub: https://github.com/denosaurs/debug

@Qix-
Copy link
Member

Qix- commented Sep 13, 2020

Yeah, Deno is a completely different platform and language. I don't really see how we'd support that.

Going to close, thanks for the update @trivikr.

@Qix- Qix- closed this as completed Sep 13, 2020
@tracker1
Copy link

Should be very similar to the browser module, but exported as esm.

@AddictArts
Copy link

AddictArts commented May 24, 2023

@pinghe ultimately, the Deno community needs to have a workaround for legacy modules they wish to use on Deno. You can't create a new runtime with different standards and expect modules/packages/plugins/whatever from other, incompatible runtimes to magically work with it.

It recently does, not sure when, but I ran into this issue. For anyone looking like I was using an import map, ex import_map.json will solve it. You can use deno cli arg --import-map= instead of the deno conf.

       │ File: .\import_map.json
   1   │ {
   2   │   "imports": {
   3   │     "debug": "npm:debug"
   4   │   }
   5   │ }

and to make cli execution easier ...

       │ File: .\deno.jsonc
   1   │ {
   2   │   "importMap": "./import_map.json",
   3   │   "tasks": {
   4   │     "run": "deno run --allow-read --allow-write --allow-env --allow-sys ./index.ts",
   5   │     "compile": "deno compile --allow-read --allow-write --allow-env --allow-sys --no-check --unstable ./index.ts"
   6   │   }
   7   │ }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue identifies a malfunction change-patch This proposes or provides a change that requires a patch release
Development

No branches or pull requests

6 participants