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

Fix TypeScript Errors and add Redux #64

Closed
wants to merge 10 commits into from

Conversation

Alex-Cannon
Copy link
Collaborator

@Alex-Cannon Alex-Cannon commented Nov 20, 2019

Work in Progress

Redux Refactoring

Close #54 - WIP, but TypeScript & redux were added and have basic setup

  • I pushed the wrong branch for my previous PR. This is the correct branch.
  • Installed redux react-redux redux-thunk
  • Initialized Redux store
  • Converted ./src/index.jsx to .tsx and updated /src/index.html
  • Refactored useAPI with redux
  • Refactored /categories and /search pages to

Fixed TypeScript Path Error

  • When I use "~/core/..." or any "~" paths, TypeScript throws the error: "Cannot find module".
  • Fixed TypeScript and Parcel issues via official parcel docs
  • Installed @types/node to allow process to be typed globally.

My solution: Use tsconfig.json, package.json and the official parcel docs to fix this.

Copy link
Contributor

@Vpr99 Vpr99 left a comment

Choose a reason for hiding this comment

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

Looks solid. Just a couple tiny nitpicks.

@@ -49,14 +49,18 @@
},
"dependencies": {
"@types/jest": "^24.0.23",
"@types/node": "^12.12.11",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, what do we need Node types for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this was an issue to do with making TypeScript recognize process.env as a global. I should look into it as it's been a few weeks.

export const useCategories = () => {};

// Returns a list of subtypes for a category
//export const useSubTypes = category => {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these being used? If not could we get rid of them for now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah for sure. I think for now, I should remove any code like this or that isn't being used. The app doesn't use redux yet, but I think it'd be good to merge in TypeScript for now.

@Alex-Cannon
Copy link
Collaborator Author

Because of git wierdness, I'm creating a new PR for this.

@Alex-Cannon Alex-Cannon mentioned this pull request Dec 22, 2019
7 tasks
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.

PWA: Make 1 call to the spreadsheet instead of scattered calls
2 participants