Skip to content

Conversation

@soareschen
Copy link
Collaborator

@soareschen soareschen commented Dec 7, 2024

Closes: #25

  • 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}]

@soareschen soareschen changed the title Redesign derive_component to cgp_component with better syntax Redesign derive_component to cgp_component with improved syntax Dec 7, 2024
@soareschen soareschen merged commit 7c680b7 into main Dec 7, 2024
5 checks passed
@soareschen soareschen deleted the rename-derive-component branch December 7, 2024 21:58
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.

Redesign derive_component to cgp_component with better syntax

2 participants