fix(html): support iterating & Children in html for-loops#4074
fix(html): support iterating & Children in html for-loops#4074XploitMonk0x01 wants to merge 1 commit intoyewstack:masterfrom
Conversation
XploitMonk0x01
commented
Mar 18, 2026
- Added reference iteration support for Children so html for-loops can work with &children style.
- Added a compile-pass macro test that uses for child in &children.
|
Visit the preview URL for this PR (updated for commit 89df185): https://yew-rs-api--pr4074-fix-4073-html-for-re-rngw6dvr.web.app (expires Wed, 25 Mar 2026 10:02:08 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Benchmark - coreYew MasterPull Request |
Size ComparisonDetails
✅ None of the examples has changed their size significantly. |
Benchmark - SSRYew MasterDetails
Pull RequestDetails
|
Madoshakalaka
left a comment
There was a problem hiding this comment.
can you fix the syntax error and reference the issue.
| type Item = T; | ||
|
|
||
| fn into_iter(self) -> Self::IntoIter { | ||
| self.iter().collect::<Vec<_>>().into_iter() |
There was a problem hiding this comment.
This could return just self.iter() and avoid the clone of the whole Vec with more precise types, I believe.
I do note that with some self-referential tricks, the above impl for ChildrenRenderer<T> could do the same, clone just the Rc instead of the whole Vec. Being able to just take a reference to the contained Vec without carrying around the owner should be a lot simpler in this case though.