Skip to content

Improve wrangler json diffing logic #10885

@dario-piotrowicz

Description

@dario-piotrowicz

Currently when wrangler needs to compute the diff of two json objects uses its own diffing logic, this however is not ideal for a few reasons.

The main issue is that the implementation is completely text-based and very lossy. Before objects can be compared they need to be stringified (example) and then a line-by-line diffing is applied. This results in a result that doesn't contain much information regarding what changed, it mostly includes how many lines have been added, removed or modified (this for example can include lines that imply add a semicolon due to a new properties being added).

Ideally we should have a diffing implementation that provides information on what specific fields have changed and how.


Additionally the current diffing logic presents quirks that are difficult to deal with (example).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions