From 05b625908bf88c9402b9aa83ea4485715411138e Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Thu, 29 May 2025 09:43:46 +0100 Subject: [PATCH] Adds 2 snippets to reference node.js version for v3 and v4 --- docs/config/config-file.mdx | 5 +++++ docs/snippets/node-versions.mdx | 16 ++++++++++++++++ docs/upgrade-to-v4.mdx | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 docs/snippets/node-versions.mdx diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 62da85593e..5bf73a1a95 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -6,6 +6,7 @@ description: "This file is used to configure your project and how it's built." import ScrapingWarning from "/snippets/web-scraping-warning.mdx"; import BundlePackages from "/snippets/bundle-packages.mdx"; +import NodeVersions from "/snippets/node-versions.mdx"; The `trigger.config.ts` file is used to configure your Trigger.dev project. It is a TypeScript file at the root of your project that exports a default configuration object. Here's an example: @@ -245,6 +246,10 @@ export default defineConfig({ See our [Bun guide](/guides/frameworks/bun) for more information. +### Node.js versions + + + ## Default machine You can specify the default machine for all tasks in your project: diff --git a/docs/snippets/node-versions.mdx b/docs/snippets/node-versions.mdx new file mode 100644 index 0000000000..17f527ec15 --- /dev/null +++ b/docs/snippets/node-versions.mdx @@ -0,0 +1,16 @@ +Trigger.dev runs your tasks on specific Node.js versions depending on the version you're using: + +- **v3**: Uses Node.js `21.7.3` +- **v4**: Uses Node.js `21.7.3` by default, or Node.js `22.12.0` if you set `runtime: "node-22"` in your `trigger.config.ts` + +In v4, you can specify `runtime: "node-22"` to use Node.js 22 like this: + +```ts trigger.config.ts +import { defineConfig } from "@trigger.dev/sdk/v3"; + +export default defineConfig({ + project: "", + // Your other config settings... + runtime: "node-22", // Uses Node.js 22.12.0 +}); +``` \ No newline at end of file diff --git a/docs/upgrade-to-v4.mdx b/docs/upgrade-to-v4.mdx index 03a8ba6b1a..0ba6364890 100644 --- a/docs/upgrade-to-v4.mdx +++ b/docs/upgrade-to-v4.mdx @@ -3,10 +3,16 @@ title: "Upgrading to v4" description: "What's new in v4, how to upgrade, and breaking changes." --- +import NodeVersions from "/snippets/node-versions.mdx"; + ## What's new in v4? [Read our blog post](https://trigger.dev/blog/v4-beta-launch) for an overview of the new features. +### Node.js 22 support + + + ### Wait tokens In addition to waiting for a specific duration, or waiting for a child task to complete, you can now create and wait for a token to be completed, giving you more flexibility and the ability to wait for arbitrary conditions. For example, you can send the token to a Slack channel, and only complete the token when the user has clicked an "Approve" button.