Skip to content

Builder interface for registration of Signals #813

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

Closed
chitoyuu opened this issue Nov 8, 2021 · 1 comment
Closed

Builder interface for registration of Signals #813

chitoyuu opened this issue Nov 8, 2021 · 1 comment
Labels
c: core Component: core (mod core_types, object, log, init, ...) quality-of-life No new functionality, but improves ergonomics/internals
Milestone

Comments

@chitoyuu
Copy link
Contributor

chitoyuu commented Nov 8, 2021

Since v0.9, we have had idiomatic builder interfaces for registering properties, then for methods, but not yet for signals. This makes signals a lot more cumbersome to use, and out of place in terms of API design, compared to other aspects of exposing a GDScript API.

Drawbacks

No known drawbacks. PropertyBuilder and MethodBuilder has proven to be successful.

Alternatives

No known alternatives. The builder pattern is ubiquitous in the Rust ecosystem for use cases like this.

Further features like typed signal emission (#758 (comment)) and derive macro support (#715) are orthogonal to the procedural registration API.

Prior art

The API of clap can serve as an inspiration on how multiple named arguments can be handled.

@chitoyuu chitoyuu added the quality-of-life No new functionality, but improves ergonomics/internals label Nov 8, 2021
@Bromeon Bromeon added the c: core Component: core (mod core_types, object, log, init, ...) label Nov 8, 2021
@Bromeon Bromeon added this to the v0.10.1 milestone Nov 8, 2021
@Bromeon Bromeon modified the milestones: v0.10.1, v0.10.0 Jan 4, 2022
@Bromeon
Copy link
Member

Bromeon commented Jan 4, 2022

Implemented in #828.

The ClassBuilder::signal() API is available online.

@Bromeon Bromeon closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Component: core (mod core_types, object, log, init, ...) quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

No branches or pull requests

2 participants