Closed sigmaSd closed 2 years ago
Thanks for the suggestions.
Actually, the files inside deno_lib
, should not be changed manually. They are auto-generated.
In the latest version, core.types.ts
as been renamed to types.d.ts
and will be imported via /// <reference path="./types.d.ts" />
in core.ts
.
See: https://github.com/nanojsx/nano/tree/master/src
What do you think about this aproach? Does deno read the types from the triple slash directives?
If the new types are imported from a .d.ts
file instead of a type-only .ts
file, there is no issue👍 When the next version is available we can update the example at https://deno.com/deploy/docs/using-jsx.
I will publish it right away.
Is declare global
needed around export var _nano
?
Edit: Found the answer: https://stackoverflow.com/a/57040462
Done.
Works well in my example repo: https://github.com/nanojsx/nano-jsx-deno-example
Thanks!
Actually, I think using a .ts
file like @sigmaSd suggested is better. I noticed that standalone .d.ts
do not get copied over to the dist folder.
The newest releases of deno changed module detection behavior, commit https://github.com/denoland/deno/commit/845d4754c6fb959d1404f5de4bba9e71667b8c89 issue https://github.com/denoland/deno/issues/14960
This pr changes exported types to be more deno module friendly.
I wrote this with guidance from @nayeemrmn