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

Move from CRA to Vite #3103

Closed
wants to merge 1 commit into from
Closed

Move from CRA to Vite #3103

wants to merge 1 commit into from

Conversation

bdbch
Copy link
Member

@bdbch bdbch commented Jun 15, 2023

THIS PR IS STILL WIP

This PR migrates the project from Create React App to Vite. Why?

https://semaphoreci.com/blog/vite

In general CRA is slower than Vite. Vite is pretty fast as it is using ESMby default skipping the whole bundling process for es modules.

From my tests everything looked okay. I guess secrets would need to be updates on the hosting part (as instead of using REACT_APP_* for env vars Vite is falling back to VITE_)

From my feeling Vite feels way faster and snappier on building & starting up the project, specially after the app was cached.

Important
One thing that didn't work anymore was the heatmap.js package as it doesn't seem to support Vite. Looking at the activity of the package (https://github.com/pa7/heatmap.js) it seems to be quite dead.

To fix this issue for now I built a very basic heatmap with canvas on my own. It's not as beautiful as heatmap.js heatmaps because of the missing color grading between points - but this could be built afterwards.

Otherwise the PR currently does not load the page since something is not working with Recharts. Looking at this tomorrow.

@bdbch bdbch self-assigned this Jun 15, 2023

// blur whole heatmap
ctx.drawImage(heatmap.current, 0, 0);
// heatmap.setData(adjustedData);
Copy link
Member Author

Choose a reason for hiding this comment

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

can be removed

@bdbch bdbch mentioned this pull request Jun 15, 2023
@howardchung
Copy link
Member

I've done a little research into converting CRA projects and it seems like Vite is an easier drop-in replacement for CRA, so if the Next.js effort is stalled it seems we could get some dev wins out of figuring out the blockers here

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants