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

fix(deps): ⬆️ upgrade dependencies (major) to v4 (major) #79

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 12, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
date-fns 2.29.3 -> 4.1.0 age adoption passing confidence
jwt-decode 3.1.2 -> 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.

v3.6.0

Compare Source

On this release worked @​kossnocorp and @​world1dan. Also, thanks to @​seated for sponsoring me.

Fixed
Added

v3.5.0

Compare Source

Kudos to @​fturmel, @​kossnocorp, @​makstyle119, @​tan75, @​marcreichel, @​tareknatsheh and @​audunru for working on the release. Also, thanks to @​seated for sponsoring me.

Fixed
Added
  • Added the constructNow function that creates the current date using the passed reference date's constructor.

v3.4.0

Compare Source

Kudos to @​kossnocorp, @​sakamossan and @​Revan99 for working on the release. Also thanks to @​seated for sponsoring me.

Added

v3.3.1

Compare Source

Kudos to @​kossnocorp and @​fturmel for working on the release.

Fixed
  • Fixed DST issue in getOverlappingDaysInIntervals, resulting in an inconsistent number of days returned for intervals starting and ending in different DST periods.

  • Fixed functions incorrectly using trunc instead of round. The bug was introduced in v3.3.0. The affected functions: differenceInCalendarDays, differenceInCalendarISOWeeks, differenceInCalendarWeeks, getISOWeek, getWeek, and getISOWeeksInYear.

v3.3.0

Compare Source

On this release worked @​kossnocorp, @​TheKvikk, @​fturmel and @​ckcherry23.

