fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

Deno Support?

Open KnorpelSenf opened this issue 3 years ago • 2 comments

Are there any plans to support Deno and to publish on https://deno.land/x?

KnorpelSenf avatar Jan 23 '22 21:01 KnorpelSenf

No such current plans exist. The source files include .js extensions when importing TypeScript files; is that still unsupported in Deno?

eemeli avatar Jan 26 '22 14:01 eemeli

Not sure I understand, does this project contain TS in .js files? Or do you explicitly import from a non-existing .js file but actually mean to import from the corresponding .ts file?

KnorpelSenf avatar Jan 26 '22 22:01 KnorpelSenf

Deno's imports are URL-based so it can fetch any file as long as the path exists or the path can be resolved using the import map. I believe it uses the file extension for language detection on local filesystems, so it will error if you import a .js file, but it's actually written in TypeScript. For online registries and CDNs the server is mainly responsible for handling module resolution, content type, and type acquisition.

For Fluent itself, @fluent/bundle is available through https://esm.sh/@fluent/bundle@<version> (I haven't checked if all the other packages are on it yet). Deno's npm import feature should also work fine, although it wouldn't be my first choice.

In any case, I think this issue can probably be closed since the CDN import seems to be working fine.

Seally avatar Dec 14 '22 07:12 Seally