-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
fix(compiler-sfc): properly analyze patch flag of vFor + (ref or vnodeHook or dir) #11682
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: main
Are you sure you want to change the base?
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
WalkthroughThe changes update the patch flag analysis in the element transform logic to ensure that Changes
Sequence Diagram(s)sequenceDiagram
participant Template
participant Compiler
participant PatchFlagAnalyzer
Template->>Compiler: Template with v-for and ref/custom directive
Compiler->>PatchFlagAnalyzer: Analyze element props and directives
PatchFlagAnalyzer-->>Compiler: Detects 'ref' in v-for, sets NEED_PATCH flag
Compiler-->>Template: Generates code with correct patch flags
Assessment against linked issues
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
🔇 Additional comments (5)
✨ Finishing Touches
🪧 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 (
|
close #9239
close #12569
I’m not sure if this change is correct. Here is my understanding:
When an element uses
ref
,vnodeHook
, orcustom directives
, thepatchFlag
should beNEED_PATCH
. However, when they are used together withv-for
, thepatchFlag
gets lost.related commit 1c9a481
playground
playground with this PR
The following problems will be fixed
The last two are from #9240 (comment) created by skirtles-code
Summary by CodeRabbit
NEED_PATCH
flag when usingv-for
with static or setup-boundref
, custom directives, or vnode hooks.v-for
combined with various features.