[6.4] Add extension points to documentation components - #1028
Merged
Merged
Conversation
franklinsch
approved these changes
Aug 17, 2026
marinaaisa
force-pushed
the
6.4/added-slots
branch
from
August 18, 2026 17:22
554e42e to
f6abf16
Compare
Member
|
@swift-ci test |
marinaaisa
force-pushed
the
6.4/added-slots
branch
from
August 18, 2026 17:39
f6abf16 to
f82f1f8
Compare
Member
|
@swift-ci test |
marinaaisa
marked this pull request as draft
August 18, 2026 17:42
marinaaisa
force-pushed
the
6.4/added-slots
branch
from
September 2, 2026 10:46
f82f1f8 to
98eddba
Compare
…wiftlang#1017) Without a slot between the Abstract and the elements that follow it, consumers of DocumentationTopic have no way to inject custom content immediately after the page description. The only option would be to override or fork the entire component, which is fragile and breaks on upstream updates. A new named slot `below-abstract` [1] is added directly after the `Abstract` component and before the `v-if="sampleCodeDownload"` div. This placement means content projected into the slot appears below the page description but above the download button, availability badges, and declarations, keeping it logically grouped within the introductory part of the hero without interfering with any of the surrounding conditionally rendered elements. A test is added to verify that content projected into the slot is rendered inside the DocumentationHero component at the expected location. [1] https://vuejs.org/guide/components/slots#named-slots
The label rendered inside the Aside component was hardcoded as a plain <p class="label"> element with no extension point. Any consuming component that needed a different label presentation, or no label at all, had no way to achieve that without adding a new special-cased prop or a new kind value just to toggle the element off. Vue's named slots with fallback content [1] are the best solution here: the slot renders its default content when the parent provides nothing, preserving all existing behaviour exactly as before, while still giving any consumer the freedom to supply its own label markup or suppress the label entirely by providing a non-rendering element (e.g. <span />) in the #label slot. The <p class="label"> is now wrapped in <slot name="label">…</slot> so that it continues to act as the default for every current usage of <Aside> (ContentNode, DocumentationTopic, etc.), and a new test documents and verifies the override path. [1] https://vuejs.org/v2/guide/components-slots.html#Fallback-Content
marinaaisa
force-pushed
the
6.4/added-slots
branch
from
September 10, 2026 17:12
98eddba to
66080e0
Compare
Member
|
@swift-ci test |
marinaaisa
marked this pull request as ready for review
September 10, 2026 17:13
Member
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation: Adds extension points to 2 documentation components
Scope: Added slot below documentation abstract, added slot for aside title
Issue: rdar://176906827
Risk: Low, only added slots. No change to existing behavior—just extension points that can be overridden
Testing: Added unit tests, manually checked that there are no visual regressions
Reviewer: @mportiz08
Original PRs: