-
Notifications
You must be signed in to change notification settings - Fork 121
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
Prefer to set property when property & attribute are identical #319
base: main
Are you sure you want to change the base?
Conversation
Trying to think if there is a downside. When I started Solid I actually used all properties but we switched to attributes for consistency reasons. We still use properties for webcomponents. So trying to remember why we made this choice. I might have to do some digging to remind myself of why. |
Ah please do. We definitely cannot do this for all of them though— there are some tricky ones like checked where the there is a similarly weird case for the value property. To the best of my understanding, this optimization is safe for all IDL attribute reflection properties so I made a very careful list of only a few. |
@ryansolid Have you gotten a chance to review this? I’ve been taking a look at how Preact handles this and it’s interesting. I may follow their approach It seems to specially handle |
@ryansolid Would you be willing to merge this optimization if it were opt-in only like |
That might be a good way to start it. Mostly I don't want to break in preparation for SolidStart release. |
Changes
Bundle size win
Example code
OLD output
NEW output
(-0.1KB)
Notes
maxlength (string)
/maxLength (number)
will require slightly more effort to coerce types