Fixed
  • Fixed the bug in getOverlappingDaysInIntervals caused by incorrect sorting of interval components that led to 0 for timestamps of different lengths.

  • Fixed bugs when working with negative numbers caused by using Math.floor (-1.1-2) instead of Math.trunc (-1.1-1). Most of the conversion functions (i.e., hoursToMinutes) were affected when passing some negative fractional input. Also, some other functions that could be possibly affected by unfortunate timezone/date combinations were fixed.

    The functions that were affected: format, parse, getUnixTime, daysToWeeks, hoursToMilliseconds, hoursToMinutes, hoursToSeconds, milliseconds, minutesToMilliseconds, millisecondsToMinutes, monthsToYears, millisecondsToHours, millisecondsToSeconds, minutesToHours, minutesToSeconds, yearsToQuarters, yearsToMonths, yearsToDays, weeksToDays, secondsToMinutes, secondsToHours, quartersToYears, quartersToMonths and monthsToQuarters.

  • Fixed the Czech locale's formatDistance to include 1 in formatDistance.

  • Fixed differenceInSeconds and other functions relying on rounding options that can produce a negative 0.

  • Added a preprocessor to the locales API, enabling fixing a long-standing bug in the French locale. (#​1391)

  • Added missing yearsToDays to the FP submodule.

  • Made functions using rounding methods always return 0 instead of -0.

Added

v3.2.0

Compare Source

This release is brought to you by @​kossnocorp, @​fturmel, @​grossbart, @​MelvinVermeer, and @​jcarstairs-scottlogic.

Fixed
Added
  • Added exports of format, lightFormat, and parse internals that enable 3rd-parties to consume those.

v3.1.0

Compare Source

This release is brought to you by @​kossnocorp, @​makstyle119 and @​dmgawel.

Fixed
Added

v3.0.6

Compare Source

On this release worked @​imwh0im, @​jamcry and @​tyrw.

Fixed

v3.0.5

Compare Source

This release is brought to you by @​goku4199.

Fixed

v3.0.4

Compare Source

This release is brought to you by @​kossnocorp.

Fixed
  • Fixed isWithinInterval bug caused by incorrectly sorting dates (#​3623).

v3.0.3

Compare Source

Fixed
  • Rolled back pointing ESM types to the same d.ts files. Instead now it copies the content to avoid the Masquerading as CJS problem reported by "Are the types wrong?".

v3.0.2

Compare Source

Fixed

v3.0.1

Compare Source

Fixed
  • Fixed an error in certain environments caused by d.mts files exporting only types.

v3.0.0

Compare Source

Changed
  • BREAKING: date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the package.json. The ESM files now have .mjs extension.

  • BREAKING: The package now has a flat structure, meaning functions are now named node_modules/date-fns/add.mjs, locales are node_modules/date-fns/locale/enUS.mjs, etc.

  • BREAKING: Now all file content’s exported via named exports instead of export default, which will require change direct imports i.e. const addDays = require(‘date-fns/addDays’) to const { addDays } = require(‘date-fns/addDays’).

  • BREAKING: TypeScript types are now completely rewritten, check out the d.ts files for more information.

  • BREAKING: constants now is not exported via the index, so to import one use import { daysInYear } from "date-fns/constants";. It improves compatibility with setups that modularize imports like Next.js.

  • BREAKING: Functions now don’t check the number of passed arguments, delegating this task to type checkers. The functions are now slimmer because of this.

  • BREAKING The arguments are not explicitly converted to the target types. Instead, they are passed as is, delegating this task to type checkers.

  • BREAKING: Functions that accept Interval arguments now do not throw an error if the start is before the end and handle it as a negative interval. If one of the properties in an Invalid Date, these functions also do not throw and handle them as invalid intervals.

    • areIntervalsOverlapping normalize intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. When comparing intervals with one of the properties being Invalid Date, the function will return false unless the others are valid and equal, given the inclusive option is passed. Otherwise, and when even one of the intervals has both properties invalid, the function will always return false.

    • getOverlappingDaysInIntervals now normalizes intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. If any of the intervals’ properties is an Invalid Date, the function will always return 0.

    • isWithinInterval now normalizes intervals before comparison, so { start: a, end: b } is practically equivalent to { start: b, end: a }. If any of the intervals’ properties is an Invalid Date, the function will always return false.

    • intervalToDuration now returns negative durations for negative intervals. If one or both of the interval properties are invalid, the function will return an empty object.

    • The eachXOfInterval functions (eachDayOfInterval, eachHourOfInterval, eachMinuteOfInterval, eachMonthOfInterval, eachWeekendOfInterval, eachWeekendOfMonth, eachWeekendOfYear, eachWeekOfInterval, eachYearOfInterval) now return a reversed array if the passed interval’s start is after the end. Invalid properties will result in an empty array. Functions that accept the step option now also allow negative, 0, and NaN values and return reversed results if the step is negative and an empty array otherwise.

  • BREAKING: intervalToDuration now skips 0 values in the resulting duration, resulting in more compact objects with only relevant properties.

  • BREAKING: roundToNearestMinutes now returns Invalid Date instead of throwing an error when nearestTo option is less than 1 or more than 30.

  • BREAKING: IE is no longer supported.

  • BREAKING: Now all functions use Math.trunc rounding method where rounding is required. The behavior is configurable on a per-function basis.

  • BREAKING: Undocumented onlyNumeric option was removed from nn and sv locales. If you relied on it, please contact me.

  • BREAKING: Flow is not supported anymore. If you relied on it, please contact me.

  • BREAKING: The locales now use regular functions instead of the UTC version, which should not break any code unless you used locales directly.

Added
  • All functions that accept date arguments now also accept strings.

  • All functions now export options interfaces.

  • Now functions allow passing custom Date extensions like UTCDate. They will detect and use the arguments constructor to generate the result of the same class.

  • eachMonthOfInterval, eachQuarterOfInterval, eachWeekOfInterval, and eachYearOfInterval now accept the step option like most of the eachXOfInterval functions.

  • A new interval function that validates interval, emulating the v2 interval functions behavior.

  • differenceInX functions now accept options and allow setting up roundingMethod that configures how the result is rounded. Math.trunc is the default method.

v2.30.0

Compare Source

Kudos to @​kossnocorp and @​Andarist for working on the release.

Changes
  • Fixed increased build size after enabling compatibility with older browsers in the previous release. This was done by adding @​babel/runtime as a dependency. See more details.
auth0/jwt-decode (jwt-decode)

v4.0.0

Compare Source

Full Changelog

A new version of the library, including a couple of improvements:

  • No longer include a polyfill for atob, as this is supported in all major browsers (and node environments > 14).
  • Compile to ES2017, dropping support for anything that does not support ES2017 (which should be very limited according to caniuse)
  • Use Node's atob when running on node.
  • Drop support for Node 14 and 16, add support for Node 20.
  • Add support for package.json's exports field, for better CJS/ESM support
  • Reorganize build artifacts for better CJS/ESM support (cjs and esm needs to be their own directory with a cjs specific package.json file)
  • Drop manual UMD bundle creation in index.standalone.ts, but rely on rollup instead.
  • Infer JwtPayload and JwtHeader default types from the header argument by using overloads.

Even though some users might experience breaking changes, mostly because of the exports field, the majority should be able to update without making any changes, assuming the SDK is used in environments with support for atob.

Migration to v4.0.0

The jwtDecode function is now no longer the default export, and is instead provided as a named export. Make sure to update your code in places where you are importing this function:

-import jwtDecodefrom "jwt-decode";
+import { jwtDecode } from "jwt-decode";

Configuration

📅 Schedule: Branch creation - "before 4am on Monday" in timezone Asia/Kolkata, 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 these updates 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 added the Dependency ⏫ Pull requests that update a dependency file label Nov 12, 2023
Copy link

vercel bot commented Nov 12, 2023

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

Name Status Preview Comments Updated (UTC)
bookmark-tags 🛑 Canceled (Inspect) Sep 25, 2024 3:15pm

kodiakhq[bot]
kodiakhq bot previously approved these changes Nov 12, 2023
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch 3 times, most recently from 41f76cd to 830f02c Compare November 12, 2023 19:33
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 830f02c to 6e169f7 Compare November 12, 2023 19:48
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 6e169f7 to 27b51c5 Compare November 12, 2023 20:02
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 27b51c5 to ebf3228 Compare November 12, 2023 20:17
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from ebf3228 to 6a3aa02 Compare November 12, 2023 20:26
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 6a3aa02 to dcb6d14 Compare November 19, 2023 18:54
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from dcb6d14 to 997d404 Compare November 19, 2023 19:03
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 997d404 to da5a064 Compare November 19, 2023 19:06
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from da5a064 to 58b07d5 Compare November 30, 2023 06:45
kodiakhq[bot]
kodiakhq bot previously approved these changes Nov 30, 2023
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch 2 times, most recently from a9b90e7 to 4ef1297 Compare November 30, 2023 06:53
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 4ef1297 to a024133 Compare November 30, 2023 06:59
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from a024133 to 85e307a Compare December 3, 2023 21:21
Copy link
Contributor Author

renovate bot commented Aug 26, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: pnpm-lock.yaml
undefined
 ERROR  Cannot read properties of undefined (reading 'startsWith')

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at refIsLocalTarball (/opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:116581:18)
    at any2 (/opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:179315:15)
    at /opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:21339:20
    at f2 (/opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:21288:18)
    at hasLocalTarballDepsInRoot (/opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:179578:32)
    at /opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:179478:37
    at /opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:179248:29
    at /opt/containerbase/tools/pnpm/9.10.0/20.17.0/node_modules/pnpm/dist/pnpm.cjs:50328:59

kodiakhq[bot]
kodiakhq bot previously approved these changes Aug 26, 2024
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from b240c67 to 2cb8d78 Compare September 1, 2024 19:17
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 2cb8d78 to 33656ca Compare September 19, 2024 03:38
@renovate renovate bot changed the title fix(deps): ⬆️ upgrade jwt-decode to v4 fix(deps): ⬆️ upgrade dependencies (major) to v4 (major) Sep 19, 2024
kodiakhq[bot]
kodiakhq bot previously approved these changes Sep 19, 2024
@renovate renovate bot force-pushed the renovate/major-4-dependencies-(major) branch from 1d7401b to 4ea5f51 Compare September 25, 2024 15:04
Copy link
Contributor Author

renovate bot commented Sep 25, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency ⏫ Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants