Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: Migrate type implementations into basetypes subpackage #567

Merged
merged 3 commits into from Dec 12, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Nov 30, 2022

Closes #91

Aliasing and function shadowing in the original types package should prevent most provider developer changes. The main exception is the newer type-specific Typable and Valuable interfaces were moved without a type alias. This should help developers find the necessary interfaces for custom types next to the base type implementations.

The underlying implementation of the primitive types (BoolType, Float64Type, Int64Type, NumberType, and StringType) are now fully exported types instead of the unexported primitive type which was difficult to extend.

The underlying value type creation functions were prefixed with New and the value types themselves were renamed to include Value at the end. This should prevent rough edges with the String value type since it conflicted with the String() method and could not be directly embedded easily.

Reference: #91

Aliasing and function shadowing in the original `types` package should prevent most provider developer changes. The main exception is the newer type-specific `Typable` and `Valuable` interfaces were moved without a type alias. This should help developers find the necessary interfaces for custom types next to the base type implementations.

The underlying implementation of the primitive types (`BoolType`, `Float64Type`, `Int64Type`, `NumberType`, and `StringType`) are now fully exported types instead of the unexported `primitive` type which was difficult to extend.

The underlying value type creation functions were prefixed with New and the value types themselves were renamed to include Value at the end. This should prevent rough edges with the `String` value type since it conflicted with the `String()` method and could not be directly embedded easily.
@bflad bflad added enhancement New feature or request breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. labels Nov 30, 2022
@bflad bflad added this to the v0.17.0 milestone Nov 30, 2022
@bflad bflad requested a review from a team as a code owner November 30, 2022 18:49
@bflad bflad modified the milestones: v0.17.0, v1.0.0 Nov 30, 2022
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

@bflad bflad merged commit 7afa862 into main Dec 12, 2022
@bflad bflad deleted the bflad/types-basetypes branch December 12, 2022 18:46
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify Extending Primitive Types
2 participants