Progress doesn't have to be very detailed. Big chunky steps like "download," "decompress," etc. are fine. I know we use stuff like fetch and single-call xz_dec_run which doesn't produce progress info.
Error display doesn't have to be fancy. Put a red div on screen maybe. The error stack should be fine, don't need custom error messages. Just so we don't have to open the developer console to see if something went wrong.
Oh, a warning: we transfer control of the main thread to the wasm decompressor, i.e. it's syncrhonous. So make sure to schedule a separate task to render the "decompressing" message before starting the decompression. Probably rigging up a line to await a requestAnimationFrame will suffice.
Progress doesn't have to be very detailed. Big chunky steps like "download," "decompress," etc. are fine. I know we use stuff like
fetch
and single-callxz_dec_run
which doesn't produce progress info.Error display doesn't have to be fancy. Put a red div on screen maybe. The error stack should be fine, don't need custom error messages. Just so we don't have to open the developer console to see if something went wrong.
Currently we only have a
catch (e) { console.error(e); }
https://github.com/wh0/nix-cache-view/blob/1a5bba2d55272506ff2f7c6af27cf0bf92d79474/nar.html#L77Oh, a warning: we transfer control of the main thread to the wasm decompressor, i.e. it's syncrhonous. So make sure to schedule a separate task to render the "decompressing" message before starting the decompression. Probably rigging up a line to await a requestAnimationFrame will suffice.