Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Consider bundle size #2113

Open
Open
@brambow

Description

@brambow

Feature Request

Consider the total library size.

Problem description

Fluent is significantly larger than comparable options, including it's spiritual predecessor SUIR. (244kb gzipped vs 83 for SUIR). While apps that treeshake can reduce the size, I've noticed it's still pretty large. For example, I've been working on a library that uses Fluent, but only imports 10 of Fluent's components and the gzipped size is still over 100kb.

https://bundlephobia.com/result?p=@stardust-ui/react@0.40.3
image

Here's an example of what stardust is taking up in my library once treeshaking occurs (using source-map-explorer):

According to this, the 10 stardust components I'm using account for 15% of my overall application size at 230kb (All the application is doing here is displaying a Mapbox map)

image

Proposed solution

I'm not really sure. I know a library that considers so much, like accessibility and theming, and has so many components out of the box might be bigger than something like Rebass. But surely there are some opportunities to reduce size. For example, there's a ton of places where you're importing the full lodash library, only to use one function, like _.get(). In those cases, wouldn't it be better to import the individual lodash es modules?

I think Fluent has a lot to like, but its size concerns me a bit and definitely has me looking at other alternatives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions