Skip to content

@babylonjs/inspector and gui-editor packages install unnecessary dependencies / cause TS errors in certain project setups #13581

Open
@wmurphyrd

Description

@wmurphyrd

Repro

  • Bug repro : npm install @babylonjs/inspector && npm ls @types/react
  • Expected result: └── (empty)
  • Current result:
└─┬ @babylonjs/[email protected]
  ├─┬ @babylonjs/[email protected]
  │ └── @types/[email protected] deduped
  ├─┬ @types/[email protected]
  │ └── @types/[email protected] deduped
  └── @types/[email protected]

npm 8.19.3

Additional context

Installing react types creates big problems in projects using typescript and non-react frameworks like vue. See e.g. vuejs/language-tools#592

These package are distributed as a pre-built bundles with the main and module fields pointing to dist files, so there's no need to include build-time dependencies, but npm installs these because they are listed as peer dependencies:

"peerDependencies": {
"@babylonjs/core": "^5.22.0",
"@babylonjs/gui": "^5.22.0",
"@babylonjs/gui-editor": "^5.22.0",
"@babylonjs/loaders": "^5.22.0",
"@babylonjs/materials": "^5.22.0",
"@babylonjs/serializers": "^5.22.0",
"@types/react": ">=16.7.3",
"@types/react-dom": ">=16.0.9"
},

Moving both @types/react and @types/react-dom from peerDependencies to devDependencies in these two packages would resolve the issue

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions