Fix the UMD definition for selectize.

Review Request #13736 — Created April 16, 2024 and submitted

Information

Djblets
release-5.x

Reviewers

We bundle selectize, which is a very old UMD module, built in a way that
makes some poor assumptions. The main poor assumption is that this is
always defined. A modern UMD definition checks globalThis and self
as possible options, and uses those. Not having this meant that we could
hit issues importing this module (or its parent bundle) in a ESM-based
app.

Since newer 0.12.x releases also lack this fix, we're just going to
patch our copy of it for now. In time, we'll want to replace or upgrade
selectize, but that's a far bigger task.

Verified this still worked correctly in Review Board.

Also verified I could now import the containing bundle and not hit
errors about trying to set attributes in undefined.

Summary ID
Fix the UMD definition for selectize.
We bundle selectize, which is a very old UMD module, built in a way that makes some poor assumptions. The main poor assumption is that `this` is always defined. A modern UMD definition checks `globalThis` and `self` as possible options, and uses those. Not having this meant that we could hit issues importing this module (or its parent bundle) in a ESM-based app. Since newer 0.12.x releases also lack this fix, we're just going to patch our copy of it for now. In time, we'll want to replace or upgrade selectize, but that's a far bigger task.
9125c6d3a1da0cf701eef872d0febcf04ca1c2ed
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (db25cfd)