Support multi-target-bundle references in code component content-entity-reference props
<h3 id="overview">Overview</h3> Code components can declare content-entity-reference props whose entity field expressions descend through an entity reference field. When that field targets a single bundle, <code>JsComponent::buildReferencePayload()</code> resolves the nested per-entity payload. When the reference field targets <em>multiple</em> bundles, the coalesced expression carries a <code>ReferencedBundleSpecificBranches</code> target — one branch per bundle, because each bundle can expose different fields. <code>buildReferencePayload()</code> cannot yet resolve that case: it does not select a branch based on the runtime entity's bundle. Multi-target-bundle references are not supported end to end yet. As of [#3585354] the render path throws a <code>\LogicException</code> instead of only asserting, so that if such an expression is ever reached the failure is explicit even with assertions disabled. This issue tracks adding real support. <h3 id="proposed-resolution">Proposed resolution</h3> <ul> <li>In <code>buildReferencePayload()</code>, when a <code>ReferenceFieldPropExpression</code>'s <code>referenced</code> is a <code>ReferencedBundleSpecificBranches</code>, resolve the referenced entity first, then select the branch matching that entity's entity-type + bundle and evaluate its leaf expressions. The infrastructure exists: <code>Evaluator</code> already does branch selection (<code>getBranch()</code> / <code>withoutBranch()</code>), and each per-entity object already carries its resolved bundle as <code>__type</code>.</li> <li>Remove the <code>\LogicException</code> guard once the branch is resolved at runtime.</li> <li>Add render-path coverage to <code>JsComponentTest</code> for a reference field targeting more than one bundle (the deferral test <code>testMultiTargetBundleReferenceThrows()</code> becomes a resolves-correctly test).</li> </ul> <h3 id="ui-changes">User interface changes</h3> To be determined.
issue