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 totrue
for dev mode, it falls back to checkingNODE_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 likectx
,trace_id
,span_id
,global
, etc. are no longer shown unless explicitly opted in via the newinclude
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: Thedata
payload is always included. Below is an example where you can see explicit opt-in through the newinclude
option:
new ConsoleExporter({
include: ['ctx', 'trace_id', 'span_id', 'global'],
grouped: true,
});
- feat: The
group
option inConsoleExpoter
(introduced in 0.24.0) will now by default be set tofalse
- 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 aConsoleExporter
that includes only thetrace_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. ❄️