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

Size regression in main.js bundle caused by standalone component migration #2899

Open
ybnd opened this issue Apr 5, 2024 · 2 comments
Open
Assignees
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back performance / caching Related to performance, caching or embedded objects

Comments

@ybnd
Copy link
Member

ybnd commented Apr 5, 2024

Describe the bug
Looks like migrating to standalone components in #2750 increased the size of our main.js bundle by about 30kB.

While this is not a significant increase, it's a bit counter-intuitive since the claim is that standalone components should improve the bundle structure.

Here are some improvements we can make:

  • Move route-specific components out of ListableModule and reduce the number of imports
    • Mainly: Standalone Item pages, MyDSpace components
    • This can easily save us ~60kB (gz)
    • A little fragile though: we've already seen that overwriting these components in themes causes regressions. We can propose a workaround to mitigate this.
  • Make dynamic form code lazy again
    • Dynamic forms are only used on a select number of routes, many of which are not even accessible by anonymous users, so it would be good to keep them out of the main bundle
    • Looked into this for a short while, and it's not as easy but could save us another ~40kB (gz)
@ybnd ybnd added bug needs triage New issue needs triage and/or scheduling claimed: Atmire Atmire team is working on this issue & will contribute back labels Apr 5, 2024
@ybnd ybnd self-assigned this Apr 5, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Apr 5, 2024
@ybnd
Copy link
Member Author

ybnd commented Apr 5, 2024

Note: for the numbers above I compared a8f31948bc9 and 41eccbbfe15, the "potential gains" from splitting up ListableModule may be different after the Angular 16 upgrade

@ybnd
Copy link
Member Author

ybnd commented Apr 5, 2024

Just re-checked: main.js is ~600kB currently (down from ~670kB)
But the potential size reductions from ↑ still apply.

@tdonohue tdonohue removed the needs triage New issue needs triage and/or scheduling label Jul 26, 2024
@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Jul 26, 2024
@tdonohue tdonohue added the performance / caching Related to performance, caching or embedded objects label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back performance / caching Related to performance, caching or embedded objects
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

2 participants