mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[docs][pickers] Fix adapter version resolving when opening demo to edit

Open LukasTy opened this issue 7 months ago • 1 comments

Fixes an issue where, after migration to pnpm catalogs, our postProcessImport script resolves adapter dependencies to the catalog: version and results in the following failures when code examples are opened. 🙈

Screenshot 2025-06-13 at 17 42 05 Screenshot 2025-06-13 at 17 42 45

LukasTy avatar Jun 13 '25 14:06 LukasTy

Deploy preview: https://deploy-preview-18363--material-ui-x.netlify.app/

Bundle size report

Total Size Change: ▼-237B(0.00%) - Total Gzip Change: ▼-194B(-0.01%) Files: 122 total (0 added, 0 removed, 5 changed)

Show details for 100 more bundles (22 more not shown)

@mui/x-charts-pro/FunnelChartparsed: 🔺+369B(+0.18%) gzip: 🔺+79B(+0.12%) @mui/x-charts-proparsed: 🔺+118B(+0.03%) gzip: ▼-23B(-0.02%) @mui/x-chartsparsed: ▼-251B(-0.09%) gzip: ▼-71B(-0.09%) @mui/x-charts/ScatterChartparsed: ▼-251B(-0.16%) gzip: ▼-80B(-0.15%) @mui/x-charts-pro/ScatterChartProparsed: ▼-222B(-0.11%) gzip: ▼-99B(-0.15%) @mui/x-charts-pro/BarChartProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/ChartContainerProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/ChartDataProviderProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/ChartsToolbarProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/ChartZoomSliderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/Heatmapparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/LineChartProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/PieChartProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts-pro/RadarChartProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/BarChartparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartContainerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartDataProviderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsAxisparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsAxisHighlightparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsClipPathparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsGridparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsLabelparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsLegendparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsLocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsOverlayparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsReferenceLineparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsSurfaceparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsTextparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsTooltipparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsXAxisparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/ChartsYAxisparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/Gaugeparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/LineChartparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/PieChartparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/RadarChartparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/SparkLineChartparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-charts/Toolbarparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-gridparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-grid-premiumparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-grid-premium/DataGridPremiumparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-grid-proparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-grid-pro/DataGridProparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-data-grid/DataGridparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickersparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-proparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterDateFnsparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterDateFnsJalaliparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterDayjsparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterLuxonparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterMomentparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterMomentHijriparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/AdapterMomentJalaaliparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DateRangeCalendarparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DateRangePickerDayparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DateRangePickerDay2parsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DesktopDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DesktopDateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/DesktopTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/LocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MobileDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MobileDateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MobileTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MultiInputDateRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MultiInputDateTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/MultiInputTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/PickersRangeCalendarHeaderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/SingleInputDateRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/SingleInputDateTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/SingleInputTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/StaticDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers-pro/TimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterDateFnsparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterDateFnsBaseparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterDateFnsJalaliparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterDayjsparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterLuxonparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterMomentparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterMomentHijriparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/AdapterMomentJalaaliparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DateCalendarparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DateFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DatePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DateTimeFieldparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DayCalendarSkeletonparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DesktopDatePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DesktopDateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DesktopTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/DigitalClockparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/LocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/MobileDatePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/MobileDateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/MobileTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/MonthCalendarparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/MultiSectionDigitalClockparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/PickerDay2parsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/PickersActionBarparsed: 0B(0.00%) gzip: 0B(0.00%) @mui/x-date-pickers/PickersCalendarHeaderparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 5f216538f34a848cacf3bf89b67a63802fd79759

mui-bot avatar Jun 13 '25 14:06 mui-bot

It is odd that this is necessary, though I don't have any suggestions 🫠

It's because we started statically parsing the date library version from the package.json file some time ago, instead of keeping a map of library to version. 🙈 Static analysis is that, static. 😆 catalog: is replaced only when packing the package.

LukasTy avatar Jun 18 '25 07:06 LukasTy

What's the real benefit of using catalogs? Is it only to keep dependencies in sync? In principle renovatebot should already do the right thing. If catalogs is too exotic, and duplicate versions are a real problem, perhaps it makes sense to revert the catalog and use linting instead to ensure consistent package versions?

I feel like more tooling could get in trouble with this.

Janpot avatar Jun 18 '25 08:06 Janpot

What's the real benefit of using catalogs? Is it only to keep dependencies in sync?

No huge benefit given our setup and automation, just slightly less noise when certain updates happen, because duplicate dependency version is defined in a single location.

perhaps it makes sense to revert the catalog and use linting instead to ensure consistent package versions?

I'm not against it if we find further issues, that are tedious to get around. 🤔

LukasTy avatar Jun 18 '25 09:06 LukasTy

Just reading through the checkMaterialVersion test. It's not very clear to me what its purpose is. As far as I understand all it really does is verifying pnpm install has run? 🤔 There's a code smell to this test, but I can't really lay my finger on it yet, it feels unnecessary.

Not a hard recommendation, but personally I'd remain cautious using catalog: dependencies until it's an established feature that exists in multiple package managers such as the workspace: protocol. Only then we know the feature solves a broad user need and tooling has an incentive to support it.

Janpot avatar Jun 18 '25 09:06 Janpot

Just reading through the checkMaterialVersion test. It's not very clear to me what its purpose is. As far as I understand all it really does is verifying pnpm install has run? 🤔 There's a code smell to this test, but I can't really lay my finger on it yet, it feels unnecessary.

Indeed, same feeling here. 🙈 I think it was added when we were working on support multiple "material-ui" versions and wanted to ensure we run tests on what we expect them to run. 🤔

Not a hard recommendation, but personally I'd remain cautious using catalog: dependencies until it's an established feature that exists in multiple package managers such as the workspace: protocol. Only then we know the feature solves a broad user need and tooling has an incentive to support it.

Very wise rec. 👌 mui-x will battle-test the concept and if it proves too problematic, it's not end of the world to migrate away from it.

LukasTy avatar Jun 18 '25 09:06 LukasTy