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

Fix some Hook edge cases #2592

Merged
merged 2 commits into from Apr 15, 2022
Merged

Conversation

futursolo
Copy link
Member

@futursolo futursolo commented Apr 8, 2022

Description

This pull request fixes a couple edge cases with the #[hook] macro:

  1. impl Trait in return position is supported.
  2. Box<dyn Fn(&str) -> &str> will not have its lifetime rewritten.
  3. &T in return position will become 'hook automatically.

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

github-actions[bot]
github-actions bot previously approved these changes Apr 8, 2022
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Visit the preview URL for this PR (updated for commit 4ad2b71):

https://yew-rs-api--pr2592-fc-impl-trait-2-5rgkhzaw.web.app

(expires Fri, 22 Apr 2022 14:40:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Size Comparison

examples master (KB) pull request (KB) diff
boids 173.301 173.301 0
contexts 111.393 111.393 0
counter 86.998 86.998 0
counter_functional 87.473 87.473 0
dyn_create_destroy_apps 90.104 90.104 0
file_upload 102.929 102.929 0
function_memory_game 169.999 169.999 0
function_router 351.643 351.643 0
function_todomvc 161.887 161.887 0
futures 226.574 226.574 0
game_of_life 108.032 108.032 0
inner_html 83.506 83.506 0
js_callback 92.103 92.103 0
keyed_list 195.865 195.865 0
mount_point 86.514 86.514 0
nested_list 115.569 115.569 0
node_refs 89.831 89.831 0
password_strength 1539.505 1539.505 0
portals 96.905 96.905 0
router 316.716 316.716 0
simple_ssr 499.814 499.814 0
ssr_router 425.162 425.162 0
suspense 110.433 110.433 0
timer 89.712 89.712 0
todomvc 143.693 143.693 0
two_apps 87.581 87.581 0
webgl 87.124 87.124 0

Copy link
Member

@hamza1311 hamza1311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, didn't mean to approve

@futursolo futursolo added A-yew Area: The main yew crate A-yew-macro Area: The yew-macro crate labels Apr 15, 2022
@hamza1311 hamza1311 merged commit 6fb5473 into yewstack:master Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew Area: The main yew crate A-yew-macro Area: The yew-macro crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants