Skip to content

Conversation

@bterlson
Copy link
Contributor

The renderer now bookkeeps whether contexts have content underneath them. This capability is used to provide:

  • createContentSlot which returns a component that exposes whether its children have contents.
  • List, For, etc. now handle list items that don't have any content properly.

I've also updated the python components to use the content slot.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

All changed packages have been documented.

  • @alloy-js/core
  • @alloy-js/csharp
  • @alloy-js/python
Show changes

@alloy-js/python - feature ✏️

pass is now emitted when function and class bodies have no content (rather than just no children). For example, show can now be used inside a class body.

@alloy-js/csharp - fix ✏️

Empty namespaces now don't render an empty block.

@alloy-js/core - feature ✏️

Add a createContentSlot API which returns a component which can be used to detect whether content is added inside it. This can be used to conditionally render fallback content or properly format empty components.

@alloy-js/core - feature ✏️

List, For, and their wrapper components now handle when an element has no content. Show can now be used to conditionally render an item in a list, for example.

@timotheeguerin
Copy link
Collaborator

🎉🎉

@bterlson bterlson merged commit 90bf01f into alloy-framework:main Oct 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants