Skip to content

Commit cb3f54f

Browse files
committed
feat(core,cli): add node-24 and node-26 runtimes, deprecate experimental aliases
Promote node-24 and node-26 to supported runtime options in trigger.config.ts. The experimental-node-24 and experimental-node-26 names remain as deprecated aliases that resolve to their replacements and emit a deprecation warning.
1 parent 7a14188 commit cb3f54f

7 files changed

Lines changed: 70 additions & 27 deletions

File tree

.changeset/node-24-26-runtimes.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@trigger.dev/core": patch
3+
"trigger.dev": patch
4+
---
5+
6+
Add `node-24` and `node-26` as supported `runtime` options in `trigger.config.ts`. The `experimental-node-24` and `experimental-node-26` names are now deprecated aliases and emit a deprecation warning; switch to `node-24` / `node-26` instead.
7+
8+
```ts
9+
import { defineConfig } from "@trigger.dev/sdk";
10+
11+
export default defineConfig({
12+
runtime: "node-24",
13+
project: "<your-project-ref>",
14+
});
15+
```

docs/snippets/node-versions.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
Trigger.dev runs your tasks on specific Node.js versions:
22

3-
### v3
4-
5-
- Node.js `21.7.3`
6-
7-
### v4
8-
93
- Node.js `21.7.3` (default)
104
- Node.js `22.16.0` (`node-22`)
5+
- Node.js `24.18.0` (`node-24`)
6+
- Node.js `26.4.0` (`node-26`)
117
- Bun `1.3.3` (`bun`)
128

139
You can change the runtime by setting the `runtime` field in your `trigger.config.ts` file.
@@ -16,8 +12,13 @@ You can change the runtime by setting the `runtime` field in your `trigger.confi
1612
import { defineConfig } from "@trigger.dev/sdk";
1713

1814
export default defineConfig({
19-
// "node", "node-22" or "bun"
20-
runtime: "node-22",
15+
// "node", "node-22", "node-24", "node-26" or "bun"
16+
runtime: "node-24",
2117
project: "<your-project-ref>",
2218
});
2319
```
20+
21+
<Note>
22+
The `experimental-node-24` and `experimental-node-26` runtime names are deprecated. Use `node-24`
23+
and `node-26` instead.
24+
</Note>

