gis-ops / valhalla-app

This is the demo web app running on https://valhalla.openstreetmap.de
https://valhalla.openstreetmap.de
MIT License
164 stars 90 forks source link

Migrate to Vite #171

Open sammaji opened 1 year ago

sammaji commented 1 year ago

Description

What kind of feature you are suggesting?

As you know, CRA is slow. I recommend using Vite. Even the official react docs recommend using vite.

Does it solve any problem?

Using Vite would significantly reduce build time, improving developer experience. It does not have any effect on the production version.

Screenshots

No response

Additional information

No response

chrstnbwnkl commented 1 year ago

We've been having Vite on our Radar, but were hesitant to jump on yet another hype train. But now that they recommend it in React's beta docs (and mention CRA nowhere anymore), I think it's safe to migrate (also, the speed increase is just mind blowing :exploding_head: )

Sheikh-JamirAlam commented 1 year ago

Agreed. Using Vite is way better than CRA. I can work on this issue if no one else is assigned.

sammaji commented 1 year ago

Hey @chrstnbwnkl @nilsnolde,

While migrating I found some issues that needs to be addressed

  1. In file src/Controls/Isochrones/Waypoint there is an error (says ESLint Parsing error: Unexpected token). The solution is to use "@babel/eslint-parser"

    parser
  2. Vite does not allow ".js" extension for files containing react components. So all files containing react components needs to be renamed ".jsx"

  3. Vite path aliases are needed.

For now, I did not remove react-scripts.

Himanshu2561 commented 1 year ago

Hello @chrstnbwnkl @samyabrata-maji I am also a react developer and i have migrated my previous project from CRA to Vitejs, So you are right we you need to rename the component's extinsions to jsx to follow jsx syntax. It's cool vitejs is blazing fast and everyone is using it, infact the beginners.

I would like to contribute to this project because i think i have the relivent skills. I can migrate the app to vitejs if you can assign me the role. 👍

pawelborkar commented 1 year ago

Hi @chrstnbwnkl, I would like to help migrate the project to vite. I also have a question regarding the package manager should we use pnpm instead of npm since it will also increase the developer experience substantially.

Would like to know your opinion on this.

Thanks.