Refactor supergroup to TypeScript Vue.js composables with full type safety and generic inference#21
Draft
Refactor supergroup to TypeScript Vue.js composables with full type safety and generic inference#21
Conversation
Co-authored-by: bkoplin <17945159+bkoplin@users.noreply.github.com>
Co-authored-by: bkoplin <17945159+bkoplin@users.noreply.github.com>
Co-authored-by: bkoplin <17945159+bkoplin@users.noreply.github.com>
Co-authored-by: bkoplin <17945159+bkoplin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor supergroup function for modular reactive utility
Refactor supergroup to Vue.js composables with dual module support
Jan 20, 2026
Collaborator
|
@copilot please make this a typescript library and strongly type the modules. The return types should vary by the type of the iterable passed to the composables. |
Co-authored-by: bkoplin <17945159+bkoplin@users.noreply.github.com>
Author
Done! The library is now fully TypeScript with strong typing and generic type inference. What was added:
Type inference example: interface Employee { name: string; dept: string; salary: number; }
const data = ref<Employee[]>([...]);
const grouping = useGrouping(data, 'dept');
// grouping is typed as UseGroupingReturn<Employee>
// All return values know about Employee structure!All tests passing (43/43). See commit e402111 for the full TypeScript implementation. |
Copilot
AI
changed the title
Refactor supergroup to Vue.js composables with dual module support
Refactor supergroup to TypeScript Vue.js composables with full type safety and generic inference
Jan 20, 2026
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.
Modernizes supergroup for Vue.js applications by providing reactive composables with full TypeScript support and generic type inference, while preserving the legacy lodash mixin API.
Architecture
New Composables (
src/composables/- TypeScript)useGrouping- Core reactive grouping with auto-update on data changesuseGroupList- List operations (lookup, tree navigation, D3 conversion)useGroupValue- Value operations (paths, aggregates, siblings)useGroupSelection- Non-mutating state managementTypeScript Features
.d.tstype definitions exportedsrc/types.tsModule Strategy
src/compiled to ES modules indist/supergroup.cjsfor CommonJS compatibilityUsage
Backward Compatibility
Testing
Documentation
COMPOSABLES.md- Full API reference with TypeScript examplesexamples/VueComponent.vue- Working exampleREADME.md- Updated with TypeScript usage examplesOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.