Skip to content

Add eager loading to icon component + header icon#21

Merged
t-kelly merged 1 commit intomainfrom
eager-icons
Jun 6, 2024
Merged

Add eager loading to icon component + header icon#21
t-kelly merged 1 commit intomainfrom
eager-icons

Conversation

@t-kelly
Copy link
Copy Markdown
Contributor

@t-kelly t-kelly commented Jun 6, 2024

Any custom elements inside an <is-land> have their connectedCallback() function delayed until the island is hydrated. This was working against our icon approach and delaying the downloading and setting of icon svgs until on:idle, aka when page completed loading.

The lib we use for comes with defer-hydration functionality (read more here) which when applied to our icon element allows them to be loaded eagerly. Adding this as a param since the default functionality works well in most cases!

@t-kelly t-kelly merged commit 73e1ab6 into main Jun 6, 2024
@t-kelly t-kelly deleted the eager-icons branch June 6, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant