Breaking changes:
- Remove
#[cgp_context]and simplify consumer trait implementation - #205 - Rename
ProvideTypetoTypeProvider- #211 - Remove
{Type}Oftype alias from#[cgp_type]- #212 - Use
Copyinstead ofClonefor owned getter field values - #213 - Update syntax for
check_components!anddelegate_and_check_components!- #214 - Change the default check trait name in
check_components!- #215
New features:
- Implement
#[cgp_fn]- #197 - Tests and Improvements for
#[cgp_fn]- #198 - Support abstract type equality in
#[use_type]- #200 - Support
#[implicit],#[uses], and#[use_type]in#[cgp_impl]- #201 - Support
#[use_type]and#[extend]in#[cgp_component]- #202 - Add basic support for foreign abstract types in
#[use_type]- #203 - Support
#[use_provider]attribute inside#[cgp_impl]for higher order providers - #204 - Support use of
#[cgp_impl]on consumer trait with concrete context - #206 - Support
#[use_provider]inside#[cgp_fn]- #210
Bug fixes:
- Fix
#[cgp_type]when associated types contain self-referential bounds - #208
- Support implicit
Contexttype in#[cgp_impl]- #189 - Support provider checks in
check_components!- #190 - Support associated type in getter trait - #191
- Introduce
#[cgp_impl]to simplify provider trait implementation - #174 - Allow context types to delegate components directly - #175
- Introduce
#[cgp_inherit]for inheriting from presets - #176 - Fix use of self inside default trait method implementation body - #179
-
Monadic computation support
-
Extensible data types improvements
- Add generalized field transformation on partial records to support building with default values. - #128
- Add
CanFinalizeWithDefaultmethod for partial records - #130 - Extensible Visitor Improvements - #132
- Add support for passing additional arguments to extensible visitors - #134
- Add extensible visitor support mutable partial variants - #135
- Introduce
UpdateFieldtrait to generalize field transformation in partial data - #148 - Add optional field builder constructs for extensible records - #152
- Introduce
#[derive(CgpData)]and#[derive(CgpRecord)]Macros - #154 - Add
__prefix to Partial data types generated - #156 - Implement ref variants of matcher providers - #161
-
Handler improvements
-
Dispatch macro
-
Component system improvements
- Allow only provider name to be specified inside
#[cgp_getter]- #143 - Support use of lifetime parameters inside CGP traits - #145
- Add
?Sizedbound toDelegateComponent'sNameparameter - #147 - Allow shortcut definition of provider name in
#[cgp_type]- #163 - Fix use of
newindelegate_components!when keys array are used - #164 - Add
Lifetype to represent lifetimes as types - #166
- Allow only provider name to be specified inside
-
Field improvements
-
Symbol improvements
-
Breaking changes toward stabilization
-
Datatype-generic Programming Support
- Data-generic programming support in CGP - #112
- Implement
DispatchHandlersReffor dispatching based on enum references - #116 - Builder dispatcher refactoring - #117
- Introduce ref version of handler traits - #118
- Dispatcher Refactoring - #119
- Remove Input param from
MatchWithFieldHandlers- #120 - Support use of ref handlers in handler macros - #121
-
Preset Improvements
- Add new direct delegation mode and use it in preset inheritance - #111
-
Bug Fixes
-
New
cgp-handlerCrate- Introduce new
cgp-handlercrate - #105
- Introduce new
-
Macro Improvements
-
CGP Field Improvements
- Format
Charstatically withoutself- #104
- Format
-
Miscellaneous
- Minor improvements - #107
-
Documentation
- Add inline Rust documentation for common CGP constructs - #109
-
Debugging Improvements
- Implement
delegate_and_check_components!- #98 - Implement
check_components!macro to check if a context implements a component - #78 - Permanently enable provider supertrait - #73
- Introduce
#[new_cgp_provider]to also generate provider struct definition - #67 - Preserve original provider bounds inside
#[cgp_provider]- #65 - Introduce
IsProviderFortrait to help improve compile errors - #63
- Implement
-
CGP Presets Implementation
-
CGP Getter Improvements
- CGP Getter Improvements - #94
- Getter Macro Improvements - #87
- Refactoring and Improvements on
#[cgp_getter]- #81 - Fix component generics inside derivation of
WithProviderfor#[cgp_getter]- #80 - Fix
#[cgp_getter]macro when the getter trait contains generic parameters - #76 - Allow generic arguments inside
#[cgp_auto_getter]traits - #64
-
Macro Improvements
- Simplify attribute arguments for
#[cgp_component],#[cgp_provider]and#[cgp_context]- #96 - Allow definition of new structs inside
delegate_components!- #93 - Migrate macro tests to
cgp-testscrate, part 1 - #90 - Automatically derive
UseContextimplementation inside#[cgp_component]- #88 - Macro Crates Reorganization - #83
- Refactoring and rename
#[trait_alias]to#[blanket_trait]- #82 - Introduce
#[trait_alias]macro to simplify definition of alias traits - #79 - CGP Macro Refactoring - #77
- Rename
#[new_cgp_provider]to#[cgp_new_provider]- #75 - Introduce
#[cgp_context]attribute macro for CGP contexts - #66
- Simplify attribute arguments for
-
Component System Improvements
-
CGP Field Improvements
-
Update Rust MSRV to v1.84 - #58
-
Add
HasAsyncErrorTypeto prelude - #59 -
Add
CanRaiseAsyncErrorandCanWrapAsyncErrortocgp-errorand prelude - #60
-
Introduce Accessor Component Macros - #56
- Introduce
#[cgp_getter]attribute macro that extends#[cgp_component]and implementUseFieldsandUseFieldfor accessor traits. - Introduce
#[cgp_auto_getter]attribute macro for deriving accessor traits with blanket implementations that useHasFielddirectly.
- Introduce
-
Introduce
cgp_type!macro for defining simple abstract CGP types - #55- Use
cgp_type!to deriveHasErrorTypeandHasRuntimeType.
- Use
-
Implement
ErrorWrapperon genericErrorRaiserproviders - #54- Implement
ErrorWrapperfor the following providers:DebugError,DisplayError,DebugAnyhowError,DisplayAnyhowError,RaiseAnyhowError,DebugEyreError,DisplayEyreError,RaiseEyreError,DebugBoxedStdError,DisplayBoxedStdError.
- Implement
-
Reorganize crate exports - #53
- Move generic error providers to the
cgp-error-extracrate. - Add an
allocfeature tocgp-error-extrato enable use ofallocin providers. - Make private the sub-modules inside CGP crates.
- Explicitly export module items instead of using
*.
- Move generic error providers to the
-
Move
cgp-innertocgp-extra- #51- Remove re-export of
cgp-innerfromcgp-core. - Re-export
cgp-innerandcgp-runtimefromcgp-extra.
- Remove re-export of
-
Introduce
cgp-runtimecrate - #50- Introduce the
HasRuntimeTypeandHasRuntimetraits. - Introduce
HasAsyncRuntimeTypetrait used for addingAsyncconstraint toHasRuntimeType::Error.
- Introduce the
-
Error crates refactoring - #48
- Remove
Asynctrait bound fromHasErrorType::Error. - Introduce
HasAsyncErrorTypetrait used for addingAsyncconstraint toHasErrorType::Error. - Introduce
CanWrapErrortrait. - Introduce generic
ErrorRaiserproviders incgp-error. - Rename and reoganize constructs in
cgp-error-eyreandcgp-error-std. - Introduce
cgp-error-anyhowcrate.
- Remove
-
Decouple component and field macro crates from the library crates - #47
- Remove
cgp-component-macrocrate from being a dependency ofcgp-component. - Remove
cgp-field-macrocrate from being a dependency ofcgp-field.
- Remove
-
Rename
define_components!tocgp_preset!with slight improvement - #41- Introduce
replace_with!macro that allows replacement of an identifier with a list of component types in the body. - Introduce
for_each_replace!macro that allows repeated replacement of an identifier with each element of components in the list in the body. - Rename
define_components!tocgp_preset!. - Use
replace_with!inside the generatedwith_preset!macro. - Re-introduce the
IsPresettrait to allow bulk delegation of components.
- Introduce
-
Redesign
derive_componenttocgp_componentwith improved syntax - #38- Rename the attribute
#[derive_component]to#[cgp_component] - The macro syntax has been changed as follows:
- Old:
#[derive_component(NameGetterComponent, NameGetter<MyContext>)] - New:
#[cgp_component { name: NameGetterComponent, context: MyContext, provider: NameGetter }] - For migration, the following regex can be used in a global search and replace:
- Search:
#\[derive_component\(([\w<>, ]+), (\w+)<(\w+)>\)\] - Replace:
#[cgp_component {\n name: $1,\n provider: $2,\n context: $3,\n}]
- Rename the attribute
-
Support async-generic feature flags in cgp-async - #37
- Introduce the following feature flags to
cgp-async: asyncsendsyncstaticfull- default feature with all enabled- Introduce the following traits in
cgp-async: MaybeSend- alias toSendwhen thesendfeature is enabled, otherwise nothing.MaybeSync- alias toSyncwhen thesyncfeature is enabled, otherwise nothing.MaybeStatic- alias to'staticwhen thestaticfeature is enabled, otherwise nothing.- Update the
Asynctrait fromSized + Send + Sync + 'statictoMaybeSend + MaybeSync + MaybeStatic. - The
Sizedconstraint is removed fromAsyncto allow use insidedyntraits. - Update the
#[async_trait]macro to desugar async functions to returnimpl Future<Output: MaybeSend>. - Use of
#[async_trait]now requires import ofcgp::prelude::*to allowMaybeSendto be auto imported. cgp-asyncnow re-exportscgp_sync::strip_asyncif theasyncfeature is not enabled.- i.e. async functions are desugared into sync functions if the
asyncfeature is disabled. - Crates such as
cgpandcgp-coreoffers thefullfeature, which can be disabled to disable the indirect default features incgp-async.
- Introduce the following feature flags to
-
Introduce new cgp-field constructs - #36
- Introduce the product type constructs
ConsandNil. - Introduce the sum type constructs
EitherandVoid. - Introduce the
Fieldtype for tagged field value. - Introduce the
Product!macro for building product types. - Introduce the
product!macro for building product expressions. - Introduce the
Sum!macro for building sum types. - Change the
symbol!macro to generate product type ofCharusingConsandNil.
- Introduce the product type constructs
-
Rename
HasField::FieldtoHasField::Value- #35 -
Remove
Sizedconstraint fromAsynctrait - #34 -
Component pattern improvements - #24
- Rename
DelegateTotoUseDelegate. - Implement
FieldGetterforUseContext. - Introduce
UseDelegatedType.
- Rename
-
Introduce
cgp-typecrate with various refactoring - #23- Introduce
cgp-typecrate, with theHasTypecomponent. - Introduce
FieldGetteras a manual provider trait forHasField. - Introduce
HasFieldMuttrait tocgp-field, and auto derive it in#[derive(HasField)]. - Introduce
DelegateToincgp-componentas a generalized delegation component. - Introduce
WithProviderincgp-componentas a generalized provider transformation component. - Introduce
UseContextincgp-componentfor generalized implementation of provider via context. - Replace
DelegateErrorComponentsincgp-errorand replace it withDelegateTo. - Use
core::error::Errorinstead ofstd::error::Errorincgp-error-std.
- Introduce