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

Incorrect typings with both new Cesium (>=1.117.0) and new React (>=18.3.1) + typescript (>=5.5) #675

Open
MrShtrahman opened this issue Oct 11, 2024 · 0 comments

Comments

@MrShtrahman
Copy link
Contributor

MrShtrahman commented Oct 11, 2024

Hi,

I'd like to address two new (independent) issues regarding wrong typings with new Cesium and new React:

  1. Resium currently uses [email protected]. From [email protected] onwards, new attributes were added to classes on almost every release. This caused some of the tests in resium to fail, becuase the type checking wasn't precise.

For exmaple, take Billboard.ts:

1
2

In version 1.120 of cesium, Billboard.splitDirection was added, which caused mismatches between the type and the cesiumProps array in Billboard.ts:

3

After the addition (of course, checking that it's not a readonly attribute), the test passed.

There are in total 11 such cases.

  1. The upgrade of @types/react from version 18.2 to 18.3 causes breaks in the definition of forwardRef, as mentioned in this PR in react itself
    (They mention that it itself is being caused by typescript 5.5+).

This causes usages of forwardRef in resium to fail typescript checks, and a tiny fix would just be to change the type inside of it from Props to PropsWithoutRef<Props>>

@keiya01 I'd like to add two PRs for each issue 🙂

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

No branches or pull requests

1 participant