Skip to content

[core] Mark date-fns peer dependencies as optional#4639

Merged
LukasTy merged 2 commits intomui:masterfrom
LukasTy:claude/quizzical-gauss-f4143b
Apr 17, 2026
Merged

[core] Mark date-fns peer dependencies as optional#4639
LukasTy merged 2 commits intomui:masterfrom
LukasTy:claude/quizzical-gauss-f4143b

Conversation

@LukasTy
Copy link
Copy Markdown
Member

@LukasTy LukasTy commented Apr 17, 2026

Summary

  • Mark date-fns and @date-fns/tz as optional peer dependencies in @base-ui/react. They're only used by the opt-in internal adapter at ./internals/temporal-adapter-date-fns; no public component requires them, and the sibling luxon adapter isn't listed as a peer dep at all. Consumers who don't import the adapter now install Base UI without peer-dep warnings.
  • Remove the now-unused date-fns and @date-fns/tz direct dependencies from docs/package.json (orphaned after the Calendar demos were removed in [internals] Move the exported internals to a new folder and remove private Calendar component #4505).

Fixes #4632

Test plan

  • Install @base-ui/react in a fresh project without date-fns/@date-fns/tz and confirm no peer-dependency warnings
  • Install with date-fns/@date-fns/tz present and confirm the version constraint is still validated
  • Docs build still passes

The `date-fns` and `@date-fns/tz` peer dependencies are only used by the
opt-in internal temporal adapter at `./internals/temporal-adapter-date-fns`.
No public component requires them, and the sibling `luxon` adapter is not
listed as a peer dependency at all. Mark them as optional so that
consumers who don't use the adapter don't see install-time warnings.

Fixes mui#4632
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 17, 2026

commit: f675495

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard bot commented Apr 17, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,417.95 ms 🔺+165.04 ms(+13.2%) | Renders: 53 (+0) | Paint: 2,184.67 ms 🔺+230.27 ms(+11.8%)

Test Duration Renders
Menu mount (300 instances) 166.07 ms 🔺+35.52 ms(+27.2%) 2 (+0)
Popover mount (300 instances) 129.15 ms 🔺+24.88 ms(+23.9%) 2 (+0)
Select mount (200 instances) 163.46 ms 🔺+25.78 ms(+18.7%) 3 (+0)
Checkbox mount (500 instances) 83.68 ms 🔺+11.09 ms(+15.3%) 1 (+0)
Dialog mount (300 instances) 85.86 ms 🔺+11.15 ms(+14.9%) 2 (+0)

...and 7 more. View full report

Details of benchmark changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 17, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f675495
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69e1ee68cd19ee000929a4df
😎 Deploy Preview https://deploy-preview-4639--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LukasTy LukasTy added type: bug It doesn't behave as expected. dependencies Update of dependencies. scope: temporal Changes related to the Temporal components. labels Apr 17, 2026
@LukasTy LukasTy marked this pull request as ready for review April 17, 2026 07:36
The `date-fns` and `@date-fns/tz` entries in `docs/package.json` are no
longer imported anywhere in docs after the Calendar demos were removed
in mui#4505.
@LukasTy LukasTy merged commit c0b4937 into mui:master Apr 17, 2026
24 checks passed
@LukasTy LukasTy deleted the claude/quizzical-gauss-f4143b branch April 17, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Update of dependencies. scope: temporal Changes related to the Temporal components. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected peer dependencies in v1.4.0

2 participants