Skip to content
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 dynamic call expressions correctly generate output #14345

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Nov 18, 2024

Fixes #14343

Copy link

changeset-bot bot commented Nov 18, 2024

🦋 Changeset detected

Latest commit: 214f0cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@Rich-Harris
Copy link
Member

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

this is an automated message

Copy link
Contributor

Playground

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

@@ -179,6 +180,7 @@ export function CallExpression(node, context) {
context.state.expression.has_call = true;
context.state.expression.has_state = true;
context.state.expression.can_inline = false;
mark_subtree_dynamic(context.path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, just for the sake of it, can we check wherever else we set can_inline to false to see if the subtree is actually marked dynamic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to other places but didn't notice any differences. Which was odd, but this whole inline/dynamic system feels a bit wonky tbh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i think we need to restructure this a bit to keep a single source of truth (but i think it will be difficult)

@trueadm trueadm merged commit 1c454c2 into main Nov 18, 2024
11 checks passed
@trueadm trueadm deleted the fix-call-expresssions branch November 18, 2024 14:24
@github-actions github-actions bot mentioned this pull request Nov 18, 2024
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.

IIFE in nested element does not work
3 participants