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

Multiple assets loading #2451

Closed
vinicius73 opened this issue May 26, 2022 · 6 comments · Fixed by #4698
Closed

Multiple assets loading #2451

vinicius73 opened this issue May 26, 2022 · 6 comments · Fixed by #4698

Comments

@vinicius73
Copy link
Member

vinicius73 commented May 26, 2022

Now is created one bundle for each "viewer" / "page".

  • main.js
  • files.js
  • public.js
  • viewer.js

Each of these files is bundled with Vue, Vuex, Nextcloud Components, Tiptap, CSS...
Although, the main issue could be the page load, it is causing other issues like "CSS collisions" and extra memory usage.

@max-nextcloud
Copy link
Collaborator

Isn't there a vendor.js that ships most of the dependencies such as Vue, Vuex, ...?

@juliusknorr
Copy link
Member

juliusknorr commented May 27, 2022

Yep, most parts should be shared from the vendors or editor-*.js files as the size of the bundles indicate:

-rw-r--r--  1 julius  staff    35K May 27 08:19 editor-collab.js
-rw-r--r--  1 julius  staff   6.3K May 27 08:19 editor-guest.js
-rw-r--r--  1 julius  staff    40K May 27 08:21 editor-rich.js
-rw-r--r--  1 julius  staff   201K May 27 08:21 editor.js
-rw-r--r--  1 julius  staff   1.0K May 27 08:21 files-modal.js
-rw-r--r--  1 julius  staff   213K May 27 08:21 text-files.js
-rw-r--r--  1 julius  staff   164K May 27 08:21 text-public.js
-rw-r--r--  1 julius  staff   121K May 27 08:21 text-text.js
-rw-r--r--  1 julius  staff    33K May 27 08:21 text-viewer.js
-rw-r--r--  1 julius  staff   2.5M May 27 08:21 vendors.js

But we can of course have a look if splitting like that still makes sense. The main reasoning behind the split and dynamic imports was that with the viewer we can only load the heavy parts if the user is actually opening the text app, e.g. on talk or the dashboard.

The text-public.js entrypoint we may drop once viewer is used on public pages of single shared files: nextcloud/viewer#508

@vinicius73
Copy link
Member Author

vinicius73 commented May 27, 2022

Yes, there is a vendor.
But for unknown reason not all libs are shared between bundles.

image

image

image

image

image

@susnux
Copy link
Contributor

susnux commented Jul 21, 2022

A bit off topic: Maybe ModuleFederation of vendor packages (vue, @nextcloud/...) should be considered / discussed on a nextcloud/core (server) level to reduce traffic / improve loading times.

Even without any additional applications installed that would reduce the traffic of JS files about 10% (as currently nextcloud/server and nextcloud/text share many dependencies and text is enabled by default).
There might be 3rd party apps which want to use newer versions of some packages, but at least apps bound to nextcloud releases, like the text app, would benefit.

@vinicius73
Copy link
Member Author

It is in my personal roadmap @susnux
I wish I will be able to open some issues and PRs about it soon as possible.

@blizzz
Copy link
Member

blizzz commented Jun 23, 2023

Are we still interesting in picking this up, at some point? It's been roughly a year since.

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

Successfully merging a pull request may close this issue.

6 participants