Repository navigation
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.
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.
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.
What did you expect? This looks reasonable to me.
There was a problem hiding this comment.
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.
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.
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.
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).
Backlinking to purescript/purescript#3942