Homestyx hydra
Diffusion hydra 8ac2da9850b0

Provide hasChildren() to replace isEmptyContent()

Description

Provide hasChildren() to replace isEmptyContent()

Summary:
Fixes T3698. Sometimes views need to render differently depending on whether they contain content or not. The existing approach for this is isEmptyContent(), which doesn't work well and is sort of hacky (it implies double-rendering content, which is not always free or side-effect free).

Instead, provide a test for an element without children. This test is powerful enough to catch the easy cases of null, etc., and just do the expected thing, but will not catch a View which is reduced upon rendering. Since this is rare and we have no actual need for it today, just accept that as a limitation.

Test Plan:
Viewed Timeline and Feed UI examples. Viewed Feed (feed), Pholio (timelineview), and Differential (old transactionview).

{F53915}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T3698

Differential Revision: https://secure.phabricator.com/D6718

Details

Provenance
epriestleyAuthored on Aug 12 2013, 10:51 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:52225f7eb987: Fix bug with macros search being global.
Branches
Unknown
Tags
Unknown

Event Timeline