Closed ad1992 closed 1 year ago
@size-limit/time
is not using on client-side. It is server-side only package.
Are you sure it leads to increasing bundle size? Can you show some project with this issue?
@size-limit/time
is not using on client-side. It is server-side only package.Are you sure it leads to increasing bundle size? Can you show some project with this issue?
Since size-limit
a dev dependency so bundle size eventually won't matter but due to multiple versions of react the host build can break if they are on React 18 specially thats what is happening right now https://github.com/excalidraw/excalidraw/issues/6801
Hm. The problem is that we can’t use host’s version.
We are using React sources to estimate to CPU power of CI by parsing these sources. React 18 and React 17 has a different size and the result will be different.
But we can switch from React to some another library. Do you know some big library without dependencies?
parsing these sources
In that case instead of using the npm package for react
, you can keep a local copy of its react.production.min.js
? or even use the unpkg link ?
That way host don't have to install react
Hm, interesting idea. Do you want to send PR to keep your name in the project’s history?
Sure I will raise a PR shortly
In the package
@size-limit/time
,react @17.x
is a dependency which leads to installing multiple versions in host and increasing bundle size as well.https://github.com/ai/size-limit/blob/main/packages/time/package.json#L24
It should be instead a peer dependency where 17.x / 18.x should be allowed whichever host is using.