Esri / esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. :rocket:
https://developers.arcgis.com/esri-leaflet/
Apache License 2.0
1.61k stars 799 forks source link

Support Modern (ES6+) JavaScript #1238

Open gavinr opened 4 years ago

gavinr commented 4 years ago

In the source of esri-leaflet, we'd like to start using more modern JavaScript, like Object.assign(), arrow functions, template strings, let/const, etc.

I'm pretty sure that right now if we try to use any of that, it would cause the library not to work with versions of IE and per the wiki we should be supporting IE8+.

So, I'd like to propose changing build process for esri-leaflet to include a transpile step that would allow us to use some of these more modern JavaScript commands within the source, but the build process will allow the code to work with IE8+. It may be as simple as using @rollup/plugin-babel ... not quite sure. Looking for comments and input! Thanks!

jgravois commented 4 years ago

It may be as simple as using @rollup/plugin-babel

definitely should be. the first commit in https://github.com/Esri/esri-leaflet/pull/1201 contains an example.

gavinr commented 4 years ago

Related to all this: the latest standard, and thus semistandard which we use, has set to give a warning if your project uses var. https://github.com/standard/standard/issues/633#issuecomment-719874016 So we either need to switch to let instead of var, or be limited to a non-latest version of standard/semistandard.

gavinr commented 2 years ago

Now in 2022, all these are now supported in the browsers we're supporting, so we're planning on switching the source code to use Object.assign(), arrow functions, template strings, let/const, etc. without setting up a transpile step.

patrickarlt commented 2 years ago

@gavinr related to this lets setup prettier as well and remove semistandard.