Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Consider removing font-awesome #14572

Closed
joshuaellis opened this issue Oct 7, 2022 · 8 comments · Fixed by #15133
Closed

[RFC] Consider removing font-awesome #14572

joshuaellis opened this issue Oct 7, 2022 · 8 comments · Fixed by #15133
Assignees
Labels
issue: discussion A general discussion issue severity: medium If it breaks the basic use of the product but can be worked around source: core:admin Source is core/admin package

Comments

@joshuaellis
Copy link
Member

Discussion report

I've been doing some investigations around bundle size (namely the design system and it's integration with the admin application) and noticed how large the fortawesome package is (see image below)

CleanShot 2022-10-07 at 11 09 10@2x

It accounts for ~40% of the bundle size, I appreciate it's been chunked but i'm wondering if it's really necessary to use an external library? (side note) are we lazy loading its usage? Could we find either a leaner library or one that's significantly smaller etc, or perhaps enhance the @strapi/icons and use that.

If we want to tackle the bundle size that we pass to the client really then this topic needs to be approached.

Steps to reproduce the behavior

  1. run yarn analyze:bundle in packages/core/admin
  2. see report and investigate yourself.

cc @gu-stav / @ronronscelestes / @maevalienard

@joshuaellis joshuaellis added issue: discussion A general discussion issue source: core:admin Source is core/admin package labels Oct 7, 2022
@gu-stav
Copy link
Contributor

gu-stav commented Oct 7, 2022

As I've mentioned on Slack: I'm all in for that. The size of that dependency is just crazy. It costs our users a lot of money, makes the overall performance worse, and will have the same implications soon for us on the cloud. We would see a considerable performance benefit by removing that.

The most challenging thing will be to refactor the icons for components: currently, users can select from all available icons, which is the reason we need to bundle all of them. If we want to eliminate it, we need to find a replacement to make components visually distinct for content editors.

@gu-stav gu-stav added the severity: medium If it breaks the basic use of the product but can be worked around label Oct 7, 2022
@joshuaellis
Copy link
Member Author

It costs our users a lot of money, makes the overall performance worse, and will have the same implications soon for us on the cloud.

This is a really good point. I'm not sure how billing is done on cloud, do they get charged for bandwidth when accessing the admin panel? I would assume so.

@maevalienard
Copy link

All in for that too. We were already discussing that while building v4 and at the time, I cherry picked some icons to replace the library we have in the CTB to have less icons and stop being dependent from font-awesome.
I'm not sure how exactly I could help to move on with this topic so don't hesitate to tell me :)

@derrickmehaffy
Copy link
Member

Don't we use FA for the component "icon picker" (of which I get several comments from users and customers alike that ask why we even have that)

@maevalienard
Copy link

Indeed Derrick, that's what I meant by replacing the library we have in the CTB actually :D

@CleberRossi
Copy link
Contributor

Hello,
Found this discuttion about the size of the bundle.

FortAwesome/react-fontawesome#70

We need to import expliciting the component want in order of the webback be able to only import what you need.

I opened this PR : #14579

However I am worried about some content-type builder tests I had to update the snapshot and I'm not sure I am doing it right. Can you guys help?

@soupette
Copy link
Contributor

100% aligned with dropping FA!

@WalkingPizza
Copy link
Contributor

You should consider just yeeting the icons from components altogether, they are painfully annoying to pick because of the limited selection and don't really serve a purpose that is not purely aesthetic.

I am pretty confident Maeva can find a way to make the CTB look good without those icons (eg. using the component's initials instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: discussion A general discussion issue severity: medium If it breaks the basic use of the product but can be worked around source: core:admin Source is core/admin package
Projects
Status: Fixed/Shipped
Archived in project
8 participants