-
Notifications
You must be signed in to change notification settings - Fork 3
Support Tree shaking #165
Copy link
Copy link
Open
Labels
p/mediumNon-urgent issues/features that are candidates for inclusion in one of the upcoming sprintsNon-urgent issues/features that are candidates for inclusion in one of the upcoming sprints
Metadata
Metadata
Assignees
Labels
p/mediumNon-urgent issues/features that are candidates for inclusion in one of the upcoming sprintsNon-urgent issues/features that are candidates for inclusion in one of the upcoming sprints
User story.
As a developer, I can use the pieces of
ui-kitwithout bloating my package by including the entire bundle.Is your feature request related to a problem?
See stoplightio/elements#376 for example. Elements uses parts of
ui-kit, then the elements bundle gets very large as it imports all of@blueprintjs/core, even parts that it doesn't need.Ninja has this problem, to a lesser degree. Lesser because I assume we use almost the entire
ui-kitin ninja, but probably still not 100%.Describe the solution you'd like
Implement dual ESM + CJS packaging. yalc into ninja to see if SSR support (CJS) is still intact.
Additional context
I have created an example project to demonstrate the issue: https://github.com/marcelltoth/bundle-size-test
This is a simple CRA template that includes a single button from
ui-kit.Using the current beta the resulting bundle looks like this:

I experimented with packing the same

ui-kitas an ESM. Looks much better (35% improvement):The second one still has the problem of including all blueprint icons, that's an open issue at palantir/blueprint#2193