-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
fix(compiler-vapor): empty interpolation #13592
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
base: minor
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
@@ -129,8 +143,14 @@ function processTextContainer( | |||
children: TextLike[], | |||
context: TransformContext<ElementNode>, | |||
) { | |||
const values = children.map(child => createTextLikeExpression(child, context)) | |||
const values = children | |||
.map(child => createTextLikeExpression(child, context)) |
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.
This logic is duplicated with the code above (line 103). Perhaps we can extract a function that also incorporates the logic of createTextLikeExpression
.
- logic reusability
- only traverse the children once
function processTextLikeChildren(children:TextLike[]){
const exps:SimpleExpressionNode[]=[]
for(node ... children){
markNonTemplate(node, context)
// skip empty node
if(!node.content) continue
if (node.type === NodeTypes.TEXT) {
exps.push(...)
} else {
exps.push(...)
}
}
return exps
}
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.
I have refactored this
reference: #290