A New Major Version for Leaflet Is in the Works; Catching up With Latest Technological Developments
Leaflet was one of these libraries that I thought were done. While there have been constant updates and new releases throughout the years, there were rarely any massive, ground-breaking additions. Leaflet is built perfectly against its small, well-defined scope. Huge changes just weren’t necessary.
Even great software is never done because it needs to keep up with the latest technological developments. And so development of a new major release for Leaflet was announced as part of the 1.9 release notes. The work for the next major version catches up with recent developments in the browser market, the JavaScript landscape and compiler tooling:
- Dropping support for Internet Explorer.
This has been a long time coming, but now that Internet Explorer is officially end-of-life, it’s time to say goodbye. Going forward, Leaflet will move to an evergreen strategy that targets browsers like Firefox, Chrome, Edge and Safari.- Embracing modern JavaScript.
To maintain backwards compatibility, Leaflet is written entirely in ES5, a version of JavaScript supported by legacy browsers. So we have not been able to make use of many great JavaScript features (e.g. standardized classes, instead having to rely on our own implementation). By adopting a more modern version of the ECMAScript standard, we can start working towards aligning Leaflet with what is expected from a modern JavaScript library.- Standardized modules.
When we released Leaflet v1, the landscape in the JavaScript world was very different and full of competing module standards such as CommonJS, AMD and UMD. Today, ECMAScript modules have become the clear way forward to unite the JavaScript ecosystem under one banner. Moving forward, Leaflet will only be distributed in a single standardized module system, greatly reducing complexity of our distributed code.- Removing the Leaflet global.
As a developer using Leaflet, the capital letter L is probably intimately familiar to you. This is the Leaflet global where all of Leaflet’s functionality lives. To allow compiler tooling to better eliminate dead-code through a process called tree-shaking, we are removing this global variable. To preserve backwards compatibility with older plugins, we will provide a shim that can be imported manually that will restore this functionality.
There’s no release date, not even an estimate, and maintenance of the 1.x branch will continue in the meantime.