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

Fixed an issue that caused too few large bundles #1096

Merged
merged 1 commit into from
Jul 21, 2024

Conversation

valadas
Copy link
Member

@valadas valadas commented Jul 21, 2024

Closes #1094

Stencil tries to intelligently decide which components should be bundled together for lazy-loading. Somehow this "intelligence" got confused and we ended up with fewer and fewer larger files along the commit history. Rading more about this, we can in the config define how we want our stuff bundled knowing which components usually are used together. The goal is to balance between multiple downloads and small downloads.

This PR manually defines bundles we want.
Examples:

  1. dnn-monaco-editor has all the component code and all of monaco code in a single bundle (10.7Mb) that can be forever cached even if we do updates (as long as we don't touch that component).
  2. dnn-richtext is in a bundle with all of the Jodit code together (1.1Mb)
  3. dnn-color-picker is in a bundle (30Kb) has all the components that are always needed for it (buttons, modals, tabs, tab, etc.)
  4. dnn-permissions gid (24Kb) has all the components used by it in the same bundle.
  5. So on and so forth reducing in size up to our smallest component that can be used on its own, dnn-chevron (1Kb)

Stencil tries to intelligently decide which components should be bundled together for lazy-loading. Somehow this "intelligence" got confused and we ended up with fewer and fewer larger files along the commit history. Rading more about this, we can in the config define how we want our stuff bundled knowing which components usually are used together. The goal is to balance between multiple downloads and small downloads.

This PR manually defines bundles we want.
Examples:
1. dnn-monaco-editor has all the component code and all of monaco code in a single bundle (10.7Mb) that can be forever cached even if we do updates (as long as we don't touch that component).
2. dnn-richtext is in a bundle with all of the Jodit code together (1.1Mb)
3. dnn-color-picker is in a bundle (30Kb) has all the components that are always needed for it (buttons, modals, tabs, tab, etc.)
4. dnn-permissions gid (24Kb) has all the components used by it in the same bundle.
5. So on and so forth reducing in size up to our smallest component that can be used on its own, dnn-chevron (1Kb)
@valadas valadas added the bug Something isn't working label Jul 21, 2024
@valadas valadas added this to the 0.24.0 milestone Jul 21, 2024
Copy link
Contributor

@david-poindexter david-poindexter left a comment

Choose a reason for hiding this comment

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

Awesome job!

@david-poindexter david-poindexter merged commit a3b05f1 into DNNCommunity:develop Jul 21, 2024
2 checks passed
@valadas valadas mentioned this pull request Jul 23, 2024
valadas added a commit to valadas/dnn-elements that referenced this pull request Jul 23, 2024
In DNNCommunity#1096 a major issue was resolved to prevent most components to get merged into very few large bundles. This fixed the issue but was done wrong as we are not supposed to have any component into more than one bundle.

This PR refactors that and closes  DNNCommunity#1120
@valadas valadas mentioned this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigating bundling issue
2 participants