-
-
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: transform everything that is not a selector inside :global
#14577
Conversation
🦋 Changeset detectedLatest commit: ed4f62d 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 |
preview: https://svelte-dev-git-preview-svelte-14577-svelte.vercel.app/ this is an automated message |
|
If it's only the keyframes, what about creating a zimmerframe walker just for that, and call that in this case? const keyframes = {
WhatEverSelectorIsNeededForThat(node) {
if (needsToScopeSelector) { doIt }
}
}
// ...
if (node.metadata.is_global_block) {
// ...
walk(node.block, null, keyframes)
} |
That's a good idea but i wonder if it's not better to do this like this so that it's not an "edge case" and even if there's something else that get's transformed it will be transformed anyway. |
I think I wrote my answer very bad lol. The point is: this will technically transform everything that is not a selector. If we specifically target key frames we will fix this bug but we might discover new edge cases or, if we add new transforms in the future, we have to add it to the special case. Considering this is not to hairy maybe is the better solution? I'm a bit thorned |
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.
Thanks
This should lay some ground to also fix #14616 |
Seems like this PR broke disabling |
Yup, technically there are workaround to that but we need to fix it |
@paoloricciuti what is a way to prevent it? Use |
Yeah...but I think the important bit is just the one with the animation |
Anyway I'll try to fix this asap |
@paoloricciuti I try to draft some fix if it could help #14822 |
Closes #14568
I'm not entirely sure if there's a better way: i think keyframes are the only thing transformed that are not selectors but this should make sure that we transform everything, we just don't touch the selectors.
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