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

[examples] Update gatsby example to use @material-ui/* next #23089

Merged
merged 4 commits into from
Oct 17, 2020

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Oct 16, 2020

This PR updates the gatsby example project to use next version of @material-ui/* packages. It adds the @emotion/* packages and the gatsby-plugin-emotion plugin.

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 16, 2020

No bundle size changes comparing a0acea9...84f0ef8

Generated by 🚫 dangerJS against 84f0ef8

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

examples/gatsby/package.json Outdated Show resolved Hide resolved
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Oct 16, 2020
@oliviertassinari
Copy link
Member

I had a look at what's done by other libraries using emotion. You have:

It seems that they are closer to gatsby-theme-material-ui than gatsby-plugin-material-ui.

I'm surprised that gatsby-plugin-emotion doesn't try to inline the CSS in the head as styled-components or @material-ui/styles do.

@mnajdova
Copy link
Member Author

I had a look at what's done by other libraries using emotion. You have:

  • gatsby-plugin-theme-ui
  • gatsby-plugin-chakra-ui

It seems that they are closer to gatsby-theme-material-ui than gatsby-plugin-material-ui.

I'm surprised that gatsby-plugin-emotion doesn't try to inline the CSS in the head as styled-components or @material-ui/styles do.

I am looking next on the gatsby-theme example project. Should we invest into creating our own custom plugin? Or should we wait and see if the community will come up with some plugin that works better maybe? I can't see at this moment the benefits or downsides of this one to be honest.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 16, 2020

I would be leaning toward waiting on authoring a custom Gatsby plugin too.

The example we are editing shows how to implement most of it user land. I think that the most interesting part of our v4 Gatsby plugin is the SSR inlining. With emotion, it becomes optional.
Also, @hupe1980 has solved the problem well so far.

The Gatsby plugin was interesting for us because we can use it to analyze if we are doing great or not in the Gatsby environment. It would help optimize for: are people using Material-UI with Gatsby? Now, we don't have that metric with Next.js and that's probably fine.

@mnajdova mnajdova merged commit 919f2d2 into mui:next Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants