Skip to content

Commit 45506d2

Browse files
author
Alice Cecile
committed
Discuss adding layout information to traits
1 parent 472cc76 commit 45506d2

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

rfcs/77-dev-tools-abstraction.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,16 @@ There are three arguments against this:
602602
2. We can get good enough results to print via `Reflect` and `Debug`.
603603
3. Toolkits will typically rely on their own custom UI for formatting this information, and need more structured data than a simple string.
604604

605+
### Why not add information about layout to our traits?
606+
607+
This sort of information is really helpful for toolboxes like editors to ensure that dev tools don't overlap each other: allowing them to be laid out beside each other or enabled one at a time when necessary.
608+
609+
However:
610+
611+
1. This RFC is complex enough: keeping its scope small will make it easier to review and implement.
612+
2. Unlike with a CLI-style interface the correct abstractions aren't immediately obvious: we should prototype more toolkits and tools to explore the needs of the space further.
613+
3. Not all dev tools need layout information: we would need to use optional methods and/or subtraits to fill this need, adding further complexity.
614+
605615
## Unresolved questions
606616

607617
1. Are the provided methods (along with those on `Reflect`) sufficient to allow toolkits to populate and run a wide range of dev tools without requiring an additional trait and manual registration?
@@ -626,9 +636,11 @@ Related but out-of-scope questions:
626636

627637
Future possibilities:
628638

629-
1. Over time, we can extend the `ModalDevTool` and `DevCommand` traits with optional methods, enabling:
639+
1. Over time, we can extend the `ModalDevTool` and `DevCommand` traits with more methods (mandatory and optional), enabling:
630640
1. Gradual unification of more complex shared configuration (e.g. a `set_font` method).
631-
2. Opt-in metadata about the type of tool they are (e.g. an overlay, a camera controller, a 2D vs. 3D tool), allowing toolkits to seamlessly organize the options.
632-
3. Parsing from a `.bsn` file.
641+
2. Serializing and deserializing structs from a `.bsn` file, rather than simple CLI-style strings, allowing toolboxes to build abstractions for persistent config.
633642
2. Add support for a trait-queries-on-resources operation, and stop storing modal dev tools in the `DevToolsRegistry`.
634643
3. A derive macro for `DevCommand`, that aligns with `clap`'s calling conventions.
644+
4. Add specialized types of dev tools, likely each with their own trait to establish conventions and resolve conflicts between them.
645+
1. For example, we may want to coordinate between various UI elements or overlays to avoid positioning conflicts, dev tools that change the materials of objects, or camera controllers.
646+
2. This could be queried via Opt-in metadata about the type of tool they are (e.g. an overlay, a camera controller, a 2D vs. 3D tool), allowing toolkits to seamlessly organize the options.

0 commit comments

Comments
 (0)