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

feat(web): start using TypeScript #1456

Merged
merged 5 commits into from
Jul 12, 2024
Merged

feat(web): start using TypeScript #1456

merged 5 commits into from
Jul 12, 2024

Conversation

dgdavid
Copy link
Contributor

@dgdavid dgdavid commented Jul 11, 2024

Problem

Agama web UI is using plain JavaScript but relying in TypeDoc for performing type checking. It is ok, but as the project grows looks like would be easier and straight forward to use TypeScript instead.

Solution

Start using TypeScript and migrate the current code little by little as the files are touched.

Testing

  • Adapted Jest for working with TypeScript too.

Comment on lines -126 to +129
const [
{ data: config },
{ data: locales },
{ data: keymaps },
{ data: timezones }
] = useSuspenseQueries({
queries: [
configQuery(),
localesQuery(),
keymapsQuery(),
timezonesQuery()
]
});
const [{ data: config }, { data: locales }, { data: keymaps }, { data: timezones }] =
useSuspenseQueries({
queries: [configQuery(), localesQuery(), keymapsQuery(), timezonesQuery()]
});
Copy link
Contributor Author

@dgdavid dgdavid Jul 12, 2024

Choose a reason for hiding this comment

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

Ouch, I didn't realize I sent these (and others) format changes made by Zed editor which I'm testing. Will revert them in a new commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After a short discussion with @imobachgs, I will keep it as it is because we're gonna format all the code base for consistence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, the format change was not because Zed but because Zed applying the rules we have at .prettierrc file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're gonna format all the code base for consistence.

Done at #1460

@dgdavid dgdavid changed the title WIP: feat(web): start using TypeScript. feat(web): start using TypeScript Jul 12, 2024
@dgdavid dgdavid marked this pull request as ready for review July 12, 2024 10:43
@dgdavid dgdavid merged commit 2b7a16e into master Jul 12, 2024
1 check passed
@dgdavid dgdavid deleted the typescript branch July 12, 2024 10:51
imobachgs added a commit that referenced this pull request Jul 12, 2024
## Problem

After merging #1456, the build task is failing when running it for the
production environment (`NODE_ENV=production npm run build`).

## Solution

Fix these problems having in mind that most of the complaints will be
solved in a better way when migrating components to TypeScript.

## Testing

- [x] `npm run server` succeed.
- [x] `npm run tests` succeed.
- [x] `NODE_ENV=production npm run build` succeed.
@imobachgs imobachgs mentioned this pull request Sep 20, 2024
imobachgs added a commit that referenced this pull request Sep 20, 2024
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