-
Notifications
You must be signed in to change notification settings - Fork 184
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
Better API for declaring the fold: <TheFold /> #161
Comments
@bartkusa - That's an awesome idea! SO much better than the current API! |
This change would make life sooo much easier for the DP! |
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
Instead of saying "the fold for this page is after the first N elements" (which could change based on middlewares? maybe?), it'd be nice if you could just declare it inline with everything else in JSX. Eg:
(Obviously it doesn't need to really be React or JSX. It could just be
require("react-server/TheFold")
or something.)The text was updated successfully, but these errors were encountered: