You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of #10488 it has been determined that we should replace the thirdparty difflib with a maintained library which should be added via composer.
A good candidate is sebastianbergmann/diff, and I have created a proof of concept PR which does some of the work to implement this library - but take a look at #10488 (comment) for other possible alternatives.
difflib is only directly referenced in SilverStripe\View\Parsers\Diff which subclasses it - but that class is in turn referenced in a few places:
Various tests reference it
SilverStripe\VersionedAdmin\Forms\DiffField in silverstripe/versioned-admin uses it (compareHTML() only, none of the underlying methods from difflib, so should be fine)
SilverStripe\Versioned\DiffDifferencer uses it (again using compareHTML() only, none of the underlying methods from difflib)
Acceptance Criteria
The thirdparty difflib is removed from the codebase, and a suitable replacement is added via composer
The existing functionality which uses difflib is changed to use the replacement library
The result is clearly correct, even if slightly different to the output from difflib
e.g. it's okay if, when replacing content, the removal is shown before the addition where difflib shows the addition before the removal
The changelog calls out that the SilverStripe\View\Parsers\Diff class no longer has all of the methods it was inheriting from difflib
The methods in SilverStripe\View\Parsers\Diff which were inherited from difflib are deprecated in CMS 4 Changed\Removed methods defined directly in SilverStripe\View\Parsers\Diff are deprecated in CMS 4
Methods inherited from the thirdparty difflib are not called out as deprecated methods.
As part of #10488 it has been determined that we should replace the thirdparty difflib with a maintained library which should be added via composer.
A good candidate is sebastianbergmann/diff, and I have created a proof of concept PR which does some of the work to implement this library - but take a look at #10488 (comment) for other possible alternatives.
difflib
is only directly referenced inSilverStripe\View\Parsers\Diff
which subclasses it - but that class is in turn referenced in a few places:SilverStripe\VersionedAdmin\Forms\DiffField
insilverstripe/versioned-admin
uses it (compareHTML()
only, none of the underlying methods from difflib, so should be fine)SilverStripe\Versioned\DiffDifferencer
uses it (again usingcompareHTML()
only, none of the underlying methods from difflib)Acceptance Criteria
SilverStripe\View\Parsers\Diff
class no longer has all of the methods it was inheriting from difflibThe methods inChanged\Removed methods defined directly inSilverStripe\View\Parsers\Diff
which were inherited from difflib are deprecated in CMS 4SilverStripe\View\Parsers\Diff
are deprecated in CMS 4PRs
CMS 5
CMS 4 (deprecations)
The text was updated successfully, but these errors were encountered: