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] Better support of Vite examples #37367

Open
oliviertassinari opened this issue May 22, 2023 · 13 comments
Open

[examples] Better support of Vite examples #37367

oliviertassinari opened this issue May 22, 2023 · 13 comments
Labels
examples Relating to /examples

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented May 22, 2023

Summary 💡

Per reactjs/react.dev#5487 and https://npm-stat.com/charts.html?package=vite&package=react-scripts&package=next it doesn't make a lot of sense to have all these Create React App demos.

Screenshot 2023-05-22 at 01 04 20

https://github.com/mui/material-ui/tree/master/examples

I think that we could either move them to be specialized examples with Vite or create them

Examples 🌈

No response

Motivation 🔦

No response

@acomanescu
Copy link

Since CRA is no longer supported and there are many packages that fail to run/install (e.g. TypeScript v5.x), I support the migration to Vite.

@nithins1
Copy link
Contributor

I would like to work on this. I could start with a joy-vite-ts example.

@misyel
Copy link

misyel commented Jun 8, 2023

I'd like to help with this too! I can make a material-vite-styled-components-ts example.

@samuelsycamore
Copy link
Contributor

Do we want to remove CRA examples entirely? See: #37595 (comment). I think we should definitively answer that question before proceeding.

@dvkam
Copy link
Contributor

dvkam commented Jun 14, 2023

Happy to help with the migration from CRA to Vite. In most of this examples this should be straightforward as you still use React.
For context the React documentation removed CRA and some reasoning behind this decision

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Jun 14, 2023

Do we want to remove CRA examples entirely?

@samuelsycamore I would personally keep CRA, but only in its basic form. I think that TS & JS examples are enough, no need for examples with other libraries.

@BearCooder
Copy link

@oliviertassinari Your statement contradicts a bit what you said in your initial post? Od do you mean to have a folder with CRA examples and one with Vite? Anyway CRA is littered with so many stuff there isnt something like "CRA in its basic form".
And Vite is no library, Vite is a bundler like Parcel. That does the job 100x better and is maintained actively compared to CRA.
Vite is even more basic than setting up the examples with a framework e.g. Next.

Mui shouldnt lure new people into CRA (with the examples) that is not even recommended by React maintainers.

@samuelsycamore
Copy link
Contributor

samuelsycamore commented Jun 15, 2023

@BearCooder I believe what @oliviertassinari meant is that it's enough to have examples of CRA + Material UI, CRA + Base UI, and CRA + Joy UI—no need, for example, to keep additional examples involving CRA + MUI libs + Tailwind CSS (#37595) or other libraries that folks could add to the mix. I agree with this position FWIW. CRA definitely still exists out in the world even if it's fallen out of favor for brand-new projects, so I think there's value in continuing to provide boilerplate examples.

@BearCooder
Copy link

@BearCooder I believe what @oliviertassinari meant is that it's enough to have examples of CRA + Material UI, CRA + Base UI, and CRA + Joy UI—no need, for example, to keep additional examples involving CRA + MUI libs + Tailwind CSS (#37595) or other libraries that folks could add to the mix.

Let me quote Olivier Tassinari from the beginning of this thread:

Per reactjs/react.dev#5487 and https://npm-stat.com/charts.html?package=vite&package=react-scripts&package=next it doesn't make a lot of sense to have all these Create React App demos.
Screenshot 2023-05-22 at 01 04 20

I think that we could either move them to be specialized examples with Vite or create them

"I think that we could either move them to be specialized examples with Vite or create them"

I am not sure how to understand that but when simply reading it, for me this sounds like to move to Vite?
Even here in this issue #37358 (comment) Olivier Tassinari asked you to move the special examples to Vite?

It might be good to definitely clear the lack of clarity, as I was also gonna start to rewrite examples into Vite and I guess I am not the only one.

CRA still exists thats true but its illusory to say it brings value when its clearly not recommended by their own creators.
CRA is not the official way to create React apps and definitely not what we want to ship to production.

And thats the thing, many will use the example templates as their starter and build on top of it. Thats what we should avoid.

In short:
CSR: Pick Parcel or Vite
SSR: Next or Remix for example

@samuelsycamore
Copy link
Contributor

@BearCooder with all due respect, I think you've misunderstood what @oliviertassinari was saying. "[...] either move them to be specialized examples with Vite or create them". What I'm proposing is the latter—to create new Vite examples and not necessarily trash all of the existing CRA examples. I don't think we need CRA + Material UI + Tailwind, CRA + Material UI + Styled Components, etc. It's enough just to have CRA + Material UI.

@samuelsycamore
Copy link
Contributor

In the interest of moving forward here, let's do this:

  • keep and/or create CRA examples for Material UI, Base UI, and Joy UI in JS and TS
  • remove all other CRA examples
  • create Vite examples for all Core libs and use Vite as the default for more "complex" examples (Vite + Material UI + Tailwind CSS for example)

@amitava82
Copy link

Can we have an example of Vite + Express + SSR similar to material-ui-express-ssr?

@oliviertassinari
Copy link
Member Author

oliviertassinari commented May 9, 2024

The ones that make no sense to me to be with CRA and not Vite: https://mui.com/material-ui/getting-started/example-projects/. I think we should migrate those:

  • Tailwind CSS
SCR-20240509-qbob
  • Styled-components
SCR-20240509-qbrk
  • Preact
SCR-20240509-qcjc

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

No branches or pull requests

8 participants