packages/cli-v3/src/config.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ async function createProject(runtime?: string) {
3333

3434
describe("loadConfig runtime", () => {
3535
it.each([
36+
["node", "node"],
37+
["node-22", "node-22"],
38+
["node-24", "node-24"],
39+
["node-26", "node-26"],
3640
["experimental-node-24", "node-24"],
3741
["experimental-node-26", "node-26"],
3842
] as const)("normalizes %s before returning the resolved config", async (runtime, expected) => {
@@ -47,7 +51,7 @@ describe("loadConfig runtime", () => {
4751
await expect(loadConfig({ cwd, warn: false })).resolves.toMatchObject({ runtime: "node" });
4852
});
4953

50-
it.each(["node-24", "node-26", "node-23"])(
54+
it.each(["node-23"])(
5155
"rejects unsupported public runtime %s while loading config",
5256
async (runtime) => {
5357
const cwd = await createProject(runtime);

packages/cli-v3/src/config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import type {
88
import type { ResolvedConfig } from "@trigger.dev/core/v3/build";
99
import {
1010
DEFAULT_RUNTIME,
11-
isExperimentalConfigRuntime,
11+
deprecatedRuntimeReplacement,
12+
isDeprecatedConfigRuntime,
1213
resolveBuildRuntime,
1314
} from "@trigger.dev/core/v3/build";
1415
import * as c12 from "c12";
@@ -184,9 +185,11 @@ async function resolveConfig(
184185
const configuredRuntime = overrides?.runtime ?? config.runtime ?? defaultRuntime;
185186
const runtime = resolveBuildRuntime(configuredRuntime);
186187

187-
if (warn && isExperimentalConfigRuntime(configuredRuntime)) {
188+
if (warn && isDeprecatedConfigRuntime(configuredRuntime)) {
188189
prettyWarning(
189-
`The "${configuredRuntime}" runtime is experimental and may change before general availability.`
190+
`The "${configuredRuntime}" runtime is deprecated. Use "${deprecatedRuntimeReplacement(
191+
configuredRuntime
192+
)}" instead.`
190193
);
191194
}
192195

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
11
import { describe, expect, it } from "vitest";
22
import { BuildManifest, BuildRuntime, ConfigRuntime, WorkerManifest } from "../schemas/build.js";
3-
import { isExperimentalConfigRuntime, resolveBuildRuntime } from "./runtime.js";
3+
import { isDeprecatedConfigRuntime, resolveBuildRuntime } from "./runtime.js";
44

55
describe("runtime configuration", () => {
6-
it.each(["node", "node-22", "experimental-node-24", "experimental-node-26", "bun"] as const)(
7-
"accepts %s as a public config runtime",
8-
(runtime) => {
9-
expect(ConfigRuntime.parse(runtime)).toBe(runtime);
10-
}
11-
);
6+
it.each([
7+
"node",
8+
"node-22",
9+
"node-24",
10+
"node-26",
11+
"experimental-node-24",
12+
"experimental-node-26",
13+
"bun",
14+
] as const)("accepts %s as a public config runtime", (runtime) => {
15+
expect(ConfigRuntime.parse(runtime)).toBe(runtime);
16+
});
1217

1318
it.each([
1419
["experimental-node-24", "node-24"],
1520
["experimental-node-26", "node-26"],
1621
["node", "node"],
1722
["node-22", "node-22"],
23+
["node-24", "node-24"],
24+
["node-26", "node-26"],
1825
["bun", "bun"],
1926
] as const)("normalizes %s to %s", (runtime, expected) => {
2027
expect(resolveBuildRuntime(runtime)).toBe(expected);
2128
});
2229

2330
it.each(["node-24", "node-26"] as const)(
24-
"keeps internal runtime %s out of the public config schema",
31+
"accepts internal runtime %s in both public and internal schemas",
2532
(runtime) => {
26-
expect(ConfigRuntime.safeParse(runtime).success).toBe(false);
33+
expect(ConfigRuntime.safeParse(runtime).success).toBe(true);
2734
expect(BuildRuntime.safeParse(runtime).success).toBe(true);
28-
expect(() => resolveBuildRuntime(runtime)).toThrowError(/Unsupported runtime/);
35+
expect(resolveBuildRuntime(runtime)).toBe(runtime);
2936
}
3037
);
3138

@@ -36,12 +43,12 @@ describe("runtime configuration", () => {
3643
});
3744

3845
it.each(["experimental-node-24", "experimental-node-26"] as const)(
39-
"keeps %s out of internal runtime schemas",
46+
"treats %s as a deprecated alias kept out of internal runtime schemas",
4047
(runtime) => {
4148
expect(BuildRuntime.safeParse(runtime).success).toBe(false);
4249
expect(BuildManifest.shape.runtime.safeParse(runtime).success).toBe(false);
4350
expect(WorkerManifest.shape.runtime.safeParse(runtime).success).toBe(false);
44-
expect(isExperimentalConfigRuntime(runtime)).toBe(true);
51+
expect(isDeprecatedConfigRuntime(runtime)).toBe(true);
4552
}
4653
);
4754
});

packages/core/src/v3/build/runtime.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@ import { homedir } from "node:os";
66

77
export const DEFAULT_RUNTIME = "node" satisfies BuildRuntime;
88

9-
export type ExperimentalConfigRuntime = "experimental-node-24" | "experimental-node-26";
9+
export type DeprecatedConfigRuntime = "experimental-node-24" | "experimental-node-26";
1010

11-
export function isExperimentalConfigRuntime(
11+
export function isDeprecatedConfigRuntime(
1212
runtime: unknown
13-
): runtime is ExperimentalConfigRuntime {
13+
): runtime is DeprecatedConfigRuntime {
1414
return runtime === "experimental-node-24" || runtime === "experimental-node-26";
1515
}
1616

17+
/** Maps a deprecated runtime alias to the runtime that should be used instead. */
18+
export function deprecatedRuntimeReplacement(runtime: DeprecatedConfigRuntime): BuildRuntime {
19+
switch (runtime) {
20+
case "experimental-node-24":
21+
return "node-24";
22+
case "experimental-node-26":
23+
return "node-26";
24+
}
25+
}
26+
1727
export function resolveBuildRuntime(runtime: unknown): BuildRuntime {
1828
const parsedRuntime = ConfigRuntime.safeParse(runtime);
1929

packages/core/src/v3/schemas/build.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export type BuildTarget = z.infer<typeof BuildTarget>;
1616
export const ConfigRuntime = z.enum([
1717
"node",
1818
"node-22",
19+
"node-24",
20+
"node-26",
21+
// Deprecated aliases, kept for backwards compatibility. Use "node-24"/"node-26" instead.
1922
"experimental-node-24",
2023
"experimental-node-26",
2124
"bun",

0 commit comments

Comments
 (0)