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
I faced some difficulties when trying to make a fix in three-vrm.
The published contents of @pixiv/three-vrm contained .js files that bundle all subpackages together, but the .d.ts still reference individual subpackages from @pixiv/three-vrm-*. Additionally, these subpackages are listed as "dependencies" of three-vrm even though their code is already bundled. These dependencies are only used to provide types for the bundle.
This causes the following issues:
Users download unused .js bundles for each subpackage to node_modules
Type definitions for three-vrm can get desynchronized from the actual .js code
For example, I tried to fork the repo to make a small change. After building and publishing three-vrm to my own namespace, I experienced strange build errors. Even though my published .js files contained the desired changes, the types were still pointing at the unchanged upstream three-vrm-core package. This means I'd have to publish each subpackage individually to my namespace!
A solution I adopted in my fork is to bundle the types for three-vrm using tsup. This means the published .js and .d.ts files are sure to be in sync, and subpackages are no longer required as "dependencies".
This might make it easier for folks in the community to make fixes, while also reducing the package's footprint in node_modules :)
This shouldn't affect users who wish to install the subpackages individually.
node_modules before
node_modules after
Just a suggestion—I can make a PR for this if you're interested, otherwise feel free to close.
The text was updated successfully, but these errors were encountered:
@mattrossman Hi, thanks for the suggestion. The example makes sense to me and the diff looks good overall. Since it changes the build workflow please let us consider it for a while. Much appreciated.
I faced some difficulties when trying to make a fix in
three-vrm
.The published contents of
@pixiv/three-vrm
contained.js
files that bundle all subpackages together, but the.d.ts
still reference individual subpackages from@pixiv/three-vrm-*
. Additionally, these subpackages are listed as "dependencies" ofthree-vrm
even though their code is already bundled. These dependencies are only used to provide types for the bundle.This causes the following issues:
.js
bundles for each subpackage tonode_modules
three-vrm
can get desynchronized from the actual.js
codeFor example, I tried to fork the repo to make a small change. After building and publishing
three-vrm
to my own namespace, I experienced strange build errors. Even though my published.js
files contained the desired changes, the types were still pointing at the unchanged upstreamthree-vrm-core
package. This means I'd have to publish each subpackage individually to my namespace!A solution I adopted in my fork is to bundle the types for
three-vrm
using tsup. This means the published.js
and.d.ts
files are sure to be in sync, and subpackages are no longer required as "dependencies".Here is the change: mattrossman@3c1e258
This might make it easier for folks in the community to make fixes, while also reducing the package's footprint in node_modules :)
This shouldn't affect users who wish to install the subpackages individually.
node_modules
beforenode_modules
afterJust a suggestion—I can make a PR for this if you're interested, otherwise feel free to close.
The text was updated successfully, but these errors were encountered: