patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

diff in a minified file is hard to read

Open Haroenv opened this issue 2 years ago • 2 comments

Of course the diff format used works line-based, as that's the norm, git etc. also use that. Unfortunately many libraries are minified upon publish, which means that when you import the file, and a patch needs to be made, that patch must be in the minified version. As soon as the line changed is more than a couple hundred lines, tools like vscode and GitHub will no longer highlight what's the exact change made, and will make it harder to evaluate what changed.

Is there some patch format that is suitable for more granular patches, maybe character or character group-based?

Haroenv avatar Jul 15 '21 08:07 Haroenv

I've had the same issue. Maybe the simplest fix would be to be able to apply some kind of a transformation (e.g., Prettier) to the file before creating/applying the patch? That way the patch could be much smaller, but the minified output would be lost.

fo-fo avatar Sep 12 '22 15:09 fo-fo

Another issue is that in minified files the variable names will mostly be random

j4k0xb avatar Nov 29 '23 02:11 j4k0xb