Skip to content

Conversation

@Bromeon
Copy link
Member

@Bromeon Bromeon commented Dec 1, 2025

So far, builtin types did not use the *_ex method + Ex* builder struct pattern to emulate default parameters. Instead, we've used a patchwork of different API styles to accomodate this. This causes quite a bit of inconsistency, requiring users to learn the specifics of each builtin API, while also making it easy for us to forget new additions in Godot (methods + parameters).

This PR changes the approach and adopts the *_ex method pattern from the class APIs. We can write our own APIs whenever we find more idiomatic APIs, but for many methods (especially in GString + StringName), there's not much point.

Note that the current set of APIs is a first draft, which we can refine until the v0.5 release (even once merged). Would be good to collect some feedback on the master version.

Closes #1335.

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: core Core components labels Dec 1, 2025
@Bromeon Bromeon changed the title Support default methods on builtins Default-param _ex functions on builtins Dec 1, 2025
@Bromeon Bromeon added the breaking-change Requires SemVer bump label Dec 1, 2025
@Bromeon Bromeon added this to the 0.5 milestone Dec 1, 2025
@Bromeon Bromeon force-pushed the feature/builtin-ex-builders branch from a3e5cfd to 0e584e5 Compare December 1, 2025 21:09
@Bromeon Bromeon force-pushed the feature/builtin-ex-builders branch from 0e584e5 to a18c1da Compare December 1, 2025 21:11
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1424

@Bromeon Bromeon force-pushed the feature/builtin-ex-builders branch from a18c1da to 1879ddc Compare December 4, 2025 17:55
@Bromeon Bromeon enabled auto-merge December 4, 2025 17:55
@Bromeon Bromeon force-pushed the feature/builtin-ex-builders branch from 1879ddc to f0eb7f5 Compare December 4, 2025 18:30
@Bromeon Bromeon added this pull request to the merge queue Dec 4, 2025
Merged via the queue into master with commit 4d4c920 Dec 4, 2025
20 checks passed
@Bromeon Bromeon deleted the feature/builtin-ex-builders branch December 4, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Requires SemVer bump c: core Core components quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing builder method for Basis::looking_at()

2 participants