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

Update README.md #55

Closed
wants to merge 1 commit into from
Closed

Conversation

nilsmartel
Copy link
Contributor

Given the previous statement, I can only hope, that this is what was meant. Godspeed developing this library, great work so far

Given the previous statement, I can only hope, that this is what was meant. Godspeed developing this library, great work so far
@jkelleyrtp
Copy link
Member

Given the previous statement, I can only hope, that this is what was meant. Godspeed developing this library, great work so far

Thanks!

I haven't figured out how to get the "desktop" feature enabled by default when running examples, so you have to manually specify the desktop feature. Do you know if there's a way to always force the desktop feature? Maybe something in .cargo/config?

@nilsmartel
Copy link
Contributor Author

I am rather unfamiliar with these settings.

Though I think for something like a GUI library it makes sense to turn on all features by default and manually turning them of can be done as an optimization.

Is it possible to structure code like this in general?

@jkelleyrtp
Copy link
Member

I am rather unfamiliar with these settings.

Though I think for something like a GUI library it makes sense to turn on all features by default and manually turning them of can be done as an optimization.

Is it possible to structure code like this in general?

rust-lang/cargo#4663

I'm not too sure if it's possible. At least, cargo doesn't support that, so we'd need to create a new "examples" crate in the workspace that has all those features enabled. So instead of having to pass the --features desktop flag, you'd need to CD into the examples directory to run any of the examples.

I know repositories that do both.

Though, we might be able to patch .cargo/config.toml with a custom runner that always has those features.

@nilsmartel
Copy link
Contributor Author

I'd prefer to to enable some/all features by default, it seems to be possible: https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature

I think it makes "just getting started" with this crate tremendously easier and disabling features is still a useful fine-tuning step.

This would also make running the examples easier.

Option 2:

Maybe create a custom run command?
We are not allowed to overwrite cargo run --example, but (the way I understood it) we're allowed to create a new command like
cargo example X <=> cargo run --example --features desktop X

@jkelleyrtp
Copy link
Member

jkelleyrtp commented Jan 7, 2022

Update!

I did not know you could do this, but you can infact put the current crate as its own dev dependency with features enabled.

[dev-dependencies]
dioxus = { path = ".", features = ["desktop", "ssr", "router"] }

I'm going to close your PR and then make a new one that implements this change and simplifies the running process.

Good suggestion!

@jkelleyrtp jkelleyrtp closed this Jan 7, 2022
@nilsmartel nilsmartel deleted the patch-1 branch January 10, 2022 10:15
jkelleyrtp pushed a commit that referenced this pull request Jun 28, 2023
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

Successfully merging this pull request may close these issues.

2 participants