-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECS design #150
Comments
I'm open to potentially switching to an ECS, but I'm a little wary of it:
I suspect it won't ever make sense to go down the full bevy_ui route. Blitz's DOM is considerably more capable at rendering HTML than bevy_ui, and bevy probably won't want to take on all the legacy code required to implement that. I think we should continue down a route of modular crates where it makes sense (winit, taffy, parley, cosmic-text, accesskit, wgpu, vello, etc - and maybe bevy_ecs), but not attempt to share glue code where we may well want to diverge on the implementation. |
Huh I think I see your points, but I have grown really fond of the Rust + ECS combo. I think it helps with maintainability quite a bit, even if a custom solution like IIRC the last few versions of Blitz featured an ECS so I was hoping those comments were indicative we were doing the same here 👀 Also I guess I do agree it doesn't make sense to use parts of |
I've noticed quite a few comments mentioning a future refactor to an ECS based design, which I think would be great to bring back! The ECS paradigm seems to fit us well here by making it easy to parallelize our state management and render pipeline.
I think
bevy_ecs
would be the perfect fit for us, especially since we may be able to integrate with their Accesskit, and Winit support (among other things).Outline
This sounds like a major change so just to outline the steps I think we could take:
bevy_ecs::World
, usingbevy_hierarchy::Children
to maintain the document hierarchyNode
struct with a series of components:Hidden
andHovered
can be attached to a node dynamicallyblitz/packages/blitz-dom/src/node.rs
Lines 72 to 73 in caa3bbf
Finally we may be able to replace our rendering logic with systems, potentially simplifying the crates here and increasing performance. This I imagine could be a longer term goal, but one I think that would come with major benefits.
Sharing more with Bevy
UICamera
with customUINode
s we design for the web we could share code for accessibility, rendering, and running shaders.bevy_winit
andbevy_a11y
could work well with an ECS-based node hierarchyThe text was updated successfully, but these errors were encountered: