Giter VIP home page Giter VIP logo

Comments (3)

JackuB avatar JackuB commented on June 12, 2024

Yea, the change happened here https://github.com/JackuB/diff-match-patch/pull/13/files#diff-168726dbe96b3ce427e7fedce31bb0bcR76

It's emulating array for backward compatibility. But the destructing use case is not taken care of.

  1. We could add Symbol.iterator to the Diff object (this would require some kind of transpilation)
  2. Publish this as breaking and go for v2 (and release 1.0.4 without this change)
  3. Patch it to use array (current tests are passing)
diff_match_patch.Diff = function(op, text) {
  return [op, text];
};

Wondering if there is any reason they did that - most likely to keep the API 1:1 with rest of the implementations. Will try to look into it a bit more.

from diff-match-patch.

bebbi avatar bebbi commented on June 12, 2024

I was going to submit an issue in google but saw yours , thanks.
If google is happy with status quo, I'd propose option 2 as the one that can break in least possible ways, although it's a bit a strange api. Lets see what they say..

from diff-match-patch.

JackuB avatar JackuB commented on June 12, 2024

Released 1.0.4 with a rollback https://github.com/JackuB/diff-match-patch/releases/tag/1.0.4
Will hold on with releasing v2 as there is a chance they will rollback the API change

from diff-match-patch.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.