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

fix(octicons-styled): update how package is output to reduce bundle size #1027

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

joshblack
Copy link
Member

Closes #981

Update how @primer/octicons-styled is built so that it doesn't re-include icons in each entrypoint 😅

This seems to occur because rollup (at least in the previous version used) does not eliminate unused exports for each of the entry points that were being generated for icons. This PR updates our dependencies on rollup to the latest version and changes how these icons are emitted so that there is only ever one instance of the icons from octicons-react in the bundle.

This also points out that this package could also be importing directly from @primer/octicons-react but I'll save that for another change if we want to go down that route.

Copy link

changeset-bot bot commented Jun 25, 2024

🦋 Changeset detected

Latest commit: 5b7a094

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/octicons Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 24, 2024
@github-actions github-actions bot closed this Aug 31, 2024
@github-actions github-actions bot deleted the chore/update-rollup-to-latest branch August 31, 2024 18:03
@lesliecdubs
Copy link
Member

@joshblack should we consider reviving this PR? Not sure how complete / how close to merge it is.

@joshblack
Copy link
Member Author

joshblack commented Sep 3, 2024

@lesliecdubs happy to revive this! It should be good to go, just needs a review 👀 One question this does bring up is if we want to continue supporting this "styled-components" package, or not.

@joshblack joshblack restored the chore/update-rollup-to-latest branch September 3, 2024 15:53
@joshblack joshblack reopened this Sep 3, 2024
@lesliecdubs
Copy link
Member

One question this does bring up is if we want to continue supporting this "styled-components" package, or not.

@joshblack do you know how much effort it is to continue supporting this? I can understand that we may not want to commit over the long haul, but if this change will improve performance by only including one version of the icons I'd be interested to ship it and iterate from there.

@joshblack
Copy link
Member Author

@lesliecdubs hopefully not much 🤞 And sounds good to me! 👍

@github-actions github-actions bot removed the Stale label Sep 3, 2024
@lesliecdubs
Copy link
Member

Nice! I'm going to add this PR review to the FR inbox as well so we can hopefully get some movement on that and get closer to merge.

@lesliecdubs
Copy link
Member

FYI, I'm marking this as ready for review so we can try to get an initial review from a FR on this 😄

@lesliecdubs lesliecdubs marked this pull request as ready for review September 16, 2024 19:20
@lesliecdubs lesliecdubs requested a review from a team as a code owner September 16, 2024 19:20
Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😎

@lesliecdubs
Copy link
Member

Bump on this, as I saw additional comments on the issue (#981). @joshblack looks like we got a ✅ ; should we merge?

@joshblack
Copy link
Member Author

Hey @lesliecdubs! Sorry for the delay, this has been falling behind with the next major work 👀

I noticed an issue with how the bundle gets emitted that I need to check first 🤔 it seems like something key has changed that is causing the bundle to be different than expected

@joshblack joshblack merged commit 12c6fb0 into main Oct 30, 2024
11 checks passed
@joshblack joshblack deleted the chore/update-rollup-to-latest branch October 30, 2024 22:05
@primer primer bot mentioned this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Using styled-octicons in development mode significantly bloats bundle
5 participants