feat(globals): add Temporal to browser/worker globals#9466
feat(globals): add Temporal to browser/worker globals#9466mixelburg wants to merge 2 commits intobiomejs:mainfrom
Conversation
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 detectedLatest commit: a4b3baf The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
WalkthroughThis pull request adds Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
crates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/add-temporal-global.mdcrates/biome_js_analyze/src/globals/javascript/web.rscrates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js
| 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. |
There was a problem hiding this comment.
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.
| 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.
Merging this PR will not alter performance
Comparing Footnotes
|
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
Temporalto the JavaScriptBROWSER,SERVICE_WORKER, andWEB_WORKERglobals lists so that thenoUndeclaredVariablesrule (and related rules) no longer flagTemporalas an undeclared identifier in browser/worker environments.Motivation
Temporalreached TC39 Stage 4 and has shipped in Chrome 127+ and Firefox 139+. It is already present in sindresorhus/globals under thebrowser,serviceworker, andworkersections — the same source used for Biome's globals files.Closes #9464
Changes
crates/biome_js_analyze/src/globals/javascript/web.rs: add"Temporal"toBROWSER(before"Text"),SERVICE_WORKER(before"TextDecoder"), andWEB_WORKER(before"TextDecoder") — maintaining sorted ordercrates/biome_js_analyze/tests/specs/correctness/noUndeclaredVariables/noUndeclaredVariables.js: addTemporal.Now.instant()to the valid-uses sectionTest Plan