Skip to content

Use identity/value for Bytes port encoding instead of lamdera/codecs#91

Open
MavenRain wants to merge 1 commit intolamdera:lamdera-nextfrom
MavenRain:fix/bytes-flag-crash
Open

Use identity/value for Bytes port encoding instead of lamdera/codecs#91
MavenRain wants to merge 1 commit intolamdera:lamdera-nextfrom
MavenRain:fix/bytes-flag-crash

Conversation

@MavenRain
Copy link
Copy Markdown

The Bytes encoder and decoder for ports and flags referenced encodeBytes_/decodeBytes_ from lamdera/codecs, which crashes with Map.! when that package is absent. Since Bytes is a raw DataView in JS, no transformation is needed at the boundary: use Basics.identity for encoding and Json.Decode.value for decoding, matching how Json.Encode.Value is already handled. Fixes #26.

  The Bytes encoder and decoder for ports and flags referenced
  encodeBytes_/decodeBytes_ from lamdera/codecs, which crashes with
  Map.! when that package is absent.  Since Bytes is a raw DataView in
  JS, no transformation is needed at the boundary: use Basics.identity
  for encoding and Json.Decode.value for decoding, matching how
  Json.Encode.Value is already handled.  Fixes lamdera#26.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bytes flag causes Map.! error

1 participant