Skip to content

Reorganize meta/register modules slightly #1475

@Bromeon

Description

@Bromeon

There is some unclear split of responsibilities:

It would probably make sense to:

  1. Group signals in their own module.
  2. Consider property-related symbols into one module (away from meta?)
  3. Decide whether attribute/derive macros should be modularized based on macro-ness or based on their scope.
  4. Remove more rarely used traits like Var/Export from 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    quality-of-lifeNo new functionality, but improves ergonomics/internals

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions