elixir-lang / elixir-lang.github.com

Website for Elixir
elixir-lang.org
354 stars 822 forks source link

Since Elixir 1.15 :observer and :debugger need to be mentioned in the `mix.exs` to work in iex #1712

Closed UweKrause closed 1 year ago

UweKrause commented 1 year ago

In the (excellent!) getting started guide, in chapter Dynamic Supervisors in section Observer, the reader is encouraged to try the :observer within the iex, using iex> :observer.start.

With Elixir version 1.15, there is a problem with :observer.start() in combination with iex, as discussed in the elixirforum. A working solution, mentioned as answer in the forum, is to add :observer, :wx and :runtime_tools in the :extra_applications in the file mix.exs.

The getting started guide already has a note about problems with :observer.start(). I would propose to add another hint to the getting started guide. I would suggest something myself, but since I don't know how fast this problem might be solved, I am not sure if it would be good to document this workaround.

Using the :observer in iex is also mentioned in the Debugging Chapter earlier.

Additionally, :debugger is also mentioned in the getting started guide chapter about debugging. This can also be fixed the same way (adding :debugger to the extra_applications list).

josevalim commented 1 year ago

The guides have been moved to Elixir, and I have fixed this there, but I ported here for now until we officially point to the new docs!

UweKrause commented 1 year ago

Cool! I have seen that it got fixed in the guide at one place (chapter "Getting started", Section "Debugging", Subsection "Observer".

But it still is the old text in chapter "Mix and OPT", Section "Dynamic supervisors", Subsection "Observer".

I am also glad that I did not make a CR myself, since you (as someone who is capable of writing this guide) decided to tell the reader another workaround. I (as someone who barely can follow the guide) would have told the reader to just add those dependencies in the mix.exs.

Thanks for the guide, it really explains complex stuff in a digestible way :)

josevalim commented 1 year ago

Would you like to backport the changes to the Mix guides? Perhaps it needs to be done here and in the Elixir repo. :)

UweKrause commented 1 year ago

Sure, I could try! I just dont know which is the correct repo. I followed the link at the bottom of the page and arrived at this repo.

josevalim commented 1 year ago

Yes, this repo is one of them. The other is elixir-lang/elixir. The files will have the same names.

UweKrause commented 1 year ago

I am really sorry to bother you again with this really minor stuff, but I noticed that the current solution is not really working. In my PR, I just copied from "getting started" guide to "mix otp" guide.

image (Don't wonder about different colors, that's a browser extension "Dark Reader", applying dark mode.)

What would be the right way? Remove the > #### Missing dependencies {: .warning} from both (actually four cause of two repos) places? I could add another two PRs to do the dirty work :)

josevalim commented 1 year ago

Yes, we should remove it. It is not supported here. :)

UweKrause commented 1 year ago

I am sorry, I still owe you two small PR... Here they are: