Open shah opened 4 years ago
I tried running deno run -A bin/daff.js
and fixing up problems ad-hoc, just to assess how much was broken. There were a bunch of trivial problems - code for picking what global object (exports/windows/...) to put the library in was failing - hacking it to use self
worked, I'd be interested to know how libraries should behave in deno. Then there were some syntax issues (missing "var" declarations) - easy. But then there were complaints about require is not defined
(e.g. require('fs')
) and I don't know what to replace that with. As a library, daff doesn't need requires, but as a console tool it does. I'd welcome any advice.
Excellent sleuthing @paulfitz thanks for checking into this. Deno has its own fs module and cannot use the Node fs module so that might be tricky to fix (since, I suppose, Haxe is generating the require fs
?). For the 'require' replacement, that's easy -- Deno supports EcmaScript import
s.
@paulfitz this is a great library and seems to work in NodeJS. I'm trying to use
bin/daff.js
in Deno TypeScript and JavaScript runtime but am getting the following error:This is probably a problem in the Haxe JS generator but other Haxe generated JS files seem to run in Deno's JavaScript runtime. Any thoughts?
Thanks!