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] Add Vite.js example #28241

Merged
merged 6 commits into from
Jan 27, 2022

Conversation

goncalovf
Copy link
Contributor

@goncalovf goncalovf commented Sep 9, 2021

Fix #21377

The example I added is based on the React template provided by Vite.js

I did not add aliases to the vite.config.js (as suggested here, here and here as workarounds to the base issues described in #21377 and in the issue in Vite.js) because the issue should be resolved by Vite.js.

CodeSandbox with this example:
Edit on CodeSandbox

TODO:

  • Add CodeSandbox to README.md

Question: Should I make a typescript example?

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 9, 2021

No bundle size changes (experimental)

Generated by 🚫 dangerJS against 6aab170

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Given that the config is quite small I don't think we want to include this example. The problem is that once it's included we need to maintain it for which we currently don't have the bandwidth. Though we definitely want to revisit this when we have a dedicated role for this problem space.

@goncalovf
Copy link
Contributor Author

@eps1lon I've applied to the Developer Advocate role, so if I'm hired I would be able to own this and the other examples, freeing some bandwidth for you all :)

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 10, 2021
@eps1lon eps1lon changed the base branch from next to master September 14, 2021 09:09
@eps1lon
Copy link
Member

eps1lon commented Sep 14, 2021

Thanks for the work. Closing this until we have the bandwidth to support these types of examples. Looking forward to your application 👍🏻

@eps1lon eps1lon closed this Sep 14, 2021
@oliviertassinari
Copy link
Member

I've applied to the Developer Advocate role

@goncalovf We are primarily looking in the US/Canada for this role (and a bit the UK), thanks for the interest thought.


Closing this until we have the bandwidth to support these types of examples.

@mui-org/core I think that it's worth discussing more. Keeping #21377 open and closing this PR doesn't seem compatible. From what I understand, the root ESM issue with vite is fixed. What bandwidth do we need to keep to support the examples? How important are the examples?

Based on the assumption that: examples are key to minimizing churn of new users, that next.js supports dozens of examples with the same size team like us, that #21377 has a number of upvotes, and that vite is relatively popular: https://npm-stat.com/charts.html?package=next,vite,snowpack. +1 to reopen this PR.

@oliviertassinari oliviertassinari added the examples Relating to /examples label Jan 21, 2022
examples/vitejs/README.md Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 26, 2022
@mui-bot
Copy link

mui-bot commented Jan 26, 2022

No bundle size changes

Generated by 🚫 dangerJS against d520097

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks good, sorry for the delay :)

@mnajdova mnajdova merged commit 27881f4 into mui:master Jan 27, 2022
@goncalovf goncalovf deleted the examples/add-vitejs-example branch February 1, 2022 18:14
@dantman
Copy link
Contributor

dantman commented Feb 1, 2022

Shouldn't this example have used @vitejs/plugin-react instead of @vitejs/plugin-react-refresh?

From the looks of it @vitejs/plugin-react-refresh doesn't exist in the Vite codebase anymore. It's 6 months old while @vitejs/plugin-react was updated 1 month ago and says that it supports Fast Refresh. So @vitejs/plugin-react-refresh seems to be redundant and likely abandoned.

wladimirguerra pushed a commit to wladimirguerra/material-ui that referenced this pull request Feb 2, 2022
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

Successfully merging this pull request may close these issues.

[examples] Add example demo with vite
7 participants