Skip to content

Remove IIFEs for several JS files - Part 1

username-removed-636429 requested to merge remove-iifes-1 into master

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?

What are the relevant issue numbers?

#29219 (moved)

related to #27486 (moved)

Merge request reports