chore(deps): update dependency diff to v8 #412
+12
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.0.0->8.0.27.0.1->8.0.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Test plan: CI should pass with updated dependencies. No review required: this is an automated dependency update PR.
Release Notes
kpdecker/jsdiff (diff)
v8.0.2Compare Source
diffSentenceswith old Safari versions. This was broken in 8.0.0 by the introduction of a regex with a lookbehind assertion; these weren't supported in Safari prior to version 16.4.sideEffects: false.v8.0.1Compare Source
diffJsonwhich were broken by 8.0.0. The new bundled types in 8.0.0 only alloweddiffJsonto be passed string arguments, but it should've been possible to pass either strings or objects (and now is). Thanks to Josh Kelley for the fix.v8.0.0Compare Source
diffSentences:["foo.", " ", "bar."]but "foo. bar" tokenized to["foo.", " bar"]- i.e. whether the space between sentences was treated as a separate token depended upon whether the final sentence had trailing punctuation or not. This was arbitrary and surprising; it is no longer the case.)diffWordstaking O(n^2) time in pathological cases.push()using.applyor the spread operator and hitting the JS-implementation-specific limit on the maximum number of arguments to a function, as shown at https://stackoverflow.com/a/56809779/1709587; thus the exact threshold to hit the error will depend on the environment in which you were running JsDiff.)mergefunction. Previously JsDiff included an undocumented function calledmergethat was meant to, in some sense, merge patches. It had at least a couple of serious bugs that could lead to it returning unambiguously wrong results, and it was difficult to simply "fix" because it was unclear precisely what it was meant to do. For now, the fix is to remove it entirely.the
diffpackage on npm now includes its own TypeScript type definitions. Users who previously used the@types/diffnpm package from DefinitelyTyped should remove that dependency when upgrading JsDiff to v8.Note that the transition from the DefinitelyTyped types to JsDiff's own type definitions includes multiple fixes and also removes many exported types previously used for
optionsarguments to diffing and patch-generation functions. (There are now different exported options types for abortable calls - ones with atimeoutormaxEditLengththat may give a result ofundefined- and non-abortable calls.) See the TypeScript section of the README for some usage tips.The
Diffobject is now a class. Custom extensions ofDiff, as described in the "Defining custom diffing behaviors" section of the README, can therefore now be done by writing aclass CustomDiff extends Diffand overriding methods, instead of the old way based on prototype inheritance. (I think code that did things the old way should still work, though!)diff/lib/index.es6.jsanddiff/lib/index.mjsno longer exist, and the ESM version of the library is no longer bundled into a single file.The
ignoreWhitespaceoption fordiffWordsis no longer included in the type declarations. The effect of passingignoreWhitespace: truehas always been to makediffWordsjust calldiffWordsWithSpaceinstead, which was confusing, because that behaviour doesn't seem properly described as "ignoring" whitespace at all. The property remains available to non-TypeScript applications for the sake of backwards compatibility, but TypeScript applications will now see a type error if they try to passignoreWhitespace: truetodiffWordsand should change their code to calldiffWordsWithSpaceinstead.JsDiff no longer purports to support ES3 environments. (I'm pretty sure it never truly did, despite claiming to in its README, since even the 1.0.0 release used
Array.mapwhich was added in ES5.)diffJson'sstringifyReplaceroption behaves more likeJSON.stringify'sreplacerargument now. In particular:keypassed to the replacer when the top-level object is passed in asvalueis now""(previously, wasundefined), and thekeypassed with an array element is the array index as a string, like"0"or"1"(previously was whatever the key for the entire array was). Both the new behaviours match that ofJSON.stringify.undefinedwhen called in async mode (i.e. with a callback). Previously, there was an odd quirk where they would returntrueif the strings being diffed were equal andundefinedotherwise.Configuration
📅 Schedule: Branch creation - "on the 1st through 7th day of the month" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.