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:
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
Encoder class
- 📦 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.105
2. Update Code
Review and update src/lib/utils/search.ts:
- Check import statement compatibility
- Verify
Index constructor and options
- Test
add() and search() methods
- Check return types and data structures
3. Testing Checklist
4. Documentation
Resources
Priority
Low - Current version (0.7.43) is working fine. This is an enhancement for better performance and features.
Labels
enhancement
dependencies
breaking-change
Overview
Update
flexsearchfrom 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:
src/lib/utils/search.tssrc/lib/components/singletons/SearchBar.svelteCurrent implementation:
What's New in v0.8
According to the release notes:
EncoderclassResolverBreaking Changes
Required Work
1. Update Dependency
2. Update Code
Review and update
src/lib/utils/search.ts:Indexconstructor and optionsadd()andsearch()methods3. Testing Checklist
4. Documentation
Resources
Priority
Low - Current version (0.7.43) is working fine. This is an enhancement for better performance and features.
Labels
enhancementdependenciesbreaking-change