-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: support camelCase properties on custom elements #9328
Conversation
while attributes are case insensitive, properties are not. to not introduce a breaking change, the lowercased variant is checked first. fixes #9325
🦋 Changeset detectedLatest commit: 8a9fcab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -480,7 +480,10 @@ export function set_custom_element_data_map(node, data_map) { | |||
/** | |||
* @returns {void} */ | |||
export function set_custom_element_data(node, prop, value) { | |||
if (prop in node) { | |||
const lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first | |||
if (lower in node) { |
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 don't think this is a particularly good thing to do. Can you remove this in Svelte 5?
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.
Yes, we'll likely do that
while attributes are case insensitive, properties are not. to not introduce a breaking change, the lowercased variant is checked first. fixes sveltejs#9325
while attributes are case insensitive, properties are not. to not introduce a breaking change, the lowercased variant is checked first. fixes #9325
Svelte compiler rewrite
Please note that the Svelte codebase is currently being rewritten. Thus, it's best to hold off on new features or refactorings for the time being.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint