Sasha Firsov
Sasha Firsov
In order to reuse the scope, content of script tags and event handlers should be executed in same scope. Which could be achieved either by - running all code within...
Global script handling will try to implement 1st option - 1. Collect all scripts code, extract all variables as keywords with exception of - JS keywords - "clean" window properties...
Async/defer scripts Worth special treatment. Globals in "detauched" scripts most likely would not expose variables for reuse in external scripts. In this case execution could be delayed after page load....
Most popular global variables - jQuery, $, query versions - '_' lowdash - dojo - d3 - Sortable, Effect, ...( http://script.aculo.us ) - shaka ( Shaka Player ) - spf...
Unifying JS under single script allows a single variables list sharing. But concatenation of multiple files conflicts with import module statements which meant to be used ONLY in beginning of...
**Individual script loading** seems to be quite attractive. PROS: * broken scripts would not break others * no conflicts on import variables between otherwise concatenated scripts * development could use...
Rather using `setTimeout(0)` , need to evaluate https://github.com/YuzuJS/setImmediate or https://github.com/medikoo/next-tick
sequential execution of SCRIPT type="module" saved the hassle of hooking into last script execution. 'load' event is emitted on `embed-page` withing SCRIPT appended to HTML body.
Since each SCRIPT has own context with simulated list of global variables, functions would reside in own script closure. When functions used from another module, globals would be visible as...
Apparently when calling the function from another scope the marshaling of variables needed in both scopes. Otherwise upon return from caller scope the callee scope variables not updated. The call...