Skip to content

chore(deps): bump @js-temporal/polyfill from 0.4.4 to 0.5.1 #5679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 30, 2025

Bumps @js-temporal/polyfill from 0.4.4 to 0.5.0.

Release notes

Sourced from @​js-temporal/polyfill's releases.

Version 0.5.0

Please see CHANGELOG.md for a summary of changes in this release.

Thanks to everyone who contributed!

Changelog

Sourced from @​js-temporal/polyfill's changelog.

0.5.0

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

... (truncated)

Commits
  • 025c8f9 Release 0.5.0 changelog
  • d5a2d4a Update deps to fix security audit
  • 77ae571 Remove runtime dependency on tslib
  • 29ea965 Remove formatAsDecimalNumber dead code
  • 2ecc4e9 Use CreateTemporalZonedDateTime when internally creating instances of ZDT
  • f6bb8bc Use CreateTemporalInstant when internally creating instances of Instant
  • 6e485c5 Less repetition in converting epoch milliseconds / epoch nanoseconds
  • 07298e8 Fix -0 and argument type in ApplyUnsignedRoundingMode
  • 0e71ed3 Add missing return type
  • badaf27 Less repetition in receiver checks
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Mar 30, 2025
Copy link
Contributor Author

dependabot bot commented on behalf of github Apr 1, 2025

A newer version of @​js-temporal/polyfill exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@ZhongpinWang
Copy link
Contributor

@dependabot recreate

Bumps [@js-temporal/polyfill](https://github.com/js-temporal/temporal-polyfill) from 0.4.4 to 0.5.0.
- [Release notes](https://github.com/js-temporal/temporal-polyfill/releases)
- [Changelog](https://github.com/js-temporal/temporal-polyfill/blob/main/CHANGELOG.md)
- [Commits](js-temporal/temporal-polyfill@v0.4.4...v0.5.0)

---
updated-dependencies:
- dependency-name: "@js-temporal/polyfill"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/main/js-temporal/polyfill-0.5.0 branch from 02a94cc to c8bed03 Compare April 10, 2025 10:04
@ZhongpinWang ZhongpinWang changed the title chore(deps): bump @js-temporal/polyfill from 0.4.4 to 0.5.0 chore(deps): bump @js-temporal/polyfill from 0.4.4 to 0.5.1 Apr 10, 2025
@ZhongpinWang
Copy link
Contributor

ZhongpinWang commented Apr 10, 2025

Temporal.TimeZone was removed in 0.5.0.

Also epochSeconds was removed.

https://github.com/js-temporal/temporal-polyfill/blob/025c8f963b115a582d3e6a596c6fd1e0f622205e/CHANGELOG.md

@ZhongpinWang ZhongpinWang requested a review from deekshas8 April 10, 2025 13:25
Copy link
Contributor

@deekshas8 deekshas8 left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this !

@deekshas8 deekshas8 merged commit 2503303 into main Apr 11, 2025
16 checks passed
@deekshas8 deekshas8 deleted the dependabot/npm_and_yarn/main/js-temporal/polyfill-0.5.0 branch April 11, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants