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

Use idiomatic, built-in From and Into traits instead of IntoView, IntoAttribure, etc. #2131

Closed
SleeplessOne1917 opened this issue Dec 23, 2023 · 3 comments

Comments

@SleeplessOne1917
Copy link
Contributor

Currently, leptos uses a few bespoke Into traits. While they get the job done, using the traits from std::convert would be more idiomatic, and I suspect it would make Leptos play nicer with other dependencies developers may use.

I'll work on this one.

@gbj
Copy link
Collaborator

gbj commented Dec 30, 2023

For context: These separate traits come from the 0.4-and-earlier period when they required an additional Scope argument that is no longer used in 0.5, and they will likely not exist in the next meaningful version change. Feel free to experiment with something like implementing From<T> for Attribute where T: IntoAttribute or whatnot, but obviously removing the traits themselves would be a breaking change and replacing all the -> impl IntoView and so on with -> impl Into<View> is just churn. Having a separate IntoView trait in particular allows a lot of flexibility, as there is no View enum in the next version of the renderer.

@SleeplessOne1917
Copy link
Contributor Author

@gbj I'll experiment with Into<Attribute>. I was banging my head against the wall trying to get Into<View> working, but will hold off on that since View is going away anyway.

Is there anywhere I can keep an eye on what's being done with the renderer you mentioned?

@gbj
Copy link
Collaborator

gbj commented Jan 2, 2024

Sure. See my comment on the roadmap and the links to associated repos there.

@gbj gbj closed this as completed Apr 2, 2024
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