Simplifying Phoenix Playground Restarts in LiveBook

10
clicks
Simplifying Phoenix Playground Restarts in LiveBook

Source: jakeprem.com

Type: Post

The article addresses the challenge of running multiple Phoenix examples in LiveBook, where there's no straightforward way to stop the current playground and start a new one with different code. It introduces PlaygroundManager, a simple module featuring helper functions that allow users to stop the current playground and start another seamlessly. By using this module, developers can easily demonstrate LiveViews, such as a counter and a demo view, within a single LiveBook. The author suggests that integrating such functionality directly into Phoenix Playground in the future would be beneficial. Additional recommendations are provided for avoiding port conflicts and giving users the option to control tab launches during examples.

© HashMerge 2025