Rightpoint / Eject

An eject button for Interface Builder to generate swift code
MIT License
523 stars 24 forks source link

Add xib diff to github PRs #32

Open drumnkyle opened 7 years ago

drumnkyle commented 7 years ago

I am interested in this just for the idea of being able to make a diff more readable of a XIB file. I was doing some work on this concept in the following gist. I think you could use a couple of other naming ideas like the ones I used here https://gist.github.com/drumnkyle/bf3f3b5acbb1199c7b6c0f00f396977b aside from just the userLabel.

KingOfBrian commented 7 years ago

Excellent! I think the diff use case is very compelling.

I believe that I take those 3 things into account though. Do you have an example that should be more readable? I don't have any direct test cases for this and may have introduced a regression.

drumnkyle commented 7 years ago

I actually only read your README; I hadn't looked through yet to see if you handled all of them. So if you do already, feel free to close the issue. I don't have a good example at the moment.

The thing that would be interesting is coming up with a way to integrate this into a code reviewing system so that you don't need to actually check in the swift file, but rather just see a diff of the generated code version alongside the XIB itself.

KingOfBrian commented 7 years ago

Yea, that is interesting. The web app could be passed 2 file URLs and generate a diff. Then there could be a diff button injected via javascript which would open my web app diff or do a div swap.

I like this idea, so I'm going to rename the issue to track this instead of closing it. Usually I move web app bugs over to EjectAssist, but I'll keep this here for now since it may direct some Eject work.

If you could double check that the names are looking good to you, that'd be great.

drumnkyle commented 7 years ago

Ok. That sounds good. Yeah, I'll try to test this library when I can. Definitely looks interesting for diffing purposes to me.

drumnkyle commented 7 years ago

Also, might I suggest making sure your solution to this issue be extendable enough so that it can be used for different code reviewing systems. So, maybe a way of allowing someone to provide the javascript for the place where you would swap or something like that. (I'm not good at Javascript or web dev at all, so I don't really know what I'm talking about ;))