fixes an issue where the aresrpg-engine sometimes imported three directly instead of using the centralized three-usage.ts
tries to fix a bug where at the start up of the aresrpg-dapp, we see 2 warnings
These warnings mean that aresrpg-world, aresrpg-dapp and aresrpg-engine had different THREE versions.
My understanding is that it happens because aresrpg-engine wants a THREE v0.163.0 whereas aresrpg-dapp wants a THREE v0.164.1, so NPM installs both versions and both are bundled in the final product. To fix this, we could always synchronize versions in the 3 packages, but it is not very easy to do. I hope passing three as a peerDependecy instead of a dependency will make npm understand that aresrpg-engine can use the same version as aresrpg-dapp.
Importing multiple THREE versions is bad because:
it might lead to bugs
it slows down the start up of aresrpg-dapp, since a minified THREE is abound 600KB of minified javascript, so loading 3 different versions takes network and CPU time uselessly
This PR:
aresrpg-engine
sometimes importedthree
directly instead of using the centralizedthree-usage.ts
aresrpg-dapp
, we see 2 warningsaresrpg-world
,aresrpg-dapp
andaresrpg-engine
had different THREE versions. My understanding is that it happens becausearesrpg-engine
wants a THREE v0.163.0 whereasaresrpg-dapp
wants a THREE v0.164.1, so NPM installs both versions and both are bundled in the final product. To fix this, we could always synchronize versions in the 3 packages, but it is not very easy to do. I hope passingthree
as apeerDependecy
instead of adependency
will make npm understand thataresrpg-engine
can use the same version asaresrpg-dapp
. Importing multiple THREE versions is bad because:aresrpg-dapp
, since a minified THREE is abound 600KB of minified javascript, so loading 3 different versions takes network and CPU time uselessly