-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
fix(compiler-sfc): ensure props bindings register before compiling template #13922
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
Conversation
WalkthroughMoved generation of the runtime props declaration earlier in compileScript so Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Compile as compileScript()
participant Ctx as Context
participant Template as Inline Template Handler
participant Runtime as Runtime Options Assembler
rect rgba(220,235,255,0.35)
Compile->>Ctx: genRuntimeProps(ctx) -> propsDecl (early)
Note right of Ctx: propsDecl available to subsequent steps
end
Compile->>Template: handle inline template (may compile)
Template->>Compile: template result
Compile->>Runtime: assemble runtime options using propsDecl
Runtime->>Compile: runtime options object
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/compiler-sfc/src/compileScript.ts (1)
836-836
: Microcopy nit: tweak the comment for clarityConsider: “ensure props bindings are registered before compiling the template in inline mode”
- // ensure props bindings register before compile template in inline mode + // ensure props bindings are registered before compiling the template in inline mode
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/compiler-sfc/src/compileScript.ts
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/compiler-sfc/src/compileScript.ts (1)
packages/compiler-sfc/src/script/defineProps.ts (1)
genRuntimeProps
(141-177)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules
- GitHub Check: Header rules
- GitHub Check: Pages changed
🔇 Additional comments (1)
packages/compiler-sfc/src/compileScript.ts (1)
836-837
: Add test for member-expression component tags in inlineTemplate modeConfirmed: props runtime generation is invoked before inline template compile (packages/compiler-sfc/src/compileScript.ts — propsDecl at lines ~793/837/970) and inlineTemplate:true is used in tests, but no fixtures/tests contain member-expression tags like <Foo.Bar/>. Add a focused test under packages/compiler-sfc/tests/compileScript/ that compiles an SFC with a member-expression component tag and { inlineTemplate: true } to prevent regressions.
Works well in our prod build, thanks a lot! |
close #13920
Summary by CodeRabbit
Bug Fixes
Tests