fix(runtime-vapor): add dev-only warning for non-existent property access during render#14162
Conversation
…cess during render
|
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 ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
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: |
There was a problem hiding this comment.
Pull request overview
This PR adds a development-only warning to the runtime-vapor implementation that alerts developers when they access non-existent properties during component render. This matches similar functionality in the non-vapor runtime and helps catch common errors during development.
Key changes:
- Added
createDevSetupStateProxyfunction that wraps the setup state with a proxy in dev mode to detect and warn about undefined property access - Added test coverage to verify the warning is triggered correctly
- Fixed an existing test that was accessing a non-existent property (
style) which would now trigger the new warning
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/runtime-vapor/src/component.ts | Implements dev proxy wrapper for setup state to warn on non-existent property access; adds imports for toRaw and hasOwn utilities |
| packages/runtime-vapor/tests/component.spec.ts | Adds test case to verify warning is triggered when accessing non-existent properties during render |
| packages/runtime-vapor/tests/hmr.spec.ts | Removes reference to non-existent style property from test template to avoid triggering the new warning |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.