Extensibility #19
Locked
robertlong
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just completed a first draft at refactoring some of the Matrix-related code and in the process I thought a little about how we might start structuring extensibility for Third Room.
I think Third Room should be opinionated about quite a few things including:
I don't think it should be opinionated about:
I think you should be able to swap out:
I think that we should decouple logical components from presentational components for the UI. This means splitting matrix-specific code into hooks or hooks that deal with rendering the 3D scene, avatar previews, etc. I think the 2D UI extensibility should come from installing Third Room as a library of React components and hooks that you can compose however you see fit. There will be sensible defaults, but you can override most things. We won't use super opinionated methods of styling or storing state. We'll use CSS modules and support passing
className
andstyle
props to most components. For state stores, we'll probably stick to the built-in hooks likeuseState
anduseContext
. Maybe we'll pull in something like Zustand for a global state store, but I'd really like to keep it lightweight.For the 3D code I think we should take care to define core libraries that don't make assumptions about the UI or backend. Instead we should expose APIs that can interface with these external dependencies. I think we need a plugin API that has three layers:
Plugin
interface which will work around Third Room specific concepts. It'll have lifecycle hooks for loading/unloading rooms, switching scenes, or changing avatars. This is where you can do Third Room specific things and really tie into the UI layer.I'm still not exactly sure what the
Plugin
interface looks like or what our final ECS framework will look like. If you have ideas on these concepts or examples you'd like to point to I'd love to hear them!Beta Was this translation helpful? Give feedback.
All reactions