Skip to content

migrate to Vite#97

Merged
EndBug merged 7 commits into
PoliNetworkOrg:mainfrom
lorenzocorallo:96-migrate-vite
May 3, 2023
Merged

migrate to Vite#97
EndBug merged 7 commits into
PoliNetworkOrg:mainfrom
lorenzocorallo:96-migrate-vite

Conversation

@lorenzocorallo
Copy link
Copy Markdown
Member

@lorenzocorallo lorenzocorallo commented Apr 30, 2023

Changes listed in first commit notes
@EndBug please double-check that everything is working fine, especially workflows, deploy, db build and env variables.

Note: the high number of line changes only depends on package-lock.json and, as you can see, CRA sucks

Closes #96

- remove: react-scripts
- add: vite @vitejs/plugin-react-swc eslint-plugin-react-hooks
  eslint-plugin-react-refresh
- bump: typescript dotenv
- update package.json scripts
- remove assets symlink in static folder: vite does not support
  importing files in /public in javascript
  telegram_logo is moved to static
  logo3000 is copied to static
- fix code using new typescript rules: react-hooks and react-refresh
- update tsconfig referring to create-vite template
- replace react-app-env.d.ts with vite-env.d.test
- move /public/index.html to /index.html because of vite setup
@github-actions github-actions Bot temporarily deployed to preview April 30, 2023 23:42 Destroyed
@github-actions github-actions Bot temporarily deployed to preview April 30, 2023 23:47 Destroyed
Comment thread vite.config.js
Comment thread vite.config.js
Comment thread src/components/App.tsx
- in useEffect, useState MUST be used in its extended form
  e.g.  WRONG -> props.viewState[1](.....)
        CORRECT -> setView(....)
  note: change the dependencies array accordingly
- this fixes also a related issue regarding i18n not working
@github-actions github-actions Bot temporarily deployed to preview May 1, 2023 11:20 Destroyed
@github-actions github-actions Bot temporarily deployed to preview May 1, 2023 11:32 Destroyed
@lorenzocorallo lorenzocorallo requested a review from EndBug May 1, 2023 11:37
@lorenzocorallo lorenzocorallo changed the title migrate to vite migrate to Vite May 1, 2023
Copy link
Copy Markdown
Member

@EndBug EndBug left a comment

Choose a reason for hiding this comment

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

@EndBug
Copy link
Copy Markdown
Member

EndBug commented May 2, 2023

(currently waiting for the next version to be released before merging this)

@EndBug EndBug merged commit ec5db36 into PoliNetworkOrg:main May 3, 2023
@lorenzocorallo lorenzocorallo deleted the 96-migrate-vite branch May 3, 2023 21:12
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.

migrate CRA to Vite

2 participants