Currently, we use layer id's as the immutable property to keep track of layers between before and after. This means the differ can't make sense of any changes to that property (i.e. renaming layers).
There are clever things we can do to guess whether a new layer is probably actually a renamed one (the new layer having many of the same properties as an old, deleted one), but it's not fully reliable.
One way to track changes while supporting variable layer names is attaching a unique identifier to the layer metadata -- assigning it upon layer creation in Maputnik, and preserving that across all layer mutations until the layer is deleted.
Currently, we use layer id's as the immutable property to keep track of layers between before and after. This means the differ can't make sense of any changes to that property (i.e. renaming layers).
There are clever things we can do to guess whether a new layer is probably actually a renamed one (the new layer having many of the same properties as an old, deleted one), but it's not fully reliable.
One way to track changes while supporting variable layer names is attaching a unique identifier to the layer metadata -- assigning it upon layer creation in Maputnik, and preserving that across all layer mutations until the layer is deleted.