Refactor Vue 3 integration guide to use composables pattern#1657
Refactor Vue 3 integration guide to use composables pattern#1657sequba wants to merge 1 commit intofeature/hf-122-framework-integration-guidesfrom
Conversation
Switch the basic example from a class wrapper to a composable, the idiomatic Vue 3 pattern for stateful reuse. Correct the reactivity explanation: TypeScript's `private` is erased at compile time, so the class did not actually shield the instance from Vue's Proxy — what keeps the engine out of reactivity is simply not passing it to ref()/reactive(). Use shallowRef for the values grid so reassignment triggers re-renders without deep-proxying every row. Use HyperFormula's own Sheet and CellValue types instead of hand-rolled unions. Expand the markRaw section to clarify when it is and isn't needed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/hf-122-framework-integration-guides #1657 +/- ##
============================================================================
Coverage 97.18% 97.18%
============================================================================
Files 174 174
Lines 15086 15086
Branches 3223 3223
============================================================================
Hits 14662 14662
Misses 424 424 🚀 New features to boost your workflow:
|
Performance comparison of head (443c87b) vs base (d6a316c) |
|
Picked nothing up from this PR into #1653 — the composables refactor ( The bug surfacing in this review ( Closing-suggestion: park until the Vue specialist task lands. I'll let you close at your discretion. |
Context
The Vue 3 integration guide was using an outdated pattern with a plain class wrapper (
SpreadsheetProvider) to keep the HyperFormula instance outside Vue's reactivity system. This approach is less idiomatic for modern Vue 3 development.The guide has been updated to demonstrate the recommended composable pattern, which is the standard way to encapsulate stateful logic in Vue 3. This change also improves the clarity of the troubleshooting section by better explaining when and why
markRawis needed.How did you test your changes?
Documentation review only. The changes are instructional updates to the integration guide with no functional code changes to the library itself.
Types of changes
Related issues:
None
Checklist:
Summary of changes
SpreadsheetProviderpattern with a composable functionuseSpreadsheet<script setup>shallowRefusagemarkRawis needed vs. when it's unnecessary<ClientOnly>wrapper with proper contexttype="button"attributes to button elements for better HTML semanticshttps://claude.ai/code/session_01FBwp6T1sLtGPiWUKHMn8hH