Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web app improvements #81

Open
5 of 11 tasks
georgefst opened this issue Sep 13, 2020 · 6 comments · Fixed by #116
Open
5 of 11 tasks

Web app improvements #81

georgefst opened this issue Sep 13, 2020 · 6 comments · Fixed by #116

Comments

@georgefst
Copy link
Collaborator

georgefst commented Sep 13, 2020

The web branch contains Miso 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:

  • General prettiness - the current layout exposes the fact that I'm very much not a web developer.
    • EDIT: since Web app #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.
    • 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.
  • It would be nice to have several example inputs to select from. Perhaps some of these. At least one should show an effect from changing the StringOutputStyle dropdown (see pPrint prints unexpected characters for unprintable string contents #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.
  • Host at a more suitable URL. Probably https://cdepillabout.github.io/pretty-simple in order to match this repository.
  • Integrate with CI, so that it can be rebuilt and deployed whenever a release tag is pushed.
  • Link to the webpage prominently from Github and Hackage.
  • Switch from GHCJS to GHC's own JS backend, or even WASM (see examples).

Note that, for development, everything can be built with just Cabal, which will use jsaddle to run a web server. Use nix-build to compile to JavaScript, using GHCJS.

Inspiration:

@cdepillabout
Copy link
Owner

Thanks for putting this together. It seems like there were a lot of good comments on reddit about the webview!

https://www.reddit.com/r/haskell/comments/iss9vo/ann_prettysimple_40/

@georgefst
Copy link
Collaborator Author

Further work on this (by me, anyway) is blocked on dmjio/miso#639.

@georgefst
Copy link
Collaborator Author

georgefst commented Sep 20, 2022

Further work on this (by me, anyway) is blocked on dmjio/miso#639.

Finally resolved (EDIT: actually while half the issue there is solved, namely that GHCJS is back in Nixpkgs, what's really changed is that I have a Linux machine running Nix). I've pushed some package bumps etc. The cabal-based build is crashing upon first page load. I'll have to investigate that (EDIT: only on Firefox - looks a lot like ghcjs/jsaddle#64, which has been fixed but I think Miso is stuck on an old version...). But the deployed version is actually working with CSS correctly loaded, for the first time in two years!

@cdepillabout
Copy link
Owner

@georgefst Wow, https://georgefst.github.io/pretty-simple/ is really nice!

I'd love if you sent a PR to get this all into the pretty-simple repo. Or at least add this online page to the README of pretty-simple!

@georgefst
Copy link
Collaborator Author

georgefst commented Sep 20, 2022

I'd love if you sent a PR to get this all into the pretty-simple repo.

#116. I'll try to tidy this up in the coming days.

@georgefst
Copy link
Collaborator Author

This shouldn't have been closed. I think it's down to GitHub's parser seeing "close" on #116.

Anyway I've added another bullet point, about using GHC's WASM backend.

@georgefst georgefst reopened this Oct 1, 2024
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 a pull request may close this issue.

2 participants