-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: ensure inline object literals are correctly serialised #14325
Conversation
🦋 Changeset detectedLatest commit: 1c4596d 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-14325-svelte.vercel.app/ this is an automated message |
|
packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js
Outdated
Show resolved
Hide resolved
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.
There's a deeper disconnect somewhere that was either introduced or exposed by #14269 — if is_pure
returns the 'wrong' value then it should affect what happens in the template and what happens in the init block, not just one or the other — this case still fails
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.
approving since it's a nasty bug and we need to release a fix quickly, but i'm still very nervous about the fact that this bug arose. this feels like a workaround (a good and welcome workaround, since it extends the is_pure
optimisation to more cases) rather than a fix for the deeper issue, which is that it's apparently possible for sequences to show up in neither the template nor the init block. we'll need to investigate why this happens
When I initially worked on that issue it was very intricate because there are multiple reasons to include or not something in the template, if it's, dynamic, if it's only a single text, if it's pure, if it's static. So this specific part of the codebase is extremely interconnected. |
Fixes #14324