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

Add TypeScript #960

Open
1 of 2 tasks
AminoffZ opened this issue Oct 16, 2023 · 0 comments
Open
1 of 2 tasks

Add TypeScript #960

AminoffZ opened this issue Oct 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@AminoffZ
Copy link
Contributor

AminoffZ commented Oct 16, 2023

Extension or Userscript?

Both

Request or suggest a new feature!

After having looked at the codebase and tried to understand where and how things happen to fix #954, I felt like many contributors could benefit from a refactor.

The main thing for this refactor would be adding TypeScript. The second thing I propose would be a small restructuring of the src/ folder. What I mean here is we could, first of all have types.ts if we need them, but also break up some of the larger files and end up with something like:

└── src
    ├── api.ts
    ├── selectors
    │   ├── desktop.ts
    │   └── mobile.ts
    └── types
        └── index.ts
    ...

This would be alot of work but it would, ideally, make the code more maintainable.

Ways to implement this!

Adding typescript, ts-loader and @types/chrome to dev-dependencies as well as modifying the webpack config.

I have a WIP branch where I have played around with implementing these changes.

Can you work on this?

  • Yes
  • No

Will you be available for follow-up questions to help developers implement this?

Yes

UPDATE: I completed adding TypeScript, wasn't too bad. There are certainly things that need work. An obvious example is the typing from the API. Other than that, it could be stricter in places but works as normal.

@AminoffZ AminoffZ added the enhancement New feature or request label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant