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

[core] Update jss plugins dependencies #9732

Merged
merged 5 commits into from
Jan 5, 2018

Conversation

cherniavskii
Copy link
Member

@cherniavskii cherniavskii commented Jan 4, 2018

  • removed jss-preset-default from dependencies
  • added to dependencies JSS plugins which are actually used by MUI
  • updated the documentation to use MUI jssPreset from material-ui/styles instead of jss-preset-default.

Breaking change

You might be relying on the transitive dependency of Material-UI: jss-preset-default.
If you do, you need to declare the dependency in your package.json. Material-UI will no longer install it for you.
Alternatively, you can use our preset to save bundle size.

-import preset from 'jss-preset-default';
+import { jssPreset } from 'material-ui/styles';

Closes #9719

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 4, 2018

I'm wondering if jss-preset-default should be also removed from create-react-app examples? 🤔

Do we use it?

I'm having some concern about documenting the withStyles preset. Given it's not exposed in the index.js. We can consider it private. We need to expose it before documenting it. I think that it should be renamed: jssPreset when exported. But again. I would rather keep jss-preset-default in the examples. It's a good default.

@oliviertassinari oliviertassinari self-assigned this Jan 4, 2018
@oliviertassinari oliviertassinari changed the title Update jss plugins dependencies [core] Update jss plugins dependencies Jan 4, 2018
@cherniavskii
Copy link
Member Author

@oliviertassinari

I would rather keep jss-preset-default in the examples. It's a good default.

I do not agree with that, at least in some examples it's good to use jssPreset from material-ui.

Consider CSS injection order example.
If someone copies that example to his project (I believe copying code is very common) - it will work fine.
But if we leave jss-preset-default in that example - it will add extra jss plugins to user's bundle.
From the other hand, if that example uses jssPreset from material-ui - it will do what it supposed to do - set injection point, and will not change jss plugins set.

Same applies to Right-to-left example and probably some other examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants