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

Describe Current Leptos Features Presently Missing From The Book #16

Open
21 tasks
diversable opened this issue Dec 9, 2023 · 3 comments
Open
21 tasks

Comments

@diversable
Copy link
Contributor

diversable commented Dec 9, 2023

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: #8)

Pt 2: SSR-related features

  • common / recommended middleware

  • explicitly talking about changing headers and status in responses for server bodies

  • ...

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.


leptos-rs/leptos#2007 (comment)

"""

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
Copy link
Contributor

benwis commented Dec 9, 2023

I'd add

  • Changing signals reactive context to parents or other items in the tree
  • More explicitly talking about changing headers and status in responses for server bodies
  • Common/recommended middleware
  • Resources that depend on other resources, resources that update with actions
    That's off the top of my head. Thanks for doing this!

@diversable
Copy link
Contributor Author

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
Copy link
Contributor

benwis commented Dec 10, 2023

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 👍

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

No branches or pull requests

2 participants