Skip to content

feat: update dependencies and fix StatsGl component #579

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

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

alvarosabu
Copy link
Member

  • Upgraded stats-gl from version 2.0.1 to 3.6.0
  • Added a temporary TypeScript comment in StatsGl.ts to handle an expected error while waiting for an update from stats-gl.

- Upgraded `stats-gl` from version 2.0.1 to 3.6.0
- Added a temporary TypeScript comment in `StatsGl.ts` to handle an expected error while waiting for an update from `stats-gl`.
@alvarosabu alvarosabu requested a review from andretchen0 January 4, 2025 11:56
@alvarosabu alvarosabu self-assigned this Jan 4, 2025
@alvarosabu alvarosabu added feature New feature or request types deps labels Jan 4, 2025
Copy link

pkg-pr-new bot commented Jan 6, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@tresjs/cientos@579

commit: d3afa4a

@@ -93,6 +93,7 @@ export const StatsGl = defineComponent<StatsGlProps>({
expose({ instance: statsGl })

const node = document.body
// @ts-expect-error waiting for stats-gl update https://github.com/RenaudRohlinger/stats-gl/issues/16
const statContainer = statsGl.dom || statsGl.container
Copy link
Contributor

@andretchen0 andretchen0 Jan 7, 2025

Choose a reason for hiding this comment

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

tldr: This is a problem on the Cientos side. Not with stats-gl. Running pnpm build appears to clear the type error.


I can confirm that I also saw the type error if I removed the @ts-expect-error here.

This was odd, because checking the installed exported types from stats-gl 3.6, there's an public dom field.

Digging into it, after doing this initially ...

  • Check out this PR
  • pnpm i
  • In VS Code, right-click on statsGl on the line shown above, then select "Go to Type Definition"

... the editor showed a 2.4 version of the Stats type. That version doesn't have a public dom field.

After running pnpm build, the 2.4 version was fully removed for me. Then the following line works in the editor without a @ts-expect-error

const statContainer = statsGl.dom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps feature New feature or request types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants