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

RootContainers count twice for getAboveTheFoldCount #144

Closed
lidawang opened this issue May 12, 2016 · 2 comments
Closed

RootContainers count twice for getAboveTheFoldCount #144

lidawang opened this issue May 12, 2016 · 2 comments
Labels
bug An issue with the system

Comments

@lidawang
Copy link
Contributor

We have a page that has an entire RootContainer that's above the fold, but we don't account for it in our getAboveTheFoldCount implementation. While debugging why our waterfall is looking weird (caused by this wrong count number), we noticed that the fix would be to a) take into account the RootContainer in our getAboveTheFoldCount implementation, but also b) increment our count by 2 for each entirely-above-the-fold RootContainer. The latter is extremely confusing and easy to miss - can we either omit RootContainers from being part of the above-the-fold-count (they are elements, but they're container elements that can only contain RootElements, which already count for above-the-fold so it seems duplicative), or at least fixing this double-counting thing?

@gigabo
Copy link
Contributor

gigabo commented May 12, 2016

Thanks for reporting @lidawang. That's definitely confusing. I think omitting RootContainers entirely from the above-the-fold count makes the most sense.

@gigabo gigabo added the bug An issue with the system label May 12, 2016
lidawang pushed a commit to lidawang/react-server that referenced this issue May 13, 2016
@gigabo
Copy link
Contributor

gigabo commented May 16, 2016

Good bug @lidawang. @bartkusa came up with a better API that doesn't have this sort of confusing behavior to deal with. We're going to migrate to that, so closing this ticket as not relevant to the future.

@gigabo gigabo closed this as completed May 16, 2016
gigabo added a commit to gigabo/react-server that referenced this issue May 26, 2016
This replaces the `getAboveTheFoldCount()` page method, which is awful:

- It's separate from the elements themselves, so even remembering to update it
  can be a challenge.
- If the number of root elements above the fold varies, then duplicative logic
  may be required to determine the count.
- Middleware that inserts elements must remember to _increment_ it.
- It has non-obvious behavior when root containers are used above the fold (redfin#144)

This closes redfin#161 where @bartkusa proposed this _much_ nicer interface.

This is a breaking change.  The _default_ was previously to wake up the client
controller after the _first_ element.  With this change the client controller
isn't bootstrapped until either `<TheFold />` is seen, or we're out of
elements.  So, if unspecified, the entire page is assumed to be above the
fold.
gigabo added a commit to gigabo/react-server that referenced this issue May 26, 2016
This replaces the `getAboveTheFoldCount()` page method, which is awful:

- It's separate from the elements themselves, so even remembering to update it
  can be a challenge.
- If the number of root elements above the fold varies, then duplicative logic
  may be required to determine the count.
- Middleware that inserts elements must remember to _increment_ it.
- It has non-obvious behavior when root containers are used above the fold (redfin#144)

This closes redfin#161 where @bartkusa proposed this _much_ nicer interface.

This is a breaking change.  The _default_ was previously to wake up the client
controller after the _first_ element.  With this change the client controller
isn't bootstrapped until either `<TheFold />` is seen, or we're out of
elements.  So, if unspecified, the entire page is assumed to be above the
fold.
davidalber pushed a commit to davidalber/react-server that referenced this issue Jul 24, 2016
This replaces the `getAboveTheFoldCount()` page method, which is awful:

- It's separate from the elements themselves, so even remembering to update it
  can be a challenge.
- If the number of root elements above the fold varies, then duplicative logic
  may be required to determine the count.
- Middleware that inserts elements must remember to _increment_ it.
- It has non-obvious behavior when root containers are used above the fold (redfin#144)

This closes redfin#161 where @bartkusa proposed this _much_ nicer interface.

This is a breaking change.  The _default_ was previously to wake up the client
controller after the _first_ element.  With this change the client controller
isn't bootstrapped until either `<TheFold />` is seen, or we're out of
elements.  So, if unspecified, the entire page is assumed to be above the
fold.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants