Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
2.27k stars 107 forks source link

Vscode intellisense autocompletion not getting Tres components props #785

Closed alvarosabu closed 2 months ago

alvarosabu commented 4 months ago

Describe the bug

Vscode intellisense autocompletion tooltip is not working for custom render components.

TresPerspectiveCamera (custom renderer):

Screenshot 2024-07-18 at 09 09 59

TresCanvas (actual vue component):

Screenshot 2024-07-18 at 09 10 37

Reproduction

https://stackblitz.com/~/edit/tresjs-minimal-reproduction?file=package.json

Steps to reproduce

No response

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 62.16 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    pnpm: 9.4.0 - ~/Library/pnpm/pnpm
    bun: 1.0.2 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 120.1.61.116
    Chrome: 126.0.6478.128
    Safari: 17.5
  npmPackages:
    @tresjs/cientos: 3.9.0 => 3.9.0 
    @tresjs/core: workspace:^ => 4.2.1 
    @tresjs/leches: 0.15.0-next.3 => 0.15.0-next.3

Used Package Manager

pnpm

Code of Conduct

devick commented 2 months ago

When can this bug be fixed?

alvarosabu commented 2 months ago

Hi @devick, unfortunately, we don't know, something changed in vue language tools and we still need to figure out what it is and how to fix it.

devick commented 2 months ago

I found that after uninstalling the latest version and installing version 3.8.1, this feature becomes available

alvarosabu commented 2 months ago

Hi @devick does it work for https://github.com/Tresjs/tres/releases/tag/3.9.0 ?

It makes no sense if it doesn't work there since we didn't make any change from 3.8.1 to 3.9.0 that would affect types

alvarosabu commented 2 months ago
Screenshot 2024-09-04 at 13 12 11

Checking both versions (3.8.1 and 3.9.0) package.json the only thing I see different is the vue version and the vite-plugin-dts

There was a breaking change on vue 3.4 for JSX global types, bout that should be affecting us since we don't use JSX https://github.com/vuejs/core/blob/main/changelogs/CHANGELOG-3.4.md#340-slam-dunk-2023-12-29

gangsthub commented 2 months ago

What TypeScript version are you using? It could be something related with the language tools package.

devick commented 2 months ago

Hi @devick does it work for https://github.com/Tresjs/tres/releases/tag/3.9.0 ?

It makes no sense if it doesn't work there since we didn't make any change from 3.8.1 to 3.9.0 that would affect types

It also works on 3.9.0。

my package.json:

{
  "name": "mytresjs",
  "version": "0.0.0",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "run-p type-check \"build-only {@}\" --",
    "preview": "vite preview",
    "build-only": "vite build",
    "type-check": "vue-tsc --build --force"
  },
  "dependencies": {
    "@tresjs/cientos": "3.8.0",
    "@tresjs/core": "3.9.0",
    "three": "^0.167.1",
    "tweakpane": "^4.0.4",
    "vue": "^3.4.29"
  },
  "devDependencies": {
    "@tsconfig/node20": "^20.1.4",
    "@types/node": "^20.14.5",
    "@types/three": "^0.167.2",
    "@vitejs/plugin-vue": "^5.0.5",
    "@vue/tsconfig": "^0.5.1",
    "npm-run-all2": "^6.2.0",
    "typescript": "~5.4.0",
    "vite": "^5.3.1",
    "vue-tsc": "^2.0.21"
  }
}
devick commented 2 months ago

@

What TypeScript version are you using? It could be something related with the language tools package.

is 5.4.5

alvarosabu commented 2 months ago

Hi all @devick after a long debugging session, I managed to figure out the issue, there was an unwanted overwrite on the InstanceProps setting all props to any. In the end had nothing to do with vue/language-tools at all even if the reproduction was similar.

Please update to v4.2.10

devick commented 2 months ago

Hi all @devick after a long debugging session, I managed to figure out the issue, there was an unwanted overwrite on the InstanceProps setting all props to any. In the end had nothing to do with vue/language-tools at all even if the reproduction was similar.

Please update to v4.2.10

This is great, thank you for your work.