Server-side ports example (if/when Task ports land)
In Prettynice v2, requests were handled with a msg sent to update. This allowed for a server-side ports example that held a response until it received the message with the results from a port. But this is complicated and confusing since it requires multiple update cycles to respond to a single request, and allowed for requests to hang (e.g. if the port never sends a msg back to the app).
In v3, requests are handled with a dedicated router function that returns a Task that must resolve to a Response. This means you can never leave a request hanging, and you can handle requests with effects in a single pipeline. But since you can't interact with a port in a synchronous way, using a port in your request/response logic is even harder, if not impossible.
Because the original port handling in v2 was confusing and flaky, and because "task ports" are currently being discussed as something to add to Gren, I'm going to release v3 without a server-side ports example and hope/wait for improved synchronous FFI to land before trying to integrate it into prettynice.