-
Notifications
You must be signed in to change notification settings - Fork 8
fix: fix build speed (#1021) #1023
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
Conversation
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 pull request refactors entity loading to improve build performance by moving genome/assembly resolution from build-time to runtime. It introduces a centralized in-memory entity management system and standardizes the genome type to a single Assembly type union.
- Implements a new runtime entity loading system with store, query, loader, and hooks to fetch and cache assemblies and workflows from JSON API endpoints
- Simplifies
getStaticPropsto only return route parameters, eliminating expensive build-time entity fetching and validation - Unifies
BRCDataCatalogGenomeandGA2AssemblyEntitytypes under a singleAssemblytype alias throughout the codebase
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
app/services/workflows/store.ts |
Introduces in-memory maps to store entities by type and by ID |
app/services/workflows/query.ts |
Provides getter functions to retrieve entities from the store with error handling |
app/services/workflows/loader.ts |
Implements fetch logic to load entities and workflows from API endpoints into the store |
app/services/workflows/entities.ts |
Exports typed getter functions for assemblies and workflows |
app/services/workflows/hooks/UseEntities/hook.ts |
Custom hook to load entities on app initialization |
app/services/workflows/hooks/UseEntities/utils.ts |
Singleton pattern to ensure entities load only once |
app/services/workflows/routes.ts |
Defines API endpoint constants for assemblies and workflows |
app/services/workflows/types.ts |
Type definitions for entity routes |
pages/_app.tsx |
Integrates entity loading hook to populate store before rendering |
pages/data/[entityListType]/[entityId]/[trsId]/index.tsx |
Simplifies getStaticProps by removing build-time entity resolution |
app/views/WorkflowInputsView/workflowInputsView.tsx |
Refactored to fetch entities at runtime using new getter functions |
app/views/WorkflowInputsView/types.ts |
Defines unified Assembly type alias |
app/components/Entity/components/ConfigureWorkflowInputs/**/*.ts |
Updated type references from specific genome types to Assembly |
scripts/sync-api-brc-analytics.sh |
Script to copy catalog JSONs to public API directory for brc-analytics |
scripts/sync-api-ga2.sh |
Script to copy catalog JSONs to public API directory for ga2 |
package.json |
Updated build and dev scripts to run sync-api scripts before Next.js commands |
.gitignore |
Excludes generated /public/api directory from version control |
tests/services/workflows.store.test.ts |
Test coverage for entity store operations |
tests/services/workflows.query.test.ts |
Test coverage for entity query functions |
tests/services/workflows.loader.test.ts |
Test coverage for entity loading logic with fetch mocking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 29 out of 30 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e4909c9 to
5b6d4b4
Compare
|
I've approved this but I think @NoopDog wanted to review the API path before merging? |
Closes #1021.
This pull request refactors the way genome/assembly entities are handled throughout the workflow input configuration codebase. It standardizes the genome type to a single
Assemblytype, replacing previous usages ofBRCDataCatalogGenomeandGA2AssemblyEntity. Additionally, it introduces a new workflows entity loading and querying system, centralizing API calls and entity storage for assemblies and workflows.Type Standardization and Refactoring:
BRCDataCatalogGenomeandGA2AssemblyEntitywith the new unifiedAssemblytype in hooks, components, and type definitions such asuseUCSCFiles,useRequirementsMatches, and related props and utility functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Workflows Entity Loading System:
app/services/workflows, including utilities to load, store, and retrieve assemblies and workflows from API endpoints, with centralized state management. [1] [2] [3] [4] [5] [6] [7] [8]Component and Utility Updates:
Assemblytype and the refactored entity types, ensuring consistency across the codebase. [1] [2] [3]These changes improve type safety, code maintainability, and centralize entity management for assemblies and workflows, making future enhancements and debugging easier.