-
Notifications
You must be signed in to change notification settings - Fork 211
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
Rename #[godot]
to #[method]
#933
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bromeon
added
c: export
Component: export (mod export, derive)
breaking-change
Issues and PRs that are breaking to fix/merge.
quality-of-life
No new functionality, but improves ergonomics/internals
labels
Aug 25, 2022
bors try |
tryBuild succeeded: |
bors r+ |
bors bot
added a commit
that referenced
this pull request
Aug 30, 2022
933: Rename `#[godot]` to `#[method]` r=Bromeon a=Bromeon Follow-up to #872. As mentioned there, the syntax was provisional and still subject to change. This PR renames `#[godot]` back to `#[method]`. Other changes, such as the `#[base]` parameter name, remain unaffected (still a bit conflicted about that too, but that's another story...) Reasoning behind the name `#[godot]` was a potential greater unification of godot-rust attributes, which would allow to use `#[godot]` more widespread as _the_ attribute, e.g. ```rs #[derive(NativeClass)] #[godot(inherit=Node, no_constructor)] struct MyClass { #[godot(get)] my_property: i32, } #[godot_api] impl MyClass { #[godot] fn my_method(&self, #[base] base: &Node) {...} } ``` However, this comes with a bigger change. In order to avoid huge deprecations or breaking changes, I think it makes sense to not include this in the current minor version. It could be discussed for v0.11, or maybe only for GDExtension. Since having `#[godot]` in only one place would be "somewhere in between" the old and new naming, I'd rather find an identifier that fits the existing `#[property]` and `#[methods]` naming scheme -- and `#[method]` as suggested by the original author would fit relatively nicely. Overall, I still believe "method" is not expressive and there is room for improvement, as well as for other names like "property" or so. But I don't want this to delay the whole 0.10.1 release further; we'd rather think about nicer naming another time, maybe when GDExtension is around. This PR introduces a breaking change toward `master`, but not toward the last released version `0.10.0`, so it can be included in `0.10.1`. Co-authored-by: Jan Haller <[email protected]>
Build failed: |
bors r+ |
Build succeeded: |
bors bot
added a commit
that referenced
this pull request
Aug 31, 2022
935: Rename a few remaining occurrences of #[export] r=Bromeon a=Bromeon Forgot to include this commit in #933. bors r+ Co-authored-by: Jan Haller <[email protected]>
bors bot
added a commit
that referenced
this pull request
Aug 31, 2022
935: Rename a few remaining occurrences of #[export] r=Bromeon a=Bromeon Forgot to include this commit in #933. bors r+ Co-authored-by: Jan Haller <[email protected]>
bors bot
added a commit
that referenced
this pull request
Aug 31, 2022
935: Rename a few remaining occurrences of #[export] r=Bromeon a=Bromeon Forgot to include this commit in #933. bors r+ Co-authored-by: Jan Haller <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
Issues and PRs that are breaking to fix/merge.
c: export
Component: export (mod export, derive)
quality-of-life
No new functionality, but improves ergonomics/internals
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #872.
As mentioned there, the syntax was provisional and still subject to change. This PR renames
#[godot]
back to#[method]
.Other changes, such as the
#[base]
parameter name, remain unaffected (still a bit conflicted about that too, but that's another story...)Reasoning behind the name
#[godot]
was a potential greater unification of godot-rust attributes, which would allow to use#[godot]
more widespread as the attribute, e.g.However, this comes with a bigger change. In order to avoid huge deprecations or breaking changes, I think it makes sense to not include this in the current minor version. It could be discussed for v0.11, or maybe only for GDExtension. Since having
#[godot]
in only one place would be "somewhere in between" the old and new naming, I'd rather find an identifier that fits the existing#[property]
and#[methods]
naming scheme -- and#[method]
as suggested by the original author would fit relatively nicely.Overall, I still believe "method" is not expressive and there is room for improvement, as well as for other names like "property" or so. But I don't want this to delay the whole 0.10.1 release further; we'd rather think about nicer naming another time, maybe when GDExtension is around.
This PR introduces a breaking change toward
master
, but not toward the last released version0.10.0
, so it can be included in0.10.1
.