Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 57041b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe Svelte table wrappers now pass context keys and values to App components. Those components register the context with ChangesSvelte context initialization
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The context change preserves the existing wrapper contracts while moving registration into component initialization. No concrete merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
In
@tanstack/svelte-table,createAppTablepreviously definedAppTable,AppCell,AppHeader, andAppFooterwrappers as plain functions that invokedsetContext()directly before invoking the underlying Svelte component (AppCellSvelte,AppHeaderSvelte,AppTableSvelte).Because
setContextwas called in the wrapper function closure before the Svelte component mounted, it ran in the parent component's context. When cells or headers are rendered dynamically after the parent component has already initialized (for example, when toggling column visibility viacolumn.toggleVisibility()or with Svelte 5 async mode enabled), Svelte throws:Changes
contextKeyand the respective entity (cell,header,table) as props intoAppCellSvelte,AppHeaderSvelte, andAppTableSvelte.setContextinside the<script lang="ts">ofAppCell.svelte,AppHeader.svelte, andAppTable.svelteduring their own component initialization.setContextcalls from the outer wrapper function closure increateTableHook.svelte.ts.@tanstack/svelte-table.Summary by CodeRabbit