Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently this method is being called everytime a
<v-icon>
component is mounted:directus/app/src/components/v-icon/v-icon.vue
Line 66 in 47db8e5
link to
library.add(...iconDefinitions)
in Font Awesome's docsThis in turn causes some performance hit as
<v-icon>
is being used throughout the app. However the most noticable impact is the<select-icon>
interface, where now that same method is being ran for every icon in the whole dropdown list, which was why the dropdown takes a while to appear.Changes
Moved the
library.add(fab)
call into the<social-icon>
so that it will only be called when using social icons.Turned
socialIcons
andcomponents
into a separate imported file (I assume this way they will only be declared once? Not 100% sure about this) which felt like it helped as well, but not sure if it's placebo.Tweaked
filteredIcons
computed property in<select-icon>
a little bit.Before
(gray circle to indicate mouse click to see how long does it take to appear/disappear)
PowerToys_Djg2uWDLfF.mp4
After
There's still a tad delay when it's dissappearing due to Vue unmounting the icons in the dropdown/v-menu (still room for improvement here), but it is appearing near instantly now.
PowerToys_gHsKnvupCY.mp4
Type of Change
Requirements Checklist
If adding a new feature: