interface ICompilationStartEvent

Event emitted when compilation begins, after configuration validation has passed but before any source is downloaded or processed.

Why this event was added

The existing ICompilerEvents had onCompilationComplete but no corresponding start event. The gap meant you could not measure total end-to-end latency from inside an event handler alone, nor could you implement pre-fetch cache-warming based on the upcoming compilation.

Firing after validation (not at the very start of compile()) is an intentional design choice: by this point we know the configuration is valid and sourceCount / transformationCount are trustworthy.

Examples

Example 1

const compiler = new FilterCompiler({
  events: {
    onCompilationStart: (e) => {
      console.log(
        `Compiling "${e.configName}": ` +
        `${e.sourceCount} sources, ${e.transformationCount} transformations`
      );
    },
  },
});

Properties

configName: string

Name of the configuration being compiled (from IConfiguration.name)

Number of sources that will be fetched and compiled

Number of global transformations that will be applied after merging sources

timestamp: number

Date.now() timestamp captured just before source fetching begins

Usage

import { type ICompilationStartEvent } from ".";