Skip to content

fix: clear stale vue reactive globals#34488

Closed
terminalchai wants to merge 1 commit into
storybookjs:nextfrom
terminalchai:codex/vue-reactive-globals-clear
Closed

fix: clear stale vue reactive globals#34488
terminalchai wants to merge 1 commit into
storybookjs:nextfrom
terminalchai:codex/vue-reactive-globals-clear

Conversation

@terminalchai
Copy link
Copy Markdown

@terminalchai terminalchai commented Apr 7, 2026

What I changed

This removes the early return in updateArgs() for the Vue 3 renderer so the deletion pass still runs when nextArgs or globals are cleared to {}.

I also added regression tests covering both cases:

  • clearing reactive args to an empty object
  • clearing reactive globals to an empty object

Fixes #34319

How to test

Automated tests

  • unit tests
  • integration tests
  • end-to-end tests
corepack yarn test code/renderers/vue3/src/render.test.ts --config code/renderers/vue3/vitest.config.ts

Manual testing

No manual testing required for this change. It is covered by focused Vue renderer regression tests.

Notes

I initially tried the root yarn test entrypoint, but in this checkout it fails during unrelated workspace Vitest project setup for @storybook/addon-vitest. The targeted Vue renderer Vitest config above passes and exercises the changed code directly.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where reactive state was not properly cleared when updating with empty arguments or globals in the Vue3 renderer. The renderer now correctly resets reactive state when provided with empty input objects.
  • Tests

    • Added test cases verifying that reactive state is properly cleared when updating with empty arguments and globals.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8633a13-c974-4356-8f82-25bbf2cdd904

📥 Commits

Reviewing files that changed from the base of the PR and between 2c99f18 and f25d26a.

📒 Files selected for processing (2)
  • code/renderers/vue3/src/render.test.ts
  • code/renderers/vue3/src/render.ts
💤 Files with no reviewable changes (1)
  • code/renderers/vue3/src/render.ts

📝 Walkthrough

Walkthrough

The PR modifies the Vue3 renderer's updateArgs function to process empty input objects by deleting existing reactive keys instead of returning early, and adds test cases verifying this behavior clears reactive state when passed empty args or globals.

Changes

Cohort / File(s) Summary
Vue3 Renderer Implementation
code/renderers/vue3/src/render.ts
Removed early-return guard that skipped processing when nextArgs is empty, enabling the function to clear reactive state by deleting keys not present in the incoming object.
Vue3 Renderer Tests
code/renderers/vue3/src/render.test.ts
Added two test cases verifying that updateArgs clears reactive state when called with empty nextArgs or nextGlobals objects.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@valentinpalkovic
Copy link
Copy Markdown
Contributor

Hi @terminalchai,

Due to a recent high volume of unreviewed AI-generated PRs, we are requesting verification and proof that the implemented fix actually works. Please provide a simple GIF/Video or image of how the fix works, optimally with before-and-after comparisons.

Thank you for your understanding!

@valentinpalkovic
Copy link
Copy Markdown
Contributor

Closing due to inactivity

@github-project-automation github-project-automation Bot moved this from Human verification to Done in Core Team Projects Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Vue: Potential desync bug in reactive globals

2 participants