Update Svelte integration guide for Svelte 5 and runes#1659
Draft
sequba wants to merge 1 commit intofeature/hf-122-framework-integration-guidesfrom
Draft
Update Svelte integration guide for Svelte 5 and runes#1659sequba 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 to Svelte 5 runes: $state for reactive values, onclick for
event handlers.
- Fix SSR snippet: onMount's async callback cannot return a cleanup
function synchronously, so the engine was never destroyed. Move
teardown to a separate onDestroy.
- Use $state around hf in the SSR snippet so disabled={!hf} updates
when the engine finishes mounting.
- Add TypeScript (lang="ts") for parity with the React and Vue guides,
with a note for JS users.
- Clarify that the SSR warning is about duplicated work per render,
not an unconditional crash.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/hf-122-framework-integration-guides #1659 +/- ##
============================================================================
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 (7c77f50) 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 Svelte integration guide was written for Svelte 4 and needs to be updated to reflect Svelte 5's new runes-based reactivity system. The changes modernize the code examples and clarify best practices for using HyperFormula with current Svelte versions.
Changes
$staterune for reactive variables instead of plainletdeclarationson:clicktoonclickto match Svelte 5 conventionsimport type) and inline type annotations using$state<Type>()onMountis necessary and corrected the async cleanup pattern (separateonDestroyinstead of returning cleanup from asynconMount)$state(for values that drive UI updates) vs. plainconst(for references that never change, like the HyperFormula instance)How did you test your changes?
Documentation review — verified that all code examples follow Svelte 5 patterns and are syntactically correct. The changes are purely documentation updates with no runtime code modifications.
Types of changes
Checklist:
https://claude.ai/code/session_0123ZjQT79obK9A6DXCwaKUW