-
Notifications
You must be signed in to change notification settings - Fork 10
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
fixes for gleam 0.33 #8
Conversation
- update dependencies, especially gleeunit 0.10 was incompatible with gleam 0.33 syntax changes to update to latest Gleam - import types with import a/b.{type C} - pub external type -> pub opaque type - BitString -> BitArray - pub external fn -> @external(erlang, …
tests don't pass though:
|
and so `nerf_ffi:ws_send_erl` will need it too. this is a change from gun 2.0 so move `ws_send/2` and `ws_send_erl` in src/nerf/websocket.gleam and pass it the whole Connection (not just ConnectionPid) - remove websocket.Frame, there's already gun.Frame. - fix test to use gun.Frame type
ws:// tests now pass with the podman/docker image. wss:// on socketsbay.com are a bit problematic, since it seems there's a lot of garbage on those sockets. looking into some wss:// echo services now. |
external fn ws_send_erl(ConnectionPid, Frame) -> OkAtom = | ||
"nerf_ffi" "ws_send_erl" | ||
|
||
pub fn ws_send(pid: ConnectionPid, frame: Frame) -> Nil { |
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 think this function has been mistakenly removed?
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.
individual commits had a bit more context.
ws_send/2
and ws_send_erl
were moved in in src/nerf/websocket.gleam since they require Connection (not just ConnectionPid).
Now another approach would be to split the types into their own file, so we can import them everywhere, or … circular imports (are they allowed?)
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.
Please revert this breaking change, thank you
Close | ||
Text(String) | ||
Binary(BitString) | ||
} |
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 think this has been mistakenly removed?
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.
type Frame exists as gun.Frame
already. it was not clear if it was intentional to have two separate types with the same name?
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.
The API is intentionally designed, the documentation explains the goals.
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.
The API is intentionally designed, the documentation explains the goals.
maybe I'm missing something. Can you point me to the documentation so I can understand this better.
https://hexdocs.pm/nerf/ is a bit sparse
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.
They are deliberately different. The nerf module is a low level binding.
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.
Hello! The upgrade looks good but please revert the changes to the API. Thank you
replaced with gleam/bytes_builder https://github.com/gleam-lang/stdlib/blob/v0.35.0/CHANGELOG.md?plain=1#L10
I tested the latest upgrade in my fork of glome, and it seems to be working just fine :) |
Thanks @jluzny but this is PR is unfinished presently. |
syntax changes to update to latest Gleam
import types with import a/b.{type C}
pub external type -> pub opaque type
BitString -> BitArray
pub external fn -> @external(erlang, …
update dependencies, especially gleeunit 0.10 was incompatible with gleam 0.33