Skip to content
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

Modular application hierarchy #3

Open
dnut opened this issue Oct 28, 2023 · 0 comments
Open

Modular application hierarchy #3

dnut opened this issue Oct 28, 2023 · 0 comments

Comments

@dnut
Copy link
Owner

dnut commented Oct 28, 2023

Currently you need a single application struct that provides all dependencies. This is typically accomplished with a single global invocation of the application macro. It would be nice if you could instead have one parent application that inherit the components from children applications. Something like this...

struct MyApp;

application! {
    self: MyApp
    children: [DataProvider]
    components: [MyService] // depends on DataComponent, which it pulls in via DataProvider
}

struct DataProvider;

application! {
    self: DataProvider
    components [DataComponent]
}

Maybe application would no longer be the right terminology. Maybe a more streamlined macro should be used.

Ideally, DataComponents could even be declared in a separate crate. But with the current design, I think the rust compiler will complain about forward compatibility issues with trait implementations if they are in separate crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant