Needless river/elements/responses queries/rendering #9046

Closed
mrclay opened this Issue Oct 22, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@mrclay
Member

mrclay commented Oct 22, 2015

A lot of river items can't have comments, but we still render the full river/elements/responses view, including a query to count comments and the comment/save form.

@mrclay mrclay added the performance label Oct 22, 2015

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Oct 22, 2015

perf(river): no longer needlessly render river responses
For river items that cannot receive comments, we explicitly pass a `responses`
option to the river layout, which bypasses the bulk of river/elements/responses
rendering. Notably a `countComments()` query is no longer performed and an empty
form is no longer rendered for each of these items.

For BC, the `div.elgg-river-responses` wrapper is still created, but contains only
whitespace.

Fixes #9046

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Oct 22, 2015

perf(river): no longer needlessly render river responses
For river items that cannot receive comments, we explicitly pass a `responses`
option to the river layout, which bypasses the bulk of river/elements/responses
rendering. Notably a `countComments()` query is no longer performed and an empty
form is no longer rendered for each of these items.

For BC, the `div.elgg-river-responses` wrapper is still created, but contains only
whitespace.

In the river/elements/responses view, we also now correctly check for comments
(and their subclasses like ElggDiscussionReply) so we don't render these. The
core river views do not reach to this point due to changes in this PR, so this
is mainly for plugins that may have overridden those views.

Fixes #9046

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Oct 22, 2015

perf(river): no longer needlessly render river responses
For river items that cannot receive comments, we explicitly pass a `responses`
option to the river layout, which bypasses the bulk of river/elements/responses
rendering. Notably a `countComments()` query is no longer performed and an empty
form is no longer rendered for each of these items.

For BC, the `div.elgg-river-responses` wrapper is still created, but contains only
whitespace.

In the river/elements/responses view, we also now correctly check for comments
(and their subclasses like ElggDiscussionReply) so we don't render these. The
core river views do not reach to this point due to changes in this PR, so this
is mainly for plugins that may have overridden those views.

Fixes #9046

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Oct 22, 2015

perf(river): no longer needlessly render river responses
For river items that cannot receive comments, we explicitly pass a `responses`
option to the river layout, which bypasses the bulk of river/elements/responses
rendering. Notably a `countComments()` query is no longer performed and an empty
form is no longer rendered for each of these items.

For BC, the `div.elgg-river-responses` wrapper is still created, but contains only
whitespace.

In the river/elements/responses view, we also now correctly check for comments
(and their subclasses like ElggDiscussionReply) so we don't render these. The
core river views do not reach to this point due to changes in this PR, so this
is mainly for plugins that may have overridden those views.

Fixes #9046
@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Nov 29, 2015

Member

Closed by #9047

Member

mrclay commented Nov 29, 2015

Closed by #9047

@mrclay mrclay closed this Nov 29, 2015

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