data-capsule icon indicating copy to clipboard operation
data-capsule copied to clipboard

Removing tslib

Open deanshub opened this issue 5 years ago • 1 comments

performance optimization

We added a feature to dumbledore that shows bundles diff between versions. I wanted to test so I searched for a big diff in bundle size image So I used the feature to see what changed And here you can see lot's of changes but one of them is that they have another version of tslib in their bundle (which makes it 2) image and using qnm it shows that the second version comes from this package.

It was added here #52 and aligns with the timeline of the bundles, I don't see a reason to add it as a dependency since typescript adds it if needed

deanshub avatar Dec 01 '20 13:12 deanshub

Almost every infra library uses TS but you don't see multiple tslib in vertical's bundle. The reason is that just one typescript compiles the code. The usual way of doing such a thing is defining a dependency using peer+dev, but since you have a regular dependency on tslib with a different version the the bundle that uses this module, it bundles it twice. And my understanding is that in any case you don't need it for tslib since it's a transitive dep of TS.

Is PR TC configured on this repo?

If it's bundle for bizManager we can add tslib as global and then consume it as externals.

In any case that's a good suggestion (I know there's a plan for such a thing)

deanshub avatar Dec 01 '20 16:12 deanshub