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

Get rid of CRA #77

Closed
NoamGaash opened this issue Sep 28, 2023 · 12 comments
Closed

Get rid of CRA #77

NoamGaash opened this issue Sep 28, 2023 · 12 comments
Assignees

Comments

@NoamGaash
Copy link
Member

we use react-scripts, and it's deprecated
https://blog.bitsrc.io/the-future-of-react-why-create-react-app-is-deprecated-and-hooks-are-the-future-83e8a087a325

Right now, I tend to think Vite is the best alternative (if you have a different opinion, convince me)
https://dev.to/henriquejensen/migrating-from-create-react-app-to-vite-a-quick-and-easy-guide-5e72

@rzarviv
Copy link
Collaborator

rzarviv commented Sep 28, 2023

If you don't need any Server-Side Rendering abilities then Vite is probably the best alternative for create-react-app AFAIK.

@knightcube
Copy link
Contributor

I can work on this.

@NoamGaash
Copy link
Member Author

@knightcube thanks! let me know if you have any question, or if there's any help required

@knightcube
Copy link
Contributor

I am following the instructions in the article that you sent.

As per Step 8 we will have to migrate our testing library from Jest to Vitest. Currently, all our tests have been written in Jest. Therefore, migrating to Vitest will break the project.

I am making some changes to the package.json file but I am not sure what to write for test and eject as they both used react-scripts earlier.

"scripts": {
    "start": "vite",
    "build": "tsc && vite build",
    "serve": "vite preview",
    "test": "",
    "test:playwright": "playwright test",
    "eject": "",
    "lint": "eslint . --max-warnings 0",
    "lint:fix": "eslint . --fix",
    "format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc"
  },

Thoughts?

@NoamGaash
Copy link
Member Author

are you sure that we have Jest tests?

@knightcube
Copy link
Contributor

@NoamGaash No we have Playwright tests.

@NoamGaash
Copy link
Member Author

@knightcube Playwright won't care about the way we transpile our project. It just uses yarn start and looks for the 8080 port

@knightcube
Copy link
Contributor

But why is the playwright test not running here? - https://github.com/hasadna/open-bus-map-search/actions/runs/6378722977/job/17313602705?pr=86

@NoamGaash
Copy link
Member Author

Did you try to run it locally? Maybe its listening to the wrong port number

@knightcube
Copy link
Contributor

Yeah I updated the port numbers in #86 just now.

@NoamGaash
Copy link
Member Author

thank you @knightcube !
you solved a real tech debt in our project. it's super helpful and appreciated
🙏 ⭐ 🥇

@knightcube
Copy link
Contributor

I was calculating the impact of this contribution.

With CRA:
Development Server Start-Up Time - 28 to 30 seconds!

With Vite:
Development Server Start-Up Time - 789 milliseconds!

MASSIVE IMPROVEMENT!

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

No branches or pull requests

3 participants