Open fullofcaffeine opened 5 years ago
Hi, Unfortunately the project has not been very active for the last few years. Also, historically, haxe-js-kit had its own nodejs externs, which may explain lack of unification here and there. Anyway, feel free to submit a pull request :)
Thanks @clemos, I hope life is treating you well, man! I'll have a peek at fixing it.
It's sad to see this project dying, hopefully someone will take it over. I think in fact the @HaxeFoundation should perhaps consider maintaining this (pour some money maybe) as I think these externs are critical for the success of Haxe-as-a-better-js/ts.
Life's great, I hope it's the same for you ;) I think what's leaking here is a maintainer, at least; I'm not sure money would help.
I managed to fix this, although I'm not sure how good the solution is and if it'll work in all cases. I'll push a PR in the next few days.
Why doesn't
js.npm.express.Request
fromhaxe-js-kit
unify withjs.node.http.IncomingMessage
? If you check the definition for the Express Request object, here: https://github.com/expressjs/express/blob/master/lib/request.js, you'll see that it extendshttp.IncomingMessage
. The express TS type definitions seem to be ok, the req object passed by theuse
method callback correctly unifies with IncomingMessage, i.e:Typescript code:
But that doesn't work with Haxe when using js-kit:
Haxe code:
Maybe the extern defs for express.Request in js-kit are wrong? I find it hard to believe that a project in the making for so many years missed something like that. Or maybe I'm missing something?