Remove IIFEs for several JS files - Part 1
What does this MR do?
removes the IIFEs wrapping several JS files... this is a necessary step toward moving to ES module exports because export default Foo
is statically analyzed and cannot exist within an IIFE.
I've just started going through scripts alphabetically starting with abuse_reports.js
and going through header.js
. I'll open other MRs for additional segments of the frontend codebase.
Are there points in the code the reviewer needs to double check?
Keep in mind no code was changed here, only indentation level and IIFE removal. The diffs may look complicated because sometimes our diff method doesn't understand indentation changes. Occasionally, I need to change this
to window
or global
to window.gl
where appropriate, but that's about it.
Why was this MR needed?
In order to enable code splitting, we first need to get all of our script dependencies into statically analyzable chunks and IIFEs make that difficult.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
related to #27486 (moved)