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

Redesign derive_component to cgp_component with improved syntax #38

Merged
merged 4 commits into from
Dec 7, 2024

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
1 participant