Skip to content

fix: bump date-fns from 2.30.0 to 4.4.0#2347

Merged
adriangohjw merged 5 commits into
mainfrom
dependabot/npm_and_yarn/date-fns-4.4.0
Jun 8, 2026
Merged

fix: bump date-fns from 2.30.0 to 4.4.0#2347
adriangohjw merged 5 commits into
mainfrom
dependabot/npm_and_yarn/date-fns-4.4.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Jun 8, 2026

Bumps date-fns from 2.30.0 to 4.4.0.

Release notes

Sourced from date-fns's releases.

v4.4.0

This release revisits the approach to CDN usage and introduces a new package, @date-fns/cdn and deprecates the date-fns CDN scripts. It allowed reducing the zipped package size from 5.83 MB down to 3.96 MB without introducing any breaking changes.

In v5.0.0-alpha.0 where CDN scripts are completely removed from date-fns the change is more significant and brings the zipped package size down to 2.89 MB.

It is just the first step in optimizing the package size. Expect further size reduction in the future v4 and v5 versions.

Changed

  • DEPRECATED: The date-fns CDN scripts are now deprecated and will be removed in the next major release. Please switch to the new @date-fns/cdn package for CDN usage.

  • Removed CDN source maps to reduce the package size. If you rely on them, please switch to the new @date-fns/cdn package that still includes them.

v4.3.0

Kudos to @​ImRodry and @​puneetdixit200 for their contributions.

Fixed

v4.2.1

Fixed

  • Fixed type definitions missing in v4.2.0 due to TypeScript misconfiguration.

v4.2.0

This is a minor release in all senses, it only includes documentation updates (first of many) that points to the new You Don't Need date-fns* page.

* Not really

Changed

  • Added Temporal API references to the JSDoc annotations of add, addBusinessDays, and addDays.

v4.1.0

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

... (truncated)

Commits
  • cd53d25 Promote to v4.4.0
  • d948ec1 Preserve but deprecate CDN versions for v4, set up v5 with polyfills
  • ee65753 Add root mise :format task
  • 9f5bdf5 Add positional argument to test/smoke.sh script
  • 651ead6 Split CDN bundles into separate @​date-fns/cdn package
  • 224c1a2 Deprecate type tests as attw hangs on date-fns package
  • 7bb2842 Switch PACKAGE_OUTPUT_PATH to --dist flag in the package build script
  • b6ad5ac Add flags to control package build script
  • 424a783 Fix docs release after moving to monorepo setup
  • f95bcf1 (docs): Add missing tsx dependency
  • 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 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)

Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.30.0 to 4.4.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Commits](date-fns/date-fns@v2.30.0...v4.4.0)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jun 8, 2026
@dependabot dependabot Bot requested a review from a team as a code owner June 8, 2026 10:38
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jun 8, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
isomer-studio Error Error Jun 8, 2026 2:48pm

Request Review

- Updated conditions for running the review job to improve specificity.
- Added permissions for various tools to facilitate the review process.
- Cleaned up formatting for better readability.

These changes improve the workflow's functionality and maintainability during Dependabot reviews.
@adriangohjw
Copy link
Copy Markdown
Contributor

date-fns: 2.30.0 → 4.4.0

Verdict: NEEDS REVIEW (run pnpm typecheck before merging — all runtime behavior is compatible)

Functions used in codebase: add, addDays, addHours, addMinutes, addSeconds, differenceInDays, differenceInMinutes, endOfMonth, format, isBefore, isMatch, isSameDay, isValid, parse, set, startOfDay, startOfMonth, subDays, subMinutes, subMonths, subYears. Import paths: "date-fns" and "date-fns/format".

Version Breaking change Impact Where in codebase Migration hint
v3.0.0 TypeScript types completely rewritten (handcrafted, replaces auto-generated JSDoc types) Uncertain All 30 files using date-fns Run pnpm typecheck to surface any type errors before merging
v4.0.0 ESM-first; CJS still supported but may break in certain environments Uncertain apps/studio (Next.js 15) Next.js 15 handles ESM — verify with pnpm build if unsure
v4.0.0 Additional TypeScript type changes (internal/nuanced; maintainer recommends running type checker) Uncertain All 30 files using date-fns Run pnpm typecheck
v3.0.0 Math.trunc replaces Math.floor for rounding in differenceIn* and other functions Safe lastLogin.ts:12, gazette.router.ts:821, ViewGazetteModal.tsx:63 All usages pass new Date() as first arg vs a past date → always positive → trunc and floor are equivalent
v3.0.0 constants no longer exported from main index; must import from "date-fns/constants" Safe No constants are imported anywhere in the codebase
v3.0.0 Default exports removed from deep subpath imports (e.g. require('date-fns/addDays') must destructure) Safe apps/studio/src/lib/dates.ts:1 Only deep subpath used is import { format } from "date-fns/format" — already a named export
v3.0.0 /esm subpath removed Safe No date-fns/esm imports in source files
v3.0.0 Interval functions no longer throw on reversed/invalid intervals — treat as negative/empty instead Safe None of areIntervalsOverlapping, intervalToDuration, isWithinInterval, eachXOfInterval are used
v3.0.0 roundToNearestMinutes returns Invalid Date instead of throwing when nearestTo out of range Safe roundToNearestMinutes not used
v3.0.0 Arguments no longer validated at runtime (delegated to type checker) Safe Reduces bundle size; correct usage unaffected
v3.0.0 IE11 support dropped Safe Not relevant for a server/modern-browser app
v3.0.0 Flow types removed Safe Project uses TypeScript
v2→v3 date-fns-tz compatibility: utcToZonedTime renamed to toZonedTime in date-fns-tz v3 Safe inactiveUsers.service.ts:2, templates.ts:1 Codebase already uses toZonedTime (v3 name); workspace pins date-fns-tz: ^3.1.3

Summary: All functions used by this codebase (format, parse, add, isBefore, etc.) are present and behaviorally unchanged in v4. The only real risk is TypeScript type errors from the v3/v4 type rewrites — run pnpm typecheck to confirm before merging.

@adriangohjw adriangohjw enabled auto-merge (squash) June 8, 2026 14:59
@adriangohjw adriangohjw merged commit a8e5144 into main Jun 8, 2026
17 of 19 checks passed
@adriangohjw adriangohjw deleted the dependabot/npm_and_yarn/date-fns-4.4.0 branch June 8, 2026 15:00
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.

1 participant