class IncrementalCompiler

Incremental compiler that caches source compilations

Constructors

new
IncrementalCompiler(options?: IncrementalCompilerOptions)

Creates a new IncrementalCompiler

Properties

private
readonly
cache: ICacheStorage
private
readonly
compiler: FilterCompiler
private
readonly
forceRefresh: Set<string>
private
readonly
logger: ILogger
private
readonly
maxCacheAge: number

Methods

clearCache(): Promise<void>

Clears the compilation cache

compile(configuration: IConfiguration): Promise<string[]>

Compiles a filter list with incremental compilation support

private
compileSource(source: ISource): Promise<string[]>

Compiles a single source

compileWithMetrics(
configuration: IConfiguration,
benchmark?: boolean,
): Promise<IncrementalCompilationResult>

Compiles with metrics and incremental compilation support

private
getCacheKey(source: ISource): string

Generates cache key for a source

getCacheStats(): Promise<{ entries: number; sources: string[]; totalRules: number; oldestEntry: number; newestEntry: number; }>

Gets cache statistics

private
hashContent(rules: string[]): Promise<string>

Hashes content for comparison

private
shouldRecompile(
source: ISource,
): boolean

Determines if a source should be recompiled