-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent SSR of Boolean attributes #391
Comments
Besides the different output, does it make any difference? There has been some effort into making all of this more predicable, which is a work in progress (so stuff is not as consistent as it should be); but my question still remains, besides the inconsistency does it make any difference? |
@titoBouzout probably just to shave off a few bytes |
Yes, agree, what I wonder is if it changes behaviour in any noticeable way, think of CSS selectors and so on |
This PR fixes the reproduction the issue is reporting #385, but that's just for the literal case, haven't looked what will happen in the dynamic case, having these to match would be good |
As I mentioned in my original post, |
I don't think so. https://www.w3.org/TR/2012/WD-html-markup-20120329/syntax.html#syntax-attr-empty says
But certainly nicer to be consistent and shorter. |
Consider the following example code:
In SSR mode, this gets transpiled to:
While technically correct according to MDN, the two templates should not differ. I'd expect
<input checked={true} />
to also result in the template["<input", " checked>"]
as opposed to the actual["<input", " checked=\"\">"]
.Furthermore, if the value of the
checked
property is computed at runtime, i.e.,<input checked={Date.now() > 0} />
, the rendered HTML string also is<input checked>
, inconsistent with the<input checked="">
generated by the transpiler when the value is a constant.The text was updated successfully, but these errors were encountered: