Why does the async loop `File.stream().getReader().read()` may block main thread?
<input type=”file” id=”el”> <code id=”out”></code> const el = document.getElementById(‘el’); const out = document.getElementById(‘out’); el.addEventListener(‘change’, async () => { const file = el.files?.[0]; if (file) { const reader = file.stream().getReader(); out.innerText = JSON.stringify({ fileSize: file.size }); let received = 0; while (true) { const chunk = await reader.read(); if (chunk.done) break; // chunk.value.forEach((it) => it + […]