Refactor Vue 3 integration guide to use composables pattern#1657
Draft
sequba wants to merge 1 commit intofeature/hf-122-framework-integration-guidesfrom
Draft
Refactor Vue 3 integration guide to use composables pattern#1657sequba wants to merge 1 commit intofeature/hf-122-framework-integration-guidesfrom
sequba 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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