cdepillabout / cdepillabout/pretty-simple

Web app improvements

Open
#81 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
260
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The [web](https://github.com/cdepillabout/pretty-simple/tree/web) branch contains [Miso](https://haskell-miso.org/) code for generating the app currently deployed at https://georgefst.github.io/pretty-simple. This is really just a proof of concept. Places to improve:

- [x] General prettiness - the current layout exposes the fact that I'm very much not a web developer.
- EDIT: since #116, I don't think it's too bad (ironically, two years on from the above comment, frontend web development is a big part of my job).
- [ ] The initial settings for the buttons and sliders do not currently reflect the initial `OutputOptions`. I was unsure how to set the right HTML attributes, without them being constantly refreshed and causing flickering. Probably worth asking on the Miso Slack channel. See [this unused commit](https://github.com/cdepillabout/pretty-simple/tree/web-initial-value).
- [ ] Relatedly, selecting an example from the drop-down menu should populate the text box.
- [ ] The settings should be reflected in the URL - I've found myself wanting to share a particular formatting of an expression.
- [x] It would be nice to have several example inputs to select from. Perhaps some of [these](https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#g:8). At least one should show an effect from changing the `StringOutputStyle` dropdown (see #64).
- [ ] Sliders should display exact current value as text.
- [ ] Version bounds. I've been using GHC 9.2 with plain Cabal, and GHC 8.6 (!) with Nix, which may make it awkward to get this right. Also, because this isn't a library, and we mostly only care about the Nix build, which has everything pinned, this is much less of an issue than it would usually be.
- [x] Host at a more suitable URL. Probably https://cdepillabout.github.io/pretty-simple in order to match this repository.
- [x] Integrate with CI, so that it can be rebuilt and deployed whenever a release tag is pushed.
- [x] Link to the webpage prominently from Github and Hackage.
- [ ] Switch from GHCJS to GHC's own JS backend.
- Actually, WASM would be even better. See [examples](https://github.com/tweag/ghc-wasm-miso-examples). Note that the packaging situation is currently [a bit messy](https://github.com/NixOS/nixpkgs/pull/225000#issuecomment-1622683134), so it might be best to wait for that. For example, currently Nix is strongly recommended for managing `ghc-wasm-meta`, but we can only (easily?) use it to get a development shell, rather than an actual package derivation.
- There's no rush on this. Everything still works with the current code. The biggest reason to move might be dropping support for GHC 8.6, but we're pretty conservative about dropping old GHCs. At time of writing, we still test 8.0.2 on CI.

Note that, for development, everything can be built with just Cabal, which will use [jsaddle](https://hackage.haskell.org/package/jsaddle) to run a web server. Use `nix-build` to compile to JavaScript, using GHCJS.

Inspiration:
- https://jsoneditoronline.org/
- https://monadfix.com/shower/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.