Hi all! I'm trying to generate externals for `zero...
# javascript
d
Hi all! I'm trying to generate externals for
zeromq.js
with
Copy code
implementation(npm("zeromq", "6.0.0-beta.6", generateExternals = true))
but I get some problems with the generated KT sources. Apart from some problems with some type parameters,
Buffer
(a node class) seems to not being correctly linked to Node declarations. Namely, I get a:
Copy code
Unresolved reference: Buffer
Is there something I am not doing right? Or is there a workaround for this, or a simple PR that I could contribute to Dukat?
p
Not exactly answering your question, but from my experience, Dukat mostly does not work with libraries I tried it with. It either outright crashes, or it produces unbildable code. So I've resulted to writing my own wrapper just with the things I need, or if the library is large enough, search for existing wrappers. I've said it in multiple K survery, but IMO Dukat should get much higher development priority.
👆 3
a
Dukat development has been paused currently. JB have been focusing on making the new JS/IR compiler stable. Maybe Dukat will be prioritized afterwards
t
You can use ArrayBuffer for browser or declare
Buffer
for NodeJS:
Copy code
external class Buffer
NodeJS
Buffer
declared here
d
Thanks everyone for your answers. I'll manually adapt the external declarations. I would have preferred not to, in order to maximize maintainability, but well...