faency icon indicating copy to clipboard operation
faency copied to clipboard

[RFC] Implement build in chunks to improve import cost

Open paulocfjunior opened this issue 4 years ago • 2 comments

RFC

Overview

Currently, our build generates one single file that embeds all components, fonts, and utils. This affects the First Load JS size as it will load the entire library in the first render.

Proposal

Configure rollup to use manualChunks or another approach that splits the code in chunks that can be imported invididually.

Examples in other libraries

I haven't found yet an example

Who does this impact? Who is this for?

This will impact anyone that uses the lib by optimizing how the components are imported.

Additional context

Rollup documentation around code splitting and manual chunks.

paulocfjunior avatar Feb 15 '22 17:02 paulocfjunior

WIP branch: https://github.com/paulocfjunior/faency/tree/chore/chunk-build

paulocfjunior avatar Feb 15 '22 17:02 paulocfjunior

I just created an issue to study alternatives to one of our (bad) rollup plugins:

  • https://github.com/traefik/faency/issues/338

seedy avatar Apr 06 '22 09:04 seedy