Skip to content

Commit

Permalink
address gbj's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
diversable committed Nov 29, 2023
1 parent c2b0b93 commit b59c449
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
20 changes: 16 additions & 4 deletions docs/book/src/getting_started/leptos_dx.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ There are a couple of things you can do to improve your experience of developing

Because of the nature of macros (they can expand from anything to anything, but only if the input is exactly correct at that instant) it can be hard for rust-analyzer to do proper autocompletion and other support.

But you can tell rust-analyzer to ignore certain proc macros. For `#[component]` and `#[server]` especially, which annotate function bodies but don't actually transform anything inside the body of your function, this can be really helpful.

If you run into issues using these macros in your editor, you can explicitly tell rust-analyzer to ignore certain proc macros. For the `#[server]` macro especially, which annotates function bodies but doesn't actually transform anything inside the body of your function, this can be really helpful.

Starting in Leptos version 0.5.3, rust-analyzer support was added for the `#[component]` macro, but if you run into issues, you may want to add `#[component]` to the macro ignore list as well (see below).
Note that this means that rust-analyzer doesn't know about your component props, which may generate its own set of errors or warnings in the IDE.

VSCode `settings.json`:

```json
"rust-analyzer.procMacro.ignored": {
"leptos_macro": [
"component",
// optional:
// "component",
"server"
],
}
Expand All @@ -33,7 +36,8 @@ require('lspconfig').rust_analyzer.setup {
procMacro = {
ignored = {
leptos_macro = {
"component",
-- optional: --
-- "component",
"server",
},
},
Expand All @@ -50,7 +54,15 @@ Helix, in `.helix/languages.toml`:
name = "rust"

[language-server.rust-analyzer]
config = { procMacro = { ignored = { leptos_macro = ["component", "server"] } } }
config = { procMacro = { ignored =
{ leptos_macro =
[
# Optional:
# "component",
"server"
]
}
} }
```

```admonish info
Expand Down
6 changes: 2 additions & 4 deletions docs/book/src/ssr/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Part 2: Server Side Rendering

The second part of the book is all about how to turn your beautiful UI's into full-stack, "Universal" Rust + Leptos powered websites and applications.
The second part of the book is all about how to turn your beautiful UIs into full-stack Rust + Leptos powered websites and applications.

As you read in the last chapter, there are some limitations to using Client-Side Rendered Leptos apps - over the next few chapters, you'll see how we can overcome those limitations
As you read in the last chapter, there are some limitations to using client-side rendered Leptos apps - over the next few chapters, you'll see how we can overcome those limitations
and get the best performance and SEO out of your Leptos apps.

Let's see how we can use the full power of Leptos and Rust on the server to make your next cutting-edge application!


```admonish info
Expand Down

0 comments on commit b59c449

Please sign in to comment.