pinia-orm
pinia-orm copied to clipboard
fix: update vue 2 reactivity
🔗 Linked issue
https://github.com/CodeDredd/pinia-orm/issues/1772
❓ Type of change
- [ ] 📖 Documentation (updates to the documentation or readme)
- [x] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
When updating an object in Vue 2, we cannot use directly Object.assign with 2 params and delete is not reactive.
cf. https://v2.vuejs.org/v2/guide/reactivity.html#For-Objects
📝 Checklist
- [x] I have linked an issue or discussion.
- [x] I have updated the documentation accordingly.
Codecov Report
Attention: 10 lines in your changes are missing coverage. Please review.
Comparison is base (
a7ab3bf) 99.10% compared to head (b289c7b) 98.94%. Report is 5 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| ...kages/pinia-orm/src/composables/useStoreActions.ts | 70.58% | 10 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1773 +/- ##
==========================================
- Coverage 99.10% 98.94% -0.17%
==========================================
Files 90 90
Lines 5917 5946 +29
Branches 494 499 +5
==========================================
+ Hits 5864 5883 +19
- Misses 50 60 +10
Partials 3 3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I don't know how to have 100% of code coverage with Vue 2 conditions, maybe it's possible to combine multiple reports with nyc https://github.com/istanbuljs/nyc?tab=readme-ov-file#combining-reports-from-multiple-runs
Some tests are failing with test:2 :/
@Graphmaxer Thanks for the PR. I try to look into it and think about it. I don't like it to have a new package as dependency. I hopefully find a solution to your problem. Meanwhile it would be good if could write a test for this.
I updated the test performance/prevent_rerender_of_child_components to be compatible with Vue 2 and it is failing because of a lack of reactivity. This test is already testing the bug.
I found a proper way without vue-demi as a direct dependency and added a specific tests to test reactivity and it is working great :)
Thanks for your PR, it works well for me, reactivity is working again! Tested on 2.7.16.
Any update on the review @CodeDredd ?
@CodeDredd if you found a minute to review and release this, I'd really appreciate it! Thanks for your time