In the root directory of that new repo, I also added a blank dune file and basic dune-project and rpc_chat.opam so it would build.
If you’re interested in learning Bonsai, you might find Tutorial: Full-Stack Web Dev in OCaml w/ Dream, Bonsai, and GraphQL interesting. I’m also working on several guided Bonsai tutorials that I’m hoping to release soon; if you’re interested in pilot testing those, let me know!
It’ll be the 2 in there; I just have to finish them up. I graduated college 2 weeks ago, so between finals, spending time with friends, and a few big trips, I’ve barely had time to make progress.
That being said, I’m planning to stick to the outline in the README and Chapter 0s of each tutorial. I’ve finished a first version for:
chapters 0 and 1 of todo_list, which teach you how to run Bonsai (served by a web server), create simple static components (writing virtual_dom and css with ppx_css), and compose Value.t and Computation.ts with the sub and arr operators.
chapters 0, 1, most of 2, and exercises for 3 of snake_game, which teach you how to use the state machine pattern to build interactive games. The code for all chapters is written, I just need to finish the guide.
Writing the remaining todo_list chapters, which teach how to implement and communicate with RPC servers, and Bonsai’s tools for forms and routing.
I also want to cover testing, but I haven’t decided if I want to make that its own chapter, or incorporate it into the tutorials from the start.
I’ll have a few days of free time at the end of the month before I leave for a 6 week trip to Latin America, so I’m really hoping to finish the snake stuff and start the next todo_list chapter before then.
It would be great to gather more bonsai components into one repository. Would anyone be interested in collaborating on a bonsai_components repo? I also ran into the same issue with missing example libraries in janestreet/bonsai as you did @zeroexcuses. It makes it difficult to get started with building an application on top of Bonsai.
I have nothing to contribute at the moment – still acquiring the skills to build bonsai components from scratch; but otherwise, yes, I completely agree with you that a bonsai_components repo would be amazing.
Were you thinking of components as examples for learning Bonsai, or as reusable building blocks for other applications?
In the former case, one piece of low hanging fruit could be a 7 GUIs implementation, like @benjamin-thomas has built for fmlib. The aforementioned tutorials and previous article series I wrote should also hopefully be useful.
I first learned Bonsai about a year and a half ago, before the guide was published by the Bonsai team. I’m hoping that the stuff I’m working on now can help supplement that by having new users write and understand actual Bonsai code, one small piece at a time. I would definitely appreciate any feedback / another perspective on the parts of Bonsai that are most challenging for newcomers.
Were you thinking of components as examples for learning Bonsai, or as reusable building blocks for other applications?
I was thinking of reusable building blocks to help build applications quickly, rather than as examples or tutorials. More applications using Bonsai would be helpful to learning how to use it effectively. Looking through the memtrace_viewer code recently was very helpful.
However, by Ctrl-f, the word ‘path’ does not appear in that page; and I still do not understand what Bonsai.Private.path represents or how it relates to this drag/drop impl.