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(web): avoid type definitions errors at build time #1465

Merged
merged 22 commits into from
Jul 12, 2024
Merged

Conversation

dgdavid
Copy link
Contributor

@dgdavid dgdavid commented 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

  • npm run server succeed.
  • npm run tests succeed.
  • NODE_ENV=production npm run build succeed.

They allows to avoid some type errors like

`Property 'hot' does not exist on type 'NodeModule'`

See https://stackoverflow.com/a/55318758
The whole Page component has to be improved with possible rewrite to
.tsx, but let's avoid the typecheck error by now.
Either, adding a temporary type definition or using @ts-ignore by now.
By adding the missing `resize` property for actions in tests and by
adapting the JSX of the component used for rendering its content.
Because there are places that does not require such a label. Anyway,
core/CardField is a component that must be rewritten/replaced.
By giving the "color-100" default value.
But also adds some @ts-ignore because this page is being already
refactored in the context of adding a "global state manager" and a log
changes / conflicts are expected.
It is a component that must be refactored or replace. Let's not invest
too much time fixing types there meanwhile.
The component is going to be refactored or replaced soon and the prop
can be easily re-introduced if really needed.
Related to the fact that core/EmptyState#rest prop is not well defined.
Of course, it should be properly fixed in the short term.
Since it is a kind of experimental wrapper component that must be
finished and, ideally, ported to .tsx now that writing TypeScript code
is possible in Agama.
Basically bypassing them. Such a client needs a refactor in which types
thingy must be addressed.
Removing the noEmit compiler option from tsconfig file and altering the
order of babel and ts loaders to make them work without errors. Most
probably that configuration has room for improvements yet.
@dgdavid dgdavid changed the title fix(web): avoid types definitions errors at build time fix(web): avoid type definitions errors at build time Jul 12, 2024
@dgdavid dgdavid marked this pull request as ready for review July 12, 2024 18:59
@dgdavid dgdavid requested a review from imobachgs July 12, 2024 19:00
@imobachgs imobachgs merged commit ef87055 into master Jul 12, 2024
2 checks passed
@imobachgs imobachgs deleted the fix-ts-errors branch July 12, 2024 19:11
@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