react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

[Feat] replace `fast-deep-equal` with `fast-equals`

Open mrienstra opened this issue 8 months ago • 2 comments

Target Use Case

Replace the unmaintained (2020) and non-ESM fast-deep-equal with fast-equals, as @googlemaps/markerclusterer did recently, see https://github.com/googlemaps/js-markerclusterer/issues/610 and https://github.com/googlemaps/js-markerclusterer/pull/893.

Proposal

Current usage of fast-deep-equal is in src/libraries/use-deep-compare-effect.tsx.

Looks like changes would be:

- import isDeepEqual from 'fast-deep-equal';
+ import { deepEqual } from 'fast-equals';

... and:

- !isDeepEqual(deps, ref.current)
+ !deepEqual(deps, ref.current)

mrienstra avatar May 05 '25 00:05 mrienstra

I'm open to making this change, with a tendency towards inlining a simple implementation of what we actually need into our library to avoid external dependencies altogether.

But to clarify, are there any actual problems with the way it is at the moment?

usefulthink avatar May 05 '25 14:05 usefulthink

Re: actual problems: Not that I'm aware of. Presumably one could be affected by a bug, e.g. https://github.com/epoberezkin/fast-deep-equal/issues/111, but that's just a hypothetical.

mrienstra avatar May 05 '25 15:05 mrienstra