fix(runtime-vapor): pass render args to template-only components#14721
fix(runtime-vapor): pass render args to template-only components#14721edison1105 merged 3 commits intominorfrom
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)
Comment |
@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
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/runtime-vapor/__tests__/component.spec.ts (1)
490-507: Preserve prior__DEV__value when restoring test state.Line 506 always resets to
true; if the suite started with a different value, this leaks global state across tests.Suggested patch
- test('should mount component only with template in production mode', () => { - __DEV__ = false + test('should mount component only with template in production mode', () => { + const prevDev = __DEV__ + __DEV__ = false try { const { component: Child } = define({ render() { return template('<div> HI </div>', true)() }, }) @@ const { host } = define({ setup() { return createComponent(Child, null, null, true) }, }).render() expect(host.innerHTML).toBe('<div> HI </div>') } finally { - __DEV__ = true + __DEV__ = prevDev } })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/runtime-vapor/__tests__/component.spec.ts` around lines 490 - 507, The test currently forces __DEV__ = true in the finally block which can leak global state; capture the current value before mutating (e.g., const prevDev = __DEV__), set __DEV__ = false for the test, and in the finally restore with __DEV__ = prevDev so prior __DEV__ is preserved; update the test surrounding the try/finally that manipulates __DEV__ accordingly.
🤖 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/runtime-vapor/__tests__/component.spec.ts`:
- Around line 490-507: The test currently forces __DEV__ = true in the finally
block which can leak global state; capture the current value before mutating
(e.g., const prevDev = __DEV__), set __DEV__ = false for the test, and in the
finally restore with __DEV__ = prevDev so prior __DEV__ is preserved; update the
test surrounding the try/finally that manipulates __DEV__ accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 545f730a-ba06-4ef0-a91d-7cf1bc59a4be
📒 Files selected for processing (2)
packages/runtime-vapor/__tests__/component.spec.tspackages/runtime-vapor/src/component.ts
Summary by CodeRabbit
Tests
Refactor