-
Notifications
You must be signed in to change notification settings - Fork 3
Update to v0.14.0-rc3 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to v0.14.0-rc3 #4
Conversation
CI will fail until |
CI is failing with this error:
|
Buffer can’t have a Show instance which provides any useful information because that would violate purity - it’s a mutable reference type. I think the test code should be amended so that we are just showing the result of reading the buffer as a string, not showing the buffer itself. |
bufferString <- toString UTF8 buffer | ||
logShow { _message: "Converted to a `String`", buffer, bufferString } | ||
logShow { _message: "Converted to a `String`", bufferString } | ||
Right string -> logShow { _message: "Received some data", string } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this would make a bigger difference, but apparently not:
{ _message: "Received some data", bufferBinary: "Hello socket\nServer is ending connection\n" }
{ _message: "Converted to a `String`", bufferString: "Hello socket\nServer is ending connection\n" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is correct behavior or not, but I don't think it should hold up a 0.14.0-rc3 merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did you expect? This looks reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings, "Binary" is a deprecated alias for "latin1". This particular string only includes ASCII characters, which means that it decodes the same way regardless of whether you interpret it as latin1 or utf-8. You'd only see differences if you had code points above 127.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this to get this done, but should we drop the 'bufferBinary' one completely since 'Binary' is deprecated (and so I imagine we'll remove it at some point in the future)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keep in mind that we need to preserve compatibility back to the last supported Node version.
I checked, and binary
was aliased to latin1
all the way back in Node 10, so perhaps it's safe to only provide latin1
here.
But perhaps the philosophy of this library is to stay faithful to the underlying supported encodings, in which case we would include 'binary', even though it's considered deprecated and simply an alias for latin1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant removing the line in these tests which calls toString Binary
, not removing the Binary
constructor itself. (That's probably worth discussing too, though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 as far as 0.14.0-rc3 changes go.
Backlinking to purescript/purescript#3942