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

Add a icon-registry to register used icons, to reduce final build size #1507

Closed
2 tasks done
Endunry opened this issue Oct 9, 2024 · 2 comments
Closed
2 tasks done
Labels
type: enhancement New feature or request

Comments

@Endunry
Copy link
Contributor

Endunry commented Oct 9, 2024

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

Suggestion / feature request

I once asked this on the siemensix community platform and i thought i might add it here. I dont think that this has a high priority or if its even possible with stencil.

But since this is a component framework for "industrial context" and maintained by siemens + the community. We're using this to create a Web-Interface on a S7-1500. Thus our space is limited and our goal was (with the code on the PLC) to only use a 4MB Card. And we got it to work, but only by writing a script that changes the build-files which deletes unused icons.

Since every single icon is stored twice inside two different js-files this takes up by far the most space (~2MB), with the script we got it to ~60KB.

I know this is a common issue with icon-libs and some solve this by requiring you to register icons. Unregistered icons are then not included in the final build because the build process uses tree-shaking. And while the script is doing its job (for now), this really is not ideal, for obvious reasons.

Can this be done in this library aswell, or is this issue planned in the future?

So to summarize my feature request: Add a way to not include every icon in the final build, but only the ones used (either by using ix-icon directly or adding the chevron-icons when using a ix-select etc.)

@Endunry Endunry added triage We discuss this topic in our internal weekly type: enhancement New feature or request labels Oct 9, 2024
@danielleroux
Copy link
Collaborator

danielleroux commented Oct 9, 2024

Hi @Endunry this is implemented with PR siemens/ix-icons#64. We switched from the pre-bundled icon package to a asset based approch. This enables to control which icon are part of the application dist.

The new icon system will be released together with 3.0.0 because we have to do some breaking changes and adaptions.

@danielleroux danielleroux removed the triage We discuss this topic in our internal weekly label Oct 9, 2024
@Endunry
Copy link
Contributor Author

Endunry commented Oct 9, 2024

WOW really nice. Thanks for the fast heads up.
Can't await the change, thanks guys

@Endunry Endunry closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants