Trigger turbo load on domcontentloaded#1493
Conversation
jjla26
commented
Jan 29, 2026
- Added console logs to track the start, state changes, and interactions within the PageObserver.
- Implemented handling for scripts loaded with the defer attribute, ensuring that DOMContentLoaded is awaited before firing turbo:load.
…ading states - Added console logs to track the start, state changes, and interactions within the PageObserver. - Implemented handling for scripts loaded with the defer attribute, ensuring that DOMContentLoaded is awaited before firing turbo:load.
|
Can you elaborate a bit more on the issue to have a better understanding? Also, I don't think it's appropriate to put so many console logs in production. |
|
@brunoprietog It's addressing #1492 |
|
@brunoprietog Apologies for the confusion. This PR was originally intended for our internal fork. However, since it's here, I'd like to explain the problem we encountered: When Turbo is loaded with the defer attribute, the turbo:load event doesn't fire at the optimal time. |
|
As @amohamed97 mentioned, we're attempting to address #1492. However, we'd appreciate your feedback on whether there's an intentional reason for the current behavior, or if perhaps we're misunderstanding how Turbo is meant to be loaded in modern bundler setups. |