meta-quest / immersive-web-emulation-runtime

Javascript WebXR Runtime for Emulation
https://meta-quest.github.io/immersive-web-emulation-runtime/
MIT License
48 stars 4 forks source link

Don't pin the react and react-dom version and move react to peerDependencies #8

Open smeng9 opened 3 weeks ago

smeng9 commented 3 weeks ago

We should always use the caret (^) symbol to specify the react version range in the package.json in a public library and let package manager to resolve to a single instance of react package.

The react and react-dom should be in the peerDependencies, because our project (we as a user) will install them. The duplicate instances of the package also increase the project size.

If we go to your npm package https://www.npmjs.com/package/@iwer/devui?activeTab=code and look for the build/iwer-devui.min.js you can find duplicate code of the react package.

Also duplication will cause hard to debug bugs in production as the context and hook used by one version of react is returning something, and the context and hook used by another version of react is returning a different thing.

See https://github.com/facebook/react/issues/13991

smeng9 commented 3 weeks ago

If r170 version of three.js is causing problem, maybe only three.js should be pinned? Even though this may still cause warnings that multiple three.js instances gets loaded.