Skip to content

[js] Remove automatic global polyfill - #1548

Merged
brandur merged 1 commit into
masterfrom
brandur-js-explicit-temporal
Oct 26, 2026
Merged

brandur merged 1 commit into
masterfrom
brandur-js-explicit-temporal

Conversation

@brandur

@brandur brandur commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 For JavaScript, remove automatic global polyfilling from library imports. River no longer
installs or replaces globalThis.Temporal. The core package keeps
@js-temporal/polyfill as a development dependency only.

When Temporal is missing, imports fail with a ConfigurationError before
modules access it. The error points to the runtime setup instructions.

The Postgres integration fixture now schedules immediately claimable jobs one
second in the past. This fixes a pre-existing Node 24 test flake reproduced on
unchanged master: the polyfill's clock can run fractionally ahead of Postgres.

@brandur

brandur commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T23:17:40.269909Z 92f6702 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 92f6702d39

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@brandur
brandur requested a review from bgentry October 26, 2026 20:08
@brandur

brandur commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@bgentry This seem okay to you?

@bgentry bgentry left a comment

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.

Implementation looks right to me: the check runs ahead of the modules that use Temporal at load, and I confirmed --import / NODE_OPTIONS preloads reach worker threads on Node 24.

One thing I'd change before merging: the CLI. On Node 24, npx riverqueue --help now dies at import with an uncaught ConfigurationError, because bin.ts statically imports run.js → @riverqueue/migrate → riverqueue. The "don't patch globals" argument is for the library; the CLI is an application and could own the polyfill itself (its own dependency, installed in bin.ts before a dynamic import of run.js). At minimum, catch the failure there and print a one-liner rather than a stack trace.

Nits: "Temporary" → "Temporal" in the description (twice); the scheduledAt minus one second change in the pg integration test looks like an unrelated flake fix worth a mention; the error message could link to #temporal-on-nodejs-24 directly.

@brandur

brandur commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author
  • Modified the CLI to bring in its own polyfill.
  • Fixed "nits" found in the last paragraph.

@brandur

brandur commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 92f6702d39

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

For JavaScript, remove automatic global polyfilling. River no longer
installs or replaces `globalThis.Temporal`. `@js-temporary/polyfill`
becomes a development dependency only.

Missing Temporary provides a helpful `ConfigurationError` before modules
evaluate and may find it missing. This produces the most helpful
possible error message to help users along.
@brandur
brandur force-pushed the brandur-js-explicit-temporal branch from 21a2cca to 1f2017a Compare October 26, 2026 23:34
@brandur
brandur merged commit 237ff56 into master Oct 26, 2026
35 checks passed
@brandur
brandur deleted the brandur-js-explicit-temporal branch October 26, 2026 23:38
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.

2 participants