Should be completely in Rust.
This looks like a good library to use: https://github.com/mitsuhiko/indicatif
Starting points is here:
https://github.com/denoland/deno/blob/a8c3b448049912ead5ba025fee9568dcc0786573/src/deno_dir.rs#L152
(After #975 the "Compiling" messages can also be added to the progress bar. It will move the compilation step into Rust. Currently "Compiling" is printed from JS.)
@ry I've been watching this project for several months and I really want to be involved. Can I try this issue?
Async module loading has now landed. It should be quite approachable now to do proper progress bars.
Waiting for denoland/deno_third_party#32 to resolve this
@ry moving discussion here to keep it in one place
@bartlomieju I'd rather there be a "ProgressBar" object (which should wrap whichever progress bar crate we're using) which can be added to ThreadSafeState. Then you'd have something like ProgressBar::start(action: String) and ProgressBar::end(action: String) ? Not sure about that exact API, but some functionality like that.
_Originally posted by @ry in https://github.com/denoland/deno/issues/2057#issuecomment-487308674_
@bartlomieju I like how ninja does its progress - which is very simple - it looks like
[4/34] STAMP obj/cli/msg_rs.stamp
maybe we can just do that manually in a few lines of code.
_Originally posted by @ry in https://github.com/denoland/deno/pull/2229#issuecomment-487383232_
Taking both comments into consideration:
Then when file is being downloaded around here:
https://github.com/denoland/deno/blob/a4551c853e25a08ea479c5b75f60dc4109eee72f/cli/deno_dir.rs#L560-L570
number of files to download should be incremented, and message displayed:
[{no_finished_downloads}/{no_downloads}] DOWNLOAD {filename}
[0/1] DOWNLOAD https://deno.land/std/prettier/main.ts
[0/4] DOWNLOAD https://deno.land/std/prettier/prettier.ts
[1/4] DOWNLOAD https://deno.land/std/prettier/prettier.ts
...
Lastly around here:
https://github.com/denoland/deno/blob/a4551c853e25a08ea479c5b75f60dc4109eee72f/cli/deno_dir.rs#L648-L650
number of files downloaded should be incremented.
I guess it makes most sense to store those numbers in Metrics. The same thing applies for compiled files.
Done in #2309
Most helpful comment
@ry I've been watching this project for several months and I really want to be involved. Can I try this issue?