Skip to content

(v2) consistency and best practices#656

Merged
meowgorithm merged 10 commits intov2-expfrom
v2-tidy-again
Oct 31, 2024
Merged

(v2) consistency and best practices#656
meowgorithm merged 10 commits intov2-expfrom
v2-tidy-again

Conversation

@meowgorithm
Copy link
Copy Markdown
Member

This is a set of breaking changes to enforce consistency and best practices in Bubbles v2.

The two big package-wide ones are:

  1. All bubbles now use getters and setters for width and height. This will prevent us from having to make breaking changes in the future when changing size needs to affect other parameters.
// Before
type Model struct {
    Height int
}

// After
func (m Model) Height() int
func (m *Model) SetHeight(int)
  1. Default keymaps are no longer global. This guards against the default keycap being altered on the package level.
// Before
var DefaultKeyMap = KeyMap{/* ... */}

// After
func DefaultKeyMap() KeyMap

There are also a series of small package-level adjustments which we'll outline in the release notes.

@meowgorithm meowgorithm merged commit 591dfd5 into v2-exp Oct 31, 2024
@meowgorithm meowgorithm deleted the v2-tidy-again branch October 31, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants