-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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 custom plugin #27357
Conversation
@siriwatknp can you validate that these are the changes done on the store? I noticed that in development mode, SSR is not really working, when I disable JavaScript I see nothing. Production build works as expected. In case these are the only changes done on the store, I will need to dig deeper on why it isn't working. I didn't add the [gatsby-plugin-material-ui(https://www.gatsbyjs.com/plugins/gatsby-plugin-material-ui/) plugin, so I re-used the same name for the custom plugin. We can consider renaming it so that it avoids confusion, but let's fix the problems first. |
Yes, your change is correct. @mnajdova
I think this is also expected. I tried with gatsby starter, also see nothing in development if disable javascript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good.
Alright, let's merge and call it a day then :) |
@oliviertassinari should we ignore the |
@@ -4,7 +4,7 @@ module.exports = { | |||
'gatsby-plugin-react-helmet', | |||
// If you want to use styled components you should add the plugin here. | |||
// 'gatsby-plugin-styled-components', | |||
'gatsby-plugin-emotion', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean we can remove "gatsby-plugin-emotion"
from the package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, good catch! That's why we need your eyes 😄
import createCache from '@emotion/cache'; | ||
|
||
export default function getEmotionCache() { | ||
return createCache({ key: 'css', prepend: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Next.js example, we don't prepend. What should be our policy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you are right, we don't need it as in the examples we do not use JSS. Will update it.
@mnajdova It looks like there is this PR: hupe1980/gatsby-theme-material-ui#53. Maybe we should remove the example until it's updated? No real preferences. Gatsby is not really important. They are getting wrecked by Next.js: https://npm-stat.com/charts.html?package=next,gatsby,react-scripts |
Let's remove it for now then, to avoid confusion for new developers |
Updates the gatsby example to use a custom plugin.