You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(validate): false positives for warmup preloads and charset position (#732)
- Allow `preload` + `fetchpriority="low"` for `as="script"` (the warmup
pattern used by `useScript` to start fetching at low priority).
- Skip `preload-async-defer-conflict` when the preload uses
`fetchpriority="low"` for the same reason.
- Run `charset-not-early` only on SSR (DOM order is already set after
hydration), and sort by capo weight while filtering virtual tags
(`templateParams`, `titleTemplate`) so they don't inflate the position
count.
- Pass tag references to several `report()` calls so consumers can
surface the offending tag in error messages.
report('og-image-missing-dimensions',`og:image is set but og:image:width and/or og:image:height are missing — social platforms may not display the image.`,'warn')
507
+
report('og-image-missing-dimensions',`og:image is set but og:image:width and/or og:image:height are missing — social platforms may not display the image.`,'warn',metaByKey.get('og:image'))
report('missing-template-params-plugin',`templateParams are set but TemplateParamsPlugin is not registered. In v3, this plugin is opt-in. Add it to createHead({ plugins: [TemplateParamsPlugin] }).`,'warn')
report('missing-template-params-plugin',`templateParams are set but TemplateParamsPlugin is not registered. In v3, this plugin is opt-in. Add it to createHead({ plugins: [TemplateParamsPlugin] }).`,'warn',tpTag)
report('charset-not-early',`<meta charset> is at position ${charsetPosition} in <head>. It should be within the first ${charsetMaxPos} tags so the browser doesn't need to re-parse.`,'warn',charsetTag)
643
654
}
644
-
if(charsetTag&&charsetPosition>charsetMaxPos)
645
-
report('charset-not-early',`<meta charset> is at position ${charsetPosition} in <head>. It should be within the first ${charsetMaxPos} tags so the browser doesn't need to re-parse.`,'warn',charsetTag)
646
655
647
656
// preload as="script" when the actual script is type="module" should use modulepreload
0 commit comments