Open mlms13 opened 4 years ago
Also, to anyone else who may see this, please feel free to add suggestions! I just brainstormed this list off the top of my head in a few minutes, so I probably missed a lot of things.
@mlms13 I can definitely help with this. Is there a particular place where you are thinking these should live?
Seems like there are two options:
We just publish a static website with examples in markdown files
We create a new relude-recipes
repo
I think option 1 is the best way to get started. It can always get moved out later if the other things become a necessity
Just to throw it out there, you can put stuff in the docs/ folder, and link to it using the docsify.js stuff that we have now. Michael just deleted a bunch of the API-level stuff in favor of the odoc, but you can add new markdown files in there for recipes.
Or you could just add tests to the project that demonstrate some of the recipes. That way they will be compiled and tested along with everything else.
Cool, sold. Once I merge the odoc PR (hopefully today!) which changes the docs folder a bit, we can create ./docs/recipes
and start putting Markdown files in there.
I'm hoping to have a centralized place to show off recipes for e.g. relude-fetch
and relude-reason-react
(which have their own tests, but things are a bit more scattered). And unlike tests, I think it could be helpful to show how to chain a few things together, instead of just showing one function at a time.
@mlms13 You asked me to drop things here that require documentation/recipes.
Something I just ran into is that apparently open Relude
is not the way to use this library.
But I had to find that out by trying to find out via the github issues why it broke my build (shadows Js, so that Js.t
cannot be found by ReactReason!). I got lucky that I found it quickly, but that could've ruined my day ;-)
I was just working on writing the api docs for the Relude
and Relude.Globals
modules that will make this clear, but it's absolutely a good call to show the open Relude.Globals
pattern consistently in the recipes as well.
I also had quite a lengthy discussion on Discord today about performance and api design. I always like if docs are explicit about complexity of operations. Especially as a beginner it is a way to understand the implementation a bit better.
Yeah, I've loved that the Purescript docs are very clear which functions on collections are O(1)
vs O(n)
vs ...whatever. I'm trying to improve those docs with more inline examples, and I'll also try to make some notes about complexity as well.
@mlms13 what's the best way to move this forward? Should I just create that directory in ./docs/recipes
and start putting markdown files in there?
I think that would be fine as a starting point - you can link to those from the sidebar markdown file.
I was looking through the fp-ts recipes, and it would be amazing for us to have something similar. No need for a full-blown open source app demonstrating every way in which you might want to use Relude, just an ever-expanding collection of "here's how you solve exactly this problem..."
Some ideas:
bs-deriving
's abilitiesbs-decode
AsyncData