Skip to content

feat: Migrate to TypeScript, Preact, and Tailwind v4 #129

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rishaan05
Copy link

Converted most of the codebase to TypeScript for better type safety. The flasher component was left as JavaScript because I don't have a comma.

Also did the following:

  • Switched the UI to Preact to reduce bundle size.
  • Upgraded Tailwind CSS to v4.
  • Upgraded Eslint
  • Updated all project dependencies to their latest versions.
  • Improved the overall code structure and quality.

These changes should make development easier going forward.

Note: Since the TypeScript migration isn't fully complete (specifically the flasher), it might be best to merge this into a feature branch first rather than directly into main.

Related bounty: #42

my discord is: elffup

@rishaan05
Copy link
Author

I will write the tests in typescript in about a week, im going on vacation

@incognitojam
Copy link
Member

This isn't really mergeable and I don't think it makes the stack simpler

  • TypeScript would give the most benefit around the flasher so it might not be worth adding without that
  • splitting components out into different files doesn't improve code structure on its own; that can be good if you are re-using components but we don't, so it's just adding extra lines
  • Adding new dependencies ("bower"?) isn't making the stack simpler either

@rishaan05
Copy link
Author

@incognitojam,
That's exactly why this is still a Draft PR. The TypeScript version is done, but I'm looking for someone in the comma discord to actually test it.

Regarding the file structure and scope: This wasn't just moving files around. It was a significant rewrite because the old code's quality and structure were frankly terrible. /components has the reusable stuff, and logical separation like /sections is standard practice for keeping a codebase manageable after a major cleanup. If /sections is really the issue, fine, it can be flattened, but the structural overhaul is needed.

As for dependencies: The point is to simplify and modernize the stack for the long run, not to code golf. Adding 'bowser' – which is only 5kb – gives us a standard way to handle user agent detection. Questioning a tiny utility like that seems off-base given the scale of the necessary refactoring elsewhere. The focus should remain on the actual improvements from the TypeScript migration and structural rewrite.

Flasher update gets done after testing. Haven't finished it yet because I'm at Formula 1. Will mark ready for review after that.

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.

2 participants