-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
chore: consolidate checks for never-static attributes #14372
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
Conversation
|
|
preview: https://svelte-dev-git-preview-svelte-14372-svelte.vercel.app/ this is an automated message |
|
| } | ||
|
|
||
| if (attribute.name === 'autofocus' || attribute.name === 'muted') { | ||
| if (cannot_be_set_statically(attribute.name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this, I think we can move this entirely?
| (attribute) => | ||
| attribute.type === 'Attribute' && | ||
| (attribute.name === 'autofocus' || attribute.name === 'muted') | ||
| (attribute) => attribute.type === 'Attribute' && cannot_be_set_statically(attribute.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic can move to Attribute visitor rather than be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just strictly did replace the usage sites, not do any correctness fixes. This is meant to be a consolidation PR, nothing else
We're using string checks in various places, better to have it encapsulated in one function