Fix: Omit layout for turbo frames with custom sidebar layout #1024

Merged
pranavbabu merged 2 commits from fix/ommit-layout-for-turbo-frames-with-custom-sidebar-layout into main 2024-07-27 00:00:41 +08:00
pranavbabu commented 2024-07-26 23:05:21 +08:00 (Migrated from github.com)

This PR folows this hint for turbo frame usage https://github.com/hotwired/turbo-rails?tab=readme-ov-file#a-note-on-custom-layouts and implements custom method for with sidebar layout. This change will ommit rendering layout when turbo frame request is used. It improves performance by returning much smaller html as example for rendering New account modal with layout server retruns 165 KB (request time: 235ms) of html with this change server returns 1.6 KB (request time: 35ms).

This PR folows this hint for turbo frame usage [https://github.com/hotwired/turbo-rails?tab=readme-ov-file#a-note-on-custom-layouts](url) and implements custom method for with sidebar layout. This change will ommit rendering layout when turbo frame request is used. It improves performance by returning much smaller html as example for rendering New account modal with layout server retruns 165 KB (request time: 235ms) of html with this change server returns 1.6 KB (request time: 35ms).
zachgoll (Migrated from github.com) approved these changes 2024-07-26 23:59:57 +08:00
zachgoll (Migrated from github.com) left a comment

Nice idea here, especially with the expensive calculations that are needed for our sidebar layout.

Nice idea here, especially with the expensive calculations that are needed for our sidebar layout.
Sign in to join this conversation.