perf(startup): lazy-load ABCJS library to reduce startup blocking#6080
perf(startup): lazy-load ABCJS library to reduce startup blocking#6080parthdagia05 wants to merge 3 commits intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
2 similar comments
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender can you review PR |
|
Why do we need multiple copies of EnsureABCJS |
|
@walterbender |
da9f235 to
967cda2
Compare
|
this PR still needs changes. |
967cda2 to
1e80cb4
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
1e80cb4 to
c019e41
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
c019e41 to
c366198
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
|
@walterbender this PR is now ready to review, happy for further changes if needed. |
Summary
Closes #5998
This PR implements Phase 4C of the startup performance optimization plan.
The ABCJS library (
lib/abc.min.js, ~552KB) was previously loaded during application startup via a<script defer>tag inindex.html.However, ABCJS is only required when users perform ABC-related operations such as:
Loading the library during startup caused unnecessary JavaScript parsing and increased Total Blocking Time.
Changes
• Removed the
<script defer src="lib/abc.min.js">tag fromindex.html• Implemented a dynamic loader to load the library only when needed
• Ensured ABCJS is loaded before any code paths that use the
ABCJSglobalBefore
ABCJS was loaded and parsed during startup regardless of user interaction.
After
ABCJS loads dynamically only when ABC functionality is triggered.
Impact
• ~552KB JavaScript removed from startup parsing
• Reduced Total Blocking Time
• Improved First Contentful Paint and Speed Index
Risk
Low risk.
ABCJS is only used in user-triggered flows and does not affect core runtime logic.
All functionality related to ABC import and notation rendering continues to work as expected.
PR Category