fix: support node v18
- fix Request.prototype.closed() clash with new Reader.closed (fixes GH-1888)
- fix IPv6 url by supporting new server.address().family format
- add node 18 to GH Actions
What?
Backward compatible change to support Node v18.
Why?
Node v18 breaking changes:
- Added a
Reader.closedgetter that clashes with theRequest.prototype.closed()patch. - Changed the data type of
server.address().familyfromstring(IPv6) to anumber(6)
Drawbacks
I don't particularly like this change because it will be unexpected to people using Node18 that closed will be a method and not a getter. I would prefer to limit Restify 8.x to Node 17 and make a breaking change for 9.x by changing the method name to isClosed() or better yet, drop the method in favor of patching a getter for node v10~v17.
@restify/current-core please advise on the preferred action plan.
@DonutEspresso thoughts?
Is there is a roadmap for reviewing and merging node18 support? How can I help?
Are there any updates on this PR? We are blocked from a security update until this is solved.
cc/ @mmarchini @wesleytodd
Can you advise what is the preferred path to add support to Node 18?
FWIW here's another ping. We'd love to be on node 18, but can't start up without this patch.
One alternative we're considering is to just remove the closed monkey patch and let restify codebase as well as users rely on connectionState instead: https://github.com/restify/node-restify/pull/1929. We might want to add a deprecation warning first though
Closing since we're moving forward with #1929