-
-
Notifications
You must be signed in to change notification settings - Fork 278
Description
There is some unclear split of responsibilities:
-
propertymodule withVar,Export,BuiltinExport,PhantomVar- Derive macros:
Var,Export,GodotConvert,GodotClass - Attribute macros:
godot_api,godot_dyn - Signals on top level:
TypedSignal,ConnectBuilder,ConnectHandle,SignalReceiver,IndirectSignalReceiver - Misc:
RpcConfig
It would probably make sense to:
- Group signals in their own module.
- Consider property-related symbols into one module (away from
meta?) - Decide whether attribute/derive macros should be modularized based on macro-ness or based on their scope.
- Remove more rarely used traits like
Var/Exportfrom prelude (they're usually derived, if at all). Also some builtin-related enums.
Adding register::signal would probably be quite straightforward, however it creates quite a deep nesting. For signals it's also not quite clear that they're part of register, because the functionality is shared between engine-provided signals, user-provided ones and several core mechanics (TypedSignals). This is also true to a lesser extend with register::properties once meta parts are moved in -- they contain Var parts which are clearly user-registration related, but PropertyInfo/ MethodInfo is rather part of Godot's type system. Maybe they should stay in meta?
Then there's also the problem that PropertyInfo/PropertyHintInfo/MethodInfo are in meta, but PropertyHint/PropertyUsageFlags are in global. They are almost always used in combination though, but the user then has to import from different modules. We already extract builtin-related enums to godot::builtin. Some of them like Side are accidentally in the prelude.
Tip
TLDR: What should guide module organization is primarily:
Which symbols does the user likely use together?
Less so how Godot exposes its APIs, or how things are named, or what simplifies implementation. UX first.