-
Notifications
You must be signed in to change notification settings - Fork 17
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
New Multiplatform Templates #50
base: v0.6
Are you sure you want to change the base?
Conversation
Use `asset!` macro instead of `mg!`
I'll link this just in case: ealmloff#2 (comment). |
The templates are set to use alpha 5 but can easily be changed at the top of the |
The Shoudn't the Barebones template spelled as Bare-bones instead? (Barebones/Jumpstart) Why I can't choose Mobile platform to serve by default? If I only choose Mobile, then it is set as default platform/feature, but the README doesn't say that I have to add Also the 0.6 alpha version is kinda strange, since the upstream repo should either have a 0.5 until the 0.6 release, or 0.6 when it released. But maybe if it's very quick, then that would be OK. I haven't compiled anything yet though. |
Speaking of dark theme, there is a light-dark function now! I hope it will work as expected, because the browsers support it, but I don't know about WebView libs. https://www.youtube.com/watch?v=A89FMtIkWKc |
I believe the I suppose it should be Dioxus can't currently serve mobile by default, I'll add some more instructions to those readmes for that. With the version, if you're talking about the template, they are now versioned by branch. This PR is merging into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts:
The Calculator demo is nice insofar as it demonstrates how fullstack works, but I think the Calculator component is too complex for a template. I think something simpler (no validation, smaller component) like an "echo" component that simply echos and/or modifies your input would be better, at least for the simpler templates.
This is just a taste thing but the logging situation should also be simplified - I would be fine with no explicit info!()
call - maybe we can put an info!()
call in our dioxus::launch
function instead. In dioxus v0.7
I'd like to wrap in dioxus_logger as dioxus::logger
and have the init
be automatic in launch
.
fn main() {
dioxus_logger::init(Level::INFO);
dioxus::launch(App);
}
Also now that the templates are quite complex, do you think we can set up a github workflow that tests each out with a simple shell script?
- run
dx new <path> --subtemplate XYZ --path XYZ
- cargo
dx check
and deny warnings
@jkelleyrtp Regarding the |
|
Unfortunately due to the heavy use of Tried checking the variable in the |
I tried this too and remembered your comment. Now |
We should simplify the template or get the --yes working again - would be ideal for harness based end to end testing. |
In fact, it already (if this PR is merged to main) will make my tests fail (DioxusLabs/dioxus#2822), since they depend on |
Questions based on the answer of previous questions. E.g. the dynamic list of platforms for the "Which default platform?" question. I decided to then use rhai for everything as it felt messy having questions for cargo-generate and then questions asked in rhai and the whole ordering of questions would be messed up. I'll play around with the script ordering and see if I can come up with anything, but this feels like something that should be improved in cargo-generate itself. I had to use the Linux |
Thanks. We all know that cargo-generate isn't ideal, but I guess it's our best bet for now. I could contribute to it to make it more flexible, but I don't know if I actually can add new features. It will probably take a while for all the discussions. Can't we have a bit simpler logic for now? Is there any other way the default platform can be selected correctly? I think if this is the only blocker, then it's probably not that bad, if we outsource this task to the end user via the README.md file. Like add a line "in ... write your preferred default platform". |
I just tested it and it looks like New issue: Values provided through |
This can now work with The CLI will also need a fix as it currently errors on the Workspace template (most likely because it expects a file that doesn't exist like it does on the other sub-templates) |
I'm not sure if the "run-and-done" must be implement by 0.6. I think for now CI/tests are more important, so the noninteractive project creation should work without additional prompts. We can cite on cargo-generate being not yet flexible enough for our use case. I have a question: shouldn't the web platform be default usually and for now? Does it have a separate feature? I have a feeling that previously it worked without any additional feature, so nothing will break if it is always the default. The user later can change the default platform if web isn't preferred. |
Yes, web has it's own feature: While we could default to the web platform, I think the current implementation is a good compromise between I'll leave the decision up to @jkelleyrtp. |
In the CLI, you mean hard-code in the I think we still have the problem of not being able to use the default subtemplate because of cargo-generate/cargo-generate#1181. So ideally it would automatically choose the BTW, that issue is now so old and was mentioned quite a few times, I really want to fix it already and forget about that. But I'm really busy now (still). Maybe in December I'll have some free time for this. |
It can check if it's using these specific templates. |
Well, yeah, I guess that can be checked. This still feels wrong, but at least now there will be no harm in doing that. We just really should hope that it's actually temporary, otherwise it will be a permanent fix. |
I noticed that even though I included Tailwind, it doesn't work. Then I realized that this is because I don't include the CSS file into the HTML head. The readme should be changed, so that it also says const FAVICON: Asset = asset!("/assets/favicon.ico");
const MAIN_CSS: Asset = asset!("/assets/styling/main.css");
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css"); It's also strange that Tailwind hot-reloading doesn't work, at least with desktop. I thought both CSS and Tailwind are fixed already. I have to rebuild the app so that it can use the newly generated Tailwind classes. |
No description provided.