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

Deno compatibility with documented example #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

garronej
Copy link

@garronej garronej commented May 31, 2020

Hi,
Denoify also resolve dependencies.

If in src/index.ts you import reflect-metadata:
image

You get in deno_dist/index.ts:
image

It would even import the correct version ( https://raw.githubusercontent.com/rbuckton/reflect-metadata/v0.1.13/Reflect.js as 0.1.13 is the version in package-lock.json ) but the maintainer of reflect-metadata forgot to create a github release of the last version so denoify have to fallback to master but it works.

Denoify can do that thanks to this bit in package.json:

image

It works:

image

Unfortunately, you still have to use //@ts-ignore when using Reflect.getMetadata('design:paramtypes', target, key); or other reflect-metadata feature. There is currently no way of loading the types definitions in Deno.

It's working in node with:

///<reference path="../node_modules/reflect-metadata/Reflect.d.ts"/>
import "reflect-metadata";

In Deno this should theoretically work but it doesn't:

/// <deno-types path="https://raw.githubusercontent.com/rbuckton/reflect-metadata/master/Reflect.d.ts" />
import "https://raw.githubusercontent.com/rbuckton/reflect-metadata/master/Reflect.js";

However, this just impacts your developing experience a little bit, not the user experience of your user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant