We should try to pre-convert things for these legacy browsers and ship that instead. It will load faster and will give us a more sane structure when debugging is needed as it will map better to the normal code.
We did a quick test to get a better idea of what the issue is. These are the load times we could see after pressing login:
Empty cache Filled Cache
IE 18 seconds 3 seconds
Edge 2 seconds 1 second
Firefox 2 seconds 1 second
So having something pre converted seems worthwhile.
We did a quick test with noVNC and a CommonJS pre-conversion. That got the load time down to around 1 second for IE.
Note that there are some upstream bugs we need to fix first:
* There is a type in the HTML generation which messes up the include of app.js
* We now use promises in the main code and not just the conversion, so the promise polyfill needs to be loaded even when doing pre-conversion
We tried to get babel to sort out the polyfill, but we couldn't really make sense out of how it was supposed to work.
Apparently the latest version of browserify isn't compatible with the latest versions of its dependencies (specifically readable-stream). So it looks like we'll have to use the AMD format instead of CommonJS when converting.
We also discovered that when babel looks up plugins it doesn't use nodejs' normal search algorithm. It forgets to check the global directories. Fortunately we can work around it by doing symlinking a local "node_modules" to the global "/usr/lib/node".
The conversion is now done in the Makefile for Web Access. Seems to work great, tested in IE 11 on Windows 10 and in Firefox and Chrome on Fedora 31.
Loading is just as fast on IE now compared to the other browsers.
The new require.js file has to be added to the Open Source bundle and be listed in the open source licenses.
Should all be fixed now.
Seems to work well. Tested with Firefox and Chrome on Linux, and IE and Edge on Windows.
Load time is now down to under 2 seconds in IE, which is very nice. All functionality also seem to work without any noise in the browser console.
(Side note, IE loads the normal "ui.js" but doesn't execute it, and Edge loads the legacy "promise.js", "require.js" and "app.js" but doesn't execute them)
I checked the open source documentation and packaging and it looked complete.
One packaging glitch though, in that require.js is packaged twice:
(In reply to comment #19)
> One packaging glitch though, in that require.js is packaged twice:
Looks good, and still works in Firefox and IE.