A controller is stored and re-connected whenever their
this.element gets put back in the main DOM tree. For an app that uses Turbolinks, does that mean that controllers are stored in memory for the entire Turbolinks session? And that the list of controllers stored by Stimulus (in memory) will grow over time with controller instances whose
this.element will never be reattached?
- This would mean that there’s a memory leak
- There’s potential for stale controller instances who are storing references to nodes with a large tree.
Thanks in advance for answering my questions.