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

Update to use Vite instead of create-react-app #61

Merged
merged 16 commits into from
Sep 12, 2024

Conversation

abigailalexander
Copy link
Collaborator

@abigailalexander abigailalexander commented Sep 4, 2024

Create-react-app is now deprecated, and came with many vulnerabilities in its dependencies. The recommended tool to use now is vite. I have updated cs-web-lib to use this, as well as:

  • Swapped from jest to vitest
  • Updated the github actions to use Node 18. This is necessary because create-react-app used polyfills to provide methods like fetch globally, and vite does NOT do the same. However, Node 18 onwards provides fetch globally. We are also currently on Node 21, so 16 is outdated.
  • Changed the name of environment variables to match vite conventions. This changes from process.env.REACT_APP_(NAME) to import.metadata.env.VITE_(NAME).
  • Minor linting changes

Copy link
Collaborator

@iamvigneshwars iamvigneshwars left a comment

Choose a reason for hiding this comment

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

There are two EOF and few suggestions in the CI, apart from that LGTM!

.eslintrc.json Outdated Show resolved Hide resolved
.github/workflows/node.install.yml Outdated Show resolved Hide resolved
.github/workflows/node.install.yml Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@iamvigneshwars iamvigneshwars left a comment

Choose a reason for hiding this comment

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

Since you are updating stuffs, it is also worth setting up a dependabot in the CI. It keeps all the libraries up-to date. It will open a PR for every version upgrade so you dont have to worry about any new breaking changes.

@abigailalexander
Copy link
Collaborator Author

Good idea, although I'll probably do that in a separate PR.

@abigailalexander abigailalexander merged commit 3819daa into master Sep 12, 2024
2 checks passed
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