-
Update Rust MSRV to v1.84 - #58
-
Add
HasAsyncErrorType
to prelude - #59 -
Add
CanRaiseAsyncError
andCanWrapAsyncError
tocgp-error
and prelude - #60
-
Introduce Accessor Component Macros - #56
- Introduce
#[cgp_getter]
attribute macro that extends#[cgp_component]
and implementUseFields
andUseField
for accessor traits. - Introduce
#[cgp_auto_getter]
attribute macro for deriving accessor traits with blanket implementations that useHasField
directly.
- Introduce
-
Introduce
cgp_type!
macro for defining simple abstract CGP types - #55- Use
cgp_type!
to deriveHasErrorType
andHasRuntimeType
.
- Use
-
Implement
ErrorWrapper
on genericErrorRaiser
providers - #54- Implement
ErrorWrapper
for 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-extra
crate. - Add an
alloc
feature tocgp-error-extra
to enable use ofalloc
in providers. - Make private the sub-modules inside CGP crates.
- Explicitly export module items instead of using
*
.
- Move generic error providers to the
-
Move
cgp-inner
tocgp-extra
- #51- Remove re-export of
cgp-inner
fromcgp-core
. - Re-export
cgp-inner
andcgp-runtime
fromcgp-extra
.
- Remove re-export of
-
Introduce
cgp-runtime
crate - #50- Introduce the
HasRuntimeType
andHasRuntime
traits. - Introduce
HasAsyncRuntimeType
trait used for addingAsync
constraint toHasRuntimeType::Error
.
- Introduce the
-
Error crates refactoring - #48
- Remove
Async
trait bound fromHasErrorType::Error
. - Introduce
HasAsyncErrorType
trait used for addingAsync
constraint toHasErrorType::Error
. - Introduce
CanWrapError
trait. - Introduce generic
ErrorRaiser
providers incgp-error
. - Rename and reoganize constructs in
cgp-error-eyre
andcgp-error-std
. - Introduce
cgp-error-anyhow
crate.
- Remove
-
Decouple component and field macro crates from the library crates - #47
- Remove
cgp-component-macro
crate from being a dependency ofcgp-component
. - Remove
cgp-field-macro
crate 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
IsPreset
trait to allow bulk delegation of components.
- Introduce
-
Redesign
derive_component
tocgp_component
with 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
: async
send
sync
static
full
- default feature with all enabled- Introduce the following traits in
cgp-async
: MaybeSend
- alias toSend
when thesend
feature is enabled, otherwise nothing.MaybeSync
- alias toSync
when thesync
feature is enabled, otherwise nothing.MaybeStatic
- alias to'static
when thestatic
feature is enabled, otherwise nothing.- Update the
Async
trait fromSized + Send + Sync + 'static
toMaybeSend + MaybeSync + MaybeStatic
. - The
Sized
constraint is removed fromAsync
to allow use insidedyn
traits. - Update the
#[async_trait]
macro to desugar async functions to returnimpl Future<Output: MaybeSend>
. - Use of
#[async_trait]
now requires import ofcgp::prelude::*
to allowMaybeSend
to be auto imported. cgp-async
now re-exportscgp_sync::strip_async
if theasync
feature is not enabled.- i.e. async functions are desugared into sync functions if the
async
feature is disabled. - Crates such as
cgp
andcgp-core
offers thefull
feature, 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
Cons
andNil
. - Introduce the sum type constructs
Either
andVoid
. - Introduce the
Field
type 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 ofChar
usingCons
andNil
.
- Introduce the product type constructs
-
Rename
HasField::Field
toHasField::Value
- #35 -
Remove
Sized
constraint fromAsync
trait - #34 -
Component pattern improvements - #24
- Rename
DelegateTo
toUseDelegate
. - Implement
FieldGetter
forUseContext
. - Introduce
UseDelegatedType
.
- Rename
-
Introduce
cgp-type
crate with various refactoring - #23- Introduce
cgp-type
crate, with theHasType
component. - Introduce
FieldGetter
as a manual provider trait forHasField
. - Introduce
HasFieldMut
trait tocgp-field
, and auto derive it in#[derive(HasField)]
. - Introduce
DelegateTo
incgp-component
as a generalized delegation component. - Introduce
WithProvider
incgp-component
as a generalized provider transformation component. - Introduce
UseContext
incgp-component
for generalized implementation of provider via context. - Replace
DelegateErrorComponents
incgp-error
and replace it withDelegateTo
. - Use
core::error::Error
instead ofstd::error::Error
incgp-error-std
.
- Introduce