fix(compiler-vapor): handle template children in Transition#14606
fix(compiler-vapor): handle template children in Transition#14606edison1105 merged 4 commits intovuejs:minorfrom
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 ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
@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: |
Size ReportBundles
Usages
|
|
Thank you for your contribution, but it introduced some regressions, which I have fixed. See f99df63 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/compiler-vapor/src/transforms/transformTransition.ts (1)
56-57: Consider simplifying the redundant condition.The condition
(!isTemplateNode(c) || (isTemplateNode(c) && !hasMultipleChildren(c)))is logically equivalent to!isTemplateNode(c) || !hasMultipleChildren(c)since if the first operand is false,isTemplateNode(c)is necessarily true.♻️ Suggested simplification
c.type === NodeTypes.ELEMENT && - (!isTemplateNode(c) || - (isTemplateNode(c) && !hasMultipleChildren(c))) && + (!isTemplateNode(c) || !hasMultipleChildren(c)) && // not has v-for🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/compiler-vapor/src/transforms/transformTransition.ts` around lines 56 - 57, The boolean expression in the condition is redundant: replace the current check `(!isTemplateNode(c) || (isTemplateNode(c) && !hasMultipleChildren(c)))` with the simplified equivalent `!isTemplateNode(c) || !hasMultipleChildren(c)` to remove the unnecessary repeated call to isTemplateNode; update the expression wherever it appears (e.g., in the conditional that references isTemplateNode and hasMultipleChildren for node variable c) to improve readability and performance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/compiler-vapor/src/transforms/transformTransition.ts`:
- Around line 56-57: The boolean expression in the condition is redundant:
replace the current check `(!isTemplateNode(c) || (isTemplateNode(c) &&
!hasMultipleChildren(c)))` with the simplified equivalent `!isTemplateNode(c) ||
!hasMultipleChildren(c)` to remove the unnecessary repeated call to
isTemplateNode; update the expression wherever it appears (e.g., in the
conditional that references isTemplateNode and hasMultipleChildren for node
variable c) to improve readability and performance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c077ce9c-4987-40b9-8532-79df5c7bf114
📒 Files selected for processing (2)
packages/compiler-vapor/__tests__/transforms/TransformTransition.spec.tspackages/compiler-vapor/src/transforms/transformTransition.ts
Problem Description
The program will report an error if there is a template tag inside Transition
Vue Version
3.6.0-beta.8
Link to minimal reproduction
Playground
Any additional comments
I don't know if it was intentional. but this is normal in VDOM mode.
I tried to fix it, If it's incorrect, please close this PR
Summary by CodeRabbit
Bug Fixes
<transition>with template structures.Tests