Closed McBen closed 7 years ago
to be more precisely what is done in this PR:
window._L = L.noConflict();
(function (L) {@@INCLUDERAW:external/L.Geodesic.js@@})(_L);
window.L = window._L;
for 3rd-party code.This is really only cosmetic in the debugger, and the temporary "window.L = window._L;" is all-but-permanent.
I would keep the window.L = window._L
just for one release.
Yeah, ATM it's just a cosmetic fix (but is reported again and again). Things may change when the Nia-Minifier choose another function L (worst case).
Thank you for the pull request. Unfortunately, it's very much not feasible to do this, particularly over the lifespan of a single release. There are a lot of plugins out there which use Leaflet, and I'm sure several of them are no longer actively maintained.
Breaking compatibility in such a major way simply for a cosmetic fix is not something I am prepared to accept. I discuss some of the possibilities in #964, including this particular solution.
In short, it is possible to remove this warning, and there are two possible fixes that I consider reasonable:
click
listener which causes this message is set on the <body>
element, the fix is to completely replace the <head>
and <body>
elements, rather than their contents. This would remove any registered event listeners and side-step the problemdocument
, however, then we need to do some GreaseMonkey/TamperMonkey magic in order to catch the event listeners before they are added by stock Intel, so we can remove them later once IITC initializes.just some notes: a) stock-intels 'L' is choosen by a minifier and may change with every release. b) ATM 'L' is a (base-?) class and not related to any click-event.
(prepared) fix for #964 "TypeError: L is not a constructor"
For 3rd-party plugins there is still a workaround ("L = _L" in boot.js) to give 3rd-party developer time to adjust their code. You have to remove this workaround to fix the #964.
As preparation developers should add something like: "var _L = window._L || L; // TODO: remove on iitc update"
Note 1: no 'external' files were changed Note 2: a bunch of plugins are affected. I wasn't able to fully-test them all.