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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"dependencies": {
"@vueuse/core": "^12.3.0",
"camera-controls": "^2.9.0",
"stats-gl": "^2.0.1",
"stats-gl": "^3.6.0",
"stats.js": "^0.17.0",
"three-custom-shader-material": "^5.4.0",
"three-stdlib": "^2.35.2"
Expand Down
17 changes: 9 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/core/misc/StatsGl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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


node?.appendChild(statContainer)
Expand Down
Loading