material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs-infra] Move ads to the `@mui/docs` package

Open alexfauquette opened this issue 1 year ago • 4 comments

Followup of #42842

commits

  1. Move files to the package
  2. Use context for configuration of ads
  3. re-export the Ad component to avoid breaking toolpad docs

https://github.com/mui/mui-toolpad/blob/4298328c314621b0533974590284eb70f3dfffd9/docs/src/modules/components/SchemaReference.tsx#L4

alexfauquette avatar Jul 15 '24 16:07 alexfauquette

Netlify deploy preview

https://deploy-preview-42944--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad) No bundle size changes

Generated by :no_entry_sign: dangerJS against 72c600fd59ff0303271b2a5966fd129d31a62047

mui-bot avatar Jul 15 '24 16:07 mui-bot

I don't know why moving those files to the package results in the following error

src/Ad/ad.styles.ts(95,14): error TS2742: The inferred type of 'adStylesObject' cannot be named without a reference to 'packages/mui-styled-engine/node_modules/csstype'. This is likely not portable. A type annotation is necessary. buildTypes.mjs

Not proud of my fix: https://github.com/mui/material-ui/pull/42944/commits/0aa6cf43ded245b306772e16a6f4c440cb401fcc I probably missed something

alexfauquette avatar Jul 18 '24 10:07 alexfauquette

I probably missed something

Have you tried adding a reference to @mui/styled-engine here?

Janpot avatar Jul 18 '24 12:07 Janpot

Have you tried adding a reference to @mui/styled-engine here?

It did not worked (or I don't know how to do it correctly)

After some code commenting, it appears that the issue does not come from the styled(...)(problematicFunction) which infers the typing of the problematicFunction.

It's just the theme.typographe.body1 and other typography that requires the font typing which are in csstypes So I just added the library to the tsconfig

alexfauquette avatar Jul 18 '24 14:07 alexfauquette