Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update @elastic/kibana-data-discovery dependencies (main) #202622

Merged
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^6.1.0",
"diff": "^5.1.0",
"diff": "^7.0.0",
"dotenv": "^16.4.5",
"elastic-apm-node": "^4.9.0",
"email-addresses": "^5.0.0",
Expand All @@ -1143,7 +1143,7 @@
"extract-zip": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"fast-glob": "^3.3.2",
"fastest-levenshtein": "^1.0.12",
"fastest-levenshtein": "^1.0.16",
"fflate": "^0.6.9",
"file-saver": "^1.3.8",
"fnv-plus": "^1.3.1",
Expand Down Expand Up @@ -1581,7 +1581,7 @@
"@types/dagre": "^0.7.47",
"@types/dedent": "^0.7.0",
"@types/deep-freeze-strict": "^1.1.0",
"@types/diff": "^5.0.8",
"@types/diff": "^6.0.0",
"@types/ejs": "^3.0.6",
"@types/enzyme": "^3.10.12",
"@types/eslint": "^8.44.2",
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of how the output is different now:

  • before:
Screenshot 2025-01-06 at 15 00 13
  • after:
Screenshot 2025-01-06 at 15 00 28

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As briefly discussed in our sync, the change in output here is likely due to kpdecker/jsdiff#439 where diff deletions are now prioritized over additions, which is apparently the standard behaviour for the Myers diff algorithm (v5 implemented in incorrectly). While technically breaking, I think the change is minor enough (and more consistent with other diff tools) that we can safely backport to 8.x, although I'll only target prev-minor instead of all-open to be careful.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,63 +20,81 @@ describe('calculateDiff', () => {
expect(result).toMatchInlineSnapshot(`
Array [
Object {
"added": false,
"count": 5,
"removed": false,
"value": "This ",
},
Object {
"added": true,
"count": 4,
"removed": undefined,
"removed": false,
"value": "one ",
},
Object {
"added": false,
"count": 5,
"removed": false,
"value": "is a ",
},
Object {
"added": true,
"count": 10,
"removed": undefined,
"value": "different ",
},
Object {
"added": false,
"count": 1,
"removed": true,
"value": "m",
},
Object {
"added": undefined,
"added": true,
"count": 4,
"removed": false,
"value": "diff",
},
Object {
"added": false,
"count": 1,
"removed": true,
"removed": false,
"value": "e",
},
Object {
"added": true,
"count": 6,
"removed": false,
"value": "rent m",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": "s",
},
Object {
"added": undefined,
"added": false,
"count": 2,
"removed": true,
"value": "sa",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": "g",
},
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": "e",
},
Object {
"added": false,
"count": 4,
"removed": false,
"value": " val",
},
Object {
"added": true,
"count": 2,
"removed": undefined,
"removed": false,
"value": "ue",
},
]
Expand All @@ -88,45 +106,51 @@ describe('calculateDiff', () => {
expect(result).toMatchInlineSnapshot(`
Array [
Object {
"added": false,
"count": 2,
"removed": false,
"value": "This ",
},
Object {
"added": true,
"count": 2,
"removed": undefined,
"removed": false,
"value": "one ",
},
Object {
"added": false,
"count": 4,
"removed": false,
"value": "is a ",
},
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": "message",
},
Object {
"added": true,
"count": 1,
"removed": undefined,
"removed": false,
"value": "different",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": " ",
},
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": "val",
},
Object {
"added": true,
"count": 3,
"removed": undefined,
"removed": false,
"value": "msg value",
},
]
Expand All @@ -138,15 +162,15 @@ describe('calculateDiff', () => {
expect(result).toMatchInlineSnapshot(`
Array [
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": "This is a message val",
},
Object {
"added": true,
"count": 1,
"removed": undefined,
"removed": false,
"value": "This one is a different msg value",
},
]
Expand All @@ -162,31 +186,37 @@ describe('calculateDiff', () => {
expect(result).toMatchInlineSnapshot(`
Array [
Object {
"added": false,
"count": 1,
"removed": false,
"value": "[
",
},
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": " \\"gif\\",
",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": " \\"png\\",
",
},
Object {
"added": true,
"count": 1,
"removed": undefined,
"removed": false,
"value": " \\"jpg\\"
",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": "]",
},
]
Expand All @@ -203,12 +233,14 @@ describe('calculateDiff', () => {
expect(result).toMatchInlineSnapshot(`
Array [
Object {
"added": false,
"count": 1,
"removed": false,
"value": "[
",
},
Object {
"added": undefined,
"added": false,
"count": 1,
"removed": true,
"value": " \\"single value\\"
Expand All @@ -217,13 +249,15 @@ describe('calculateDiff', () => {
Object {
"added": true,
"count": 2,
"removed": undefined,
"removed": false,
"value": " \\"multiple\\",
\\"values\\"
",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": "]",
},
]
Expand All @@ -236,12 +270,14 @@ describe('calculateDiff', () => {
expect(result2).toMatchInlineSnapshot(`
Array [
Object {
"added": false,
"count": 1,
"removed": false,
"value": "[
",
},
Object {
"added": undefined,
"added": false,
"count": 2,
"removed": true,
"value": " \\"multiple\\",
Expand All @@ -251,12 +287,14 @@ describe('calculateDiff', () => {
Object {
"added": true,
"count": 1,
"removed": undefined,
"removed": false,
"value": " \\"single value\\"
",
},
Object {
"added": false,
"count": 1,
"removed": false,
"value": "]",
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ describe('useComparisonCellValue', () => {
expect(comparisonCell1.getCell()).not.toHaveClass(BASE_CELL_CLASS);
expect(comparisonCell1.getCell()).not.toHaveClass(MATCH_CELL_CLASS);
expect(comparisonCell1.getCell()).not.toHaveClass(DIFF_CELL_CLASS);
expect(comparisonCell1.getAllSegments()).toHaveLength(12);
expect(comparisonCell1.getAddedSegments()).toHaveLength(3);
expect(comparisonCell1.getAllSegments()).toHaveLength(13);
expect(comparisonCell1.getAddedSegments()).toHaveLength(4);
expect(comparisonCell1.getRemovedSegments()).toHaveLength(3);
expect(comparisonCell1.getCell()).toMatchSnapshot();
const comparisonCell2 = renderComparisonCell({
Expand Down
21 changes: 13 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11473,10 +11473,10 @@
resolved "https://registry.yarnpkg.com/@types/deep-freeze-strict/-/deep-freeze-strict-1.1.0.tgz#447a6a2576191344aa42310131dd3df5c41492c4"
integrity sha1-RHpqJXYZE0SqQjEBMd099cQUksQ=

"@types/diff@^5.0.8":
version "5.0.8"
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.8.tgz#28dc501cc3e7c62d4c5d096afe20755170acf276"
integrity sha512-kR0gRf0wMwpxQq6ME5s+tWk9zVCfJUl98eRkD05HWWRbhPB/eu4V1IbyZAsvzC1Gn4znBJ0HN01M4DGXdBEV8Q==
"@types/diff@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-6.0.0.tgz#031f27cf57564f3cce825f38fb19fdd4349ad07a"
integrity sha512-dhVCYGv3ZSbzmQaBSagrv1WJ6rXCdkyTcDyoNu1MD8JohI7pR7k8wdZEm+mvdxRKXyHVwckFzWU1vJc+Z29MlA==

"@types/ejs@^3.0.6":
version "3.0.6"
Expand Down Expand Up @@ -17403,6 +17403,11 @@ diff@^5.0.0, diff@^5.1.0, diff@^5.2.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==

diff@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-7.0.0.tgz#3fb34d387cd76d803f6eebea67b921dab0182a9a"
integrity sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==

diffie-hellman@^5.0.0:
version "5.0.2"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
Expand Down Expand Up @@ -19058,10 +19063,10 @@ fast-xml-parser@4.4.1:
dependencies:
strnum "^1.0.5"

fastest-levenshtein@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==
fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16:
version "1.0.16"
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5"
integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==

fastest-stable-stringify@^1.0.1:
version "1.0.1"
Expand Down