Giter Club home page Giter Club logo

Comments (7)

AsyncBanana avatar AsyncBanana commented on May 12, 2024

Good question! Currently, there is no recommended way to visualize changes. However, it should not be difficult to make your own method of doing this, and if you make an open-source library for this, I would love to feature it on the Microdiff README. Also, #17 should help once it is merged.

from microdiff.

denis-bel avatar denis-bel commented on May 12, 2024

I like the library. But is there a recommended way to visualize the output? I'm looking for something that looks like jest-diff output or "github PR changes", e.g just for the terminal?

Hello, would you like to visualize the output like this one?

image

(Green - was created, Red - was deleted, Yellow - was changed)

from microdiff.

kirillgroshkov avatar kirillgroshkov commented on May 12, 2024

Hello, would you like to visualize the output like this one?

Yes, exactly.

Like github visualizes differences. Or Jest.

from microdiff.

denis-bel avatar denis-bel commented on May 12, 2024

Hello, would you like to visualize the output like this one?

Yes, exactly.

Like github visualizes differences. Or Jest.

Okay, I asked because GitHub cannot show that something has been changed. It shows that the content of the line was deleted and then added, but the microdiff has a CHANGE type. So it will be okay to have a third format for changed values?

from microdiff.

kirillgroshkov avatar kirillgroshkov commented on May 12, 2024

Aha, then I misunderstood.

No, I don't see the need for CHANGE type, but instead I expect to see "what exactly" is changed in that line. E.g if a string is changed, it would show in red the removed characters and in green the added characters.

from microdiff.

denis-bel avatar denis-bel commented on May 12, 2024

So, consider these objects like old and new

const oldObject = {
	a: 'value',
	b: 'old value'
};
const newObject = {
	b: 'another value',
	c: 'new value'
};

Would you like to get output like this?

image

from microdiff.

AsyncBanana avatar AsyncBanana commented on May 12, 2024

Closing this because a solution to this should be developed separately.

from microdiff.

Related Issues (20)

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.