go-runewidth icon indicating copy to clipboard operation
go-runewidth copied to clipboard

Semantic Versioning: `ZeroWidthJoiner` Removal

Open trynity opened this issue 3 years ago • 6 comments

ZeroWidthJoiner was removed after v0.0.9: https://github.com/mattn/go-runewidth/blob/v0.0.9/runewidth.go#L14

The next version was v0.0.10, but this introduced a breaking API change.

While being v0 means you can introduce breaking API changes, would it be possible to get a v1 release that can ensure API stability?

It's fine to just keep cutting new versions when API changes happen, but right now it makes managing Go Module dependencies rather painful, since it just assumes patch versions don't introduce breaking changes.

trynity avatar Dec 22 '21 14:12 trynity

I'm thinking global variable ZeroWidthJoiner is not used for everyone properly since the variable is overwritten in init function.

mattn avatar Dec 22 '21 14:12 mattn

However, I'm also considering upgrading the minor version.

mattn avatar Dec 22 '21 23:12 mattn

To my knowledge, I was the only one using it and I'm ok with this change.

rivo avatar Feb 16 '22 09:02 rivo

This also reintroduces the following issues when building older projects that were pinned to a version of tview that relied on ZeroWidthJoiner:

  1. https://github.com/rivo/tview/issues/205
  2. https://github.com/rivo/tview/issues/189

To resolve the issue, I updated the project go.mod file to use the latest tview at the time, e.g.

        // github.com/rivo/tview v0.0.0-20210111184519-c818a0c789ee // original
        // github.com/mattn/go-runewidth v0.0.8 // indirect - via tview above
	github.com/rivo/tview v0.0.0-20230406072732-e22ce9588bb4 // updated
	github.com/mattn/go-runewidth v0.0.14 // indirect - via tview above

I would have preferred to stick with the original pinned tview, but all of my attempts to pin a matching and compatible go-runewidth version in the go.mod file was not successful.

Even though go-runewidth v0.0.8 has the ZeroWidthJoinerField field, somehow go seems to be looking at a version that doesn't have the field.

Not sure what to make of it, and probably not that important, but just presenting the info in case it helps someone else.

W1M0R avatar Apr 06 '23 08:04 W1M0R

Special ZeroWidthJoiner handling was a mistake. We didn't understand Unicode fully back then. tview was the only project using this flag and it hasn't used it anymore for quite a long time. So there's currently no other project that needs ZeroWidthJoiner and it makes sense to remove it.

I would think that if there's an old project which uses an old version of tview, it would also reference the correct go-runewidth version which still has ZeroWidthJoiner so I'm also not sure why there's an error message related to that.

I would have preferred to stick with the original pinned tview

In any case, tview is backwards compatible. You could upgrade tview to the latest version and your program should still work.

rivo avatar Apr 06 '23 12:04 rivo

Thanks for the feedback @rivo. I've upgraded to the latest version of your package, and everything seems to be working well. Thanks for your backwards-compatibility efforts!

W1M0R avatar Apr 07 '23 00:04 W1M0R