Uh oh!
There was an error while loading. Please reload this page.
feat(dashboard): implement widget item api v2 - #39937
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| foreach ($widgets as $widget) { | ||
| if ($widget instanceof IAPIWidgetV2) { | ||
| $items[$widget->getId()] = $widget | ||
| ->getItemsV2($this->userId, $sinceIds[$widget->getId()] ?? null, $limit) |
Check notice
Code scanning / Psalm
PossiblyNullArgument
4307fb5 to
87752abCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nickvergessen
left a comment
There was a problem hiding this comment.
Needs a rebase, but otherwise seems fine and functional
76f8c59 to
a01210fCompare/backport 6982597 to stable27 |
This API enables the dashboard to render all widgets from the API data alone without having apps to provide their own bundles. This saves a lot of traffic and execution time as a lot less javascript has to be parsed on the frontend. Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: Joas Schilling <coding@schilljs.com>
nickvergessen
commented
Aug 22, 2023
Rebasing |
a01210f to
e1accafCompareThe backport to stable27 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
AndyScherzinger
commented
Aug 22, 2023
/backport 6982597 to stable27 |
nickvergessen
commented
Aug 22, 2023
Will have to do it manually, the OpenAPI stuff does not exist on stable27 |
nickvergessen
commented
Aug 22, 2023
PS I'm on it aklready |
The backport to stable27 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
Ref nextcloud/server#39937 Signed-off-by: Joas Schilling <coding@schilljs.com>
Ref nextcloud/server#39937 Signed-off-by: Joas Schilling <coding@schilljs.com>
Ref nextcloud/server#39937 Signed-off-by: Joas Schilling <coding@schilljs.com>
Ref nextcloud/server#39937 Signed-off-by: Joas Schilling <coding@schilljs.com>
Summary
This API enables the dashboard to render all widgets from the API data alone without having apps to provide their own bundles. This saves a lot of traffic and execution time as a lot less javascript has to be parsed on the frontend.
This is already done on the clients. However, the dashboard requires some extra logic and data as its widgets tend to be more sophisticated. To prevent breaking all apps and clients new API (v2) was introduced allowing each app and each client to migrate at their own pace.
Profiling results
Perceived loading time: Time from hitting refresh until all dashboard widgets finished loading.
No cache: Simulates a new visitor or a visitor returning after a long time. Cache is disabled in Chrome DevTools to force the browser to redownload all assets.
Cache: Simulates a user that often uses Nextcloud. Browser cache is enabled.
Tests were run on the same instance with exactly the same calendar, mail and spreed data etc.
Before
Without cache
Time until all widgets finised loading: 4284 ms
Chrome network stats:
With cache
Time until all widgets finised loading: 3836 ms
Chrome network stats:
After
Without cache
Time until all widgets finished loading: 2995 ms
Chrome network stats:
With cache
Time until all widgets finished loading: 1500 ms
Chrome network stats:
TODO
Checklist