-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a nice little progress bar while downloading binary #1649
Conversation
Thanks @andyxxsd. This has been on my todo list for a while. I'll take a closer look this weekend. |
complete: '=', | ||
incomplete: ' ', | ||
width: 25, | ||
total: parseInt(response.headers['content-length']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-total: parseInt(response.headers['content-length'])
+total: parseInt(response.headers['content-length'], 10),
One minor nitpick. Otherwise looks good to me. |
d0d4598
to
bacfda8
Compare
bacfda8
to
0ab263c
Compare
I have tried couple times. These CI tests just keep failing... |
I've been looking at the |
I personally dislike progress bars like this (especially the npm@3 one), wouldn't just a message informing that download starts suffice? |
I think these are super useful to majority of users. Our install process can be rather slow. I don't blame people for thinking npm has frozen. As an aside I think we might be publishing |
I'm keen to ship a 3.9.0 in the next couple days. We see steady background noise of network issues that I think this will really help with. We can probably handle network errors better in general but I don't think we can beat the user experience of a progress bar. User implicitly know what it means if the progress moves slowly or stops. @saper what exactly are you concerns? We need a solution for better communicating networking issues, even if this is just temporary stop gap. |
Let me rant a bit. Actually this is worth a separate post online or something like that. Very often I am using a debugging technique that requires treating program output captured verbose as the important information. Because npm logging is notoriously unreliable (not getting compiler output in the log file on Windows etc.) I am using script(1) or GNU screen logging to capture total output from stdout, stderr and whatever else got to the terminal. I am using this for two specific purposes:
For the purpose (1) to work, captured program output should be reliably repeatable and reproducible. People argue that those problems can be avoided by using A) it cannot detect situations like script(1) or screen(1) logging, because the two offer pseudoterminal and the program thinks it is running on a real terminal. I've also had situation (not with node) where I had to log remotely via ssh (i.e. log with the ssh client) and - again - the tool happily thinks it is "interactive". B) it introduces another code path for "interactive" logging and "file" logging, which can be a source of discrepancies between those two (and bugs).
to kill the worst offenders. If I don't, here's how the log output looks like in the text editor: A hex dump looks even worse:
ANSI terminal control characters are embedded in the output everywhere and basically make it Progress bars are even worse, since with every invocation their output needs to be different I am aware of tools stripping ANSI sequences, that usually just do some regular expressions. After trying some I had to write my own :( The next time I am going to debug the strange UTF-8 problem or compare two different I know we have moved on from the times of the ASR 33 teletypes but somehow we cannot get rid of tty-like terminals yet (and some believe it's a good thing). Regarding networking problems, what worries me is that folk reporting timeouts do not apparently get the message we put to help them (#1681). |
Would making the progress respect the npm "progress" config address your On 26 Aug 2016 10:18 PM, "Marcin Cieślak" notifications@github.com wrote:
|
I think this looks fine, but maybe using the https://github.com/npm/npmlog package should be looked at since then it would all be using the same format |
@saper's concerns are valid. There should be an opt-out and mirroring the npm config seems sane. |
This is required for nodejs/citgm#165. I conceed it will increase the size of the tarball. This isn't ideal given the background noise of installation issues atm, but IMHO the value of being in the CITGM is worth it. The additional transparency into the binary download added by sass#1649 will go a long to alleviating the addition tarball size.
Forked from sass#1649. This PR adds a small ascii progress bar to the binary download. Stalled installations make up a steady background noise of our issues. It's my hope that by making the binary fetch more transparent we can stem the tide of those issues. In order to address @saper's [concerns][1] this progress bar will respect npm's `progress` config flag. Downloading ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=============== ] 1566256 60% 4.9s ``` Success ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=========================] 2602136 100% 0.0s Binary downloaded and installed at /tmp/node-sass/vendor/darwin-x64-48/binding.node ``` [1]: sass#1649 (comment)
Forked from sass#1649. This PR adds a small ascii progress bar to the binary download. Stalled installations make up a steady background noise of our issues. It's my hope that by making the binary fetch more transparent we can stem the tide of those issues. In order to address @saper's [concerns][1] this progress bar will respect npm's `progress` config flag. Downloading ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=============== ] 1566256 60% 4.9s ``` Success ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=========================] 2602136 100% 0.0s Binary downloaded and installed at /tmp/node-sass/vendor/darwin-x64-48/binding.node ``` [1]: sass#1649 (comment)
Forked from sass#1649. This PR adds a small ascii progress bar to the binary download. Stalled installations make up a steady background noise of our issues. It's my hope that by making the binary fetch more transparent we can stem the tide of those issues. In order to address @saper's [concerns][1] this progress bar will respect npm's `progress` config flag. Downloading ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=============== ] 1566256 60% 4.9s ``` Success ``` Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.8.0/darwin-x64-48_binding.node Total 2602136 [=========================] 2602136 100% 0.0s Binary downloaded and installed at /tmp/node-sass/vendor/darwin-x64-48/binding.node ``` [1]: sass#1649 (comment)
We did this because people without the luxury of fast internet, like Australia where I live, can be stuck waiting for a binary to download without any indication of what is happening. This resulted in a steady stream of bugs that was exhausting to deal with. As for the |
Fix parsing issues with css comments in if/else blocks
I stuck for half a hour while installing node-sass as dependency of my project.
After read the source code, I figure out that my download speed from github.com is too slow. Then the problem solved by turning my VPN on.
So I decided to add a progress bar as a reminder, made life easier for people whose network connection is poor.
Downloading
Success