Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 28, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@js-temporal/polyfill ^0.4.4 -> ^0.5.0 age adoption passing confidence

Release Notes

js-temporal/temporal-polyfill (@​js-temporal/polyfill)

v0.5.0

Compare Source

Breaking changes:

This major update reflects all changes to the Temporal proposal adopted by TC39 between May 2023 and March 2025.

The majority of these changes were made in the June 2024 TC39 meeting (slides here) where the scope of Temporal was reduced at the request of JS engine implementers who were concerned about the size impact of adding Temporal to distributions on limited-capacity devices like low-end Android phones and Apple Watch.

  • User-defined calendars have been removed.
    Calendars are now represented by strings representing built-in calendars.
    Without custom calendars, the huge surface area of Temporal.Calendar was not necessary, and that type was removed from the proposal.
  • User-defined time zones have been removed.
    Time zones are now only represented by string identifiers representing built-in time zones: either a Zone or Link name from the IANA Time Zone Database, or a time zone offset with minutes precision.
    Temporal.TimeZone has also been removed, and its methods replaced by the following:
    • getPreviousTransition/getNextTransition - use the new getTimeZoneTransition method of Temporal.ZoneDateTime.
    • equals - use ZonedDateTime.prototype.equals using the same instant and calendar.
    • Other Temporal.TimeZone methods can use the corresponding methods on Temporal.ZonedDateTime.
  • Many convenience methods have been removed. In all cases, the same functionality is available using other Temporal methods:
    • Removed getISOFields() methods. Instead use withCalendar('iso8601') and the individual property getters.
    • Removed withPlainDate() methods. Instead use with({ year, monthCode, day }).
    • Removed toPlainDateTime() and toZonedDateTime() methods of Temporal.PlainTime. Instead use the same-named methods on Temporal.PlainDate to combine a date and a time.
    • Removed epochSeconds and epochMicroseconds properties. Instead calculate epoch seconds with Math.floor(epochMilliseconds / 1000) and epoch microseconds with epochNanoseconds / 1000n + ((epochNanoseconds % 1000n) < 0n ? -1n : 0n).
    • Removed toPlainYearMonth() and toPlainMonthDay() methods of Temporal.PlainDateTime and Temporal.ZonedDateTime. Instead use toPlainDate() and then the methods on Temporal.PlainDate.
    • Removed Temporal.Instant.prototype.toZonedDateTime and Temporal.Now.zonedDateTime. Instead use toZonedDateTimeISO()/zonedDateTimeISO() to create a Temporal.ZonedDateTime object using the ISO8601 calendar, and then use withCalendar() if a non-ISO calendar is desired.
  • The relativeTo parameter is no longer accepted in Temporal.Duration.prototype.add and subtract. Instead take the relativeTo object, add the two durations to it, and difference it with the original using until().
  • Throw if there are multiple calendar annotations in a string and one has the critical flag (Proposal PR)
  • Changed the way calculations are done with Temporal.Duration, and placed limits on each of the units. Years, months, and weeks are each limited to 2³²−1. The other units (days through nanoseconds) are collectively limited: taken together, they must be less than Number.MAX_SAFE_INTEGER seconds plus 999,999,999 nanoseconds. This has few user-visible changes, but it does mean that some durations are no longer allowed (for example, Temporal.Duration.from({ seconds: Number.MAX_VALUE }).) (Proposal PR 1, PR 2, PR 3)
  • Offset time zones are now limited to minutes precision. That is, you can have [+01:01] but not [+01:00:01] or [+01:00:00.000000001] (Proposal PR)
  • For APIs that take a string, other primitives are no longer coerced to strings. Technically, you could previously do Temporal.PlainDate.from(20230711) and it would be treated as Temporal.PlainDate.from("20230711"). This is no longer the case. (Proposal PR)
  • Temporal.PlainYearMonth.prototype.toPlainDate and Temporal.PlainMonthDay.prototype.toPlainDate now have clamping behaviour instead of throwing if the resulting PlainDate would be invalid. For example, birthday.toPlainDate({ year: 2025 }) will now return February 28, 2025 if the birthday in question if February 29. (Proposal PR)
    • If you still want the throwing behaviour, you can get it more verbosely:
    const { monthCode, day } = birthday;
    Temporal.PlainDate.from({ year: 2025, monthCode, day }, { overflow: 'reject' });
  • Not all calendars have a week numbering scheme, so weekOfYear and yearOfWeek methods may now return undefined (Proposal PR)
  • In Temporal.Duration.prototype.round(), rounding to a >1 increment of a calendar smallestUnit while simultaneously balancing to a calendar largestUnit is now disallowed and will throw (Proposal PR)
  • Creating a Temporal.MonthDay in a non-ISO8601 calendar will now throw if the year is too far (>¼ million years) in the future or past (Proposal PR)

Bug fixes:

  • Fixed several bugs in duration calculations, particularly rounding (Proposal PR 1, PR 2, PR 3, PR 4, PR 5)
  • Fixed a bug in start-of-day calculations (Proposal PR)
  • Many small bug fixes to bring the polyfill into better compliance with the Temporal proposal

Non-breaking changes

  • Many improvements in performance and bundle size
  • Remove runtime dependency on tslib. Now this package has only one runtime dependency: JSBI (a polyfill for BigInt)
  • Update dev dependencies
  • Support Node 20.x and test it in CI

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner March 28, 2025 01:49
@vercel
Copy link

vercel bot commented Mar 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-prisma-starter ❌ Failed (Inspect) Mar 28, 2025 1:52am
og-image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2025 1:52am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
www ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2025 1:52am

kodiakhq[bot]
kodiakhq bot previously approved these changes Mar 28, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

trpc-bot
trpc-bot previously approved these changes Mar 28, 2025
@autofix-ci autofix-ci bot dismissed stale reviews from trpc-bot and kodiakhq[bot] via 54bebcc March 28, 2025 01:51
@renovate
Copy link
Contributor Author

renovate bot commented Mar 28, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

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