From 48e28f87351099d35f5102d3d9e49e2de1446c19 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 16 Aug 2024 16:02:26 -0700 Subject: [PATCH] Stop suggesting lazy loading (#140) It causes timing issues and is not desirable for the vast majority of applications. --- .../app/javascript/controllers/index_for_importmap.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/install/app/javascript/controllers/index_for_importmap.js b/lib/install/app/javascript/controllers/index_for_importmap.js index 54ad4ca..1156bf8 100644 --- a/lib/install/app/javascript/controllers/index_for_importmap.js +++ b/lib/install/app/javascript/controllers/index_for_importmap.js @@ -1,11 +1,4 @@ -// Import and register all your controllers from the importmap under controllers/* - +// Import and register all your controllers from the importmap via controllers/**/*_controller import { application } from "controllers/application" - -// Eager load all controllers defined in the import map under controllers/**/*_controller import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" eagerLoadControllersFrom("controllers", application) - -// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) -// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" -// lazyLoadControllersFrom("controllers", application)