leptos-rs / book

The home for the Leptos book, which can be found deployed at https://book.leptos.dev
MIT License
85 stars 67 forks source link

Describe Current Leptos Features Presently Missing From The Book #16

Open diversable opened 11 months ago

diversable commented 11 months ago

There have been a few Leptos features which were brought up in discussion which should be described in the book (see reference, below).

It is possible that some of these features should be listed in a new section, "Part 3: Advanced Topics" (see here for that issue: https://github.com/leptos-rs/book/issues/8)

Pt 2: SSR-related features

As of yet, I'm not sure where these features should fit into the book: suggestions, help writing these up, and other topics missed in the list above, are all welcome. The list above will be updated with new suggestions from any comments on this issue.


https://github.com/leptos-rs/leptos/issues/2007#issuecomment-1807411843

"""

i think one problem is discoverability - there are quite a few (mostly recent) features that were added but aren't included in the book (#[prop(attrs)], #[slot]s, , slice!, Callback, TextProp, ViewFn, MaybeProp, extra signal stuff (batch, untrack, on_cleanup)) that I think could be beneficial for people to know of.

Maybe a full discussion of the features doesn't need to be included in the book, but simply mentioning that these exist could be helpful, so that people don't try to reinvent the wheel. For example, the Components and Props section could mention (and briefly describe the use cases of) #[slot]s, the handy types like Callback, TextProp, MaybeProp and ViewFn, with links to the docs.rs pages. Same thing in the Reactivity section, the signal helper functions batch and untrack could be briefly mentioned.

Perhaps a more ambitious undertaking could be restructuring the leptos modules. Currently, pretty much everything is just re-exported in leptos::*, which makes it easy to use in code but difficult to navigate the docs. Maybe having more public modules (e.g. components for all the components provided by leptos, props for all the extra structs) but still re-exporting in the crate root could help. Maybe some functions like batch and untrack could be moved to be associated functions of the Signal type?

... """

benwis commented 11 months ago

I'd add

diversable commented 11 months ago

I'd add

  • Changing signals reactive context to signals ...

thanks for the additions, @benwis!

I was hoping you could you explain a little more about what you mean by "changing signal's reactive context to signals" though..? thx!

benwis commented 11 months ago

I'd add

  • Changing signals reactive context to signals ...

thanks for the additions, @benwis!

I was hoping you could you explain a little more about what you mean by "changing signal's reactive context to signals" though..? thx!

Edited the original, I missed a word 👍