-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[CHORE] Build fixes for new js client #4752
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
Comprehensive Build Fixes and Typing Cleanups for Chroma New JS Client This major PR refactors the Chroma JS client, removing legacy code paths, streamlining collection and client APIs, improving interoperability with the updated backend API, and harmonizing type signatures throughout the codebase. It introduces architectural cleanups such as consolidating collection interfaces, simplifying row-format query/results methods, enhancing type safety for metadata (including nullability), provides unified container/server start logic, and applies post-generation fixes for OpenAPI client types. Documentation and tests were also updated to reflect the revised public APIs. Key Changes: Affected Areas: Potential Impact: Functionality: Existing apps relying on 'getCollectionById' or 'getCollectionsById' must migrate to the full-API client approach. Stronger type safety and up-to-date metadata type alignment help prevent subtle runtime errors. Performance: Some calls (such as 'getCollections') now always perform an API roundtrip and may incur more API traffic versus direct/assumed-thin calls. Security: API connection argument handling is made stricter; legacy methods that may inadvertently leak auth or allow incorrect usage are now removed. Scalability: Unified code paths and centralized startup logic reduce code duplication and improve maintainability for future features or environments. Review Focus: Testing Needed• Verify collection retrieval, addition, update, and fork operations for correct type, metadata, and config propagation in all supported environments. Code Quality Assessmentclients/new-js/packages/chromadb/scripts/start-chroma.ts: Now thin wrappers for shared ESM/CJS-aware startup logic; more DRY. clients/new-js/packages/chromadb/src/types.ts: More precise, aligns well with backend, null-handling clarified. clients/new-js/packages/chromadb/src/api/types.gen.ts: Patch applied to correct post-generation issues; should reduce downstream type bugs. clients/new-js/packages/chromadb/test/: Tests modified to validate new approach; coverage remains high. clients/new-js/packages/chromadb/src/collection.ts: Refactored and unified, more maintainable; significant duplicate logic removed. Best PracticesTesting: Types: Doc/Api: Upgrade: Potential Issues• Potential for breakage in external code relying on 'getCollectionById' or similar thin APIs. This summary was automatically generated by @propel-code-bot |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Description of changes
Add
EmbeddingFunctionSpace
toDefaultEmbedFunction
, and type forgetCollections