-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update signature of use_prepared_state/use_transitive_state #3376
Conversation
Size Comparison
✅ None of the examples has changed their size significantly. |
Visit the preview URL for this PR (updated for commit 9ab96a4): https://yew-rs--pr3376-ssr-hooks-sig-lnvl6y0o.web.app (expires Fri, 25 Aug 2023 20:06:27 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Benchmark - SSRYew Master
Pull Request
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only commented on the use_prepared_state tests, but the use_transitive_state tests should also have similar issues.
packages/yew-macro/tests/hook_macro/use_prepared_state-fail.stderr
Outdated
Show resolved
Hide resolved
error: You must specify a return type for this closure. This is used when the closure is omitted from the client side rendering bundle. | ||
--> tests/hook_macro/use_prepared_state-fail.rs:21:41 | ||
error: expected closure | ||
--> tests/hook_macro/use_prepared_state-fail.rs:21:58 | ||
| | ||
21 | use_prepared_state_without_closure!(|_| { todo!() }, 123)?; | ||
| ^^^^^^^^^^^^^^^ | ||
| ^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above, this testing is asserting that the closure has specified a return type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
07804c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Looks good to me.
Description
Update signature of use_prepared_state and use_transitive_state to take deps before closure.
Fixes #3371
Ref #3372 (review)
Checklist