Chrome/Edge 84: More performant svg workaround solution
Instead of svg4everybody we use a custom more performant solution. Unfortunately svg4everybody had a big performance impact on pages with a lot of icons: https://gitlab.com/gitlab-org/quality/performance/-/issues/312 We load our sprite icons with JS and add them to the body. Then we iterate over all the `use` elements and replace their reference to that svg which we added internally. In order to avoid id conflicts, those are renamed with a unique prefix. We do that once the DOMContentLoaded fired and otherwise we use a mutation observer to re-trigger this logic. In order to not have a big impact on performance or to cause flickering of of content, 1. we only do it for each svg once 2. we debounce the event handler and just do it in a requestIdleCallback
Showing
... | ... | @@ -129,7 +129,6 @@ |
"stickyfilljs": "^2.1.0", | ||
"string-hash": "1.1.3", | ||
"style-loader": "^1.1.3", | ||
"svg4everybody": "^2.1.9", | ||
"swagger-ui-dist": "^3.26.2", | ||
"three": "^0.84.0", | ||
"three-orbit-controls": "^82.1.0", | ||
... | ... |
Please register or sign in to comment