gleam-wisp / wisp

🧚 A practical web framework for Gleam
https://gleam-wisp.github.io/wisp/
Apache License 2.0
910 stars 41 forks source link

Increase mist version to 1.2.0 #77

Closed kwmiebach closed 5 months ago

kwmiebach commented 5 months ago

Hello,

This PR increases the mist version to >= 1.2.0 ....

I was trying out the examples and noticed they were not compiling:

error: Unknown module field
   ┌─ /app/wisp/examples/00-hello-world/build/packages/mist/src/mist/internal/websocket.gleam:47:39
   │
47 │       let assert Ok(mask_value) = list.at(masks, index % 4)
   │                                       ^^^ Did you mean `last`?

The module `gleam/list` does not have a `at` value.

I found that example 00 and 01 seem to work with the current PR.

I did not try out 02 ff and neither the main application, so you probably should not merge this.

kwmiebach commented 5 months ago

I updated the changelog and the branch. But now I noticed this in the changelog, see last line of quote:

$ head CHANGELOG.md -n11

# Changelog

## Unreleased

- The `mist` version constraint has been increased to >= 1.2.0.
- The `escape_html` function in the `wisp` module has been optimised.

## v0.14.0 - 2024-03-28

- The `mist` version constraint has been relaxed to permit 0.x or 1.x versions.

It had been relaxed to 0.x just before. I am not sure if this PR should be merged. Maybe there was a reason to relax the constraint to 0.x?

kwmiebach commented 5 months ago

It looks like the critical list.at() had been removed in this commit line https://github.com/rawhat/mist/commit/c5372b#r142703852

This commit is between mist v1.0.0 and v1.1.0.

Previously line 46 of src/mist/internal/websocket.gleam had been, see initial error message above:

let assert Ok(mask_value) = list.at(masks, index % 4)
lpil commented 5 months ago

It had been relaxed to 0.x just before. I am not sure if this PR should be merged. Maybe there was a reason to relax the constraint to 0.x?

It was relaxed to permit 1.x