Skip to content
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

⬆️ (deps) [email protected] 🧨 [skip ci] #2812

Merged
merged 3 commits into from
Sep 22, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 16, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
date-fns 3.6.0 -> 4.1.0 age adoption passing confidence
date-fns ^3.3.1 -> ^3.3.1 || ^4.0.0 age adoption passing confidence

Release Notes

date-fns/date-fns (date-fns)

v4.1.0

Compare Source

This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.

Make sure also upgrade TZDate to v1.0.2 as it includes a bunch of critical bug fixes.

Fixed
  • Fixed internal constructFrom throwing an exception on null arguments. While null isn't allowed, the functions should rather return Invalid Date or NaN in such cases. See #​3885.
Added
  • Added missing time zone support to format, formatISO, formatISO9075, formatRelative and formatRFC3339. See #​3886.

v4.0.0

Compare Source

I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.

Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward.

Read more about the release in the announcement blog post.

- Sasha @​kossnocorp

Added
  • Added time zones support via @date-fns/tz's TZDate class and tz helper function. See its README for the details about the API.

  • All relevant functions now accept the context in option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone:

    import { addDays, startOfDay } from "date-fns";
    import { tz } from "@​date-fns/tz";
    
    startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));
    //=> "2024-09-16T00:00:00.000+08:00"

    In the example, addDays will get the current date and time in Singapore and add 5 days to it. startOfDay will inherit the date type and return the start of the day in Singapore.

Changed
  • The function arguments, as well as Interval's start and end, now can be of different types, allowing you to mix UTCDate, TZDate, Date, and other extensions, as well as primitives (strings and numbers).

    The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context in option or the first encountered argument object type. The Interval's start and end will be considered separately, starting from start.

    In the given example, the result will be in the TZDate as the first argument is a number, and the start takes precedence over the end.

    clamp(Date.now(), {
      start: new TZDate(start, "Asia/Singapore"),
      end: new UTCDate(),
    });
    //=> TZDate
  • BREAKING: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you running the type checker after the upgrade. If there are unfixable problems, please open an issue.

  • BREAKING: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please report them.

Fixed
  • Fixed CDN build compatibility with jQuery and other tools that expose $ by properly wrapping the code in an IIFE.

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 becomes conflicted, or you tick the rebase/retry checkbox.

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


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


Add-On Updates

  • Remove @jeromefitz/date-fns-tz
  • Add @date-fns/tz, @date-fns/utc (may not be necessary)
  • Refactor ./packages/next-notion/src/utils/getAwsImage.ts => isImageExpired

Verification:

jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:58.4558Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T12:31:19.940Z'
jeromefitzgerald.com:dev: 'diff:         29678 (494.6333333333333 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    y'
jeromefitzgerald.com:dev: '---'
jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:58.4558Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T12:31:19.940Z'
jeromefitzgerald.com:dev: 'diff:         29678 (494.6333333333333 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    y'
jeromefitzgerald.com:dev: '---'
jeromefitzgerald.com:dev: 'SEO_IMAGE_IS_AWS: y'
jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:59.4559Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T21:45:58.919Z'
jeromefitzgerald.com:dev: 'diff:         -3599 (-59.983333333333334 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    n'
jeromefitzgerald.com:dev: '---'

@renovate renovate bot added 📦 Dependencies 💥 Breaking 💥 Pull requests that update a dependency file: Major Version 🛑️ Do Not Merge Do not merge until further notice labels Sep 16, 2024
@renovate renovate bot requested a review from JeromeFitz September 16, 2024 04:18
@renovate renovate bot changed the title ⬆️ (deps) [email protected] 🧨 [skip ci] ⬆️ (deps) [email protected] 🧨 [skip ci] Sep 17, 2024
@renovate renovate bot force-pushed the deps/date-fns-4.x branch 2 times, most recently from 2720a21 to c89bdac Compare September 18, 2024 02:51
Verification:
```bash
jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:58.4558Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T12:31:19.940Z'
jeromefitzgerald.com:dev: 'diff:         29678 (494.6333333333333 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    y'
jeromefitzgerald.com:dev: '---'
jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:58.4558Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T12:31:19.940Z'
jeromefitzgerald.com:dev: 'diff:         29678 (494.6333333333333 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    y'
jeromefitzgerald.com:dev: '---'
jeromefitzgerald.com:dev: 'SEO_IMAGE_IS_AWS: y'
jeromefitzgerald.com:dev: 'utc:          2024-09-22T20:45:59.4559Z'
jeromefitzgerald.com:dev: 'expiry_time:  2024-09-22T21:45:58.919Z'
jeromefitzgerald.com:dev: 'diff:         -3599 (-59.983333333333334 minutes)'
jeromefitzgerald.com:dev: 'isExpired:    n'
jeromefitzgerald.com:dev: '---'
```
Copy link
Contributor Author

renovate bot commented Sep 22, 2024

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.

fix import
@JeromeFitz JeromeFitz added 📦️ Dependencies Pull requests that update a dependency file 🥳️ LGTM Automerge: Let's Get This Merged and removed 🛑️ Do Not Merge Do not merge until further notice labels Sep 22, 2024
@kodiakhq kodiakhq bot merged commit b894799 into main Sep 22, 2024
2 checks passed
@kodiakhq kodiakhq bot deleted the deps/date-fns-4.x branch September 22, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Dependencies 💥 Breaking 💥 Pull requests that update a dependency file: Major Version 📦️ Dependencies Pull requests that update a dependency file 🥳️ LGTM Automerge: Let's Get This Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant