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

Maintenance: Updating icons generator to output typescript #1785

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

MikesGlitch
Copy link
Contributor

@MikesGlitch MikesGlitch commented Oct 11, 2023

So we currently use: Zondicons. Right now we have about 368 generated files based on that icon set - that's why the pr is huge.

All these files are generated with the following command:

"generate:icons": "rm src/icons/*/*.tsx; cd src/icons && svgr --typescript --expand-props start -d . .",

This PR just converts the js files to tsx.

To reduce the size of this PR we could delete the icons we don't use - that would make it harder when adding new icons to the UI in the future.

Another approach

We could use a package like styled-icons to get the zondicons into the project, and then delete all 368 of our icon files (because we'd be using the package instead). Then we wouldn't have to maintain these.

Open to thoughts

#1483

@netlify
Copy link

netlify bot commented Oct 11, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 1b85c93
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/652711ff5bee0600085a2ab5
😎 Deploy Preview https://deploy-preview-1785.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
16 2.82 MB → 2.82 MB (+48 B) +0.00%
Changeset (largest 100 files by percent change)
File Δ Size
src/icons/v2/EyeSlashed.tsx 🆕 +2.64 kB 0 B → 2.64 kB
src/icons/v2/Eye.tsx 🆕 +2.39 kB 0 B → 2.39 kB
src/icons/v2/MoonStars.tsx 🆕 +1.71 kB 0 B → 1.71 kB
src/icons/v1/PiggyBank.tsx 🆕 +1.68 kB 0 B → 1.68 kB
src/icons/v1/CloudCheck.tsx 🆕 +1.52 kB 0 B → 1.52 kB
src/icons/v2/Hyperlink2.tsx 🆕 +1.48 kB 0 B → 1.48 kB
src/icons/v2/CloudUnknown.tsx 🆕 +1.47 kB 0 B → 1.47 kB
src/icons/v1/CloudDownload.tsx 🆕 +1.39 kB 0 B → 1.39 kB
src/icons/v2/Sun.tsx 🆕 +1.16 kB 0 B → 1.16 kB
src/icons/v2/ArrowsSynchronize.tsx 🆕 +1.15 kB 0 B → 1.15 kB
src/icons/v2/NavigationMenu.tsx 🆕 +1.11 kB 0 B → 1.11 kB
src/icons/v2/PencilWriteAlternate.tsx 🆕 +1.1 kB 0 B → 1.1 kB
src/icons/v2/DownloadThickBottom.tsx 🆕 +1.06 kB 0 B → 1.06 kB
src/icons/v1/FileDouble.tsx 🆕 +1.02 kB 0 B → 1.02 kB
src/icons/v2/ArrowButtonRight1.tsx 🆕 +1 kB 0 B → 1 kB
src/icons/v2/ArrowButtonDown1.tsx 🆕 +1021 B 0 B → 1021 B
src/icons/v2/ArrowButtonLeft1.tsx 🆕 +1019 B 0 B → 1019 B
src/icons/v2/ArrowButtonUp1.tsx 🆕 +1015 B 0 B → 1015 B
src/icons/v2/ArrowsShrink3.tsx 🆕 +893 B 0 B → 893 B
src/icons/v2/EditSkull1.tsx 🆕 +882 B 0 B → 882 B
src/icons/v2/Pencil1.tsx 🆕 +874 B 0 B → 874 B
src/icons/v2/ArrowsExpand3.tsx 🆕 +870 B 0 B → 870 B
src/icons/v1/Add.tsx 🆕 +847 B 0 B → 847 B
src/icons/v1/Cog.tsx 🆕 +846 B 0 B → 846 B
src/icons/v2/CheckCircleHollow.tsx 🆕 +842 B 0 B → 842 B
src/icons/v2/Calendar.tsx 🆕 +836 B 0 B → 836 B
src/icons/v0/LeftArrow2.tsx 🆕 +806 B 0 B → 806 B
src/icons/v2/SettingsSliderAlternate.tsx 🆕 +787 B 0 B → 787 B
src/icons/v0/Add.tsx 🆕 +777 B 0 B → 777 B
src/icons/v2/FavoriteStar.tsx 🆕 +772 B 0 B → 772 B
src/icons/v1/StoreFront.tsx 🆕 +748 B 0 B → 748 B
src/icons/v2/AlertTriangle.tsx 🆕 +748 B 0 B → 748 B
src/icons/v2/RefreshArrow.tsx 🆕 +741 B 0 B → 741 B
src/icons/v2/Key.tsx 🆕 +738 B 0 B → 738 B
src/icons/v2/Remove.tsx 🆕 +730 B 0 B → 730 B
src/icons/v0/ExpandArrow.tsx 🆕 +724 B 0 B → 724 B
src/icons/v0/RightArrow2.tsx 🆕 +707 B 0 B → 707 B
src/icons/v0/Merge.tsx 🆕 +700 B 0 B → 700 B
src/icons/v2/CustomNotesPaper.tsx 🆕 +696 B 0 B → 696 B
src/icons/v0/Split.tsx 🆕 +685 B 0 B → 685 B
src/icons/v2/ValidationCheck.tsx 🆕 +685 B 0 B → 685 B
src/icons/v2/Check.tsx 🆕 +661 B 0 B → 661 B
src/icons/v2/SearchAlternate.tsx 🆕 +660 B 0 B → 660 B
src/icons/v2/CheckCircle1.tsx 🆕 +648 B 0 B → 648 B
src/icons/v1/Reports.tsx 🆕 +644 B 0 B → 644 B
src/icons/v1/InformationOutline.tsx 🆕 +624 B 0 B → 624 B
src/icons/v1/ExclamationOutline.tsx 🆕 +621 B 0 B → 621 B
src/icons/v1/Refresh.tsx 🆕 +608 B 0 B → 608 B
src/icons/v0/Delete.tsx 🆕 +604 B 0 B → 604 B
src/icons/v1/Close.tsx 🆕 +601 B 0 B → 601 B
src/icons/v1/Wallet.tsx 🆕 +596 B 0 B → 596 B
src/icons/v1/DotsHorizontalTriple.tsx 🆕 +588 B 0 B → 588 B
src/icons/v1/Tuning.tsx 🆕 +583 B 0 B → 583 B
src/icons/v1/Subtract.tsx 🆕 +569 B 0 B → 569 B
src/icons/v1/ArrowThinLeft.tsx 🆕 +563 B 0 B → 563 B
src/icons/v1/ArrowThinRight.tsx 🆕 +562 B 0 B → 562 B
src/icons/v1/CheveronRight.tsx 🆕 +557 B 0 B → 557 B
src/icons/v1/ArrowLeft.tsx 🆕 +555 B 0 B → 555 B
src/icons/v1/ArrowDown.tsx 🆕 +552 B 0 B → 552 B
src/icons/v1/ArrowUp.tsx 🆕 +551 B 0 B → 551 B
src/icons/v1/CheveronDown.tsx 🆕 +543 B 0 B → 543 B
src/icons/v1/CheveronLeft.tsx 🆕 +543 B 0 B → 543 B
src/icons/v0/Subtract.tsx 🆕 +540 B 0 B → 540 B
src/icons/v1/Trash.tsx 🆕 +530 B 0 B → 530 B
src/icons/v1/EditPencil.tsx 🆕 +529 B 0 B → 529 B
src/icons/v1/Pin.tsx 🆕 +509 B 0 B → 509 B
src/icons/v1/Checkmark.tsx 🆕 +492 B 0 B → 492 B
package.json 📈 +5 B (+0.23%) 2.15 kB → 2.15 kB
src/icons/v2/EyeSlashed.js 🔥 -2.64 kB (-100%) 2.64 kB → 0 B
src/icons/v2/Eye.js 🔥 -2.3 kB (-100%) 2.3 kB → 0 B
src/icons/v2/MoonStars.js 🔥 -1.71 kB (-100%) 1.71 kB → 0 B
src/icons/v1/PiggyBank.js 🔥 -1.68 kB (-100%) 1.68 kB → 0 B
src/icons/v1/CloudCheck.js 🔥 -1.52 kB (-100%) 1.52 kB → 0 B
src/icons/v2/Hyperlink2.js 🔥 -1.48 kB (-100%) 1.48 kB → 0 B
src/icons/v2/CloudUnknown.js 🔥 -1.47 kB (-100%) 1.47 kB → 0 B
src/icons/v1/CloudDownload.js 🔥 -1.39 kB (-100%) 1.39 kB → 0 B
src/icons/v2/Sun.js 🔥 -1.16 kB (-100%) 1.16 kB → 0 B
src/icons/v2/ArrowsSynchronize.js 🔥 -1.15 kB (-100%) 1.15 kB → 0 B
src/icons/v2/NavigationMenu.js 🔥 -1.11 kB (-100%) 1.11 kB → 0 B
src/icons/v2/PencilWriteAlternate.js 🔥 -1.1 kB (-100%) 1.1 kB → 0 B
src/icons/v2/DownloadThickBottom.js 🔥 -1.06 kB (-100%) 1.06 kB → 0 B
src/icons/v1/FileDouble.js 🔥 -1.02 kB (-100%) 1.02 kB → 0 B
src/icons/v2/ArrowButtonRight1.js 🔥 -1 kB (-100%) 1 kB → 0 B
src/icons/v2/ArrowButtonDown1.js 🔥 -1021 B (-100%) 1021 B → 0 B
src/icons/v2/ArrowButtonLeft1.js 🔥 -1019 B (-100%) 1019 B → 0 B
src/icons/v2/ArrowButtonUp1.js 🔥 -1015 B (-100%) 1015 B → 0 B
src/icons/v2/ArrowsShrink3.js 🔥 -893 B (-100%) 893 B → 0 B
src/icons/v2/EditSkull1.js 🔥 -882 B (-100%) 882 B → 0 B
src/icons/v2/Pencil1.js 🔥 -874 B (-100%) 874 B → 0 B
src/icons/v2/ArrowsExpand3.js 🔥 -870 B (-100%) 870 B → 0 B
src/icons/v1/Add.js 🔥 -847 B (-100%) 847 B → 0 B
src/icons/v1/Cog.js 🔥 -846 B (-100%) 846 B → 0 B
src/icons/v2/CheckCircleHollow.js 🔥 -842 B (-100%) 842 B → 0 B
src/icons/v2/Calendar.js 🔥 -836 B (-100%) 836 B → 0 B
src/icons/v0/LeftArrow2.js 🔥 -806 B (-100%) 806 B → 0 B
src/icons/v2/SettingsSliderAlternate.js 🔥 -787 B (-100%) 787 B → 0 B
src/icons/v0/Add.js 🔥 -777 B (-100%) 777 B → 0 B
src/icons/v2/FavoriteStar.js 🔥 -772 B (-100%) 772 B → 0 B
src/icons/v1/StoreFront.js 🔥 -748 B (-100%) 748 B → 0 B
src/icons/v2/AlertTriangle.js 🔥 -748 B (-100%) 748 B → 0 B
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/312.chunk.js 0 B → 12.78 kB (+12.78 kB) -

Removed

Asset File Size % Changed
static/js/389.chunk.js 12.77 kB → 0 B (-12.77 kB) -100%

Bigger

Asset File Size % Changed
static/js/main.js 1.12 MB → 1.12 MB (+36 B) +0.00%
static/js/wide-components.chunk.js 126.79 kB → 126.79 kB (+3 B) +0.00%
static/js/narrow-components.chunk.js 43.06 kB → 43.07 kB (+3 B) +0.01%
static/js/reports.chunk.js 29.92 kB → 29.93 kB (+2 B) +0.01%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/848.chunk.js 760.98 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/713.chunk.js 156.56 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@MikesGlitch MikesGlitch changed the title updating icons generator to typescript Maintenance: Updating icons generator to typescript Oct 11, 2023
@MikesGlitch MikesGlitch marked this pull request as ready for review October 11, 2023 21:34
@MikesGlitch MikesGlitch changed the title Maintenance: Updating icons generator to typescript Maintenance: Updating icons generator to output typescript Oct 11, 2023
Copy link
Contributor

@joel-jeremy joel-jeremy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you!

@joel-jeremy
Copy link
Contributor

I think using styled-icons would be a good move and would reduce the amount of code we need to maintain but I would like to see if all of the icons that we use are in that package. A POC would be great to see if that is the case.

@MikesGlitch
Copy link
Contributor Author

MikesGlitch commented Oct 16, 2023

I think using styled-icons would be a good move and would reduce the amount of code we need to maintain but I would like to see if all of the icons that we use are in that package. A POC would be great to see if that is the case.

It looks like there are some icons in here that aren't in the latest Zondicons package - so on second thought, using a zondicons package might not be best.

The icons seem like a mix of icon sets/self made.

E.g. Our add icon is:
image

But the Zondicon add is:
image

There are lots of others too - there are some Zondicons icons and some are slightly different. I think it might be best to keep the system we have and convert them from svg using the script.

I found that there are unused icons - mainly in the v1 folder. Do you think we should delete them or just leave them for future use? If we're happy leaving them, I think this PR's done.

@MatissJanis
Copy link
Member

I found that there are unused icons - mainly in the v1 folder. Do you think we should delete them or just leave them for future use? If we're happy leaving them, I think this PR's done.

Tree-shaking is removing them from the output bundle, so I think it's fine to keep them. A bit of overhead.. but helps with future feature creation that need more icon diversity.

@MatissJanis MatissJanis merged commit 5cc6bad into actualbudget:master Oct 19, 2023
17 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Oct 19, 2023
@MikesGlitch MikesGlitch deleted the maintenance/ts-icons branch October 19, 2023 07:45
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants