Callback function types for compiler events.
Pass an object implementing any subset of these callbacks to
FilterCompilerOptions.events or WorkerCompilerOptions.events.
All handlers are optional; you only need to implement the events you care about.
Lifecycle order
onCompilationStart for each source: onSourceStart onSourceComplete (or onSourceError) for each transformation (via bridge hook): onTransformationStart onTransformationComplete onProgress (emitted throughout) onCompilationComplete
Relationship to TransformationHookManager
onTransformationStart and onTransformationComplete are now routed
through the hook system via a bridge hook rather than direct emitter calls.
This is an implementation detail that is transparent to callers — the events
still arrive at the same callbacks as before.
For async hooks or error hooks on individual transformations, use
FilterCompilerOptions.hookManager with a TransformationHookManager.
Error safety
All handlers are wrapped in try-catch by CompilerEventEmitter.safeEmit().
Throwing inside a handler logs the error but does not abort compilation.
onCompilationStart: (event: ICompilationStartEvent) => void
Called after validation passes, before any source is fetched.
Useful for: pre-flight logging, latency measurement, cache-warming.
onSourceStart: (event: ISourceStartEvent) => void
Called when a source starts downloading
onSourceComplete: (event: ISourceCompleteEvent) => void
Called when a source completes successfully
onSourceError: (event: ISourceErrorEvent) => void
Called when a source fails to compile
onTransformationStart: (event: ITransformationStartEvent) => void
Called when a transformation starts
onTransformationComplete: (event: ITransformationCompleteEvent) => void
Called when a transformation completes
onProgress: (event: IProgressEvent) => void
Called to report progress
onCompilationComplete: (event: ICompilationCompleteEvent) => void
Called when compilation completes