mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #586] Updating tview with tcell/v1 to newer version with tcell/v2 may sometimes fail #429
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#429
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @spinzed on GitHub (Apr 2, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/586
Since updating to tcell v2, using tcell's types and constants has created an issue when upgrading. If the project is created with tview version which uses v1 of tcell and it is attempted to update
go get -ucommand, it will refuse to update with bunch of errors like this one:The types are wrong, types from
tcell/v2are expected, but the project contains those fromtcell/v1. This can be resolved by appending/v2to the tcell import paths in all project files. But that still breaks compatibility and can happen again in the future.The obvious solution is that the package should not rely on tcell's types and it should have their own that are analog to tcell's. This should be easily implemented with type aliases. It should prevent that error from happening in the future, although the problem will still be present for those who already started a project with the old version of tcell.
@rivo commented on GitHub (Apr 26, 2021):
I understand that this is frustrating. While I try hard not to break backwards compatibility,
tcelldid (I'm guessing @gdamore had to due to limitations of the old formats) and the only way to avoid breaking changes intviewwas to not upgrade. But many bugs that also affectedtviewwere fixed in the newtcellversion so that was no viable option.What you're suggesting is breaking compatibility once again by wrapping
tcelltypes withtviewtypes. Is that a good idea?By the way, this was suggested before and even back then, I explained that it wouldn't just be the types but also all of
tcell's constants. And if any of that changes intcell, I'd have to remap everything (dynamically in the worst case). I'd rather put the little time I have intotview's own features than to copy (and maintain) code fromtcell.Overall, that's a "no" for now. I'm hoping @gdamore won't make more changes to the basic types such as
Color,AttrMask,Style, andKey. If he doesn't, we should be fine.@gdamore commented on GitHub (Apr 26, 2021):
I have no plans to do so. We could not make the improvements to fix some of the bugs without the breaking change - I try hard not to do breaking changes but it was unavoidable in this case.
@rivo commented on GitHub (Apr 26, 2021):
Thanks for chiming in. That's what I had thought. All good.
@spinzed commented on GitHub (Apr 26, 2021):
If that's the case, perhaps it's best to leave it as is. The fewer breaking changes are there, the better.
I'll close this issue since we clarified all things we needed to clarify.