-
Notifications
You must be signed in to change notification settings - Fork 141
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
Upgrade-to-vite #119
Upgrade-to-vite #119
Conversation
mayank1513
commented
Jun 6, 2024
•
edited
Loading
edited
- Replace react-scripts with vite for better build and live reload speed
- better dx
- modern tooling
- Set up vitest for unit testing
- Updated dependencies to latest
- Setup ESLint as per vite
- Set up prettier for consistent code formatting
- Refactor for better readability and maintainability
- Fix lint issues
TSList extension is deprecated in favour of ESLint
- Vite with react-swc plugin is a much faster compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mayank1513 ,
thanks for this contribution ❤️ . Upgrading the seed app from CRA to ViteJS is certainly a good idea 👍
I have two remarks inline and noticed three further things:
- Linting no longer works. The whole
"eslintConfig"
property in the package.json is invalid as the referenced configs are part of CRA and, thus, no longer present. This should be removed. With this, there is no more lint config. I suppose it would make sense to use a vitejs default lint setup for typescript. Could you add this? - For me the tests (via
npm run test
) cannot be executed because a dependency forjsdom
is missing. We should add it as a dev dependency - Optional: The build complains that the deprecated CJS (common js) build is used. We could adapt the package.json and tsconfig.json to use ESM.
- @types/node - @types/react - @types/react-dom - typescript
- fix tests
- added comments to clarify that detailed testing is handled in cypress e2e tests
Thank you for your observations. Probably I did not notice these as I was using yarn and pnpm locally. I have fixed the issues you observed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mayank1513, thanks for the updates!
I only have a few minor comments inline. I also noticed that npm run cypress:ci does not seem to work and the tests fail. do the cypress tests work for you?
Initially there was issue with even launching the Cypress test. I fixed
that. However the tests were not passing in the GitHub action - it was
throwing timeout error.
Can you help debug and fix this?
…On Mon, 10 Jun, 2024, 8:52 pm Lucas Koehler, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Hi @mayank1513 <https://github.com/mayank1513>, thanks for the updates!
I only have a few minor comments inline. I also noticed that npm run
cypress:ci does not seem to work and the tests fail. do the cypress tests
work for you?
------------------------------
On .tkb
<#119 (comment)>
:
i think this was commited by mistake?
------------------------------
In .vscode/extensions.json
<#119 (comment)>
:
> @@ -5,7 +5,7 @@
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"esbenp.prettier-vscode",
- "ms-vscode.vscode-typescript-tslint-plugin"
+ "mayank1513.trello-kanban-task-board"
this should not be added here.
------------------------------
In .vscode/settings.json
<#119 (comment)>
:
> \ No newline at end of file
+ "editor.formatOnSave": true,
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "prettier.jsxSingleQuote": true,
+ "prettier.singleQuote": true,
+ "mayank1513.trello-kanban.Workspace.filePath": ".tkb"
we should not need this. please remove :)
------------------------------
On src/components/schema.json
<#119 (comment)>
:
The schema.json is not a component and, thus, should not be moved to the
components directory. The old location directly in src was fine. This makes
it also slightly easier to find for playing around
------------------------------
On src/components/uischema.json
<#119 (comment)>
:
Same as for schema.json. This should stay in src
------------------------------
On package.json
<#119 (comment)>
:
As the starter is now built and implemented as ESM, we should add "type":
"module".
—
Reply to this email directly, view it on GitHub
<#119 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGCR4VN6OYH6NF24G22DQ6DZGXACBAVCNFSM6AAAAABI5SOJY6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBYGA2TOMRVGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
b1fb424
to
6418fb7
Compare
267a8db
to
3030adf
Compare
Cypress is failing because this element does not exist in the DOM - |
c92c7f3
to
689d237
Compare
689d237
to
3168db5
Compare
Fixed Cypress tests... |
f6dba1a
to
fb31707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mayank1513 , thank you very much for the updates and the whole rework! Changes LGTM now ✨
I added commits for three small changes:
- Fix one lint error in the cypress config
- Execute CI in pull requests and add linting to CI
- Regenerate the package-lock.json: We always do that for external/unknown contributors as a general security precaution.
- Replace react-scripts with vite for better build and live reload speed - Set up vitest for unit testing - Updated dependencies to latest - Setup ESLint as per vite - Set up prettier for consistent code formatting - Refactor for better readability and maintainability - Fix lint issues - Fix cypress test - Execute ci in pull requests and add linting to ci --------- Co-authored-by: Lucas Koehler <[email protected]>