Skip to content

Commit 2144371

Browse files
alice-i-cecilecart
andauthored
Add release note for infiinite children (#21107)
Fixes #21052. The changes I thought needed to happen to `related!` were actually already made, so we're good to go. --------- Co-authored-by: Carter Anderson <[email protected]>
1 parent 4b138af commit 2144371

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Infinite Children
3+
authors: ["@CorvusPrudens"]
4+
pull_requests: [18865]
5+
---
6+
7+
The `children!` macro is a convenient way to spawn children alongside their parents in Bevy code.
8+
When it was introduced in **Bevy 0.16** this was limited to 12 children, due to arbitrary limitations (Rust: please [support variadic generics!](https://blog.rust-lang.org/inside-rust/2025/09/11/program-management-update-2025-08/#variadic-generics)), and not implementing the requisite workarounds.
9+
When working with large UI hierarchies, this could be a real nuisance, forcing users to resort to ugly workarounds.
10+
11+
We've rewritten the macro and lifted this unjust restriction. You are now only limited by Rust's recursion limit: around 1400 children at once.
12+
Rejoice!
13+
If you are manually spawning more than 1400 children in a single macro call, you should reconsider your strategy (such as using `SpawnIter` or `SpawnWith`).
14+
15+
We've made the same change to the `related!` macro, allowing you to spawn huge numbers of related entities in a single call.

0 commit comments

Comments
 (0)