-
Notifications
You must be signed in to change notification settings - Fork 41
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
Huge public columns hash #162
Comments
I get a 404 on your gist link? |
My bad, fixed. I've also just noticed that the public columns hash is actually included multiple times - once per mounted component! That's surely not helping the page size. |
@sfcgeorge - so you are mounting multiple components in the view? A short term fix that is easy but not elegant is to manually put in some erb method to dump the hash and then patch it out of the hyperstack code. For ease of initial integration render_component runs assuming its the only one on the page, so dumps the hash. IIRC I could not find any way to only do it once so to speak but I could be wrong about that too. If one copy of the hash is still too big, perhaps it gets rendered as a seperate asset in production and the whole gzip mechanism compress it? Let me know if you need assistance, but I'll assume you can work around it for now? |
In the next point release we will do something to make this better:
|
Yep, mounting multiple.
|
I added this patch to ComponentMount. Page size went from 739 KB to 317 KB, nice! An ivar feels a bit wrong but it works. (note it's the def footers
unless @hyperstack_footers_rendered
@hyperstack_footers_rendered = true
Hyperstack::Component::IsomorphicHelpers.prerender_footers(controller)
end
end |
updated per @sfcgeorge suggestion: |
The database information Hyperstack includes on the page is huge for our app with >50 models. Noticeably slows down pageload.
https://gist.github.com/sfcgeorge/80bbb475e7613b85823a885cc1b2aedf
The text was updated successfully, but these errors were encountered: