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

feat(nuxt): loading indicator enhancement #25119

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8afee84
feat: enchance loading indicator strategy
Jan 9, 2024
e989ea4
fix: cancel requestAnimationFrame on clear
Jan 9, 2024
de87b58
docs: update NuxtLoadingIndicator documentary
Jan 9, 2024
601d118
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 9, 2024
952fdce
docs: Update documentation accordingly changes
Jan 10, 2024
c4b4253
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 10, 2024
a5f41a2
docs: update documentation
Jan 10, 2024
9ea2a6c
refactor: remove custom timing function property and change that on t…
Jan 11, 2024
dd25108
docs: update documentation accordingly refactoring
Jan 11, 2024
b0ecdb0
docs: fix example
Jan 11, 2024
be699be
docs: fix linter errors
Jan 11, 2024
290438c
fix: remove extra line
Jan 11, 2024
a240809
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 12, 2024
e70c48f
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 19, 2024
14fc476
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 21, 2024
e4fd870
Merge branch 'main' into feat/loading-indicator-enhancement
danielroe Jan 21, 2024
a46ef58
Merge branch 'main' into feat/loading-indicator-enhancement
ivan-kalachikov Jan 25, 2024
87b54f6
refactor: small perf/typo/style fixes
danielroe Jan 29, 2024
85a07c0
Merge remote-tracking branch 'origin/main' into feat/loading-indicato…
danielroe Jan 29, 2024
16d2ebd
refactor: allow providing custom `estimatedProgress` function
danielroe Jan 29, 2024
6666615
docs: update docs
danielroe Jan 29, 2024
4e052d2
docs: update remaining reference
danielroe Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: update documentation accordingly refactoring
  • Loading branch information
Ivan Kalachikov committed Jan 11, 2024
commit dd2510820d6230e4c1232612b31bca9b1e1156d4
7 changes: 6 additions & 1 deletion docs/3.api/1.components/5.nuxt-loading-indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ You can pass custom HTML or components through the loading indicator's default s
- `height`: Height of the loading bar, in pixels (default `3`).
- `duration`: Duration of the loading bar, in milliseconds (default `2000`).
- `throttle`: Throttle the appearing and hiding, in milliseconds (default `200`).
- `progressTimingFunction`: A function that will calculate the progress value based on duration and elapsed time. (default [function](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/loading-indicator.ts#L38))
- `progressionRate`: The steepness of the non-linear function used in calculating progress. A lower value results in a steeper curve, meaning faster initial progress that slows down more sharply towards the end. Valid range: `0` to `100` (inclusive), with values outside this range clamped accordingly. (default `50`);


::callout
This component is optional. :br
Expand All @@ -43,3 +44,7 @@ To achieve full customization, you can implement your own one based on [its sour
::callout
You can hook into the underlying indicator instance using [the `useLoadingIndicator` composable](/docs/api/composables/use-loading-indicator), which will allow you to trigger start/finish events yourself.
::

::callout
The loading indicator's speed gradually decreases after reaching a specific point controlled by `progressionRate`. This adjustment provides a more accurate reflection of longer page loading times and prevents the indicator from prematurely showing 100% completion.
::
2 changes: 1 addition & 1 deletion docs/3.api/2.composables/use-loading-indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It hooks into [`page:loading:start`](/docs/api/advanced/hooks#app-hooks-runtime)

- `duration`: Duration of the loading bar, in milliseconds (default `2000`).
- `throttle`: Throttle the appearing and hiding, in milliseconds (default `200`).
- `progressTimingFunction`: A function that will calculate the progress value based on duration and elapsed time. (default [function](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/loading-indicator.ts#L38))
- `progressionRate`: The steepness of the non-linear function used in calculating progress. A lower value results in a steeper curve, meaning faster initial progress that slows down more sharply towards the end. (default `50`);


## Properties
Expand Down