livebook icon indicating copy to clipboard operation
livebook copied to clipboard

Improve workflow for running inside Mix projects

Open josevalim opened this issue 1 year ago • 0 comments

  • [ ] When going to the Mix runtime tab, we can traverse the directory up. If any of the directories have a mix.exs, we can default to it in the input selector.

  • [ ] We should persist in the notebook the runtime information, but this should only be possible if the notebook itself is located within the mix.exs directory. In this case, we will show a checkbox: "[ ] Save this choice within the notebook". If that is not the case, the checkbox should be disabled we will show: "[ ] Save this choice within the notebook (this option is only available if the notebook is saved within the Mix project".

josevalim avatar Jul 17 '22 13:07 josevalim

I would like to take a stab at this - I just had a couple of clarifications:

  • For the first one - can you please clarify "traverse the directory up"? Say we have a directory /dir, with sub directories subdir_a and subdir_b. If subdir_b has a mix.exs then we show /dir/subdir_b in the input selector. Is this correct? If yes then if subdir_a also had a mix.exs then we default to the first subdir with mix.exs?
  • For the second one - the only runtime information to save is the command line flags no? Anything else?

adarsh1021 avatar Aug 13 '22 15:08 adarsh1021

Thanks @adarsh1021!

We have actually decided to take another approach here. From Elixir v1.14, we will allow Mix.install to load the lockfile and config files from other projects. This will solve many problems with the Mix runtime, in particular that it forces you to add Kino deps to your application. So this task is no longer relevant. :)

josevalim avatar Aug 13 '22 16:08 josevalim