addon-operator icon indicating copy to clipboard operation
addon-operator copied to clipboard

Feat/cache jq filters

Open timmilesdw opened this issue 2 months ago • 0 comments

Overview

Architectural overhaul of the shell-operator filter system that introduces pre-compilation of JQ expressions during configuration, eliminating runtime compilation overhead. The refactoring replaces the complex interface-based design with a simplified functional approach and consolidates all filtering logic.

Key changes:

  • Performance: JQ expressions now compiled once at configuration time instead of on every filter operation
  • Architecture: Replaced Filter interface with functional Run(expression, filterFn, obj) API
  • Consolidation: Consolidated pkg/filter/jq/ subdirectory into main pkg/filter/ package
  • Precedence: Implemented explicit filter precedence: custom filter function > JQ expression > no filter
  • Testing: Added comprehensive test suite covering all scenarios

Benefits:

  • Simplified architecture and maintenance
  • Clear filter precedence rules
  • Consolidated codebase
  • 100% backward compatibility maintained

Special notes for your reviewer

Internal refactoring - no breaking changes. Major code simplification while preserving functionality.

timmilesdw avatar Oct 08 '25 16:10 timmilesdw