Allow use of for loops with `for .. in .. { ... }` syntax in `html!`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 32.8k
- Forks
- 1.5k
- Avg merge
- 5h 34m
- Merged PRs (30d)
- 2
Description
Describe the feature you'd like
Allow using for loops like:
html! {
for val in range {
<p> { val } </p>
}
}
Is your feature request related to a problem? Please describe. (Optional)
Current solutions hurt readability when used inside deeply nested html and imo, aren't that concise.
Describe alternatives you've considered (Optional)
There are two alternatives to this (mentioned here). Both of which require you to wrap them in html! or empty tags which doesn't read well.
Additional context (Optional)
This will also bring loop syntax inside html! in-line with the if statement synatx
Questionnaire
- I'm interested in implementing this myself but don't know where to start
- I would like to add this feature
- I don't have time to add this right now, but maybe later
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the html! syntax shown in the issue and read the linked Yew iterators documentation to understand the current alternatives. Define the parser and rendering behavior needed for the displayed for-loop form, then verify that equivalent nested HTML can use it without the existing wrapper patterns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100