mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
235 stars 124 forks source link

Replaced lodash.merge with merge-options #312

Closed underoot closed 5 months ago

underoot commented 5 months ago

Replaced lodash.merge with merge-options (based on two options recommended in deprecation notice of deep-assign library). Noticed, that lodash.merge added ~50KB of code, which significantly increase size of bundle without proper reason for that. Now situation with merge-options much better:

image image image

stepankuzmin commented 5 months ago

Maybe we can even switch to Object.assign if we don't do a deep merge here, what do you think?

https://github.com/mapbox/mapbox-gl-directions/blob/15d305d3b6770d03bab55f005795d3b93ed953e9/src/reducers/index.js#L57

underoot commented 5 months ago

Maybe we can even switch to Object.assign if we don't do a deep merge here, what do you think?

I bet we do, i.e. for controls. We can brake backward compatibility, but I don't think that we should