MCPcopy
hub / github.com/vercel/next.js / addBeforeInteractiveToCache

Function addBeforeInteractiveToCache

packages/next/src/client/script.tsx:179–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179function addBeforeInteractiveToCache() {
180 const scripts = [
181 ...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
182 ...document.querySelectorAll('[data-nscript="beforePageRender"]'),
183 ]
184 scripts.forEach((script) => {
185 const cacheKey = script.id || script.getAttribute('src')
186 LoadCache.add(cacheKey)
187 })
188}
189
190export function initScriptLoader(scriptLoaderItems: ScriptProps[]) {
191 scriptLoaderItems.forEach(handleClientScriptLoad)

Callers 1

initScriptLoaderFunction · 0.85

Calls 3

getAttributeMethod · 0.80
forEachMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected