hxnodejs icon indicating copy to clipboard operation
hxnodejs copied to clipboard

deprecated node.js API

Open nadako opened this issue 11 years ago • 7 comments

there are some deprecated API documented in current node.js docs. we could add @:deprecated metadata in haxe to warn user about that. think that's a nice free feature that plain node.js doesn't have.

thoughts?

nadako avatar Oct 13 '14 20:10 nadako

I'm ok! Users will be delighted :)

eduardo-costa avatar Oct 13 '14 20:10 eduardo-costa

No reason not to do that.

Simn avatar Oct 13 '14 21:10 Simn

I added a guideline on using @:deprecated, but we need to review our current externs and add that it where apropriate.

nadako avatar Oct 13 '14 22:10 nadako

I have an issue with some of these. For example js.node.Util.isArray gives a deprecated warning, however I cannot find the non-deprecated way of calling the function that this deprecated call maps to (Array.isArray(...)).

I cannot find the 'NativeArray' equivalent Javascript class. So without a clear and obvious way to use the non-deprecated version in Haxe, I would rather not give compiler warnings for cases where the use cannot correct it.

dionjwa avatar Nov 03 '15 18:11 dionjwa

Isn't standard Haxe way Std.is(obj, Array) sufficient?

nadako avatar Nov 03 '15 18:11 nadako

Perhaps. I made the assumption that Haxe arrays were not the same runtime object as JS arrays. So that assumption is wrong?

dionjwa avatar Nov 03 '15 18:11 dionjwa

It's the same. However, we probably should provide Haxe-way examples in those deprecation messages indeed.

nadako avatar Nov 03 '15 18:11 nadako