Environment
- Bun:
1.3.14
ttsc: 0.20.0
@ttsc/unplugin: 0.20.0
- Typia:
13.2.0
- OS: macOS arm64
Problem
Using @ttsc/unplugin/bun as a Bun runtime plugin causes a very slow initial startup.
The application is a regular TypeScript application using Typia-generated validators.
Example runtime registration:
import typiaPlugin from "@ttsc/unplugin/bun";
import { plugin } from "bun";
plugin(typiaPlugin());
The application is started directly from a TypeScript entrypoint:
On a cold process start, the first application log line may appear only after 1–5 minutes.
The same application starts almost immediately when running a prebuilt JavaScript bundle.
Disabling the Typia transform also starts quickly, but the application then fails because Typia requires its compile-time transformation.
Expected behavior
The Bun runtime plugin should provide one of the following:
- Transform only files required by the entrypoint.
- Reuse persistent or incremental compiler state.
- Provide a documented resident compiler or cache mode for development.
A normal development startup should complete within a few seconds without disabling Typia transformations.
Actual behavior
The first runtime import appears to trigger a project-wide TypeScript transformation.
The transformation is repeated after every process restart. The cache appears to be process-local, so it does not help when the development server is restarted.
Minimal reproduction
preload.ts:
import typiaPlugin from "@ttsc/unplugin/bun";
import { plugin } from "bun";
plugin(typiaPlugin());
bunfig.toml:
preload = ["./preload.ts"]
Start the application:
Example Typia usage:
import typia from "typia";
export const validate = typia.createValidate<{ id: string }>();
Additional observations
- Native Bun TypeScript startup without the Typia transform is fast.
- A prebuilt bundle starts fast.
- The delay occurs before application bootstrap code executes.
- A resident
TtscService was also tested, but it still compiled the full configured project.
- A narrow
tsconfig did not clearly limit the resident compilation scope.
Questions
- Is project-wide compilation expected for
@ttsc/unplugin/bun in runtime mode?
- Is there a supported way to use a persistent resident compiler for Bun runtime loading?
- Can the runtime adapter use incremental per-file transformation instead of a full project transform?
- Can the project input set be restricted reliably to the entrypoint dependency graph?
- Is there a recommended development workflow for Bun and Typia that avoids multi-minute cold starts while preserving transformations?
Thank you.
Environment
1.3.14ttsc:0.20.0@ttsc/unplugin:0.20.013.2.0Problem
Using
@ttsc/unplugin/bunas a Bun runtime plugin causes a very slow initial startup.The application is a regular TypeScript application using Typia-generated validators.
Example runtime registration:
The application is started directly from a TypeScript entrypoint:
On a cold process start, the first application log line may appear only after 1–5 minutes.
The same application starts almost immediately when running a prebuilt JavaScript bundle.
Disabling the Typia transform also starts quickly, but the application then fails because Typia requires its compile-time transformation.
Expected behavior
The Bun runtime plugin should provide one of the following:
A normal development startup should complete within a few seconds without disabling Typia transformations.
Actual behavior
The first runtime import appears to trigger a project-wide TypeScript transformation.
The transformation is repeated after every process restart. The cache appears to be process-local, so it does not help when the development server is restarted.
Minimal reproduction
preload.ts:bunfig.toml:Start the application:
Example Typia usage:
Additional observations
TtscServicewas also tested, but it still compiled the full configured project.tsconfigdid not clearly limit the resident compilation scope.Questions
@ttsc/unplugin/bunin runtime mode?Thank you.