Skip to content

refactor!: drop support for Node 18#1509

Merged
Timeless0911 merged 1 commit intomainfrom
refactor/drop-node-18
Mar 3, 2026
Merged

refactor!: drop support for Node 18#1509
Timeless0911 merged 1 commit intomainfrom
refactor/drop-node-18

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

@Timeless0911 Timeless0911 commented Mar 3, 2026

Summary

As Node.js 18 reached its end-of-life on April 30, 2025, Rslib will no longer support this version since v0.20.0. The minimum supported version will be Node.js 20.19.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings March 3, 2026 08:53
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44174d5
Status: ✅  Deploy successful!
Preview URL: https://0f8caad0.rslib.pages.dev
Branch Preview URL: https://refactor-drop-node-18.rslib.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44174d5318

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Timeless0911 Timeless0911 merged commit 342d8d7 into main Mar 3, 2026
15 checks passed
@Timeless0911 Timeless0911 deleted the refactor/drop-node-18 branch March 3, 2026 09:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR drops Node.js 18 support across the repo by updating engine constraints, un-skipping Node 18-gated integration tests, and aligning documentation and CI configuration with the new supported Node baseline.

Changes:

  • Updated engines.node to ^20.19.0 || >=22.12.0 in the root and key packages.
  • Removed Node 18 conditional skips in multiple integration tests (notably tsgo-related suites).
  • Updated docs and GitHub Actions workflows to reflect the new runtime/support posture.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
website/docs/zh/guide/start/quick-start.mdx Updates environment prep guidance and adds runtime/version requirements tip.
website/docs/en/guide/start/quick-start.mdx Same as above for English docs; rewords section title and adds runtime list + tip.
tests/integration/redirect/dtsTsgo.test.ts Removes Node 18 skip for tsgo dts redirect integration tests.
tests/integration/dts-tsgo/bundle/index.test.ts Removes Node 18 skip for tsgo “bundle: true” integration tests.
tests/integration/dts-tsgo/bundle-false/index.test.ts Removes Node 18 skip for tsgo “bundle: false” integration tests.
tests/integration/dts-tsgo/build/index.test.ts Removes Node 18 skip for tsgo “build: true” integration tests.
tests/integration/banner-footer/index.test.ts Removes Node 18 skip for banner/footer integration test.
packages/plugin-dts/rslib.config.ts Changes build syntax setting from Node 18 to ES target.
packages/plugin-dts/package.json Updates Node engine requirement for the package.
packages/create-rslib/rslib.config.ts Changes build syntax setting from Node 18 to ES target.
packages/create-rslib/package.json Updates Node engine requirement for the package.
packages/core/rslib.config.ts Changes build syntax setting from Node 18 to ES target.
packages/core/package.json Updates Node engine requirement for the package.
package.json Updates workspace-level Node engine requirement.
.github/workflows/test.yml Updates CI Node version matrix (now Node 24 only).
.github/workflows/reusable-test.yml Removes Node 18 special handling steps.
.github/workflows/release.yml Bumps release workflow Node version.
.github/workflows/preview.yml Bumps preview workflow Node version.
.github/workflows/lint.yml Bumps lint workflow Node version.
.github/workflows/benchmark.yml Bumps benchmark workflow Node version (placeholder job).

format: 'esm',
bundle: false,
syntax: ['node 18.12.0'],
syntax: ['es2023'],
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: ['es2023'] is currently treated as es2022 for Rspack target (newer ES versions are mapped down), so it doesn't actually express an ES2023 target. If the goal is “modern syntax”, use es2022 explicitly; if the goal is “Node runtime target”, prefer a node XX browserslist target that matches the supported engines.

Suggested change
syntax: ['es2023'],
syntax: ['es2022'],

Copilot uses AI. Check for mistakes.
{
format: 'esm',
syntax: ['node 18.12.0'],
syntax: ['es2023'],
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: ['es2023'] is mapped down to es2022 for Rspack target, so this setting won’t actually target ES2023. Consider using es2022 explicitly (or a node XX target aligned with the supported engines) to make the intended runtime/syntax level unambiguous.

Suggested change
syntax: ['es2023'],
syntax: ['es2022'],

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 46
"engines": {
"node": ">=18.12.0"
"node": "^20.19.0 || >=22.12.0"
},
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create-rslib now requires Node ^20.19.0 || >=22.12.0, but the bundled templates still generate configs with syntax: ['node 18'] (e.g. template-node-esm-ts / template-node-dual-ts). Update the templates to reflect the new minimum Node target so newly generated projects don’t default to an unsupported runtime target.

Copilot uses AI. Check for mistakes.
{
format: 'esm',
syntax: ['node 18.12.0'],
syntax: ['es2023'],
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: ['es2023'] is mapped down to es2022 for Rspack target, so it won’t actually target ES2023. Consider using es2022 explicitly (or a node XX target aligned with the supported engines) so the intended compilation target is clear.

Suggested change
syntax: ['es2023'],
syntax: ['es2022'],

Copilot uses AI. Check for mistakes.
Comment on lines +15 to 17
- Rslib >= 0.20 requires Node.js version 20.19+, 22.12+.
- Rslib < 0.20 requires Node.js 18.12.0 or higher.

Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This “Version requirements” tip only lists Node.js versions even though the section claims Node/Deno/Bun runtimes. Clarify that these requirements apply when using the Node.js runtime (and/or document minimum supported Deno/Bun versions) to prevent reader confusion.

Suggested change
- Rslib >= 0.20 requires Node.js version 20.19+, 22.12+.
- Rslib < 0.20 requires Node.js 18.12.0 or higher.
These version requirements apply when using the Node.js runtime:
- Rslib >= 0.20 requires Node.js version 20.19+ or 22.12+.
- Rslib < 0.20 requires Node.js 18.12.0 or higher.
When using Deno or Bun, ensure that your runtime (and any Node.js compatibility layer it provides) supports at least the corresponding Node.js version required by your Rslib version.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +16
:::tip 版本要求

下面是通过 nvm 安装的例子:
- Rslib >= 0.20 要求 Node.js 版本 20.19+,22.12+。
- Rslib < 0.20 要求 Node.js 18.12.0 或更高版本。
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“版本要求”只列了 Node.js 版本,但本节同时提到 Node/Deno/Bun 运行时。建议补充说明这些要求仅适用于使用 Node.js 运行时(以及如有需要补充 Deno/Bun 的最低版本),避免读者误解。

Copilot uses AI. Check for mistakes.
Comment on lines 17 to 21
strategy:
matrix:
runner: [ubuntu-latest, windows-latest]
node-version: [22]
node-version: [24]
uses: ./.github/workflows/reusable-test.yml
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now runs tests only on Node 24, but the repo's declared engines are "^20.19.0 || >=22.12.0". Add CI coverage for the minimum supported versions (e.g. 20.19.x and 22.12.x) to avoid shipping regressions that only reproduce on the supported floor versions.

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 48
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 22
node-version: 24
cache: 'pnpm'
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release workflow was bumped to Node 24, which isn't mentioned in the PR summary and reduces confidence that publishing is validated on the supported LTS floors (20.19.x / 22.12.x). Consider pinning release to a supported LTS (or running a small matrix) so the release environment matches the stated engine range.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants