Make WebSocket support conditional#643
Conversation
|
cc @MangoIV |
|
The failing formatting check is due to fourmolu not knowing how to parse CPP directives? I find this on ormolu's README:
I can try to accommodate it by moving the directive around. |
|
@andy0130tw It is fine, the formatter check is not blocking. |
|
I would be tempted to try and avoid the CPP entirely. AFAICT the websocket support is entirely additional code. So what we can do is to a) put it in its own module, b) in the cabal file, expose that module only if the flag is set. I think that does everything you want without any CPP? |
|
@michaelpj That requires a structural change, but I would be fine with that. |
Fixes #642.
Makes WebSocket support configurable via a
websocketflag (defaults toTrue). Setting this toFalsestrips out the dependency of packagewebsockets, along with all WebSocket-related implementation, making it compatible with platforms that don't support WebSockets (e.g., the WebAssembly backend).It introduces CPP macros to the project, which makes the code a little bit tangled. Feel free to edit it further.