Skip to content

docs: note Node.js Timeout return for global timers (2.8)#3068

Merged
bartlomieju merged 2 commits into
denoland:2.8from
lunadogbot:docs/2.8-node-timers-default
May 20, 2026
Merged

docs: note Node.js Timeout return for global timers (2.8)#3068
bartlomieju merged 2 commits into
denoland:2.8from
lunadogbot:docs/2.8-node-timers-default

Conversation

@lunadogbot
Copy link
Copy Markdown
Contributor

Summary

Documents the global-timer behavior change shipping in Deno 2.8 (denoland/deno#33249). Global setTimeout / setInterval now return a Node.js
Timeout object instead of a number, matching Node.js semantics.

  • Adds a setTimeout / setInterval bullet to the "Node.js global objects" section in runtime/fundamentals/node.md.
  • Calls out the new .ref() / .unref() / .refresh() / .hasRef() methods.
  • Notes that numeric coercion still works via Symbol.toPrimitive, so existing code is unaffected.

Test plan

  • deno task serve renders the new bullet inside the existing list.

Deno 2.8 switches the global setTimeout/setInterval/clearTimeout/
clearInterval to use Node.js timer semantics by default — the timer ID
is now a Node.js \`Timeout\` object (with \`.ref()\`/\`.unref()\` etc.)
rather than a number. Numeric coercion still works, so most existing
code is unaffected. Documents the change in the Node compat guide.

Refs denoland/deno#33249
@crowlKats crowlKats changed the base branch from main to 2.8 May 5, 2026 11:46
Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

The timer note matches denoland/deno#33249: globals now use Node timer APIs, and the upstream tests changed setTimeout()/setInterval() expectations from number to object while clearTimeout(t) remains covered. No check-runs are reported for this 2.8-branch PR, so holding approval until CI is green.

  • nit: last_modified: 2026-02-10 should be bumped for this content addition.

@bartlomieju bartlomieju merged commit d966847 into denoland:2.8 May 20, 2026
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