ocsigen / ocsigen-toolkit

User interface widgets for OCaml applications
Other
32 stars 20 forks source link

Workflow for hacking on ocsigen-toolkit #124

Open TixieSalander opened 7 years ago

TixieSalander commented 7 years ago

What would be the workflow for hacking on the code of ocisgen-toolkit's widgets? Would it make sense to have a demo page containing all the widgets and that can be run with e.g make demo?

This would allow iterating quickly when hacking on widgets. Using ocsigen-start requires recompiling ocisgen-toolkit, then ocsigen-start, and finally the ocsigen-start based app for each modification, which quickly becomes annoying.

dannywillems commented 7 years ago

@theotix This is one of the principles and goals of Ocsigen Start: demonstrate Ocsigen framework capabilities in only one template and library, and in particular Ocsigen Toolkit. I agree with you it's not simple and the workflow it's not fast.

We can imagine we have a demo available in Ocsigen Toolkit but it would be exactly the same than Ocsigen Start template (because it is what Ocsigen Start does), and it implies to duplicate code and support both, which is not easy.

Do you have any suggestion?

Armael commented 7 years ago

Do the ocsigen-toolkit developers go through the "recompile ocsigen-toolkit + recompile ocsigen-start + recompile an ocsigen-start instance" routine for each tweak to the library?

An Ocsigen Toolkit demo could be (imo) significantly simpler than Ocsigen Start: it could be a single page with all the widgets, it wouldn't need a sql database and all the npm/sass machinery. I think it's also important for it to be in the ocsigen-toolkit repo directly: otherwise the only workflow I see is having a local pin of ocsigen-toolkit, used by whatever the demo is. But then, for each modification in ocsigen-toolkit, opam update && opam upgrade is needed, which will recompile every installed package that depends on ocsigen-toolkit.

I agree adding a demo to ocsigen-toolkit would add some maintenance burden. In the other hand I think it would be nice providing a more developer friendly workflow; which can be something else than a demo in ocsigen-toolkit, if you have a better idea.

FlorentBecker commented 7 years ago

You can save some recompilation by using nix, and it gives you a single command workflouw: nix-build in the directory of your ocsigen-start application. You'll only be rebuilding ocsigen-start and your ocsigen-start application, not other reverse dependencies of ocsigen-toolkit.