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
[docs] Add example for using styled-components as styled-engine #22788
[docs] Add example for using styled-components as styled-engine #22788
Conversation
I've tested the project by copying and running it, works as expected. However if we try to run it directly in the examples folder, we get this errors (the same is happening with the
|
const { addWebpackAlias, override } = require('customize-cra'); | ||
|
||
module.exports = override( | ||
addWebpackAlias({ |
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.
This is the part that does the aliasing
While working on the examples project, should we update the create-react-app example project to include the emotion |
What about we duplicate each demo with a |
Not sure if is necessary to add the next suffix, as we would anyway update the example on the next branch, once that one is merged on master, that should be the only example we provide in my opinion.. |
@mnajdova I guess it comes down to: How often does a developer that wants to use a stable version land on the examples using the GitHub source UI (could only find v5) vs https://material-ui.com/getting-started/example-projects/. It seems to be the latter. So, sounds good without the next prefix and only v5. |
Done |
examples/create-react-app-with-styled-components-engine/src/App.js
Outdated
Show resolved
Hide resolved
examples/create-react-app-with-styled-components-engine/src/App.js
Outdated
Show resolved
Hide resolved
examples/create-react-app-with-styled-components-engine/src/index.css
Outdated
Show resolved
Hide resolved
…p.js Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
…/index.html Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
examples/create-react-app-with-styled-components-engine/src/App.js
Outdated
Show resolved
Hide resolved
docs/src/pages/getting-started/example-projects/example-projects.md
Outdated
Show resolved
Hide resolved
…ts.md Co-authored-by: Matt <github@nospam.33m.co>
…om/mnajdova/material-ui into feat/add-styled-components-example
examples/create-react-app-with-styled-components-engine/README.md
Outdated
Show resolved
Hide resolved
examples/create-react-app-with-styled-components-engine/package.json
Outdated
Show resolved
Hide resolved
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.
Related to #22805. This is the warnings I get when running yarn
with the new example:
Maybe we should make emotion an optional peer dependency?
…e.json Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
…om/mnajdova/material-ui into feat/add-styled-components-example
@oliviertassinari on which example do you get this warning? Let me take a look if there are some implications of adding them as optional peer dependencies. I will open a separate PR for this. |
I get this warning with this very new example we are adding (styled-components). I think that it's one more element to take into account in the tradeoff around how we handle npm. |
Ah I see now, I wonder why we didn't saw this initially. It makes sense to have them as optional peer dependencies 👍 Let me test this and open a PR |
Cool. From my perspective, it's one more element to take into account for the peer dependency / dependency tradeoff. As long as we keep that in mind and are aware of it, it would already be a great thing. Should we act on it? No strong point of view, maybe yes? |
Alright, merging this one and let's continue the discussion on the peer dependencies here #22808 |
This PR adds example project of how developers may swap the styled engine from
emotion
tostyled-components