Skip to content

perf(dashboard): only load the On This Day widget when it is displayed - #3913

Merged
skjnldsv merged 3 commits into
nextcloud:masterfrom
tmmmemcee:fix/2674-dashboard-script-lazy
Oct 16, 2026
Merged

skjnldsv merged 3 commits into
nextcloud:masterfrom
tmmmemcee:fix/2674-dashboard-script-lazy

Conversation

@tmmmemcee

Copy link
Copy Markdown
Contributor

The dashboard calls load() for every registered widget, so the
photos-dashboard entry point is fetched on every dashboard visit. It
statically imported the widget and its dependencies, pulling in ~1.7 MiB
of JavaScript even when the widget is not on the user's dashboard.

The entry point now only registers the widget and loads the Vue app
through a dynamic import once the dashboard renders it. The initial
download drops to ~5 KiB (3 files instead of 27).

Closes #2674

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Tim tmmmemcee@gmail.com

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@skjnldsv skjnldsv added the 3. to review Waiting for reviews label Oct 16, 2026
@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Oct 16, 2026
@skjnldsv
skjnldsv force-pushed the fix/2674-dashboard-script-lazy branch from d0bce31 to 0a8b1cd Compare October 16, 2026 08:34
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

tmmmemcee and others added 3 commits October 16, 2026 11:11
The dashboard calls load() for every registered widget, so the
photos-dashboard entry point is fetched on every dashboard visit. It
statically imported the widget and its dependencies, pulling in ~1.7 MiB
of JavaScript even when the widget is not on the user's dashboard.

The entry point now only registers the widget and loads the Vue app
through a dynamic import once the dashboard renders it. The initial
download drops to ~5 KiB (3 files instead of 27).

Closes nextcloud#2674

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Tim <tmmmemcee@gmail.com>
The widget moved to its own module while the app still ran on Vue 2.
It now mounts the way master does since the switch to Vue 3: an app of
its own with the photos-dashboard id prefix and a Pinia store.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the fix/2674-dashboard-script-lazy branch from b6b1e91 to 8602803 Compare October 16, 2026 09:12
@skjnldsv
skjnldsv merged commit 6dffa86 into nextcloud:master Oct 16, 2026
19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard javascript file is loaded when no Photos widgets are used

2 participants