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
feat(nuxt): move loading api behind hooks #24010
Conversation
Run & review this pull request in StackBlitz Codeflow. |
β Live Preview ready!
|
Hello, Sorry to bump, is there any ETA for this feature to be merged? cc @danielroe Thanks! |
It'll need to wait for the next minor. |
Hello, Sorry to bump, since the minor is coming soon does it mean this can be merged? Thanks! |
I'm also eagerly waiting for this fix. I have confirmed it works as expected and have been using a custom build including this patch in production for a few weeks now. I'd love to see it merged. |
Could you also link to the |
Is it possible to trigger a release to test this on a project @danielroe ? |
Co-authored-by: SΓ©bastien Chopin <seb@nuxt.com>
/trigger release |
π Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-24010 |
/trigger release |
π Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-24010 |
|
π Linked issue
resolve #15232
resolve #23568
resolves #14221
β Type of change
π Description
Hi π
This PR moves the loading mechanism behind nuxt hooks and bring some improvements to
NuxtLoadingIndicator
.1. New hooks
loading states are now triggered by
page:loading:start
andpage:loading:end
(theircallHook
are not awaited for perf reasons)2.
useLoadingIndicator
is now exported and auto-importedIt keeps local refs to handle the loading state. The loading state hasn't been moved behind a plugin or a global var to avoid having to compute it when not needed.
useLoadingIndicator
hook intopage:loading:start
andpage:loading:end
to know when the loading state changes3. Controllable
NuxtLoadingIndicator
A request from some users was to be able to control the loading indicator. Since we now expose
useLoadingIndicator
withinNuxtLoadingIndicator
, users can trigger thestart
function or simply call the new hooks to control the state.π Checklist