stevage / map-gl-utils

A utility library that makes Mapbox GL JS or Maplibre GL a bit more convenient to work with.
https://npmjs.com/package/map-gl-utils
212 stars 24 forks source link

Fixes a typo, UMD bundling and some package.json setup. #30

Closed lasseborly closed 2 years ago

lasseborly commented 2 years ago

This is just going of what I would think would be the right way to go about it. Very open to corrections.

We are experiencing some issues in Safari 10 with spread operators which prompted me to investigate and make the needed changes.

stevage commented 2 years ago

Thanks so much for taking the time to do this - much appreciated.

I did a bit more fiddling with packaging (ESM modules were broken), so please double check I didn't break this in my published version 0.41.0.

lasseborly commented 2 years ago

No, thank you for taking the time and not letting me run with a fork for half a year 🥇

lasseborly commented 2 years ago

Oh but adding back in

targets: {
    esmodules: true,
}

makes some assumptions about compatibility, adds back in the object spread operators and makes the UMD bundle not ES5 anymore. https://babeljs.io/docs/en/babel-preset-env#targetsesmodules

We already have an ESM target that should fit the needs when it comes to consuming this package in modern environments. Having the UMD bundle be ES5 will have every project avoid having to transpile it's node_modules, which is what I have to do with map-gl-util at the moment to have Safari 10 support, which is still being used on many older iPads.

stevage commented 2 years ago

Oh thanks for picking that up. I'll double check and fix.

stevage commented 2 years ago

Ok, published as 0.42.0.