You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
The inspector typings depend on react, so those typings are needed in order to use the inspector as is. Building with the inspector will fail on (ts-enabled) projects that don't include those. npm has changed the way it treats peer dependencies (personally I find it better, but one could argue that it isn't ;-) ). So the dependency is installed.
I'll be happy to discuss it in the forum. i'll be happy to understand in what project this files and why.
i'm closing it for now (as we are using github issues exlusively to track work) and waiting for a ping on our forum.
@RaananW types don't exist at runtime in javascript, so having type libraries as a runtime dependency is never useful
I'll leave this here for others that have the issue then since this is closed: the workaround described here for stubbing out the unnecessary react types library does work: vuejs/language-tools#592 (comment)
You will notice i did mention typescript in my answer. And the same goes to what you said - it shouldn't fail 🙃
But i do want to find a solution that works for everyone and will be really happy to discuss it longer in our forum, if possible
I did some research regarding what can be done here. I believe the es6 version could be exported without the react dependencies, if we change the public API available for the package consumer. However, I prefer not to make this change a week before our 7.0 release.
I am moving this to 8.0 for now.
Repro
npm install @babylonjs/inspector && npm ls @types/react
└── (empty)
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:
Babylon.js/packages/public/@babylonjs/inspector/package.json
Lines 24 to 33 in d521fd0
Moving both
@types/react
and@types/react-dom
from peerDependencies to devDependencies in these two packages would resolve the issueThe text was updated successfully, but these errors were encountered: