Skip to content

feat(globals): add Temporal to browser/worker globals#9466

Closed
mixelburg wants to merge 2 commits intobiomejs:mainfrom
mixelburg:feat/add-temporal-global
Closed

feat(globals): add Temporal to browser/worker globals#9466
mixelburg wants to merge 2 commits intobiomejs:mainfrom
mixelburg:feat/add-temporal-global

Conversation

@mixelburg
Copy link
Copy Markdown

Note

AI Assistance Disclosure: This PR was developed with assistance from Claude Code (AI). The logic and implementation were reviewed and verified manually.

Summary

Adds Temporal to the JavaScript BROWSER, SERVICE_WORKER, and WEB_WORKER globals lists so that the noUndeclaredVariables rule (and related rules) no longer flag Temporal as an undeclared identifier in browser/worker environments.

Motivation

Temporal reached TC39 Stage 4 and has shipped in Chrome 127+ and Firefox 139+. It is already present in sindresorhus/globals under the browser, serviceworker, and worker sections — the same source used for Biome's globals files.

Closes #9464

Changes

  • crates/biome_js_analyze/src/globals/javascript/web.rs: add "Temporal" to BROWSER (before "Text"), SERVICE_WORKER (before "TextDecoder"), and WEB_WORKER (before "TextDecoder") — maintaining sorted order
  • crates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js: add Temporal.Now.instant() to the valid-uses section
  • Updated the corresponding snapshot
  • Added changeset

Test Plan

cargo test -p biome_js_analyze

Temporal (TC39 Stage 4) has shipped in Chrome and Firefox.
Add it to the BROWSER, SERVICE_WORKER, and WEB_WORKER globals lists
so that rules like noUndeclaredVariables do not flag Temporal as
an undeclared identifier in browser/worker environments.

Closes biomejs#9464
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: a4b3baf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 12, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 12, 2026

Walkthrough

This pull request adds Temporal to Biome's list of recognised browser and web worker JavaScript globals. Three global arrays in the web globals configuration have been updated to include Temporal following its Stage 4 completion and default enablement in Chrome 127 and Firefox 139. A test case has been added to verify the linter no longer reports Temporal as an undeclared variable in these environments. A changelog entry documents the patch update.

Suggested labels

A-Linter

Suggested reviewers

  • siketyan
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: adding Temporal to browser and worker global scopes.
Description check ✅ Passed The description comprehensively details the changes, motivation, and test plan, all directly related to the changeset.
Linked Issues check ✅ Passed The PR fully addresses issue #9464 by adding Temporal to BROWSER, SERVICE_WORKER, and WEB_WORKER globals as requested.
Out of Scope Changes check ✅ Passed All changes are scoped to adding Temporal to the globals lists and updating tests; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/add-temporal-global.md:
- Around line 5-10: The changeset message needs to follow the bug-fix opening
format; update the first line to begin with "Fixed [`#NUMBER`](issue link): ..."
(replacing `#NUMBER` and the URL with the actual issue reference) while keeping
the existing body that states adding the Temporal global to the BROWSER,
SERVICE_WORKER, and WEB_WORKER lists; ensure the identifier "Temporal" and the
global lists "BROWSER", "SERVICE_WORKER", and "WEB_WORKER" are mentioned
unchanged in the description.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9188f0b8-a346-40e2-8f47-f37b1752a9bc

📥 Commits

Reviewing files that changed from the base of the PR and between 4305e9d and a4b3baf.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/add-temporal-global.md
  • crates/biome_js_analyze/src/globals/javascript/web.rs
  • crates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js

Comment on lines +5 to +10
Add `Temporal` to the browser and worker JavaScript globals.

`Temporal` (TC39 Stage 4) has shipped in Chrome 127 and Firefox 139. It was
previously reported as an undeclared variable by `noUndeclaredVariables` when
used in browser or web-worker environments. The identifier is now recognised in
the `BROWSER`, `SERVICE_WORKER`, and `WEB_WORKER` global lists.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Please use the required bug-fix opening format.

This reads well, but bug-fix changesets here should begin with Fixed [#NUMBER](issue link): ....

Suggested wording
-Add `Temporal` to the browser and worker JavaScript globals.
-
-`Temporal` (TC39 Stage 4) has shipped in Chrome 127 and Firefox 139. It was
-previously reported as an undeclared variable by `noUndeclaredVariables` when
-used in browser or web-worker environments. The identifier is now recognised in
-the `BROWSER`, `SERVICE_WORKER`, and `WEB_WORKER` global lists.
+Fixed [`#9464`](https://github.com/biomejs/biome/issues/9464): `Temporal` is now recognised as a browser and worker global.
+This prevents `noUndeclaredVariables` from incorrectly reporting `Temporal` as undeclared in those environments.

As per coding guidelines: "For bug fix changesets, start with 'Fixed [#NUMBER](issue link): ...' format".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Add `Temporal` to the browser and worker JavaScript globals.
`Temporal` (TC39 Stage 4) has shipped in Chrome 127 and Firefox 139. It was
previously reported as an undeclared variable by `noUndeclaredVariables` when
used in browser or web-worker environments. The identifier is now recognised in
the `BROWSER`, `SERVICE_WORKER`, and `WEB_WORKER` global lists.
---
`@biomejs/biome`: patch
---
Fixed [`#9464`](https://github.com/biomejs/biome/issues/9464): `Temporal` is now recognised as a browser and worker global.
This prevents `noUndeclaredVariables` from incorrectly reporting `Temporal` as undeclared in those environments.
🧰 Tools
🪛 LanguageTool

[style] ~9-~9: Would you like to use the Oxford spelling “recognized”? The spelling ‘recognised’ is also correct.
Context: ...ker environments. The identifier is now recognised in the BROWSER, SERVICE_WORKER, and...

(OXFORD_SPELLING_Z_NOT_S)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/add-temporal-global.md around lines 5 - 10, The changeset message
needs to follow the bug-fix opening format; update the first line to begin with
"Fixed [`#NUMBER`](issue link): ..." (replacing `#NUMBER` and the URL with the
actual issue reference) while keeping the existing body that states adding the
Temporal global to the BROWSER, SERVICE_WORKER, and WEB_WORKER lists; ensure the
identifier "Temporal" and the global lists "BROWSER", "SERVICE_WORKER", and
"WEB_WORKER" are mentioned unchanged in the description.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 156 skipped benchmarks1


Comparing mixelburg:feat/add-temporal-global (a4b3baf) with main (4305e9d)

Open in CodSpeed

Footnotes

  1. 156 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Netail
Copy link
Copy Markdown
Member

Netail commented Mar 12, 2026

#9465

@Netail Netail closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📎 Add Temporal to list of globals

2 participants