-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: add check for is attribute #15086
Conversation
🦋 Changeset detectedLatest commit: 57137e6 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 |
Thank you! Could you add a test to |
Hello @dummdidumm, I added the test but I am unable to run |
|
packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
Show resolved
Hide resolved
Sure, I'll take a look |
Hi @paoloricciuti, I managed to extend html validation to custom elements with |
@@ -47,6 +47,7 @@ export function SvelteElement(node, context) { | |||
'$.push_element', | |||
b.id('$$payload'), | |||
tag, | |||
b.literal(false), |
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.
Couldn't this also be a custom element?
<svelte:element tag={tag} is="my-element" />
i wonder if we need to add extra checks for the SvelteElement case (before it was using the name so it was probably fine)?
I think we need to revert the changes to validation. When you create a custom element that should be used in place of a regular element, then you do that to mimic the semantics of that element. So |
@dummdidumm You are probably right 🤔 I can easily revert the last commit, let me know how to proceed. |
yeah just reverting that last commit sounds good 👍 (sorry for the back and forth) |
And sorry for interjecting and make everybody waste time 😅 |
This reverts commit 72fab2b.
Done!
No problem at all! |
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.
thank you!
Fixes #15085
Add a check for
is
attribute inis_custom_element_node
function.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint