docs: note Node.js Timeout return for global timers (2.8)#3068
Merged
bartlomieju merged 2 commits intoMay 20, 2026
Conversation
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
fibibot
reviewed
May 17, 2026
Contributor
fibibot
left a comment
There was a problem hiding this comment.
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-10should be bumped for this content addition.
bartlomieju
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the global-timer behavior change shipping in Deno 2.8 (denoland/deno#33249). Global
setTimeout/setIntervalnow return a Node.jsTimeoutobject instead of a number, matching Node.js semantics.setTimeout/setIntervalbullet to the "Node.js global objects" section inruntime/fundamentals/node.md..ref()/.unref()/.refresh()/.hasRef()methods.Symbol.toPrimitive, so existing code is unaffected.Test plan
deno task serverenders the new bullet inside the existing list.