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(ssr): fix adjacent text node concatenation within slotted content #5069

Closed

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Dec 20, 2024

Details

Fixes #5067

Moves adjacent text node concatenation from a runtime concern to a compile-time (AST) concern, which more closely aligns with how template-compiler is doing it.

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

@nolanlawson
Copy link
Collaborator Author

The last thing to fix is (as always) light DOM slotted content. It has its own pseudo-irChildrenToEs routine that needs to consider adjacent text nodes.

child.type === 'Text' || (child.type === 'Comment' && !cxt.templateOptions.preserveComments);

const bMassageTextContent = esTemplate`
massageTextContent(${/* string value */ is.expression});
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we renamed this to normalizeTextContent. I guess not. 🤔

@nolanlawson
Copy link
Collaborator Author

Closing in favor of #5079

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.

[SSR] Fix remaining slot-not-at-top-level tests
3 participants