Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

pranavbabu
Copy link
Contributor

@pranavbabu pranavbabu commented Jul 26, 2024

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).

@zachgoll zachgoll changed the title Fix: ommit layout for turbo frames with custom sidebar layout Fix: Omit layout for turbo frames with custom sidebar layout Jul 26, 2024
Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@zachgoll zachgoll merged commit 7ba9830 into maybe-finance:main Jul 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants