-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Overview
Update flexsearch from version 0.7.43 to 0.8.105 (or latest stable).
Context
This is a major version update (0.7 β 0.8) with significant breaking changes that require code modifications and thorough testing.
Related Snyk PR: #153
Current Usage
Flexsearch is currently used in the blog search functionality:
- File:
src/lib/utils/search.ts - Component:
src/lib/components/singletons/SearchBar.svelte
Current implementation:
import FlexSearch from 'flexsearch';
postsIndex = new FlexSearch.Index({ tokenize: 'forward' });What's New in v0.8
According to the release notes:
- π 4.5x faster query performance
- π Persistent indexes support (IndexedDB, Redis, SQLite, PostgreSQL, MongoDB, ClickHouse)
- π¨ Result highlighting
- π Enhanced language customization via
Encoderclass - π¦ Improved build system with better CJS/ESM support
- π§ Improved interoperability and TypeScript definitions
- β‘ Regex pre-compilation
- π― Intermediate result sets and
Resolver
Breaking Changes
- API changes: Import patterns and method signatures may have changed
- Build system: Different module format (CJS vs ESM)
- Type definitions: Updated TypeScript types
Required Work
1. Update Dependency
npm install flexsearch@^0.8.1052. Update Code
Review and update src/lib/utils/search.ts:
- Check import statement compatibility
- Verify
Indexconstructor and options - Test
add()andsearch()methods - Check return types and data structures
3. Testing Checklist
- Search functionality works correctly
- Search results are accurate
- Result highlighting works (if implemented)
- Performance is acceptable
- No TypeScript errors
- Build completes successfully
- Test on different browsers (if client-side indexing is used)
4. Documentation
- Update any relevant comments in the code
- Document any configuration changes
Resources
Priority
Low - Current version (0.7.43) is working fine. This is an enhancement for better performance and features.
Labels
enhancementdependenciesbreaking-change