Skip to content

Latest commit

 

History

History
119 lines (95 loc) · 7.19 KB

CHANGELOG.md

File metadata and controls

119 lines (95 loc) · 7.19 KB

Changelog

v0.3.1 (2025-01-16)

  • Update Rust MSRV to v1.84 - #58

  • Add HasAsyncErrorType to prelude - #59

  • Add CanRaiseAsyncError and CanWrapAsyncError to cgp-error and prelude - #60

v0.3.0 (2025-01-08)

  • Introduce Accessor Component Macros - #56

    • Introduce #[cgp_getter] attribute macro that extends #[cgp_component] and implement UseFields and UseField for accessor traits.
    • Introduce #[cgp_auto_getter] attribute macro for deriving accessor traits with blanket implementations that use HasField directly.
  • Introduce cgp_type! macro for defining simple abstract CGP types - #55

    • Use cgp_type! to derive HasErrorType and HasRuntimeType.
  • Implement ErrorWrapper on generic ErrorRaiser providers - #54

    • Implement ErrorWrapper for the following providers: DebugError, DisplayError, DebugAnyhowError, DisplayAnyhowError, RaiseAnyhowError, DebugEyreError, DisplayEyreError, RaiseEyreError, DebugBoxedStdError, DisplayBoxedStdError.
  • Reorganize crate exports - #53

    • Move generic error providers to the cgp-error-extra crate.
    • Add an alloc feature to cgp-error-extra to enable use of alloc in providers.
    • Make private the sub-modules inside CGP crates.
    • Explicitly export module items instead of using *.
  • Move cgp-inner to cgp-extra - #51

    • Remove re-export of cgp-inner from cgp-core.
    • Re-export cgp-inner and cgp-runtime from cgp-extra.
  • Introduce cgp-runtime crate - #50

    • Introduce the HasRuntimeType and HasRuntime traits.
    • Introduce HasAsyncRuntimeType trait used for adding Async constraint to HasRuntimeType::Error.
  • Error crates refactoring - #48

    • Remove Async trait bound from HasErrorType::Error.
    • Introduce HasAsyncErrorType trait used for adding Async constraint to HasErrorType::Error.
    • Introduce CanWrapError trait.
    • Introduce generic ErrorRaiser providers in cgp-error.
    • Rename and reoganize constructs in cgp-error-eyre and cgp-error-std.
    • Introduce cgp-error-anyhow crate.
  • Decouple component and field macro crates from the library crates - #47

    • Remove cgp-component-macro crate from being a dependency of cgp-component.
    • Remove cgp-field-macro crate from being a dependency of cgp-field.

v0.2.0 (2025-12-08)

  • Rename define_components! to cgp_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! to cgp_preset!.
    • Use replace_with! inside the generated with_preset! macro.
    • Re-introduce the IsPreset trait to allow bulk delegation of components.
  • Redesign derive_component to cgp_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}]
  • 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 to Send when the send feature is enabled, otherwise nothing.
    • MaybeSync - alias to Sync when the sync feature is enabled, otherwise nothing.
    • MaybeStatic - alias to 'static when the static feature is enabled, otherwise nothing.
    • Update the Async trait from Sized + Send + Sync + 'static to MaybeSend + MaybeSync + MaybeStatic.
    • The Sized constraint is removed from Async to allow use inside dyn traits.
    • Update the #[async_trait] macro to desugar async functions to return impl Future<Output: MaybeSend>.
    • Use of #[async_trait] now requires import of cgp::prelude::* to allow MaybeSend to be auto imported.
    • cgp-async now re-exports cgp_sync::strip_async if the async feature is not enabled.
    • i.e. async functions are desugared into sync functions if the async feature is disabled.
    • Crates such as cgp and cgp-core offers the full feature, which can be disabled to disable the indirect default features in cgp-async.
  • Introduce new cgp-field constructs - #36

    • Introduce the product type constructs Cons and Nil.
    • Introduce the sum type constructs Either and Void.
    • 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 of Char using Cons and Nil.
  • Rename HasField::Field to HasField::Value - #35

  • Remove Sized constraint from Async trait - #34

  • Component pattern improvements - #24

    • Rename DelegateTo to UseDelegate.
    • Implement FieldGetter for UseContext.
    • Introduce UseDelegatedType.
  • Introduce cgp-type crate with various refactoring - #23

    • Introduce cgp-type crate, with the HasType component.
    • Introduce FieldGetter as a manual provider trait for HasField.
    • Introduce HasFieldMut trait to cgp-field, and auto derive it in #[derive(HasField)].
    • Introduce DelegateTo in cgp-component as a generalized delegation component.
    • Introduce WithProvider in cgp-component as a generalized provider transformation component.
    • Introduce UseContext in cgp-component for generalized implementation of provider via context.
    • Replace DelegateErrorComponents in cgp-error and replace it with DelegateTo.
    • Use core::error::Error instead of std::error::Error in cgp-error-std.