-
Notifications
You must be signed in to change notification settings - Fork 22
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
Change to #[styled] #[function_component]
#150
Comments
As was mentioned to me over Discord, this PR combines Following is also possible: |
Thank you for the proposal. The reason why I brought up that I would like to reserve the name However, I am fine with a different name for In addition, changing I am not a fan of the current autoprops syntax in general and is fine with stylist not making any accommodations to it if it simply works as-is.
Since you said this, I am going to make this as the final decision and will not discuss this any further. |
Gotta point out, only the
I've only heard negative opinions on that JS library, meanwhile stylist is at least as good as tailwind, about which I heard only positive opinions and it is getting very popular
I can only think of
Only if Yew officially has
Thats not what I meant, I meant that if discussion happens, it happens, if not, PRs would suffice, but OK lol I will stand by my opinion, and keep using |
Change
#[styled_component]
to no longer be a#[function_component]
wrapper, and to become a simple function body modifier#[styled]
instead.Breaking changes; low or medium priority. Discussion is not required, PRs can be done either by stylist devs, me, or someone else in the community.
Description
As yew-autoprops 0.4 released, we have been greeted with the following syntax:
Autoprops only touches props and the function body (to add some implicit clones in front). Assuming
#[styled_component]
also only slightly modifies the component body, it appears to be changeable to use the same model (becoming#[styled]
) with still being able to be compatible with autoprops in either of those two configurations:Note
With yew #3347, the whole chain will look like
#[styled] #[autoprops] #[component]
or#[autoprops] #[styled] #[component]
.Benefits
#[styled]
to have an easy way to write down some custom options for it (if that will ever be needed).#[autoprops]
- this one is fully up to stylist to decide, its just a bonus lol#[function_component]
in its code.Drawbacks
] #[function
for the users.#[function_component]
ensured that the result will make a yew-compatible code. If stylist uses hooks in the generated body, it will have no proper way to check whether user used#[function_component]
, which may lead to a non-user-friendly error.Alternative
Leave only autoprops supporting this. Following syntax should already work now:
Warning
Mind that yew #3347 will require a stylist change to use
#[::yew::functional::component]
or something similar.The text was updated successfully, but these errors were encountered: