Skip to content

Let a fallback shown through <c-fill fallback=...> hold a component or a <c-slot> #351

Closed

Description

@JuroOravec

In a component that uses Vue, <c-fill fallback="fallback"> lets a caller's fill show the receiving component's slot fallback, as {{ fallback }}. The caller's Vue template compiles that fallback. Since the fix stacked on #341 (branch fix/fill-fallback-values), its values are copied into the caller's data, which that template reads. A component call or a <c-slot> inside the fallback is still recorded in the receiver's data: the calls, callRuns, selectedSlots and slotKeys tables, which merge_projected_data in packages/py/citry/citry/_vue/direct_capture.py skips, with the call owner left as the receiver. So such a fallback now raises "a slot's fallback that a caller shows through '' cannot hold a component" (or "a '' outlet"). Before that fix, the content was dropped silently, or the page failed with an unrelated error. To make it work, record those calls and slot choices in the data of the component whose template compiles the body (definition_owner_id), as the values already are. Then check that the child's parent occurrence, its hydration and an Events update of the receiver alone still agree. A test that renders <c-slot name="body"><c-Child /></c-slot> in a receiver and <c-fill name="body" fallback="fallback">{{ fallback }}</c-fill> in a caller should show the child, with and without js.

Activity

  1. JuroOravec commented on Oct 28, 2026

    @JuroOravec
    MemberAuthor

    #430 made a fallback shown through <c-fill fallback=...> hold components; the remaining case, a <c-slot> inside that fallback, is tracked in #429.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions