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
In browser-side JavaScript, file size matters a lot. It would be nice if there
was a well-documented easy way to get rid of the code that wasn't needed for
Match and Patch if all you care about is the Diff features, for instance.
Original issue reported on code.google.com by philfreo on 4 May 2011 at 10:01
The text was updated successfully, but these errors were encountered:
I can document the process I used a moment ago when I updated my "improved
github diffs" user script
(https://github.com/johan/github-improved/blob/master/better-diffs.user.js - or
direct install link
https://github.com/johan/github-improved/raw/master/better-diffs.user.js) a
moment ago, which uses Neil's amazing diff backend without the match and patch
parts:
* replace all instances of "diff_match_patch" with "Diff" in javascript/diff_match_patch_uncompressed.js
* remove all the code from // MATCH FUNCTIONS to the end of the file
* wrap the file between a "var Diff = (function(){" and "return new Diff; })()" (without the quotes)
* prepend a little header comment annotating what revision it's based on, and linking to the source here
That's all. (Step 3 is only necessary if you want to keep identifier leakage to
just the Diff object, it's really only the three DIFF_DELETE, DIFF_INSERT and
DIFF_EQUAL constants.)
That said, it would be neat if the three portions were split up into a diff.js,
a match.js and a patch.js (maybe a main.js too?) with a Makefile that
recombines them back together into the current form;
Original comment by oyas...@gmail.com on 9 Jun 2011 at 12:55
Original issue reported on code.google.com by
philfreo
on 4 May 2011 at 10:01The text was updated successfully, but these errors were encountered: