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

Client-side rendering a component with a blank response blocks the dom #118

Closed
matteofigus opened this issue Oct 1, 2015 · 3 comments
Closed

Comments

@matteofigus
Copy link
Member

If the component has even a single space, it is fine.
If multiple components are there, the component shows "Loading..." and prevents other components to be rendered. Gently reported by @ajcw

@andyroyle
Copy link
Collaborator

it's actually quite a simple issue, turns out it's caused by this line here: https://github.com/opentable/oc/blob/master/components/oc-client/src/oc-client.js#L239

When data.html is empty it evaluates to false and so falls into the error handling branch.

It could be mitigated by removing the truthiness check, but maybe this is desirable.

I'm not yet sure why it blocks the remainder of the render, I'll keep digging.

@andyroyle andyroyle self-assigned this Oct 26, 2015
@andyroyle
Copy link
Collaborator

ah right, so it's because the callback doesn't happen on error: https://github.com/opentable/oc/blob/master/components/oc-client/src/oc-client.js#L240

@matteofigus
Copy link
Member Author

Thanks for the investigation, yes agree, we need to fix both problems. I think the first check can just be removed as having a component that returns blank may actually be a common use-case (imagine you want to just return an empty component in case of error or feature toggled off or whatever). So that is not an error.

The un-called callback is definitely something to fix too as that is the cause for the rendering waterfall cycle to be blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants