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

perf(various): don't use lazy-loaded icon names in components #24671

Merged
merged 5 commits into from
Jan 28, 2022

Conversation

amandaejohnston
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A (tech debt issue)

Many components use lazy-loaded ionicon names, which requires us to front-load the imports in React and Vue. This leads to a larger bundle size than necessary if you don't use all the related components, and is difficult to maintain since you have to remember to edit the front-load.

What is the new behavior?

  • Icons are imported as raw SVG data directly in the component instead.
  • Icon front-loading in React and Vue removed.
  • Docs updated in a few places to not explicitly list the icon names as strings.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@amandaejohnston amandaejohnston requested a review from a team as a code owner January 27, 2022 22:49
@github-actions github-actions bot added package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package labels Jan 27, 2022
@amandaejohnston amandaejohnston merged commit 484de50 into main Jan 28, 2022
@amandaejohnston amandaejohnston deleted the FW-326 branch January 28, 2022 15:13
@danleedham
Copy link

Unsure if anyone else has found this adds an additional error when operating with a stricter Content Security Policy? Not the end of the world, but wasn't expecting during a refactoring update. If so, adding data: to the CSP removes the errors. Not entirely related but did find this ionic-team/ionicons#1025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants