Skip to content

Conversation

@kolesnikova-dev
Copy link
Collaborator

@kolesnikova-dev kolesnikova-dev commented Sep 17, 2024

Description

This code proposes refactoring our application to TypeScript. These changes will keep the app type safe, scalable and easy to read and to debug.
Some console logs are still in place as the work is still in progress.

Issue

closes #56

Type of Changes

enhancement

Updates

Added types.

Issues

  • Duplicate items are still being added;
  • New items are being added on refresh - this affects normalization and duplicate check

Testing Steps / QA Criteria

  • Ran npm start and navigated to localhost:3000,
  • Logged in,
  • Added a new list,
  • Added unique and duplicate items to a new list,
  • Shared new list,
  • Verified that list will be only shared when the list is owned by the user that is currently logged in.

Nika Kolesnikova added 30 commits September 16, 2024 11:59
- install types and necessary dependencies;
- add TypeScript configuration;
- change extention of files to .tsx;
- add User and Item types.
@kolesnikova-dev kolesnikova-dev self-assigned this Sep 17, 2024
@kolesnikova-dev kolesnikova-dev added help wanted Extra attention is needed refactoring labels Sep 17, 2024
Comment on lines 28 to 29
userId: string | null | undefined,
userEmail: string | null | undefined,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this might simplify a little bit

Suggested change
userId: string | null | undefined,
userEmail: string | null | undefined,
userId?: string | null,
userEmail?: string | null,

Comment on lines 1 to 13
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"moduleResolution": "node",
"jsx": "react-jsx",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src"]
}
Copy link
Member

Choose a reason for hiding this comment

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

The build works on my end now with the vite command.

I wonder if it was the file name change from vit2.config.js > vite.config.ts that did it.

I also see the built files in /build too which makes things nicer. 🙌🏻

@kolesnikova-dev kolesnikova-dev changed the title Refactor to typescript attempt Refactor to typescript Sep 26, 2024
…and firebase.ts;

 - add types to firebase functions;
- add types to a new deleteItem function;
@github-actions
Copy link

github-actions bot commented Sep 26, 2024

Visit the preview URL for this PR (updated for commit 0400b4c):

https://tcl-75-smart-shopping-list--pr50-refactor-to-typescri-pom1hab6.web.app

(expires Fri, 04 Oct 2024 14:54:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1f1fd53c369e1fa31e15c310aa075b4e8f4f8dde

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

Labels

help wanted Extra attention is needed refactoring

Projects

None yet

3 participants