Improves on the fix from https://github.com/hotwired/stimulus-rails/pull/97 where a new lookup table is created to check if a controller is registered or not. Stimulus already maintains this mapping here which we can use to determine if a controller was registered outside of stimulus-loading's scope and avoid re-registering it.
Fixes issue https://github.com/hotwired/stimulus-rails/issues/111 where lazy loading will attempt to load the external stimulus controller even if it was registered manually.
Improves on the fix from https://github.com/hotwired/stimulus-rails/pull/97 where a new lookup table is created to check if a controller is registered or not. Stimulus already maintains this mapping here which we can use to determine if a controller was registered outside of
stimulus-loading
's scope and avoid re-registering it.