@unhead/dom 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -61,7 +61,8 @@ async function renderDOMHead(head, options = {}) {
61
61
  const tagRenderId = tag._d || tag._p;
62
62
  const markSideEffect = (key, fn) => {
63
63
  key = `${tagRenderId}:${key}`;
64
- entry._sde[key] = fn;
64
+ if (entry)
65
+ entry._sde[key] = fn;
65
66
  delete staleSideEffects[key];
66
67
  };
67
68
  const setAttrs = ($el, sideEffects = true) => {
@@ -140,7 +141,7 @@ async function renderDOMHead(head, options = {}) {
140
141
  return $newEl;
141
142
  };
142
143
  for (const tag of await head.resolveTags()) {
143
- const entry = head.headEntries().find((e) => e._i === Number(tag._e));
144
+ const entry = head.headEntries().find((e) => e._i === tag._e);
144
145
  const renderCtx = { $el: null, shouldRender: true, tag, entry, queuedSideEffects: staleSideEffects };
145
146
  await head.hooks.callHook("dom:beforeRenderTag", renderCtx);
146
147
  if (!renderCtx.shouldRender)
package/dist/index.mjs CHANGED
@@ -59,7 +59,8 @@ async function renderDOMHead(head, options = {}) {
59
59
  const tagRenderId = tag._d || tag._p;
60
60
  const markSideEffect = (key, fn) => {
61
61
  key = `${tagRenderId}:${key}`;
62
- entry._sde[key] = fn;
62
+ if (entry)
63
+ entry._sde[key] = fn;
63
64
  delete staleSideEffects[key];
64
65
  };
65
66
  const setAttrs = ($el, sideEffects = true) => {
@@ -138,7 +139,7 @@ async function renderDOMHead(head, options = {}) {
138
139
  return $newEl;
139
140
  };
140
141
  for (const tag of await head.resolveTags()) {
141
- const entry = head.headEntries().find((e) => e._i === Number(tag._e));
142
+ const entry = head.headEntries().find((e) => e._i === tag._e);
142
143
  const renderCtx = { $el: null, shouldRender: true, tag, entry, queuedSideEffects: staleSideEffects };
143
144
  await head.hooks.callHook("dom:beforeRenderTag", renderCtx);
144
145
  if (!renderCtx.shouldRender)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/dom",
3
3
  "type": "module",
4
- "version": "0.6.4",
4
+ "version": "0.6.6",
5
5
  "packageManager": "pnpm@7.14.0",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@unhead/schema": "0.6.4"
33
+ "@unhead/schema": "0.6.6"
34
34
  },
35
35
  "devDependencies": {
36
36
  "zhead": "1.0.0-beta.13"