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

[docs] Limit date-fns package to v2 in codesandbox #11463

Merged
merged 6 commits into from
Dec 21, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ ponyfillGlobal.muiDocConfig = {
newDeps.dayjs = versions.dayjs;
}

// monorepo would override the version to `latest` if defined in `csbGetVersions`
if (newDeps['date-fns']) {
newDeps['date-fns'] = '^2.30.0';
}

return newDeps;
},
csbGetVersions: (versions, { muiCommitRef }) => {
Expand All @@ -59,7 +64,6 @@ ponyfillGlobal.muiDocConfig = {
'@mui/x-date-pickers-pro': getMuiPackageVersion('x-date-pickers-pro', muiCommitRef),
'@mui/x-charts': getMuiPackageVersion('x-charts', muiCommitRef),
'@mui/x-tree-view': getMuiPackageVersion('x-tree-view', muiCommitRef),
'date-fns': 'latest',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining the version did not work, because this would override it:

https://github.com/mui/material-ui/blob/8be7ac66b99059bf2c2edcca9cf15981d389db6b/docs/src/modules/sandbox/Dependencies.ts#L157

WDYT @flaviendelangle, does the proposal make sense or shall we refactor the code in monorepo?
But in that case, we'd be blocked for the moment, because we currently can't bump monorepo. 🙈

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How long do we think we will be blocked from bumping the monorepo?

Having latest hardcoded is really not a good pattern 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How long do we think we will be blocked from bumping the monorepo?

Given the complexity of #11303 I'd bet that it is not happening this year. 😃
So, at least 2+ weeks of a few broken demos in codesandbox.

Having latest hardcoded is really not a good pattern 😬

I don't disagree. It's error-prone, like we see now. 🙈
But I'd say that in such case, all of it should be controlled on the consuming side.
Now we have a bunch of logic in monorepo, some of it overrides whatever we specify here... 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be totally fine if you took the current commit of the monorepo on your repo and just did the date-fns fix
That's not clean, but this is a very bad regression on our doc 😬

But I'd say that in such case, all of it should be controlled on the consuming side.

Yes you're right
latest is bad AND having to go to the monorepo to fix it is bad...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flaviendelangle WDYT about the updated solution with fixes originating from @mui/monorepo? 🤔

dayjs: 'latest',
exceljs: 'latest',
};
Expand Down
Loading