react-native-community / upgrade-helper

⚛️ A web tool to support React Native developers in upgrading their apps.
https://react-native-community.github.io/upgrade-helper
MIT License
3.67k stars 112 forks source link

Show trailing newline differences #353

Open simon-abbott opened 1 year ago

simon-abbott commented 1 year ago

Feature Request

I was looking at the [0.71.4 -> 0.72.0-rc.0] upgrade guide and I noticed several changes (notably .watchmanconfig) that seem to be identical. I suspect that these changes are due to trailing newline changes, but the diff display doesn't show that. It would be nice if it showed both a) that there is a newline difference, and b) what that difference is (added, removed, etc).

Why it is needed

Not being able to easily tell exactly what changed makes using the helper a bit more cognitively difficult than it needs to be.

Possible implementation

Not sure, but I know it's possible since git diff does it.

Code sample

I don't know.

cortinico commented 1 year ago

I would argue that whitespace differences should actually be hidden completely

simon-abbott commented 1 year ago

Maybe have a toggle for it? I can see pros and cons to both. I personally like seeing the whitespace differences when upgrading so that our code is as similar to the "expected" code as possible, mostly so that future upgrades are easier since I can see clearly where things match up. However I can also totally see why some people wouldn't want to see them at all.

cortinico commented 1 year ago

Maybe have a toggle for it?

This would probably be the best solution 👍 I guess we'll be more than happy to receive a contribution about this

simon-abbott commented 1 year ago

Even with a toggle though I still think it should show newlines when whitespace mode is on.