-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
rstml 0.12 and enforce braces in attribute values #2753
Conversation
I'm excited, looks like you have a couple conflicts. Once those are resolved, is it ready for testing? |
Oh this PR was mergeable before and had 1 commit, I think @gbj your force push broke some things. Is it possible to revert that? Otherwise I can just fix it up later, looks like I can just accept everything on the upstream side and it should work fine. |
6d059d6
to
80e8d49
Compare
nvm fixed it up (thanks to some friends who know git way better than me), should be ready now @benwis |
Sorry @blorbb I suspect it is at least in part on my own limited git skills — when I rebase This looks good to me in general, and the compile error seems helpful at least. Maybe worth adding a note about how to migrate automatically with leptosfmt? I assume that all of the examples and many doctests will be broken when this is merged, because they aren't currently using braces for attribute values — Does that sound accurate? If so one of us should
|
Oh yeah I just fixed up the braces rust told me about, totally forgot about examples! Does leptosfmt work on examples and docs? Adding a comment explaining how to migrate might be quite a lot of noise, could you perhaps create a migration guide on GitHub/leptos.dev so that the note can link to a website(+heading) instead of a full explanation? It doesn't seem like there's a one-line command to configure leptosfmt to use the "AlwaysUnlessLit" brace style. |
I ran leptosfmt on the examples and tried to fix up all the comments. Also manually added braces to the docs (many doctests are still broken due to other reasons, I haven't fixed other issues in the commit). I went through most of the diff but I'm not 100% sure that I fixed every comment changed by leptosfmt, you may want to look through it again to double-check |
I have now merged the 0.7 branch into main, to help avoid the conflicts that have come from juggling main, 0.7, PRs to main, and PRs to 0.7. Could you please open a new PR against main? This will also allow CI to run, which will catch missing cases. |
This is an implementation of the first half of #2196
Invalid values were added in rstml 0.12.0 (related: rs-tml/rstml#54) which allows incomplete expressions to be expanded. Alongside this implementation, rust-analyzer support is significantly improved:
Even with an invalid expression, rust-analyzer can provide autocomplete suggestions.
Note: rstml 0.12 adds a generic to a few structs (
NodeElement
,Node
). I'm not actually sure what this generic is for, I just added what the compiler told me to add. Testing the changes toleptos_hot_reload
may be good.Minor issue: for some reason, adding
#[allow(unused_brace)]
directly at the expression expansion would break rust-analyzer and it wouldn't provide suggestions.#[allow(unused_braces)]
has been added to the entireview!
expansion, which allows all unused braces, so some legitimate warnings might disappear.