You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use syntax ...spread as in JS. But don't enforce user to use braces {}.
Expect to have spread syntax only at end of attributes declaration.
Motivation:
The syntax ... was used in rust before, as inclusive range, but for now it is kept unused.
So it is impossible to find ... in valid rust expressions, thats why using braces is not necessary.
Also, if someone want to implement spread syntax as {...foo} it will be available using transform_block feature.
The yew syntax ..foo is conflicting with our attribute parsing, and can't be supported atm.
On other hand syn@2.0 at its current form detect .. as part of range expression.
We using syn to parse attribute value, so using spread syntax after attribute value is imposible (example: foo="bar" ...spread is invalid)
Thats why we limit ...spread syntax to only apear at end of attributes declaration.
Examples:
Examples of some cases that would and wouldn't parse as spread syntax
❌ attribute x=y is not expected after spread syntax
<divfoo="bar"...spreadx=y/>
❌ spread syntax should contain 3 dots, this syntax would be treated as range expression
<divfoo="bar"..spread/>
✅ Spread syntax at end is valid, even if it is formatted incorrectly
<divfoo="bar"some_flag...spread/><Baz...spread/>
Limitations:
At MVP, i propose to only support one apearance of spread syntax.
Original issue: stoically#27
The text was updated successfully, but these errors were encountered: