
ALT A website usually uses external resources like images, CSS, and JavaScript. Those files need to be loaded from network or cache. The main thread could request them one by one as they find them while parsing to build a DOM, but in order to speed up, "preload scanner" is run concurrently. If there are things like <img> or <link> in the HTML document, preload scanner peeks at tokens generated by HTML parser and sends requests to the network thread in the browser process.

ALT Top-level await enables developers to use the await keyword outside of async functions. It acts like a big async function causing other modules who import them to wait before they start evaluating their body. // Before 😭😭😭 const strings = await import(`/i18n/${navigator.language}`); // → SyntaxError: await is only valid in async function // Doh. An async function wrapper it is then (async function() { const strings = await import(`/i18n/${navigator.language}`); }()); // After 🎉🎉🎉 const strings = await import(`/i18n/${navigator.language}`); // As long as you're in the top-level of a module
















