-
Type:
Bug
-
Status: Closed
-
Resolution: Inactive
-
Affects Version/s: 7.0.0 DXP SP2, Master
-
Fix Version/s: None
-
Component/s: JS APIs and Utilities, Product Menu
-
Labels:None
-
Story Points:0.25
There's a little known feature of YUI, which is the ability to know if a sandbox has "errored" while loading modules.
The API is very simple and embedded in the YUI().use(...) method (see reference).
AUI().use(function (A, status) { console.log(status.success); // Boolean console.log(status.msg) // Some string explaining the error if success: false });
Note that once a sandbox is in error state it will remain as such:
var Y = YUI(); Y.use('goodmodule', function (Y, status) { // status = { success: true } Y.use('badmodule', function (Y, status) { // status = { // success: false, // msg: "Missing modules: badmodule" // } Y.use('anothergoodmodule', function (Y, status) { // status = { // success: false, // msg: "Missing modules: badmodule" // this is not cleared!! // } }); }); });
This is wouldn't be an issue by itself, but
- AUI actually uses a single sandbox, so one error will ruin the whole page
- with Senna.js once you break the sandbox it stays as such forever
- Liferay core apps are loading not-existent modules!!!
The offending AUI modules are io-request and parse-content loaded here:
- application-list-taglib at panel_category/end.jsp
- product-navigation-control-menu-web at add_content_body.jsp
- product-navigation-product-menu-web at portlet/view.jsp
- product-navigation-simulation-web at SimulationProductNavigationControlMenuEntry.java
The sum of all these things make using the status parameter of the callback passed to Y.use completely useless and therefore there's no programmatic way to know the health of the sandbox.