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

[Demo] Move e-commerce demo from webpack to vite #8317

Merged
merged 3 commits into from
Oct 27, 2022
Merged

[Demo] Move e-commerce demo from webpack to vite #8317

merged 3 commits into from
Oct 27, 2022

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Oct 27, 2022

Problems

Create-React-App 5.0 has broken Hot Module Reloading, and the project looks abandoned. As a consequence, the developer experience with the demo is poor

Solution

Use Vite instead. This speeds up the development mode, solves the HMR problems, and doesn't slow down the build too much.

From make run-demo to loaded page in browser:

  • master: 16s
  • this branch: 11s

From make build-demo to generated files:

  • master: 35s
  • this branch: 40s

Closes #7826
Supersedes #7162

  • Make the demo run fast in development mode
  • Watch demo files and react-admin files
  • Make sure that the demo works in a subdirectory (to publish at https://marmelab.com/react-admin-demo)
  • do not mangle names
  • enable profiling in production
  • Update makefile to make the transition seamless for core developers

Copy link
Contributor

@WiXSL WiXSL left a comment

Choose a reason for hiding this comment

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

It works and it looks really fast!

✔️ Runs very fast
✔️ Hot reload works as expected
✔️ All scripts work

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

This will be a significant time save!

@slax57 slax57 added this to the 4.5.0 milestone Oct 27, 2022
@slax57 slax57 merged commit 20cb3f3 into master Oct 27, 2022
@slax57 slax57 deleted the demo-vitz branch October 27, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React-Admin examples not changing on save
4 participants