Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading.throttle doesn't seem to work #5519

Closed
hecktarzuli opened this issue Apr 12, 2019 · 12 comments
Closed

loading.throttle doesn't seem to work #5519

hecktarzuli opened this issue Apr 12, 2019 · 12 comments

Comments

@hecktarzuli
Copy link
Contributor

Version

v2.5.1

Reproduction link

https://codesandbox.io/s/zx50vm1jql

Steps to reproduce

Go to link
Slow down network (either delay 10s or change profile to 1k/sec up/down)
notice the second you click About button, the progress bar shows, even though throttle is set to 5000

What is expected ?

Per documentation, progress bar shouldn't show until throttle is expired

What is actually happening?

Progress bar is shown right away

This bug report is available on Nuxt community (#c9037)
@ghost ghost added the cmty:bug-report label Apr 12, 2019
@zhj135
Copy link

zhj135 commented Apr 15, 2019

in your reproduction link, you should replace 'thottle' to 'throttle'

@hecktarzuli
Copy link
Contributor Author

hecktarzuli commented Apr 15, 2019

LOL, I guess it was my turn to be 'that guy' ... Fixed, problem still remains (yes I restarted the sandbox & yes it was the right syntax locally when we found the problem).. @manniL

@stale
Copy link

stale bot commented May 6, 2019

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label May 6, 2019
@hecktarzuli
Copy link
Contributor Author

ping @manniL

@stale stale bot removed the stale label May 6, 2019
@stale
Copy link

stale bot commented May 27, 2019

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label May 27, 2019
@manniL
Copy link
Member

manniL commented May 28, 2019

Can't repro in Firefox 🤔

@stale stale bot removed the stale label May 28, 2019
@hecktarzuli
Copy link
Contributor Author

hecktarzuli commented May 29, 2019

Grr, now I can't repro either in the sandbox (I was able to repro before dozens of times). I'll check local and verify everything is ok now.

@hecktarzuli
Copy link
Contributor Author

Local dev looks fine now too. I assume this was fixed in a later version or something.

@gijsroge
Copy link

gijsroge commented Nov 4, 2019

@hecktarzuli I forked your sandbox and added a real http request in the fetch so it would do an actual request and take some time to resolve.

As you can see I set the throttle to 1s and it still flashes between navigating.

https://codesandbox.io/s/codesandbox-nuxt-loading-throttle-issue-yhkp3

@manniL could you review again?
@hecktarzuli can you re-open if you confirm?

I can confirm this issue does exist but it has nothing to do with Nuxt itself, it's only when you use the Axios module.

This is a knowns issue and has an open pull request.
nuxt-community/axios-module#247

@hecktarzuli
Copy link
Contributor Author

Yeah this is weird. In my local dev, setting throttle to 20s still shows the progress bar immediately. I don't know how this would be anything other than nuxt's fault. It's their component that should be abiding by the nuxt.config.js

@gijsroge
Copy link

gijsroge commented Nov 4, 2019

@hecktarzuli no the @nuxtjs/axios module calls the set method on the loading component that immediately shows the loading bar. This is by design.

The pull request I referenced is their to discus if the @nuxtjs/axios module should change its behavior so it respects the throttle configuration set by the user.

@hecktarzuli
Copy link
Contributor Author

hecktarzuli commented Nov 5, 2019

That abstraction is pretty messy. IMHO, Nuxt should expose a loading object that webpack, axios and other junk can add and remove stuff from as things are loaded. Then the only thing the loading component would need to do is decide how to render that abstraction over time.

In other words, the axios plugin should NOT be playing with the loading component, what it should be doing it just telling nuxt its loading X many resources and remove them when they are done loading. (@manniL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants