-
Notifications
You must be signed in to change notification settings - Fork 152
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
Way more diff data transfered over the wire when using Surface component than plain LV even if rendered html is very similar #615
Comments
Surface: v0.8.4 I have attached a chromium websocket logs for a simple LiveView app and the same application but converted to Surface. Here is the
With everything implemented above the LiveView application sends this message over the websocket ( 1034 characters in size
This is what is sent to the websocket from our Surface View (1577 characters):
1577 - 1034 = 543 characters This is pretty significant differences. If I did everything correctly this should be a nearly 1 to 1 comparision. chromium-add-event-without-validation.har.txt |
I notice that there is a recently merged (but unreleased) PR relating to optimising diffs for static props: #665 |
Describe the bug
Can't tell if this is a bug, more likely a flaw or technical debt, but I hope it's not the intended behavior.
Altering a SurfaceBulma.Button disabled attribute (only) produces way too much data and I don't think this has anything to do with the component itself, but rather the rendering engine.
Please note that in both cases (Surface and plain LiveView) the provided code is part of a component in a prepended list of such components, thus only the changed component is sent in each case.
1. Plain LiveView
Template code
Rendered html
Diffs when @card.favorite? toggles:
2. SurfaceBulma.Button
Template code:
Rendered html:
Diffs when @card.favorite? toggles:
How to reproduce it
Suffice changing LiveView code to using SurfaceBulma.Button component (or vice-versa).
The behavior you expected
The size of the diffs should be virtually identical, especially given that nothing except for disabled changes and the rendered html code has the same number of elements in both cases i.e. 1 per button.
Your Environment
Surface: v0.7.4
LiveView: v0.17.9
Elixir: v1.13.4
The text was updated successfully, but these errors were encountered: