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

[code-infra] Update prettier #40772

Merged
merged 12 commits into from
Feb 7, 2024
Merged

[code-infra] Update prettier #40772

merged 12 commits into from
Feb 7, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Jan 24, 2024

The result of running

pnpm upgrade --latest -r prettier pretty-quick
pnpm dedupe
pnpm docs:api
pnpm docs:typescript:formatted
pnpm prettier:all

@Janpot Janpot added the core Infrastructure work going on behind the scenes label Jan 24, 2024
@mui-bot
Copy link

mui-bot commented Jan 24, 2024

Netlify deploy preview

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against de181d5

@Janpot
Copy link
Member Author

Janpot commented Jan 24, 2024

I have this issue where if I run

pnpm upgrade --latest prettier
pnpm dedupe

and then

pnpm typescript:ci

I get a bunch of typescript errors around joy UI. No problem if I skip running

pnpm dedupe

@siriwatknp @michaldudak I have a hunch there's some implicit dependency issue around csstypes and possibly others. If you'd have a moment to take a look at this, to see if you spot something obvious?

@michaldudak
Copy link
Member

It seems that csstype 3.1.3 has breaking changes (frenic/csstype#189). Pinning the version to 3.1.2 prevents these issues from happening. I'll see if it could be fixed on our side.

@Janpot
Copy link
Member Author

Janpot commented Jan 24, 2024

Pinning it to 3.1.2 in the resolutions didn't seem to help. Adding it to @mui/joy as an explicit dependency fixed the problem for joy, but not for the docs. Doing the same for the docs didn't help

@michaldudak
Copy link
Member

Pinning in resolutions does help in Joy only.
Also, if you update version numbers manually instead of running pnpm upgrade --latest prettier, a different set of errors show up in Joy docs. @siriwatknp, could you also take a look at it?

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 24, 2024
@siriwatknp
Copy link
Member

siriwatknp commented Feb 7, 2024

Found it. This fixes the issue, here is the PR.

diff --git a/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts b/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts
index 929177b4cd..6d373d0ae5 100644
--- a/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts
+++ b/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts
@@ -9,7 +9,7 @@ import { OverwriteCSSProperties } from './OverwriteCSSProperties';
  * Note that this extends to non-theme values also. For example `display=['none', 'block']`
  * will also works.
  */
-export type ResponsiveStyleValue<T> = T | Array<T | null> | { [key: string]: T | null };
+export type ResponsiveStyleValue<T> = T | ReadonlyArray<T | null> | { [key: string]: T | null };
 
 /**
  * Map of all CSS pseudo selectors (`:hover`, `:focus`, ...).

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2024
@siriwatknp
Copy link
Member

siriwatknp commented Feb 7, 2024

I pushed the a900b56 to test if it works in this PR.

@Janpot Janpot marked this pull request as ready for review February 7, 2024 08:33
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2024
@Janpot Janpot requested a review from a team February 7, 2024 11:02
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

The lowercase doctype seems controversial (prettier/prettier#7391) but I really like indented ternaries.

@Janpot Janpot merged commit 18335a6 into mui:master Feb 7, 2024
22 checks passed
@Janpot Janpot deleted the pretty-quick branch February 7, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants