-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Reproduction
https://github.com/bodograumann/pinia-hmr-optional-attributes
Steps to reproduce the bug
git clone https://github.com/bodograumann/pinia-hmr-optional-attributescd pinia-hmr-optional-attributesnpm installnpm run devxdg-open http://localhost:5173- Press the "Increment" button. Sign says "positive".
touch src/store/counter.ts
Expected behavior
All the state should be preserved.
Actual behavior
counter.nr is preserved as 1, but counter.sign is lost. The page shows -, while it should show positive.
Additional information
The relevant code is here:
pinia/packages/pinia/src/hmr.ts
Lines 41 to 43 in 93b5546
| if (!(key in newState)) { | |
| continue | |
| } |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
💬 In discussion