fix(dx): resolve script loading race conditions in index.html#6530
fix(dx): resolve script loading race conditions in index.html#6530vanshika2720 wants to merge 1 commit intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ 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. |
|
This.cleanupIdleWatcher() is called in activity.js (2 places), but the method doesn’t exist. It should be this._stopIdleWatcher(). |
6b75f71 to
cb0b90d
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
cb0b90d to
f69477f
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
f69477f to
5fe9b88
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
1 similar comment
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
df808c9 to
d3cf6b9
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
d3cf6b9 to
7553051
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
7553051 to
eaddc28
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
Fix jQuery plugin IIFE that was never invoked: the closing `});` meant the function was defined but never called, so $.fn.fixMe and the $(document).ready handler never executed. Changed to `})(jQuery);` and wrapped in a DOMContentLoaded listener with a typeof guard so it waits for both the DOM and the deferred jQuery script. Remove broken duplicate script block (lines 1203-1285 on master) that contained: - A syntax error (`}} )`) prematurely closing the DOMContentLoaded handler after showPersistentNotification - Duplicate definitions of openFullscreen, closeFullscreen, setIcon, and handleFullscreenChange (already defined globally at lines 1132-1194) - A duplicate `#installButton.hidden` style block The working fullscreen functions and the proper play-only-mode script (at the end of the file) are preserved as-is.
eaddc28 to
c59113a
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
[DX] Resolve Script Loading Race Conditions in index.html
Type of Change
Description
This PR addresses frequent startup console errors (
$ is not defined,createjs is not defined,p5 is not defined) by standardizing and consolidating the script loading architecture inindex.html.Key Changes
<head>with thedeferattribute. This ensures they are loaded in parallel but executed in a deterministic order.DOMContentLoadedlisteners.setIcon,openFullscreen), and eliminated fragmented service worker registration blocks.Value
Dramatically improves the Developer Experience (DX) by providing a "clean" console on startup and making the application initialization sequence robust and easy to reason about. It also improves project reliability across different browsers (especially those with stricter execution timings like Firefox).
Testing Performed
$andcreatejsare ready whenloader.jsexecutes.index.html.