TriFrost

TriFrost 0.25.0

|peterver

News

From smarter exporter behavior to cleaner 404 fallbacks and a simple isDevMode() helper, this release removes noise and adds clarity, making development smoother, logs more readable, and defaults feel just right.

Added

  • feat: isDevMode(env) utility — a lightweight runtime check that determines whether TriFrost is running in development mode. It checks: TRIFROST_DEV environment variable (recommended), set to true for dev mode, it falls back to checking NODE_ENV !== 'production'. Example when configuring exporters:
import {App, isDevMode} from '@trifrost/core';

const app = await new App<Env>({
	...
	tracing: {
    exporters: ({env}) => {
      if (isDevMode(env)) return [new ConsoleExporter()];
      return [
        new JsonExporter(),
        new OtelHttpExporter({
          logEndpoint: 'https://otlp.uptrace.dev/v1/logs',
          spanEndpoint: 'https://otlp.uptrace.dev/v1/traces',
          headers: {
            'uptrace-dsn': env.UPTRACE_DSN,
          },
        }),
      ];
    },
  },
)

Improved

  • feat: ConsoleExporter now has a cleaner, more human-readable output by default. Fields like ctx, trace_id, span_id, global, etc. are no longer shown unless explicitly opted in via the new include option. These fields are part of the rich internal format used by the JSON and Otel exporters, but were found too noisy for use in a console. Note: The data payload is always included. Below is an example where you can see explicit opt-in through the new include option:
new ConsoleExporter({
    include: ['ctx', 'trace_id', 'span_id', 'global'],
    grouped: true,
});
  • feat: The group option in ConsoleExpoter (introduced in 0.24.0) will now by default be set to false
  • feat: Workerd runtime now switches to ConsoleExporter if in dev mode.
  • feat: Node, Bun, uWS now default to a ConsoleExporter with no inclusions if in dev mode. If not in dev mode they default to a ConsoleExporter that includes only the trace_id, making logs concise but still traceable.
  • feat: If no route is matched, the app now defaults to ctx.setStatus(404) automatically.

This removes the need for boilerplate in .onNotFound() handlers:

/* These now behave the same */
.onNotFound(ctx => ctx.text('Not Found', {status: 404}));
.onNotFound(ctx => ctx.text('Not Found'));
  • deps: Upgrade @cloudflare/workers-types to 4.20250604.0
  • deps: Upgrade @vitest/coverage-v8 to 3.2.1
  • deps: Upgrade typescript-eslint to 8.33.1
  • deps: Upgrade vitest to 3.2.1

As TriFrost approaches 1.0, each release sharpens the edges and sands down the rough spots. Expect fewer footguns, more consistency, and even better ergonomics — because great systems should feel effortless.

Stay frosty. ❄️

Loved the read? Share it with others