Explicitly leak to global scope instead of implicitly so strict mode and preprocessing can be used

Created on 4 March 2024, 8 months ago
Updated 23 April 2024, 6 months ago

Problem/Motivation

Both gtag.js and gtm.js are setting variables in the global scope. gtag.js does this implicitly and the way both of them do it throws an error on strict mode. This makes it so both files need to be excluded from preprocessing because if any file that's grouped with them declares "use strict", the implicit global scope contamination will throw the same error.

Proposed resolution

Declare the variable within the scope of a closure and explicitly leak it to the global scope.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇧🇪Belgium seutje Antwerp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024