Skip to content

refactor(core): move AppMenu component tree into core/src/appmenu/#60937

Open
pringelmann wants to merge 6 commits into
masterfrom
feat/noid/appmenu-priority-loading
Open

refactor(core): move AppMenu component tree into core/src/appmenu/#60937
pringelmann wants to merge 6 commits into
masterfrom
feat/noid/appmenu-priority-loading

Conversation

@pringelmann
Copy link
Copy Markdown
Contributor

@pringelmann pringelmann commented Jun 2, 2026

Summary

Moves AppMenu (the waffle) out of core-main into its own core-appmenu chunk with a small bootstrap, loaded as a normal deferred core script. Drops the old MainMenu.js mount since the component now owns its entry point.

This ensures the waffle menu appears sooner, allowing users to switch apps before page content loads.

How this works

On master the menu mounts inside initCore(), which runs on DOMContentLoaded, so it only paints after the whole deferred-script queue (including the dashboard). The new chunk mounts at its own eval alongside unified-search, before DOMContentLoaded, so it shows up with the header instead of after the page finishes.

The videos below were recorded using Firefox's Good 3G network throttle profile to simulate a poor connection.

Before:

waffle_before.mp4

After:

waffle_after.mp4

Nothing changes for users, the menu renders the same.

Changes

  • New core-appmenu webpack entry from core/src/appmenu/, pulled into core via addScript util.
  • New bootstrap mounts AppMenu on its own and replaces the setUp() call in init.js.
  • Removed core/src/components/MainMenu.js.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes (no visual change)
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone added for target branch/version (ex: 35.x)

@pringelmann pringelmann self-assigned this Jun 2, 2026
@pringelmann pringelmann force-pushed the feat/noid/appmenu-priority-loading branch 4 times, most recently from dadde3f to 494e4c1 Compare June 3, 2026 07:58
@pringelmann pringelmann added 3. to review Waiting for reviews performance 🚀 team: IDP Code maintained by 🪪 IDP team labels Jun 3, 2026
@pringelmann pringelmann added this to the Nextcloud 34.0.1 milestone Jun 3, 2026
@pringelmann pringelmann force-pushed the feat/noid/appmenu-priority-loading branch from 494e4c1 to 273ce20 Compare June 3, 2026 10:04
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Mounts the waffle launcher from its own entry point, independent of
core-main, and exposes OC.setNavigationCounter once mounted.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
AppMenu is now mounted by its own bootstrap.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Emit the AppMenu bootstrap as its own legacy entry point so it can be
loaded as a standalone core script.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Register the core/appmenu entry in the user layout so the waffle
launcher mounts like every other core script.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the feat/noid/appmenu-priority-loading branch from 273ce20 to 014f7a4 Compare June 3, 2026 13:25
@pringelmann
Copy link
Copy Markdown
Contributor Author

/compile amend

@nextcloud-command nextcloud-command force-pushed the feat/noid/appmenu-priority-loading branch from 014f7a4 to 8636ce7 Compare June 3, 2026 15:19
@pringelmann pringelmann marked this pull request as ready for review June 4, 2026 08:13
@pringelmann pringelmann requested review from a team as code owners June 4, 2026 08:13
@pringelmann pringelmann requested review from ArtificialOwl, CarlSchwan, nfebe, sorbaugh and susnux and removed request for a team June 4, 2026 08:13
Comment thread core/src/components/AppMenu/AppMenuItem.vue
Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this faster? Its so core-main where it was loaded previously is still loaded first.
Meaning its even is evaluated a bit later now because unified search and unsupported-browsers are evaluated before this script.

The only proper way to load this faster is to do an async loading which we already tried before but there we have the problem that the dependencies loaded in core-common need to be loaded which takes the most time.

@pringelmann
Copy link
Copy Markdown
Contributor Author

How is this faster? Its so core-main where it was loaded previously is still loaded first. Meaning its even is evaluated a bit later now because unified search and unsupported-browsers are evaluated before this script.

The only proper way to load this faster is to do an async loading which we already tried before but there we have the problem that the dependencies loaded in core-common need to be loaded which takes the most time.

It's faster because the old mount was inside the DOMContentLoaded callback in initCore, so it waited for the whole deferred-script queue. The new standalone chunk mounts at its own eval, alongside unified-search, before DCL. No async or extra dependencies needed.

I will update the PR description explaining the actual mechanism in more detail.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the feat/noid/appmenu-priority-loading branch from 8636ce7 to e1a531a Compare June 4, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews performance 🚀 team: IDP Code maintained by 🪪 IDP team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants