-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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(dashboard): implement widget item api v2 #39937
Conversation
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 Note
4307fb5
to
87752ab
Compare
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.
API changes LGTM
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.
Needs a rebase, but otherwise seems fine and functional
76f8c59
to
a01210f
Compare
/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>
Rebasing |
a01210f
to
e1accaf
Compare
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-stable27 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport 6982597 to stable27 |
Will have to do it manually, the OpenAPI stuff does not exist on stable27 |
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-stable27 More 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