Skip to content

Conversation

@dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Nov 20, 2024

We're using string checks in various places, better to have it encapsulated in one function

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2024

⚠️ No Changeset found

Latest commit: 10162cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-svelte-14372-svelte.vercel.app/

this is an automated message

@github-actions
Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@14372

}

if (attribute.name === 'autofocus' || attribute.name === 'muted') {
if (cannot_be_set_statically(attribute.name)) {
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Member Author

@dummdidumm dummdidumm Nov 20, 2024

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

@dummdidumm dummdidumm merged commit 4c98c2e into main Nov 20, 2024
11 checks passed
@dummdidumm dummdidumm deleted the static-attributes-consolidation branch November 20, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants