Deno compatibility with documented example #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Denoify also resolve dependencies.
If in
src/index.ts
you import reflect-metadata:You get in
deno_dist/index.ts
: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:
It works:
Unfortunately, you still have to use //@ts-ignore when using
Reflect.getMetadata('design:paramtypes', target, key);
or otherreflect-metadata
feature. There is currently no way of loading the types definitions in Deno.It's working in node with:
In Deno this should theoretically work but it doesn't:
However, this just impacts your developing experience a little bit, not the user experience of your user.