-
Notifications
You must be signed in to change notification settings - Fork 8
refactoring #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring #534
Conversation
28a016e
to
5048af0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the hypergraph-react package to improve code organization by extracting hook functionality into separate files and consolidating shared utilities. The refactoring moves hooks from a central context file into individual hook files and extracts common functionality into utility modules.
- Extracted individual hooks from
HypergraphSpaceContext.tsx
into separate files in a newhooks/
directory - Moved internal utility functions into separate modules for better reusability
- Updated import statements throughout the codebase to reflect the new structure
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/hypergraph-react/test/internal/translate-filter-to-graphql.test.ts |
Updated import path for test module |
packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx |
Replaced centralized imports with individual hook imports and renamed internal hook |
packages/hypergraph-react/src/internal/use-subscribe-to-space.tsx |
New utility for managing space subscriptions |
packages/hypergraph-react/src/internal/use-query-public.tsx |
Removed duplicate utility functions, added imports for extracted modules |
packages/hypergraph-react/src/internal/use-query-private.tsx |
New module for private query functionality |
packages/hypergraph-react/src/internal/use-hypergraph-space-internal.tsx |
Extracted context access utility |
packages/hypergraph-react/src/internal/use-entity-public.tsx |
Removed duplicate utility functions, added imports for extracted modules |
packages/hypergraph-react/src/internal/use-entity-private.tsx |
New module for private entity functionality |
packages/hypergraph-react/src/internal/convert-relations.ts |
Extracted relation conversion utility |
packages/hypergraph-react/src/internal/convert-property-value.ts |
Extracted property value conversion utility |
packages/hypergraph-react/src/index.ts |
Updated exports to use individual hook modules |
packages/hypergraph-react/src/hooks/ |
New directory containing extracted hook implementations |
packages/hypergraph-react/src/HypergraphSpaceContext.tsx |
Simplified to only contain context provider |
apps/events/vitest.config.ts |
Added vitest configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
}); | ||
|
||
if (rawEntity[key]) { | ||
rawEntity[key] = [...(rawEntity[key] as unknown[]), ...newRelationEntities]; |
Copilot
AI
Sep 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type assertion as unknown[]
suggests uncertain typing. Consider defining a more specific type or restructuring to avoid the need for type assertion.
Copilot uses AI. Check for mistakes.
No description provided.