design-system icon indicating copy to clipboard operation
design-system copied to clipboard

chore/webpack chunks

Open alexandrebodin opened this issue 1 year ago • 3 comments

  • Experimenting with webpack chunks

What does it do?

Describe the technical changes you did.

Why is it needed?

Describe the issue you are solving.

How to test it?

Provide information about the environment and the path to verify the behaviour.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

alexandrebodin avatar Aug 26 '22 17:08 alexandrebodin

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
design-system ✅ Ready (Inspect) Visit Preview Aug 26, 2022 at 5:34PM (UTC)
design-system-website ✅ Ready (Inspect) Visit Preview Aug 26, 2022 at 5:34PM (UTC)

vercel[bot] avatar Aug 26 '22 17:08 vercel[bot]

@joshuaellis I'd like to have your opinion on this PR please

HichamELBSI avatar Sep 28 '22 10:09 HichamELBSI

I'm not sure chunking would help? Isn't the issue here that when we build the library we wrap up Flex as a production ready file that includes Box as it's dep, but isn't it too early to be doing this? It then causes Box to be included multiple times.

This could always be to do with the fact we're releasing a UMD bundle. I think to solve the issue we probably want to be releasing a ESM, CJS and UMD version of the library.

The only example I can think of that I know works (doesn't duplicate it's imports from it's own lib) is https://github.com/pmndrs/drei where we import OrbitControls into the Stage component, when you build both the ESM & CJS version are using their respective versions of import to bring in the OrbitControls, so I assume when people build their packages / apps / libraries only one version of the OrbitControls is there.

joshuaellis avatar Oct 03 '22 10:10 joshuaellis

We've merged a beta for using vite so i think we can close this.

joshuaellis avatar Nov 03 '22 12:11 joshuaellis