Skip to content

feat: debounce dom updates - #120

Merged
harlan-zw merged 2 commits into
mainfrom
feat/debounce-dom-updates
Oct 4, 2022
Merged

harlan-zw merged 2 commits into
mainfrom
feat/debounce-dom-updates

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

Issue

See #58.

Also, there's a performance issue when you have many nested components updating the head, each one is triggering recursive dom updates.

Solution

Simple debounce function based on nextTick. This also fully separates dom logic into the dom namespace

@github-actions

github-actions Bot commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

Export Size

@vueuse/head

Name Size Diff
createHead 2.06 KB +97 B (+4.81%) 🔺
updateElements 774 B -5 B (-0.64%) 🔽
Unchanged

@vueuse/head

Name Size Diff
createElement 233 B -
escapeHtml 104 B -
escapeJS 152 B -
Head 531 B -
injectHead 162 B -
isEqualNode 183 B -
renderHeadToString 1.11 KB -
resolveHeadEntry 212 B -
setAttrs 219 B -
sortTags 185 B -
stringifyAttrName 109 B -
stringifyAttrs 500 B -
stringifyAttrValue 193 B -
tagDedupeKey 276 B -
tagToString 764 B -
useHead 263 B -
useHeadRaw 272 B -

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