Skip to content

Recursive Type Registration #4154

@james7132

Description

@james7132

What problem does this solve or what need does it fill?

Currently registering a type only creates a registration for itself. Registering a type will not register the types of its fields. This means every intermediate field type must be manually registered. This would make deserialization difficult to manage for deeply nested structures.

What solution would you like?

Type registration should be recursive. Upon registering a type, it's field types should be registered. This should continue recursively until a value type has been reached, or if a type had already been registered.

This may increase app load times, but provide a much better developer UX when using the TypeRegistry to handle serialization.

What alternative(s) have you considered?

Register every type manually.

Metadata

Metadata

Assignees

Labels

A-ReflectionRuntime information about typesC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions