fix(compiler-core): using v-once inside template with v-if error#7730
Open
baiwusanyu-c wants to merge 33 commits into
Open
fix(compiler-core): using v-once inside template with v-if error#7730baiwusanyu-c wants to merge 33 commits into
baiwusanyu-c wants to merge 33 commits into
Conversation
# Conflicts: # packages/compiler-core/src/transforms/vIf.ts # packages/compiler-core/src/utils.ts
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Size ReportBundles
Usages
|
# Conflicts: # packages/compiler-core/src/transforms/vIf.ts # packages/compiler-core/src/utils.ts
Comment on lines
298
to
+301
| const ret = (firstChild as ElementNode).codegenNode as | ||
| | BlockCodegenNode | ||
| | MemoExpression | ||
| const vnodeCall = getMemoedVNodeCall(ret) | ||
| const vnodeCall = getMemoedOrOnceVNodeCall(ret) |
Contributor
There was a problem hiding this comment.
I'm wondering about the casting of ret. Should that also include CacheExpression?
I realise this would lead to type changes being needed elsewhere, but the incorrect casting may be hiding further bugs.
edison1105
reviewed
Aug 20, 2024
| const { | ||
| root, | ||
| node: { codegenNode }, | ||
| } = parseWithIfTransform( |
Member
There was a problem hiding this comment.
The parseWithIfTransform does not contain transformOnce inside, which makes the resulting snap look unreasonable, and does not contain v-once related code.
Let's pass transformOnce to parseWithIfTransform to make the snap more sense.
# Conflicts: # packages/compiler-core/src/utils.ts
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/runtime-core
@vue/reactivity
@vue/runtime-dom
@vue/shared
@vue/server-renderer
@vue/compat
vue
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #7725